diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 54b06bf579020e5d0882bbe5b2e7946d710ce1c5..dabb738106e281fd75a802b353e57d226a358ac5 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
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 = 187;
+ NET_PROTOCOL_VER = 188;
NET_MAXCLIENTS = 24;
NET_CHANS = 12;
NET_MAXCLIENTS = 24;
NET_CHANS = 12;
NetAutoBanPerm: Boolean = True;
NetAutoBanWarn: Boolean = False;
NetAutoBanPerm: Boolean = True;
NetAutoBanWarn: Boolean = False;
- NetAuthTimeout: Integer = 36 * 15;
- NetPacketTimeout: Integer = 36 * 60;
+ NetAuthTimeout: Integer = 30 * 1000;
+ NetPacketTimeout: Integer = 60 * 1000;
NetState: Integer = NET_STATE_NONE;
NetState: Integer = NET_STATE_NONE;
if (State = NET_STATE_AUTH) and (AuthTime > 0) and (AuthTime <= gTime) then
begin
g_Net_Penalize(@NetClients[ID], 'auth taking too long');
if (State = NET_STATE_AUTH) and (AuthTime > 0) and (AuthTime <= gTime) then
begin
g_Net_Penalize(@NetClients[ID], 'auth taking too long');
- AuthTime := gTime + 18; // do it twice a second to give them a chance
+ AuthTime := gTime + 500; // do it twice a second to give them a chance
end
else if (State = NET_STATE_GAME) and (MsgTime > 0) and (MsgTime <= gTime) then
begin
g_Net_Penalize(@NetClients[ID], 'message timeout');
end
else if (State = NET_STATE_GAME) and (MsgTime > 0) and (MsgTime <= gTime) then
begin
g_Net_Penalize(@NetClients[ID], 'message timeout');
- AuthTime := gTime + 18; // 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;
g_Player_Remove(TP.UID);
end;
g_Player_Remove(TP.UID);
end;
+ if (TC^.Peer^.data <> nil) then
+ begin
+ FreeMemory(TC^.Peer^.data);
+ TC^.Peer^.data := nil;
+ end;
+
if (Force) then
enet_peer_reset(TC^.Peer);
if (Force) then
enet_peer_reset(TC^.Peer);
TC^.NetOut[NET_UNRELIABLE].Free();
TC^.NetOut[NET_RELIABLE].Free();
TC^.NetOut[NET_UNRELIABLE].Free();
TC^.NetOut[NET_RELIABLE].Free();
- if (NetEvent.peer^.data <> nil) then
- begin
- FreeMemory(NetEvent.peer^.data);
- NetEvent.peer^.data := nil;
- end;
-
g_Console_Add(_lc[I_NET_MSG] + Format(_lc[I_NET_MSG_HOST_DISC], [ID]));
Dec(NetClientCount);
g_Console_Add(_lc[I_NET_MSG] + Format(_lc[I_NET_MSG_HOST_DISC], [ID]));
Dec(NetClientCount);
conRegVar('sv_autoban_permanent', @NetAutoBanPerm, '', 'whether autobans are permanent');
conRegVar('sv_autoban_warn', @NetAutoBanWarn, '', 'send warnings to the client when he triggers penalties');
conRegVar('sv_autoban_permanent', @NetAutoBanPerm, '', 'whether autobans are permanent');
conRegVar('sv_autoban_warn', @NetAutoBanWarn, '', 'send warnings to the client when he triggers penalties');
- conRegVar('sv_auth_timeout', @NetAuthTimeout, '', 'number of frames in which connecting clients must complete auth (0 = unlimited)');
- conRegVar('sv_packet_timeout', @NetPacketTimeout, '', 'number of frames the client must idle to be kicked (0 = unlimited)');
+ conRegVar('sv_auth_timeout', @NetAuthTimeout, '', 'number of msec in which connecting clients must complete auth (0 = unlimited)');
+ conRegVar('sv_packet_timeout', @NetPacketTimeout, '', 'number of msec the client must idle to be kicked (0 = unlimited)');
conRegVar('net_master_list', @NetMasterList, '', 'list of master servers');
conRegVar('net_master_list', @NetMasterList, '', 'list of master servers');