Joining a game room
Posted: 17 Nov 2011, 11:22
Hi there,
I am building a set of games with a lobby area that users can navigate around with avatars. I'd like to allow a system of game entry similar to that used in club penguins 'Ski Hill' sled racing game, whereby the user chooses to start or join a game by navigating over to an onscreen game entry point. A panel appears asking if they would like to join/start the game, then displaying the names of each of the subsequent users as they also join. Once the required number of players are present the game begins automatically.
I'm thinking that the best way to do this would be to have the users join the game room but also stay in the lobby until the game starts. That way I can continue to display other users milling about in the lobby while the wait for users to join takes place.
The 'JoinRoomRequest' allows me to do this by setting 'roomToLeave' as a negative number. But the first player has to create the room before joining it, and the 'CreateRoomRequest' doesn't seem to have the same facility. I realise I could listen for the roomAdd event and then call join manually rather than using 'autoJoin' on my create request, but then I woulc have to set a room variable so that i could be sure that the roomAdd event really was dispatched in response to my createRequest, so I'm wondering if there is a simpler, cleaner way of doing this that I am missing?
The second problem is that I'd like my game rooms to be SFSGameRooms, so I'm actually now using CreateSFSGameRequest - which definitely only takes a single SFSGameSettings parameter, and seems to autoJoin me to the room by default. Is it possible to keep a presence in the lobby when creating an SFSRoom?
thanks,
Alex H
I am building a set of games with a lobby area that users can navigate around with avatars. I'd like to allow a system of game entry similar to that used in club penguins 'Ski Hill' sled racing game, whereby the user chooses to start or join a game by navigating over to an onscreen game entry point. A panel appears asking if they would like to join/start the game, then displaying the names of each of the subsequent users as they also join. Once the required number of players are present the game begins automatically.
I'm thinking that the best way to do this would be to have the users join the game room but also stay in the lobby until the game starts. That way I can continue to display other users milling about in the lobby while the wait for users to join takes place.
The 'JoinRoomRequest' allows me to do this by setting 'roomToLeave' as a negative number. But the first player has to create the room before joining it, and the 'CreateRoomRequest' doesn't seem to have the same facility. I realise I could listen for the roomAdd event and then call join manually rather than using 'autoJoin' on my create request, but then I woulc have to set a room variable so that i could be sure that the roomAdd event really was dispatched in response to my createRequest, so I'm wondering if there is a simpler, cleaner way of doing this that I am missing?
The second problem is that I'd like my game rooms to be SFSGameRooms, so I'm actually now using CreateSFSGameRequest - which definitely only takes a single SFSGameSettings parameter, and seems to autoJoin me to the room by default. Is it possible to keep a presence in the lobby when creating an SFSRoom?
thanks,
Alex H