chatroommanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

ChatRoomManager

together.ChatRoomManager

Overview

The ChatRoomManager is used for fetching and finding chatrooms that exist for the current game.


Members

List<ChatRoom> ChatRooms

Stores all the ChatRooms contained in the Manager.


Methods


Add()

Adds a ChatRoom to the manager internally without persistence.

Note
This method is deprecated

Returns void
Syntax
ChatRoomManager.Add( chatRoom )
Parameters

ChatRoom chatRoom

Instance of a ChatRoom to add internally

--------------------------------------------------------------------------------

FindByChatRoomID()

Finds the ChatRoom with the specified ChatRoomID if it exists, otherwise returns null.

Returns ChatRoom
Syntax
ChatRoomManager.FindByChatRoomID( chatRoomID )
Parameters

long chatRoomID

The ID of the ChatRoom to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of ChatRooms currently managed by the internal list

Returns int
Syntax
ChatRoomManager.GetCount(  )

Get()

Gets the ChatRoom at the specified index if it exists, otherwise returns null.

Returns ChatRoom
Syntax
ChatRoomManager.Get( index )
Parameters

int index

The index of the ChatRoom to retrieve

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified ChatRoom if it exists, otherwise returns -1

Returns int
Syntax
ChatRoomManager.IndexOf( chatRoom )
Parameters

ChatRoom chatRoom

Instance of the ChatRoom to retrieve the index of

--------------------------------------------------------------------------------

IndexOfByChatRoomID()

Returns the index of the ChatRoom with the specified ChatRoomID if it exists, otherwise returns -1.

Returns int
Syntax
ChatRoomManager.IndexOfByChatRoomID( chatRoomID )
Parameters

long chatRoomID

The ID of the ChatRoom to find the index of

--------------------------------------------------------------------------------

Remove()

Removes a ChatRoom from the managed list without persistence.

Note
This method is deprecated

Returns void
Syntax
ChatRoomManager.Remove( The )
Parameters

int The

index of the ChatRoom to be removed if it exists

--------------------------------------------------------------------------------

PostProcessUsernames()

Post processes the ChatRoomUser's usernames. If a User is registered, its Name member will be assigned the name from their social network account. Otherwise, the Name member will be set to the User's Username.

Returns void
Syntax
ChatRoomManager.PostProcessUsernames(  )

Create()

Creates a ChatRoom that can be associated to a Game Instance and optionally joined immediately.

Returns void
Syntax
ChatRoomManager.Create( name, description, roomID, gameInstanceID, chatRoomProperties, callbackFunc )
Parameters

string name

The name of the new ChatRoom.

[string](#) description

The description for the new ChatRoom.

[long](#) roomID

The ID of the room the ChatRoom is in. Pass in 0 for no room.

[long](#) gameInstanceID

The ID of the GameInstance the ChatRoom is associated with. GameInstances associated with ChatRooms will retrieved when GameInstanceManager:GetAll() is called.

[PropertyCollection](./propertycollection) chatRoomProperties

The properties to associate with the ChatRoom. Pass in null if no properties should be associated.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Delete()

Deletes a ChatRoom with the specified ID.

Returns void
Syntax
ChatRoomManager.Delete( chatRoomID, callbackFunc )
Parameters

long chatRoomID

The ID of the ChatRoom to delete

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion

--------------------------------------------------------------------------------

GetAll()

Gets all ChatRooms or optionally all a specific user is a member of.

Returns void
Syntax
ChatRoomManager.GetAll( getForUserID, callbackFunc )
Parameters

long getForUserID

The ID of the User to get ChatRooms for. When specified, only the ChatRooms the User is a member of will be retrieved. Pass in 0 to retrieve all ChatRooms.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️