friendusermanager - TogetherGames/Public-Unity-CSharp GitHub Wiki
together.FriendUserManager
The FriendUserManager class contains a collection of Friends.
List<FriendUser> Friends
Stores all the Friends contained in the Manager.
Dictionary<long, FriendUser> FriendsDictionaryByUserID
A table used to store all together friends in a dictionary form by their UserID.
Dictionary<string, FriendUser> FriendsDictionaryBySocialID
A table used to store all together friends in a dictionary form by their SocialID.
Adds a FriendUser to the manager internally without persistence.
Note
This method is deprecated
Returns void
FriendUserManager.Add( friend )
FriendUser friend
Instance of the FriendUser to add
--------------------------------------------------------------------------------Finds a FriendUser by UserID if it exists, otherwise returns null.
Returns FriendUser
FriendUserManager.FindByUserID( userID )
long userID
The ID of the User to find
--------------------------------------------------------------------------------Finds the FriendUser by SocialID if it exists, otherwise returns null.
Returns FriendUser
FriendUserManager.FindBySocialID( socialID )
long socialID
The SocialID of the User to find
--------------------------------------------------------------------------------Gets the number of FriendUsers currently managed internally.
Returns int
FriendUserManager.GetCount( )
Gets the FriendUser at the specified index if it exists, otherwise returns null.
Returns FriendUser
FriendUserManager.Get( index )
int index
The index of the Friend to find
--------------------------------------------------------------------------------Gets the Index of the specified Friend if it exists, otherwise returns -1.
Returns int
FriendUserManager.IndexOf( friend )
FriendUser friend
Instance of the Friend to get the index of
--------------------------------------------------------------------------------Returns the index of the FriendUser with the specified UserID if it exists, otherwise returns -1.
Returns int
FriendUserManager.IndexOfByUserID( userID )
long userID
The ID of the User to get the index of
--------------------------------------------------------------------------------Returns the index of the FriendUser with the specified SocialID if it exists, otherwise returns -1.
Returns int
FriendUserManager.IndexOfBySocialID( socialID )
string socialID
The social ID of the User to get the index of
--------------------------------------------------------------------------------Removes a FriendUser from the internally managed list. This does not delete the Friend from the user's list persistently.
Note
This method is deprecated
Returns void
FriendUserManager.Remove( )
Adds a new friend to the current session's User account. Upon success, this will automatically update the internal list.
Returns void
FriendUserManager.AddFriend( friendUserID, callbackFunc )
long friendUserID
The ID of the User to add as a friend.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Gets all Friends from the current session's User account. Upon success, this will automatically update the internal list.
Returns void
FriendUserManager.GetAll( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Removes a Friend from the current session's User account. Upon succes, this will automatically update the internal list.
Returns void
FriendUserManager.RemoveFriend( friendUserID, callbackFunc )
long friendUserID
The ID of a User to remove as a friend
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Synchronizes the Friend list. This method is called whenever you initially log into Facebook. For each Facebook friend, if they are also a registered Together User, they become a Together friend on the User account. Upon success, this will automatically update the internal list.
Returns void
FriendUserManager.SyncFriends( syncType, externalFriends, callbackFunc )
string syncType
The type of synchronization to be done. Pass "FB" for Facebook. This parameter exists for future expandability to other social networks.
[ExternalFriend](./externalfriend)[] externalFriendsThe array full of external (Facebook) friends.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------