This class is a wrapper for snipe.kit.room.data.RoomKit
providing limited functionality to access room variables from within room scripts.
It is available only on Snipe Kit server.
Room state. Empty string by default. If the room state does not change in 60 seconds, the room is destroyed.
read only users:Array<RoomUserClass>
List of room users data. The data is set in the "matchmaking.init" script for this game type and can be changed in room scripts.
broadcast (type:String, msg:Dynamic):Void
Broadcasts the message to all clients in this room.
Parameters:
type
Message type.
msg
Message parameters.
event (userID:Int, actionID:String, params:Dynamic):Dynamic
Sends event to this room.
Parameters:
userID
User ID.
actioID
Room event action ID.
params
Event parameters.
Returns:
Return object. Has errorCode parameter. errorCode is set to "scriptException" in case of an error. In this case room will die after finishing the outer script.
getUser (userID:Int):RoomUserClass
Returns room user object with this ID. User object must have a unique "id" field set.
Parameters:
userID
User ID.
Returns:
User object.
Returns true if client for this user is online.
Parameters:
userID
user ID.
Returns:
True, if client is online, false otherwise.
Kicks a client from this room. Room user record will stay intact. First calls leave()
then notifies the game server to return the client to default state.
Parameters:
clientID
Client ID.
notify (clientID:Int, msg:Dynamic):Void
Sends client notification to the given room client. If the client is not in the room, nothing happens.
Parameters:
clientID
Client ID.
msg
Notification message.
notifyBroadcast (msg:Dynamic):Void
Broadcasts the notification to all clients in this room.
Parameters:
msg
Message parameters.