friendGlobal synchronizes your friend list so all your friends have the same friend list.
badFriendGlobal does the same with your blacklist.
By default, when you load a character friendGlobal will first remove any names you've explicitly told it to remove. Second, it will add all names in friendGlobal's list to your friend list. Third, it will add all names in your friend list to the friendGlobal List.
This way, all characters will quickly have the same friend list automatically.
friendGlobal will now also detect when you add or remove someone from your local friend list (or blacklist) and update the global list automatically.
I tried to include all the needed commands for manually synchronizing the list.
Typing /fg will give you a list of all the available commands
One feature that isn't synchronization related is the /fg who <name> command
Inspired by the /Who mod, it will send a whisper to the character <name> telling them who you where logged onto when you added them to your friend's list. Very handy when saying "Hi" to a friend when you don't remember what character you where on when you met.
Version 0.4
Recoded the event handling to compare the local lists to a list stored in memory in order to determine whether a name is added or removed from the local list. This also fixed a major bug which caused the entire global list to be wiped clean and then filled with the contents of the local list every time a name was added or deleted from the local list.
ToDo:
Change the badFriendGlobal to track the date the name is added and auto remove names from the list after 30 days.
Look for a way to manipulate groups via code.
Version 0.3
Added event handling to detect when you add or remove people from the local friends list and update the global list accordingly.
I used the EventWatch mod by illusory to verify that the ADD_FRIEND and DEL_FRIEND events are no longer used and the RESET_FRIEND is used instead, but doesn't give any information.
Version 0.2
Added a timer to ensure that your friends list (and blacklist) are synced with the stored global list automatically. (I should have thought of this sooner)
I used the timer code from the Uberflex ACS as a template.
Hopefully this will mean that you will never have to manually update the global list.
Initial Release.
- Please let me know any thoughts you have about this mod.
- If you find any errors, please give me a complete description of the problem and/or the complete error message text (line numbers are very important).
- If you have any suggestions on anything regarding this mod, please let me know.
- I will try to address any comments quickly, barring schoolwork.
Available Commands:
/fg add <name> -- adds <name> to your global and local friend list
/fg update -- adds all names in the friend list to the friendGlobal list
/fg remove <name> -- removes <name> from your global and local friend list
/fg list -- lists global friends
/fg sync -- adds names from friendGlobal to the local friend list and deletes any names removed from friendGlobal
/fg reset -- removes all names from the friendGlobal list (leaves local friend list untouched)
/fg match -- resets local friend list to match the friendGlobal list
/fg clear -- removes all names in the local friend list (leaves friendGlobal list untouched)
/fg who <name> -- Whispers the player <name> the name of the character you where playing when you added them to the friendGlobal list.
/fg help -- to a help message
Startup Actions:
badFriendGlobal:
Exactly the same but for the blacklist instead of the friend list. Commands start with /bfg instead of /fg
AddonManager:
An entry will be added to the AddonManager mod (if installed) for both friendGlobal and badFriendGlobal
If you don't want to synchronize your blacklist, delete badFriendGlobal.lua as well as the following code in friendGlobal.xml
badFriendGlobal_OnLoad(friendGlobal_frame);
FGstartup("BadFriend");
These are on lines 5 and 11 respectively.
Mod Function Details:
SavedVariables.lua
Seperate lists are kept for friendGlobal and badFriendGlobal as well as for each server you frequent.
Names added to these lists are associated with the name of the character you where playing when you added the name to the list.
/fg add <name>
The word/name after add is added to your friend list as well as to the global list.
In the global list, it appears as [<name>] = "Player Name"
/fg remove <name>
The word/name after remove is 'marked' as removed from the global list and is removed from your friend list.
In the global list, it appears as [<name>] = ""
/fg list
prints a list of all names and associated Player Names to the chat frame.
Each entry appears as <name> > Player Name
This is to indicate that <name> was added to the list by the character Player Name.
/fg update
Adds all names in your friend list to the global list. Ideally, this should be done automatically when you load your character.
/fg reset
Completely erases all the names in your global list (limited to the server you're on).
Hopefully you won't get much use out of this command, it's more useful for testing.
/fg sync
This command does two actions.
First, it loads all names in the global list to your friend list.
Second, it removes any names in your friend list that where 'removed' from the global list.
/fg match
Deletes all names in your friend list and then loads all the names in the global list to your friend list.