Game Development Reference
In-Depth Information
Modeling game room
In the last chapter, we saw how to create the game schema and model the avatar.
The game room required for the game is also modeled via the schema file.
Subclassing should be done when you want to define additional properties on a
game room that you want to store within the game room. The properties that you
might want to add would be specific to your game. However, some of the commonly
required properties are already defined in the GameRoom class. You will only need
to define one such subclass for a game. The following are the properties defined on
the GameRoom Class:
Property
Notes
Room name
Name of the game room typically set during game
room creation
Host name
The server keeps track of this value and is set to the current
host of the room. The room host is typically the creator. If the
host leaves the room while others are still in it, an arbitrary
player in the room is set as host.
Host ID
Is maintained by the server similar to host name.
Password
Should be set by the developer upon creating a new
game room.
Player count
The server keeps track of this value as and when the players
enter or leave the room.
Max player count
Should be set by the developer upon creating a new game
room. The server will automatically reject the player joining
the room if the player count is equal to the max player count
Room status
The possible values for this property are GameConstants.
ROOM_STATE_WAITING or GameConstants.ROOM_STATE_
PLAYING
The server keeps track of these value-based player actions such
as PulseClient.startGame API.
Room type
The possible values for this property are value combinations of
GameConstants.ROOM_TURN_BASED and GameConstants.
ROOM_DISALLOW_POST_START
The developer should set this value upon creating a new
room. The server controls the callback API behavior based
on this property.
Action
A server-reserved property; the developer should not use this
for any purpose.
The developer may inherit from the game room and specify an arbitrary number of
properties. Note that the total number of bytes should not exceed 1K bytes.
Search WWH ::




Custom Search