Check if game is in progress and deny access to room?

0 votes
I need to create a game that supports up to 10 players.  The trick is that there can only be one match running at any given time.  If players attempt to join before the current match has ended they should be denied access until the current match is finished.

 

Can this system be implemented?  If so, what would be recommended for doing so?  I would assume the use of a static room, but not sure if it can be locked down once a session is in play.
asked Jun 29, 2015 in AppWarp by Jamaal Sawyer-Dymski (27 points)

1 Answer

+1 vote
 
Best answer

Hi Jamaal,

You can achieve this by setting a property to the room while creating.

You can do the following steps to achieve this:

1. When creating a new room, set the 'maxUsers'  to 10.

2. Add properties to the room and Create a room as:

Dictionary<string, object> props = new Dictionary<string, object> ();

props.Add("isGameStarted", "false"); 
 
WarpClient.GetInstance().CreateRoom("yourRoomName","roomOwner",10, props);
 
3. Update the room properties through 'UpdateRoomProperties' method and set the 'isGameStarted' property to 'true' on game start and set it back to false when the game ends.
 
4. Call 'JoinRoomWithProperties' method when anyone tries to join the room, with property 'isGameStarted' set as 'false'.
 
Now, the sever will check that if there is any room with property 'isGameStarted' set as 'false', and fails if not found, and after that you can handle the result through the Listener class.
This way, the player will only be allowed to join the room if number of players is less then or equal to 10, and 'isGameStarted' is 'false' in the room.
 
Regards,
Sumit Balodi
AppWarp Support Team
answered Jun 29, 2015 by sumit.balodi (40 points)
selected Jun 29, 2015 by Jamaal Sawyer-Dymski
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...