From: fgsfds Date: Mon, 21 Mar 2022 15:56:07 +0000 (+0300) Subject: net: log connection attempts X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=8919240d166ec9b0922747a6a02883f49420a0a1;p=d2df-sdl.git net: log connection attempts --- diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 249ef8a..d8fc004 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -1678,11 +1678,14 @@ 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]); + e_WriteLog('NET: Connection request from ' + IP + ' rejected: version mismatch', + TMsgType.Notify); NetEvent.peer^.data := GetMemory(SizeOf(Byte)); Byte(NetEvent.peer^.data^) := 255; enet_peer_disconnect(NetEvent.peer, NET_DISC_PROTOCOL); @@ -1694,6 +1697,8 @@ begin 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); NetEvent.peer^.data := GetMemory(SizeOf(Byte)); Byte(NetEvent.peer^.data^) := 255; enet_peer_disconnect(NetEvent.Peer, NET_DISC_BAN); @@ -1707,6 +1712,8 @@ begin begin g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_MSG_HOST_REJECT] + _lc[I_NET_DISC_FULL]); + e_WriteLog('NET: Connection request from ' + IP + ' rejected: server full', + TMsgType.Notify); NetEvent.Peer^.data := GetMemory(SizeOf(Byte)); Byte(NetEvent.peer^.data^) := 255; enet_peer_disconnect(NetEvent.peer, NET_DISC_FULL);