Kit room class.
Marks this room as dead when set to true. This should be set to true when the room is no longer needed through the use of kit.room.SlaveModule.remove()
API.
Room.tick()
stops working and no updates and notifications will be sent to room clients anymore. Keep in mind that Room.leavePost()
callback will not be executed for any clients.
inline broadcast (type:String, msg:Dynamic):Void
Broadcasts the message to all clients in this room.
Parameters:
type
Message type.
msg
Message parameters.
join (c:RoomClientKit):Void
Marks room field as changed. This will put the field in a list of changed fields until the replicate()
method is called.
Should be called after each state change that will need to be propagated to the clients.
In case when the room is persistent, this will also update the block field which will be saved later.
Parameters:
key
Room instance field name.
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.
leave (c:RoomClientKit):Void
Removes this client from a list of clients and calls leavePost()
callback.
Unsets the "roomID" and "roomTypeID" client variables.
If one of the clients in the room disconnects, this method will be called automatically.
If the room is dead, leavePost()
callback will not be called.
Does not reset client state on game server. Use kick()
to do it.
Parameters:
c
Client to remove from the room.
inline notifyBroadcast (msg:Dynamic):Void
Broadcasts the notification to all clients in this room.
Parameters:
msg
Message parameters.