From 44653940f08df69ed9ab2313164cd60ba5142a12 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 9 Jun 2019 20:57:53 +0300 Subject: [PATCH] (e8a04e9d9) Fixed BanList.BanPlayer failing to ban clients based on Steam ID --- .../BarotraumaServer/Source/Networking/BanList.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaServer/Source/Networking/BanList.cs b/Barotrauma/BarotraumaServer/Source/Networking/BanList.cs index 9103fee86..9f0a4b88c 100644 --- a/Barotrauma/BarotraumaServer/Source/Networking/BanList.cs +++ b/Barotrauma/BarotraumaServer/Source/Networking/BanList.cs @@ -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(); }