diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index d2bc5a2be06a30cf2111c7189d9e1ad0fed0e78e..417be8b7c6a568ad6a1742af54ef5f86adab7f00 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
- NET_PROTOCOL_VER = 184;
+ NET_PROTOCOL_VER = 189;
NET_MAXCLIENTS = 24;
NET_CHANS = 12;
BANLIST_FILENAME = 'banlist.txt';
NETDUMP_FILENAME = 'netdump';
- {$IF DEFINED(FREEBSD) OR DEFINED(DARWIN)}
- NilThreadId = nil;
- {$ELSE}
- NilThreadId = 0;
- {$ENDIF}
-
type
TNetMapResourceInfo = record
wadName: AnsiString; // wad file name, without a path
Player: Word;
RequestedFullUpdate: Boolean;
WaitForFirstSpawn: Boolean; // set to `true` in server, used to spawn a player on first full state request
+ FullUpdateSent: Boolean;
RCONAuth: Boolean;
Voted: Boolean;
+ Crimes: Integer;
+ AuthTime: LongWord;
+ MsgTime: LongWord;
Transfer: TNetFileTransfer; // only one transfer may be active
NetOut: array [0..1] of TMsg;
end;
NetPongSock: ENetSocket = ENET_SOCKET_NULL;
NetUseMaster: Boolean = True;
- NetMasterList: string = 'mpms.doom2d.org:25665,deadsoftware.ru:25665';
+ NetMasterList: string = 'mpms.doom2d.org:25665, deadsoftware.ru:25665';
NetClientIP: string = '127.0.0.1';
NetClientPort: Word = 25666;
NetMaxClients: Byte = 255;
NetBannedHosts: array of TBanRecord;
+ NetAutoBanLimit: Integer = 5;
+ NetAutoBanPerm: Boolean = True;
+ NetAutoBanWarn: Boolean = False;
+ NetAutoBanForTimeout: Boolean = False;
+
+ NetAuthTimeout: Integer = 30 * 1000;
+ NetPacketTimeout: Integer = 60 * 1000;
+
NetState: Integer = NET_STATE_NONE;
NetMyID: Integer = -1;
NetGotEverything: Boolean = False;
NetGotKeys: Boolean = False;
+ NetDeafLevel: Integer = 0;
+
{$IFDEF USE_MINIUPNPC}
NetPortForwarded: Word = 0;
NetPongForwarded: Boolean = False;
function g_Net_Host(IPAddr: LongWord; Port: enet_uint16; MaxClients: Cardinal = 16): Boolean;
procedure g_Net_Host_Die();
procedure g_Net_Host_Send(ID: Integer; Reliable: Boolean; Chan: Byte = NET_CHAN_GAME);
-function g_Net_Host_Update(): enet_size_t;
+procedure g_Net_Host_Update();
+procedure g_Net_Host_Kick(ID: Integer; Reason: enet_uint32);
function g_Net_Connect(IP: string; Port: enet_uint16): Boolean;
procedure g_Net_Disconnect(Forced: Boolean = False);
procedure g_Net_Client_Send(Reliable: Boolean; Chan: Byte = NET_CHAN_GAME);
-function g_Net_Client_Update(): enet_size_t;
-function g_Net_Client_UpdateWhileLoading(): enet_size_t;
+procedure g_Net_Client_Update();
function g_Net_Client_ByName(Name: string): pTNetClient;
function g_Net_Client_ByPlayer(PID: Word): pTNetClient;
procedure g_Net_UnbanNonPermHosts();
procedure g_Net_SaveBanList();
+procedure g_Net_Penalize(C: pTNetClient; Reason: string);
+
procedure g_Net_DumpStart();
procedure g_Net_DumpSendBuffer();
procedure g_Net_DumpRecvBuffer(Buf: penet_uint8; Len: LongWord);
uses
SysUtils,
- e_input, e_res,
+ e_input, e_res, g_options,
g_nethandler, g_netmsg, g_netmaster, g_player, g_window, g_console,
- g_main, g_game, g_language, g_weapons, ctypes, g_system, g_map;
+ g_game, g_language, g_weapons, ctypes, g_map;
const
FILE_CHUNK_SIZE = 8192;
end;
procedure g_Net_InitLowLevel ();
+ var v: ENetVersion;
begin
+ v := enet_linked_version();
+ e_LogWritefln('ENet Version: %s.%s.%s', [ENET_VERSION_GET_MAJOR(v), ENET_VERSION_GET_MINOR(v), ENET_VERSION_GET_PATCH(v)]);
if enet_init_success then raise Exception.Create('wuta?!');
enet_init_success := (enet_initialize() = 0);
end;
e_KeyPressed(JOY3_JUMP)
end;
-
//**************************************************************************
//
// file transfer declaraions and host packet processor
procedure killClientByFT (var nc: TNetClient);
begin
e_LogWritefln('disconnected client #%d due to file transfer error', [nc.ID], TMsgType.Warning);
- enet_peer_disconnect(nc.Peer, NET_DISC_FILE_TIMEOUT);
+ g_Net_Host_Kick(nc.ID, NET_DISC_FILE_TIMEOUT);
clearNetClientTransfers(nc);
g_Net_Slist_ServerPlayerLeaves();
end;
exit;
end;
+ // don't time out clients during a file transfer
+ if (NetAuthTimeout > 0) then
+ nc^.AuthTime := gTime + NetAuthTimeout;
+ if (NetPacketTimeout > 0) then
+ nc^.MsgTime := gTime + NetPacketTimeout;
+
tf := @NetClients[nid].Transfer;
tf.lastAckTime := GetTimerMS();
end;
if (freePacket) then begin freePacket := false; enet_packet_destroy(ev.packet); end;
end;
- ProcessLoading();
+
+ ProcessLoading(False);
if g_Net_UserRequestExit() then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' user abort', True);
end;
if (freePacket) then begin freePacket := false; enet_packet_destroy(ev.packet); end;
end;
- ProcessLoading();
+
+ ProcessLoading(False);
if g_Net_UserRequestExit() then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' user abort', True);
end;
if (freePacket) then begin freePacket := false; enet_packet_destroy(ev.packet); end;
end;
- ProcessLoading();
+
+ ProcessLoading(False);
if g_Net_UserRequestExit() then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' user abort', True);
NetAddr.host := IPAddr;
NetAddr.port := Port;
- if NetForwardPorts then NetPortThread := BeginThread(ForwardThread);
-
NetHost := enet_host_create(@NetAddr, NET_MAXCLIENTS, NET_CHANS, 0, 0);
if (NetHost = nil) then
Exit;
end;
+ if NetForwardPorts then NetPortThread := BeginThread(ForwardThread);
+
NetPongSock := enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM);
if NetPongSock <> ENET_SOCKET_NULL then
begin
enet_peer_reset(NetClients[I].Peer);
NetClients[I].Peer := nil;
NetClients[I].Used := False;
+ NetClients[I].Player := 0;
+ NetClients[I].Crimes := 0;
+ NetClients[I].AuthTime := 0;
+ NetClients[I].MsgTime := 0;
NetClients[I].NetOut[NET_UNRELIABLE].Free();
NetClients[I].NetOut[NET_RELIABLE].Free();
end;
NetOut.Clear();
end;
+procedure g_Net_Host_Disconnect_Client(ID: Integer; Force: Boolean = False);
+var
+ TP: TPlayer;
+ TC: pTNetClient;
+begin
+ TC := @NetClients[ID];
+ if (TC = nil) then Exit;
+ clearNetClient(NetClients[ID]);
+ if not (TC^.Used) then Exit;
+
+ TP := g_Player_Get(TC^.Player);
+
+ if TP <> nil then
+ begin
+ TP.Lives := 0;
+ TP.Kill(K_SIMPLEKILL, 0, HIT_DISCON);
+ g_Console_Add(Format(_lc[I_PLAYER_LEAVE], [TP.Name]), True);
+ e_WriteLog('NET: Client ' + TP.Name + ' [' + IntToStr(TC^.ID) + '] disconnected.', TMsgType.Notify);
+ 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);
+
+ TC^.Used := False;
+ TC^.State := NET_STATE_NONE;
+ TC^.Peer := nil;
+ TC^.Player := 0;
+ TC^.Crimes := 0;
+ TC^.AuthTime := 0;
+ TC^.MsgTime := 0;
+ TC^.RequestedFullUpdate := False;
+ TC^.FullUpdateSent := False;
+ TC^.WaitForFirstSpawn := False;
+ TC^.NetOut[NET_UNRELIABLE].Free();
+ TC^.NetOut[NET_RELIABLE].Free();
+
+ g_Console_Add(_lc[I_NET_MSG] + Format(_lc[I_NET_MSG_HOST_DISC], [ID]));
+ Dec(NetClientCount);
+
+ if NetUseMaster then g_Net_Slist_ServerPlayerLeaves();
+end;
+
+procedure g_Net_Host_Kick(ID: Integer; Reason: enet_uint32);
+var
+ Peer: pENetPeer;
+ TC: pTNetClient;
+begin
+ TC := @NetClients[ID];
+ if (TC <> nil) and TC^.Used and (TC^.Peer <> nil) then
+ begin
+ Peer := TC^.Peer;
+ g_Net_Host_Disconnect_Client(ID);
+ enet_peer_disconnect(Peer, Reason);
+ end;
+end;
+
procedure g_Net_Host_CheckPings();
var
ClAddr: ENetAddress;
Ping: array [0..9] of Byte;
NPl: Byte;
begin
- if NetPongSock = ENET_SOCKET_NULL then Exit;
+ if (NetPongSock = ENET_SOCKET_NULL) or (NetHost = nil) then Exit;
Buf.data := Addr(Ping[0]);
Buf.dataLength := 2+8;
NetOut.Clear();
NetOut.Write(Byte(Ord('D')));
NetOut.Write(Byte(Ord('F')));
- NetOut.Write(NetPort);
+ NetOut.Write(NetHost.address.port);
NetOut.Write(ClTime);
TMasterHost.writeInfo(NetOut);
NPl := 0;
end;
end;
+procedure g_Net_Host_CheckTimeouts();
+var
+ ID: Integer;
+begin
+ for ID := Low(NetClients) to High(NetClients) do
+ begin
+ with NetClients[ID] do
+ begin
+ if (Peer = nil) or (State = NET_STATE_NONE) then continue;
+ if (State = NET_STATE_AUTH) and (AuthTime > 0) and (AuthTime <= gTime) then
+ begin
+ g_Net_Penalize(@NetClients[ID], 'auth taking too long');
+ AuthTime := gTime + 1000; // do it every second to give them a chance
+ end
+ else if (State = NET_STATE_GAME) and (MsgTime > 0) and (MsgTime <= gTime) then
+ begin
+ // client hasn't sent packets in a while; either ban em or kick em
+ if (NetAutoBanForTimeout) then
+ begin
+ g_Net_Penalize(@NetClients[ID], 'message timeout');
+ MsgTime := gTime + (NetPacketTimeout div 2) + 500; // wait less for the next check
+ end
+ else
+ begin
+ e_LogWritefln('NET: client #%u (cid #%u) timed out', [ID, Player]);
+ g_Net_Host_Disconnect_Client(ID, True);
+ end;
+ end;
+ end;
+ end;
+end;
+
-function g_Net_Host_Update(): enet_size_t;
+procedure g_Net_Host_Update();
var
IP: string;
Port: Word;
ID: Integer;
TC: pTNetClient;
- TP: TPlayer;
begin
IP := '';
- Result := 0;
if NetUseMaster then g_Net_Slist_Pulse();
g_Net_Host_CheckPings();
+ g_Net_Host_CheckTimeouts();
while (enet_host_service(NetHost, @NetEvent, 0) > 0) do
begin
Port := NetEvent.Peer^.address.port;
g_Console_Add(_lc[I_NET_MSG] +
Format(_lc[I_NET_MSG_HOST_CONN], [IP, Port]));
+ e_WriteLog('NET: Connection request from ' + IP + '.', TMsgType.Notify);
if (NetEvent.data <> NET_PROTOCOL_VER) then
begin
g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_MSG_HOST_REJECT] +
_lc[I_NET_DISC_PROTOCOL]);
- NetEvent.peer^.data := GetMemory(SizeOf(Byte));
- Byte(NetEvent.peer^.data^) := 255;
+ e_WriteLog('NET: Connection request from ' + IP + ' rejected: version mismatch',
+ TMsgType.Notify);
enet_peer_disconnect(NetEvent.peer, NET_DISC_PROTOCOL);
- enet_host_flush(NetHost);
+ Exit;
+ end;
+
+ if g_Net_IsHostBanned(NetEvent.Peer^.address.host) then
+ begin
+ g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_MSG_HOST_REJECT] +
+ _lc[I_NET_DISC_BAN]);
+ e_WriteLog('NET: Connection request from ' + IP + ' rejected: banned',
+ TMsgType.Notify);
+ enet_peer_disconnect(NetEvent.Peer, NET_DISC_BAN);
Exit;
end;
begin
g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_MSG_HOST_REJECT] +
_lc[I_NET_DISC_FULL]);
- NetEvent.Peer^.data := GetMemory(SizeOf(Byte));
- Byte(NetEvent.peer^.data^) := 255;
+ e_WriteLog('NET: Connection request from ' + IP + ' rejected: server full',
+ TMsgType.Notify);
enet_peer_disconnect(NetEvent.peer, NET_DISC_FULL);
- enet_host_flush(NetHost);
Exit;
end;
NetClients[ID].Peer^.data := GetMemory(SizeOf(Byte));
Byte(NetClients[ID].Peer^.data^) := ID;
NetClients[ID].State := NET_STATE_AUTH;
+ NetClients[ID].Player := 0;
+ NetClients[ID].Crimes := 0;
NetClients[ID].RCONAuth := False;
NetClients[ID].NetOut[NET_UNRELIABLE].Alloc(NET_BUFSIZE*2);
NetClients[ID].NetOut[NET_RELIABLE].Alloc(NET_BUFSIZE*2);
+ if (NetAuthTimeout > 0) then
+ NetClients[ID].AuthTime := gTime + NetAuthTimeout
+ else
+ NetClients[ID].AuthTime := 0;
+ if (NetPacketTimeout > 0) then
+ NetClients[ID].MsgTime := gTime + NetPacketTimeout
+ else
+ NetClients[ID].MsgTime := 0;
clearNetClientTransfers(NetClients[ID]); // just in case
enet_peer_timeout(NetEvent.peer, ENET_PEER_TIMEOUT_LIMIT * 2, ENET_PEER_TIMEOUT_MINIMUM * 2, ENET_PEER_TIMEOUT_MAXIMUM * 2);
end
else
begin
+ if NetEvent.peer^.data = nil then Exit;
+
ID := Byte(NetEvent.peer^.data^);
if ID > High(NetClients) then Exit;
TC := @NetClients[ID];
+ if (NetPacketTimeout > 0) then
+ TC^.MsgTime := gTime + NetPacketTimeout;
+
if NetDump then g_Net_DumpRecvBuffer(NetEvent.packet^.data, NetEvent.packet^.dataLength);
g_Net_Host_HandlePacket(TC, NetEvent.packet, g_Net_HostMsgHandler);
end;
ENET_EVENT_TYPE_DISCONNECT:
begin
- ID := Byte(NetEvent.peer^.data^);
- if ID > High(NetClients) then Exit;
- clearNetClient(NetClients[ID]);
- TC := @NetClients[ID];
- if TC = nil then Exit;
-
- if not (TC^.Used) then Exit;
-
- TP := g_Player_Get(TC^.Player);
-
- if TP <> nil then
+ if NetEvent.peer^.data <> nil then
begin
- TP.Lives := 0;
- TP.Kill(K_SIMPLEKILL, 0, HIT_DISCON);
- g_Console_Add(Format(_lc[I_PLAYER_LEAVE], [TP.Name]), True);
- e_WriteLog('NET: Client ' + TP.Name + ' [' + IntToStr(ID) + '] disconnected.', TMsgType.Notify);
- g_Player_Remove(TP.UID);
+ ID := Byte(NetEvent.peer^.data^);
+ if ID > High(NetClients) then Exit;
+ g_Net_Host_Disconnect_Client(ID);
end;
-
- TC^.Used := False;
- TC^.State := NET_STATE_NONE;
- TC^.Peer := nil;
- TC^.Player := 0;
- TC^.RequestedFullUpdate := False;
- TC^.WaitForFirstSpawn := False;
- TC^.NetOut[NET_UNRELIABLE].Free();
- TC^.NetOut[NET_RELIABLE].Free();
-
- FreeMemory(NetEvent.peer^.data);
- NetEvent.peer^.data := nil;
- g_Console_Add(_lc[I_NET_MSG] + Format(_lc[I_NET_MSG_HOST_DISC], [ID]));
- Dec(NetClientCount);
-
- if NetUseMaster then g_Net_Slist_ServerPlayerLeaves();
end;
end;
end;
g_Net_Flush(); // FIXME: for now, send immediately
end;
-function g_Net_Client_Update(): enet_size_t;
+procedure g_Net_Client_Update();
begin
- Result := 0;
while (NetHost <> nil) and (enet_host_service(NetHost, @NetEvent, 0) > 0) do
begin
case NetEvent.kind of
ENET_EVENT_TYPE_RECEIVE:
begin
- if (NetEvent.channelID = NET_CHAN_DOWNLOAD_EX) then continue; // ignore all download packets, they're processed by separate code
if NetDump then g_Net_DumpRecvBuffer(NetEvent.packet^.data, NetEvent.packet^.dataLength);
g_Net_Client_HandlePacket(NetEvent.packet, g_Net_ClientMsgHandler);
end;
ENET_EVENT_TYPE_DISCONNECT:
begin
g_Net_Disconnect(True);
- Result := 1;
Exit;
end;
end;
end
end;
-function g_Net_Client_UpdateWhileLoading(): enet_size_t;
-begin
- Result := 0;
- while (enet_host_service(NetHost, @NetEvent, 0) > 0) do
- begin
- case NetEvent.kind of
- ENET_EVENT_TYPE_RECEIVE:
- begin
- if (NetEvent.channelID = NET_CHAN_DOWNLOAD_EX) then continue; // ignore all download packets, they're processed by separate code
- if NetDump then g_Net_DumpRecvBuffer(NetEvent.packet^.data, NetEvent.packet^.dataLength);
- g_Net_Client_HandlePacket(NetEvent.packet, g_Net_ClientLightMsgHandler);
- end;
-
- ENET_EVENT_TYPE_DISCONNECT:
- begin
- g_Net_Disconnect(True);
- Result := 1;
- Exit;
- end;
- end;
- end;
- g_Net_Flush();
-end;
-
function g_Net_Connect(IP: string; Port: enet_uint16): Boolean;
var
OuterLoop: Boolean;
end;
// предупредить что ждем слишком долго через N секунд
- TimeoutTime := sys_GetTicks() + NET_CONNECT_TIMEOUT;
+ TimeoutTime := GetTickCount64() + NET_CONNECT_TIMEOUT;
OuterLoop := True;
while OuterLoop do
end;
end;
- T := sys_GetTicks();
+ T := GetTickCount64();
if T > TimeoutTime then
begin
TimeoutTime := T + NET_CONNECT_TIMEOUT * 100; // одного предупреждения хватит
g_Console_Add(Format(_lc[I_NET_MSG_PORTS], [Integer(Port), Integer(NET_PING_PORT)]), True);
end;
- ProcessLoading(true);
-
+ ProcessLoading(True);
if e_KeyPressed(IK_SPACE) or e_KeyPressed(IK_ESCAPE) or e_KeyPressed(VK_ESCAPE) or
e_KeyPressed(JOY0_JUMP) or e_KeyPressed(JOY1_JUMP) or e_KeyPressed(JOY2_JUMP) or e_KeyPressed(JOY3_JUMP) then
OuterLoop := False;
begin
dataLength := Length(Data);
- if (Reliable) then
- F := LongWord(ENET_PACKET_FLAG_RELIABLE)
- else
- F := 0;
+ if Reliable
+ then F := LongWord(ENET_PACKET_FLAG_RELIABLE)
+ else F := 0;
- if (peer <> nil) then
- begin
- P := enet_packet_create(@Data[0], dataLength, F);
- if not Assigned(P) then Exit;
- enet_peer_send(peer, Chan, P);
- end
- else
- begin
- P := enet_packet_create(@Data[0], dataLength, F);
- if not Assigned(P) then Exit;
- enet_host_broadcast(NetHost, Chan, P);
- end;
+ P := enet_packet_create(@Data[0], dataLength, F);
+ if not Assigned(P) then exit;
+
+ if peer <> nil
+ then enet_peer_send(peer, Chan, P)
+ else enet_host_broadcast(NetHost, Chan, P);
enet_host_flush(NetHost);
end;
end
end;
+procedure g_Net_Penalize(C: pTNetClient; Reason: string);
+var
+ s: string;
+begin
+ e_LogWritefln('NET: client #%u (cid #%u) triggered a penalty (%d/%d): %s',
+ [C^.ID, C^.Player, C^.Crimes + 1, NetAutoBanLimit, Reason]);
+
+ if (NetAutoBanLimit <= 0) then Exit;
+
+ if (C^.Crimes >= NetAutoBanLimit) then
+ begin
+ // we have tried asking nicely before, now it is time to die
+ e_LogWritefln('NET: client #%u (cid #%u) force kicked',
+ [C^.ID, C^.Player]);
+ g_Net_Host_Disconnect_Client(C^.ID, True);
+ Exit;
+ end;
+
+ Inc(C^.Crimes);
+
+ if (NetAutoBanWarn) then
+ MH_SEND_Chat('You have been warned by the server: ' + Reason, NET_CHAT_SYSTEM, C^.ID);
+
+ if (C^.Crimes >= NetAutoBanLimit) then
+ begin
+ s := '#' + IntToStr(C^.ID); // can't be arsed
+ g_Net_BanHost(C^.Peer^.address.host, NetAutoBanPerm);
+ g_Net_Host_Kick(C^.ID, NET_DISC_BAN);
+ g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
+ MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
+ g_Net_Slist_ServerPlayerLeaves();
+ end;
+end;
+
procedure g_Net_DumpStart();
begin
if NetMode = NET_SERVER then
begin
Result := False;
- if NetPortForwarded = NetPort then
+ if NetHost = nil then
+ exit;
+
+ if NetPortForwarded = NetHost.address.port then
begin
Result := True;
exit;
exit;
end;
- StrPort := IntToStr(NetPort);
+ StrPort := IntToStr(NetHost.address.port);
I := UPNP_AddPortMapping(
Urls.controlURL, Addr(data.first.servicetype[1]),
PChar(StrPort), PChar(StrPort), Addr(LanAddr[0]), PChar('D2DF'),
if I <> 0 then
begin
- conwritefln('forwarding port %d failed: error %d', [NetPort, I]);
+ conwritefln('forwarding port %d failed: error %d', [NetHost.address.port, I]);
FreeUPNPDevList(DevList);
FreeUPNPUrls(@Urls);
exit;
end;
end;
- conwritefln('forwarded port %d successfully', [NetPort]);
+ conwritefln('forwarded port %d successfully', [NetHost.address.port]);
NetIGDControl := AnsiString(Urls.controlURL);
NetIGDService := data.first.servicetype;
- NetPortForwarded := NetPort;
+ NetPortForwarded := NetHost.address.port;
FreeUPNPDevList(DevList);
FreeUPNPUrls(@Urls);
if b > NetMaxClients then
begin
s := g_Player_Get(NetClients[a].Player).Name;
- enet_peer_disconnect(NetClients[a].Peer, NET_DISC_FULL);
+ g_Net_Host_Kick(NetClients[a].ID, NET_DISC_FULL);
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
end;
conRegVar('cl_interp', @NetInterpLevel, '', 'net player interpolation steps');
conRegVar('cl_last_ip', @NetClientIP, '', 'address of the last you have connected to');
conRegVar('cl_last_port', @NetClientPort, '', 'port of the last server you have connected to');
+ conRegVar('cl_deafen', @NetDeafLevel, '', 'filter server messages (0-3)');
conRegVar('sv_forwardports', @NetForwardPorts, '', 'forward server port using miniupnpc (requires server restart)');
conRegVar('sv_rcon', @NetAllowRCON, '', 'enable remote console');
conRegVar('sv_reliable_interval', @NetRelupdRate, '', 'reliable update interval');
conRegVar('sv_master_interval', @NetMasterRate, '', 'master server update interval');
+ conRegVar('sv_autoban_threshold', @NetAutoBanLimit, '', 'max crimes before autoban (0 = no autoban)');
+ 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_packet_timeout', @NetAutoBanForTimeout, '', 'autoban for packet timeouts');
+
+ 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');
SetLength(NetClients, 0);