How to reset/restart turn based room?

0 votes

Hello,

I am creating turn based room with 200+ users. Each room is having 52 cards. User has to pickup the card on turn basis where

1. If selected card is Ace of Spade then the user is selected as winner or

2. If the card is other that Ace of spade the game continues.

Once the winner is selected the room should reset and users can join the same room the and play again. User can also play in other rooms which are not closed yet.

I am able to implement the game continue flow by having sendMove().

-(void) sendMove:(NSString*) moveData nextTurn:(NSString*)nextTurn;

So my question is how should i reset the room which again reused for next play? Do i need to delete the room and create an new room with same name or is there any way to get existing room? I also want to maintain who is the winner of each room.

 

Platform Used - iOS

Laguage - Swift

asked Jul 17, 2017 in iOS by vince (10 points)

1 Answer

0 votes
Hi Vince,

To complete the game, you can call stopGame api. Whenever, you need to start the next game, you can call startGame. There is no need to delete the room unless you dont want to continue the next game in this room.

If any player want to play in other room, you can call leaveRoom first to leave the current room then joinRoom to join other room.

Let me know if you have any other query, I will be happy to help.

Thanks.
answered Jul 18, 2017 by rajeev.etc (1,660 points)
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
...