usermessagemanager - TogetherGames/Public-Unity-CSharp GitHub Wiki
together.UserMessageManager
The UserMessageManager class is used to find and fetch messages directly sent to the current session's User account. With this class, a developer will be able to create a message, delete a message, get all messages, and mark a message as read. A Developer can use UserMessages as in-game email.
List<UserMessage> UserMessages
Stores all the UserMessages contained in the Manager.
Adds a UserMessage to the internally managed list without persistence.
Note
This method is deprecated
Returns void
UserMessageManager.Add( userMessage )
UserMessage userMessage
Instance of a UserMessage to add internally
--------------------------------------------------------------------------------Finds the UserMessage with the specified UserMessageID if it exists, otherwise returns null.
Returns UserMessage
UserMessageManager.FindByUserMessageID( userMessageID )
long userMessageID
The ID of the UserMessage to find
--------------------------------------------------------------------------------Gets the number of UserMessages currently managed internally.
Returns int
UserMessageManager.GetCount( )
Gets the UserMessage at the specified index if it exists, otherwise returns null.
Returns UserMessage
UserMessageManager.Get( index )
int index
The index of the UserMessage to find
--------------------------------------------------------------------------------Returns the index of the specified UserMessage if it exists, otherwise returns -1.
Returns int
UserMessageManager.IndexOf( userMessage )
UserMessage userMessage
Instance of the UserMessage to find the index of
--------------------------------------------------------------------------------Returns the index of the UserMessage with the specified UserMessageID if it exists, otherwise returns -1.
Returns int
UserMessageManager.IndexOfByUserMessageID( userMessageID )
long userMessageID
The ID of the UserMessage to find the index of
--------------------------------------------------------------------------------Removes a UserMessage from the internally managed list. This does not delete the message from the user's mailbox persistently.
Note
This method is deprecated
Returns void
UserMessageManager.Remove( index )
int index
The index of the UserMessage to remove internally
--------------------------------------------------------------------------------Gets all UserMessages assigned to the User. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager.GetAll( unreadOnly, startID, count, callbackFunc )
bool unreadOnly
A Boolean indicating whether only unread messages should be retrieved.
[long](#) startIDThe ID of the UserMessage to start with when returning UserMessages.
[int](#) countThe max number of UserMessages to return.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Sends a message to a specific User. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager.CreateMessage( destinationUserID, title, message, isGameIndependent, messageProperties, callbackFunc )
long destinationUserID
The ID of the User to send the UserMessage to.
[string](#) titleThe title of the UserMessage.
[string](#) messageThe message of the UserMessage.
[bool](#) isGameIndependentA boolean indicating whether the generated UserMessage is assigned to the Game being played.
[PropertyCollection](./propertycollection) messagePropertiesThe properties to assign to the UserMessage. Pass in null to assign no properties.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Marks a UserMessage as read. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager.MarkMessageAsRead( userMessageID, callbackFunc )
long userMessageID
The ID of the UserMessage to mark as read.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Deletes a UserMessage. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager.DeleteMessage( userMessageID, callbackFunc )
long userMessageID
The ID of the UserMessage to delete.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------