Beamable SDK
Public Member Functions | Public Attributes | Properties | List of all members
Beamable.Experimental.Api.Chat.RoomHandle Class Reference

Public Member Functions

 RoomHandle (RoomInfo room, IDependencyProvider dependencyProvider)
 
Promise< UnitSubscribe ()
 Subscribe to the room to get a live feed of Message with the Messages list. The room will automatically subscribe if the KeepSubscribed property is true. More...
 
Promise< UnitUnsubscribe ()
 Stop listening for new messages in this room. This will not leave the room. More...
 
Promise< UnitLeaveRoom ()
 Remove the current player from this room. More...
 
Promise< UnitSendMessage (string message)
 Send a message to this room. More...
 
void Terminate ()
 Triggers the OnRemoved event.
 

Public Attributes

readonly string Id
 The room id
 
readonly string Name
 The name of the room
 
readonly bool KeepSubscribed
 When true, the player will get message updates in real time for this room
 
readonly List< long > Players
 A list of gamertags that are in the room. The list may be null if there are no tracked players.
 
readonly List< MessageMessages
 A list of Messages that are in the room. Use the OnMessageReceived to see messages as they appear.
 
Action OnRemoved
 An event that will trigger after the Terminate method has been called. This will not remove the player from the room.
 
Action< MessageOnMessageReceived
 An event that triggers anytime a new Message is received for the room. This event will only trigger when IsSubscribed is true.
 

Properties

bool ShowPlayerList [get]
 True when there are tracked players in the room
 
bool IsSubscribed [get]
 True when the Subscribe call has completed.
 

Member Function Documentation

◆ LeaveRoom()

Promise< Unit > Beamable.Experimental.Api.Chat.RoomHandle.LeaveRoom ( )
inline

Remove the current player from this room.

Returns
A Promise representing the network call.

◆ SendMessage()

Promise< Unit > Beamable.Experimental.Api.Chat.RoomHandle.SendMessage ( string  message)
inline

Send a message to this room.

Parameters
messageThe message body
Returns
A Promise representing the network call.

◆ Subscribe()

Promise< Unit > Beamable.Experimental.Api.Chat.RoomHandle.Subscribe ( )
inline

Subscribe to the room to get a live feed of Message with the Messages list. The room will automatically subscribe if the KeepSubscribed property is true.

Returns
A Promise representing when the subscription has been initialized.

◆ Unsubscribe()

Promise< Unit > Beamable.Experimental.Api.Chat.RoomHandle.Unsubscribe ( )
inline

Stop listening for new messages in this room. This will not leave the room.

Returns

The documentation for this class was generated from the following file: