room asignment
Posted: 21 Jun 2010, 05:59
Hi everyone,
New to sfs and writing an extension. I want to achieve the following:
A player hits "play" on the game and the server gets the requests.
1) it looks at its current rooms and see if any has less than 8 players.
a) if one has less than 8 players, puts him into one of them and begins game
b) if all rooms are full (8 players), creates a new room, adds it and begins game
I saw the examples and i see how to create rooms, but any way to iterate and check players and make them join? I'm sure it's a simple loop but I can't figure it out.
Thanks
Joaquin Grech
New to sfs and writing an extension. I want to achieve the following:
A player hits "play" on the game and the server gets the requests.
1) it looks at its current rooms and see if any has less than 8 players.
a) if one has less than 8 players, puts him into one of them and begins game
b) if all rooms are full (8 players), creates a new room, adds it and begins game
I saw the examples and i see how to create rooms, but any way to iterate and check players and make them join? I'm sure it's a simple loop but I can't figure it out.
Thanks
Joaquin Grech