lotodore
Admin
 Admin
| Posts: 182 |   | Karma: 10
|
Re:anti deconnection system - 2007/06/22 23:15
aelOnn wrote: Without play order at the end of the timeout, the server auto-plays for the client, as usual (checking or folding), but he could also launch a thread who tries to "ping" the client during the turn, waiting for a reply.
Well, making the server ping the client is basically a bad thing to do. One reason why this is bad is that there might be situations where the server needs to ping a lot of clients, or even fake clients, and this will eat up a lot of bandwidth. This could be used to attack the server (in case of a dedicated server).
The new protocol SCTP takes over this task, so best would be to use it. Sadly, in most cases SCTP does not work behind NAT (i.e. behind a router). And: There is still no proper SCTP support for Windows.
Usually, the pinging is done by the clients (it is called a "heartbeat" or "keepalive"), with the server confirming. If the server does not receive a keepalive within a certain time, it will assume the client is disconnected.
The problem is then, that the client has to reestablish the TCP connection. This is where things get hard to implement, since the client re-joins a game which is already running. He might not have the current state of the game, so all state needs to be transferred. This can be simplified by waiting for the end of the hand until the player is allowed to join, still, some problems remain.
Since the server decides what to do, and since the game needs to continue after a client timed out (the other players are waiting), I think it is not possible to prevent that the player who disconnected loses a hand.
The special message "pause or continue" is also an option, in other games you can also vote whether to kick players which are disconnected.
Still, this needs a lot of work, and the simple solution to pause the game would be easiest to implement.
-- Use IPv6. http://www.sixxs.net/ |