Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14392) cut connection ... due to lagging player
Home

[Freeciv-Dev] (PR#14392) cut connection ... due to lagging player

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#14392) cut connection ... due to lagging player
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Oct 2005 11:47:13 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14392 >

> [chrisk - Thu Oct 20 11:18:00 2005]:
> 
> 
> SVN HEAD 20 OCT 2005 GTK2
> 
> Changing city production for 2 cities in the city report lead to the
> client
> main screen, reporting 'connection lost to server'.
> 
> The civserver (running seperately) issues,
> 
>  cut connection chris von localhost (Spieler Willy Brandt) due to
> lagging player
> 
> It is possible to reconnect and continue the game. The production
> change had
> been accepted.
> 
> There are other game situations (such as gotos) that lead to an
> apprupt end.
> Whether the server message is the same I don't know. If the server is
> started from the client it is killed and the game not saved.

Here is a patch.

This is a major bug because the game is not saved.  So this should be
applied to 2.0.

It would also help for the client to increase its read buffer when this
happens, so that in multi-player local games the server can go on
processing.

-jason

Index: server/sernet.c
===================================================================
--- server/sernet.c     (revision 11170)
+++ server/sernet.c     (working copy)
@@ -307,8 +307,11 @@
            if(FD_ISSET(pconn->sock, &writefs)) {
              flush_connection_send_buffer_all(pconn);
            } else {
-             if (game.info.tcptimeout != 0 && pconn->last_write != 0
-                && (time(NULL)>pconn->last_write + game.info.tcptimeout)) {
+             if (game.info.tcptimeout != 0
+                 && pconn->last_write != 0
+                 && conn_list_size(game.all_connections) > 1
+                 && pconn->access_level != ALLOW_HACK
+                 && (time(NULL)>pconn->last_write + game.info.tcptimeout)) {
                freelog(LOG_NORMAL, "cut connection %s due to lagging player",
                        conn_description(pconn));
                close_socket_callback(pconn);

[Prev in Thread] Current Thread [Next in Thread]