save client IpAddress for later

This commit is contained in:
Matthias Mailänder
2013-03-12 08:13:44 +01:00
committed by Paul Chote
parent d21875d353
commit 91115d5ba3
2 changed files with 5 additions and 2 deletions

View File

@@ -263,11 +263,13 @@ namespace OpenRA.Server
return;
}
client.IpAddress = ((IPEndPoint)newConn.socket.RemoteEndPoint).Address.ToString();
// Check if IP is banned
if (lobbyInfo.GlobalSettings.Ban != null)
{
var remote_addr = ((IPEndPoint)newConn.socket.RemoteEndPoint).Address.ToString();
if (lobbyInfo.GlobalSettings.Ban.Contains(remote_addr))
if (lobbyInfo.GlobalSettings.Ban.Contains(client.IpAddress))
{
Console.WriteLine("Rejected connection from "+client.Name+"("+newConn.socket.RemoteEndPoint+"); Banned.");
Log.Write("server", "Rejected connection from {0}; Banned.",