(e8a04e9d9) Fixed BanList.BanPlayer failing to ban clients based on Steam ID

This commit is contained in:
Joonas Rikkonen
2019-06-09 20:57:53 +03:00
parent f455467765
commit 44653940f0

View File

@@ -163,7 +163,20 @@ namespace Barotrauma.Networking
expirationTime = DateTime.Now + duration.Value;
}
bannedPlayers.Add(new BannedPlayer(name, ip, reason, expirationTime));
if (!string.IsNullOrEmpty(ip))
{
bannedPlayers.Add(new BannedPlayer(name, ip, reason, expirationTime));
}
else if (steamID > 0)
{
bannedPlayers.Add(new BannedPlayer(name, steamID, reason, expirationTime));
}
else
{
DebugConsole.ThrowError("Failed to ban a client (no valid IP or Steam ID given)");
return;
}
Save();
}