Fix IPAddress capitalization.

This commit is contained in:
Paul Chote
2020-01-11 13:11:23 +00:00
committed by abcdefg30
parent 38cb818469
commit d6436858a9
3 changed files with 6 additions and 6 deletions

View File

@@ -133,7 +133,7 @@ namespace OpenRA.Network
// The full IP address is required for the IP banning moderation feature
// but we must not share the un-anonymized address with other players.
[FieldLoader.Ignore]
public string IpAddress;
public string IPAddress;
public string AnonymizedIPAddress;
public string Location;

View File

@@ -347,7 +347,7 @@ namespace OpenRA.Server
var client = new Session.Client
{
Name = OpenRA.Settings.SanitizedPlayerName(handshake.Client.Name),
IpAddress = ipAddress.ToString(),
IPAddress = ipAddress.ToString(),
AnonymizedIPAddress = Settings.ShareAnonymizedIPs ? Session.AnonymizeIP(ipAddress) : null,
Location = GeoIP.LookupCountry(ipAddress),
Index = newConn.PlayerIndex,
@@ -391,10 +391,10 @@ namespace OpenRA.Server
// Check if IP is banned
var bans = Settings.Ban.Union(TempBans);
if (bans.Contains(client.IpAddress))
if (bans.Contains(client.IPAddress))
{
Log.Write("server", "Rejected connection from {0}; Banned.", newConn.Socket.RemoteEndPoint);
SendOrderTo(newConn, "ServerError", "You have been {0} from the server".F(Settings.Ban.Contains(client.IpAddress) ? "banned" : "temporarily banned"));
SendOrderTo(newConn, "ServerError", "You have been {0} from the server".F(Settings.Ban.Contains(client.IPAddress) ? "banned" : "temporarily banned"));
DropClient(newConn);
return;
}

View File

@@ -595,9 +595,9 @@ namespace OpenRA.Mods.Common.Server
if (tempBan)
{
Log.Write("server", "Temporarily banning client {0} ({1}).", kickClientID, kickClient.IpAddress);
Log.Write("server", "Temporarily banning client {0} ({1}).", kickClientID, kickClient.IPAddress);
server.SendMessage("{0} temporarily banned {1} from the server.".F(client.Name, kickClient.Name));
server.TempBans.Add(kickClient.IpAddress);
server.TempBans.Add(kickClient.IPAddress);
}
server.SyncLobbyClients();