mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-01-13 07:18:00 +03:00
Do not drop clients reporting unparsable IP addresses.
This commit is contained in:
parent
180a61a147
commit
d0a01c6a13
@ -391,7 +391,7 @@ namespace Syroot.Worms.Worms2.GameServer
|
||||
return;
|
||||
|
||||
// Require valid room ID and IP.
|
||||
if (connection.RemoteEndPoint.Address.Equals(IPAddress.Parse(packet.Data)))
|
||||
if (IPAddress.TryParse(packet.Data, out IPAddress ip) && connection.RemoteEndPoint.Address.Equals(ip))
|
||||
{
|
||||
Game newGame = new Game(++_lastID, fromUser.Name, fromUser.Session.Nation, fromUser.RoomID,
|
||||
connection.RemoteEndPoint.Address, // do not use bad NAT IP reported by users here
|
||||
|
Loading…
x
Reference in New Issue
Block a user