Hope you don't mind I'm putting this on the dev-list instead of the bug
tracker, but this just feels like a better medium for discussion.
Alright, sounds like the clients have the initiative all the time - the
server is not going to contact the clients on its own initiative. So I
think a statefull synchronous text based (UTF-8?) protocol will suffice.
With commands along the lines of:
OPENGAME <port>\t<name>\t<player-count>
STARTGAME
CLOSEGAME <name of winner>
and
LISTALL
The CLOSEGAME part will, however, cause the TCP sessions to be very
long, if all state is tied up on the IP:PORT values - if the connection
is closed and the reinitiated, NAT routers could cause the PORT value to
change. A solution could be to return an ID number on OPENGAME and have
the client refer to it with subsequent requests, and then bind the state
information to the IP:ID combination.
About the port pinging, do you mean a TCP connection attempt?
Cheers.
Dennis Schridde wrote:
When Warzone creates a new network game it should send a notification to the
master-server with game name, player number and so on.
The master should then remember the IP and port of the game and try to ping
it on that port. If that works it should store it in his list of open games.
When the client starts that game it should notify the master server again
that the game has been started. Same should happen when the game ends.
Perhaps even mentioning the winner so we can later on gather some stats...
When a client asks the master for all games it should get a list with
IP,port,name,player-count,status.
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev