save client IpAddress for later
This commit is contained in:
committed by
Paul Chote
parent
d21875d353
commit
91115d5ba3
@@ -53,6 +53,7 @@ namespace OpenRA.Network
|
|||||||
public string Country;
|
public string Country;
|
||||||
public int SpawnPoint;
|
public int SpawnPoint;
|
||||||
public string Name;
|
public string Name;
|
||||||
|
public string IpAddress;
|
||||||
public ClientState State;
|
public ClientState State;
|
||||||
public int Team;
|
public int Team;
|
||||||
public string Slot; // slot ID, or null for observer
|
public string Slot; // slot ID, or null for observer
|
||||||
|
|||||||
@@ -263,11 +263,13 @@ namespace OpenRA.Server
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.IpAddress = ((IPEndPoint)newConn.socket.RemoteEndPoint).Address.ToString();
|
||||||
|
|
||||||
// Check if IP is banned
|
// Check if IP is banned
|
||||||
if (lobbyInfo.GlobalSettings.Ban != null)
|
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.");
|
Console.WriteLine("Rejected connection from "+client.Name+"("+newConn.socket.RemoteEndPoint+"); Banned.");
|
||||||
Log.Write("server", "Rejected connection from {0}; Banned.",
|
Log.Write("server", "Rejected connection from {0}; Banned.",
|
||||||
|
|||||||
Reference in New Issue
Block a user