Forum ‹ Multiplayer ‹ Does the code run separately for each client?
4 posts
• Page 1 of 1
Does the code run separately for each client?
I'm making a single player game that uses BigDB and PayVault, so I want the C# game code to run separately for each client.
Does this happen even if there are more players in the same room? Should I create a new room for each player or put everyone in the same room?
Does this happen even if there are more players in the same room? Should I create a new room for each player or put everyone in the same room?
- MrBiscuits
- Paid Member
- Posts: 26
- Joined: May 15th, 2011, 8:09 pm
Re: Does the code run separately for each client?
You should use service-rooms, that way you don't have to worry about placing users in rooms that have an open spot. In your serverside code you can just ignore AllowUserJoin and the UserJoined methods, never send messages to other players in the same room, and just react to and respond to messages.
-

Henrik - .IO
- Posts: 575
- Joined: January 4th, 2010, 1:53 pm
Re: Does the code run separately for each client?
Thanks for the reply.
Does this mean that you can store current game information specific for the player on the server?
ie. variables regarding game state could be put in the GameCode class for example.
Does this mean that you can store current game information specific for the player on the server?
ie. variables regarding game state could be put in the GameCode class for example.
- MrBiscuits
- Paid Member
- Posts: 26
- Joined: May 15th, 2011, 8:09 pm
Re: Does the code run separately for each client?
Yes, but if it's per player you should probably store it in the Player class. 
-

Henrik - .IO
- Posts: 575
- Joined: January 4th, 2010, 1:53 pm
4 posts
• Page 1 of 1