This module provides client request functionality for rooms.
It is available only on Snipe Kit server.
broadcast (c:RoomClientKit, params:Params):{errorCode:String}
kit/room.broadcast
Broadcasts a message to all users in the room that this client is in.
Will not send a standard response to the client that sent the broadcast in case of success.
Upon successful broadcast all clients in the room will receive the message with the type "kit/room.broadcast" and message contents in "msg" field.
Input:
msg
- Dynamic
. Message contents.Output:
errorCode
- String
. Operation error code.Error codes:
notInRoom
- This client has not joined a room.roomDead
- This room is dead. event (c:RoomClientKit, params:Params):{errorCode:String}
kit/room.event
Sends a client event to the room event handler that this client is currently in.
Input:
actionID
- String
. Event action string ID.Output:
errorCode
- String
. Operation error code. Has to be supplied in event handler.Error codes:
notInRoom
- This client has not joined a room.noSuchAction
- This game type does not have an event action with this string ID.roomDead
- This room is dead. join (c:RoomClientKit, params:Params):{errorCode:String}
kit/room.join
Adds this user to the specified room of a given game type. If room join action exists, it will be called and its results will be returned to the client.
Note: A user can only be in one room.
Input:
Output:
errorCode
- String
. Operation error code.Error codes:
ok
- Operation successful.roomNotFound
- Room with this ID was not found.joinNotAllowed
- This user is not allowed to join this room.alreadyInRoom
- This user is already in another room. leave (c:RoomClientKit, params:Params):{errorCode:String}
kit/room.leave
Removes this user from the room he is currently in.
All of room clients will receive "kit/room.left" message with userID set.
Client state on game server will be reset.
Input:
Output:
errorCode
- String
. Operation error code.Error codes:
ok
- Operation successful.notInRoom
- This user is not in a room.