Forcing client/server with GNet

BlitzMax Forums/BlitzMax Programming/Forcing client/server with GNet

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Hi,

Client/server is very much a conceptual thing, and you should be able to fake it with GNet.

For 'pregame' setup stuff (ie: lobby/client/server bit), I recommend creating a separate GNetHost on a different port from the main game host.

This host would have no game objects attached, only 'connection' objects that describe the state of players attempting to join the game. Each connection object could also have a 'chat' slot...instant lobby!

When a 'client' wants to join a game hosted on a 'server', it connects to the server host port and uses GNet messages to negotiate a game connection.

Once the client has been accepted by the server etc, it can then connect to the real game host.

This also allows you to really isolate the server/setup code - it could easily be a separate executable.