GIT
/
REPO
/
FRED-BOY
Projects
/
d2df-sdl.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: make packet timeout less aggressive
[d2df-sdl.git]
/
src
/
game
/
g_net.pas
diff --git
a/src/game/g_net.pas
b/src/game/g_net.pas
index 27825c263cf738da7301a6454a7b629d9ff8bc10..dabb738106e281fd75a802b353e57d226a358ac5 100644
(file)
--- a/
src/game/g_net.pas
+++ b/
src/game/g_net.pas
@@
-21,7
+21,7
@@
uses
e_log, e_msg, utils, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF}
const
e_log, e_msg, utils, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF}
const
- NET_PROTOCOL_VER = 18
7
;
+ NET_PROTOCOL_VER = 18
8
;
NET_MAXCLIENTS = 24;
NET_CHANS = 12;
NET_MAXCLIENTS = 24;
NET_CHANS = 12;
@@
-161,8
+161,8
@@
var
NetAutoBanPerm: Boolean = True;
NetAutoBanWarn: Boolean = False;
NetAutoBanPerm: Boolean = True;
NetAutoBanWarn: Boolean = False;
- NetAuthTimeout: Integer =
15
* 1000;
- NetPacketTimeout: Integer =
3
0 * 1000;
+ NetAuthTimeout: Integer =
30
* 1000;
+ NetPacketTimeout: Integer =
6
0 * 1000;
NetState: Integer = NET_STATE_NONE;
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');
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;
end;
end;
end;
DEADSOFTWARE 2012-2025