DEADSOFTWARE

net: make packet timeout less aggressive
[d2df-sdl.git] / src / game / g_net.pas
index 27825c263cf738da7301a6454a7b629d9ff8bc10..dabb738106e281fd75a802b353e57d226a358ac5 100644 (file)
@@ -21,7 +21,7 @@ uses
   e_log, e_msg, utils, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF}
 
 const
-  NET_PROTOCOL_VER = 187;
+  NET_PROTOCOL_VER = 188;
 
   NET_MAXCLIENTS = 24;
   NET_CHANS = 12;
@@ -161,8 +161,8 @@ var
   NetAutoBanPerm:  Boolean = True;
   NetAutoBanWarn:  Boolean = False;
 
-  NetAuthTimeout:   Integer = 15 * 1000;
-  NetPacketTimeout: Integer = 30 * 1000;
+  NetAuthTimeout:   Integer = 30 * 1000;
+  NetPacketTimeout: Integer = 60 * 1000;
 
   NetState:      Integer = NET_STATE_NONE;
 
@@ -1683,7 +1683,7 @@ begin
       else if (State = NET_STATE_GAME) and (MsgTime > 0) and (MsgTime <= gTime) then
       begin
         g_Net_Penalize(@NetClients[ID], 'message timeout');
-        AuthTime := gTime + 500; // do it twice a second to give them a chance
+        MsgTime := gTime + (NetPacketTimeout div 2) + 500; // wait less for the next check
       end;
     end;
   end;