Ban console command, clients with spaces in their name can be kicked/banned, fixed banlist not loading correctly if a client has commas in their name

This commit is contained in:
Regalis
2016-08-18 21:02:03 +03:00
parent a02f0c23e1
commit 5dc8a5f8b7
2 changed files with 43 additions and 29 deletions

View File

@@ -189,6 +189,9 @@ namespace Barotrauma
NewMessage(" ", Color.Cyan);
NewMessage("kick [name]: kick a player out from the server", Color.Cyan);
NewMessage("ban [name]: kick and ban the player", Color.Cyan);
NewMessage("debugdraw: toggles the ''debug draw mode''", Color.Cyan);
NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan);
@@ -278,8 +281,13 @@ namespace Barotrauma
HumanAIController.DisableCrewAI = false;
break;
case "kick":
if (GameMain.Server == null) break;
GameMain.Server.KickPlayer(commands[1]);
if (GameMain.Server == null || commands.Length < 2) break;
GameMain.Server.KickPlayer(string.Join(" ", commands.Skip(1)));
break;
case "ban":
if (GameMain.Server == null || commands.Length < 2) break;
GameMain.Server.KickPlayer(string.Join(" ", commands.Skip(1)), true);
break;
case "startclient":
if (commands.Length == 1) return;