From db05586dd061ae9c794f5b3b2a7e1e66856bac1a Mon Sep 17 00:00:00 2001 From: TheUbMunster <66451362+TheUbMunster@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:09:44 -0600 Subject: [PATCH] Added quotable arguments, potential fix for ban * not banning anyone. --- Server/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/Program.cs b/Server/Program.cs index 2b8ff86..045a05d 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -205,7 +205,7 @@ CommandHandler.RegisterCommand("rejoin", args => { Client[] clients = (args[0].Trim() == "*" ? server.Clients.Where(c => c.Connected) : server.Clients.Where(c => - c.Connected && args.Any(x => c.Name.StartsWith(x) || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); + c.Connected && args.Any(x => c.Name == x || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); foreach (Client user in clients) { if (moreThanOne) builder.Append(", "); builder.Append(user.Name); @@ -225,7 +225,7 @@ CommandHandler.RegisterCommand("crash", args => { Client[] clients = (args[0].Trim() == "*" ? server.Clients.Where(c => c.Connected) : server.Clients.Where(c => - c.Connected && args.Any(x => c.Name.StartsWith(x) || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); + c.Connected && args.Any(x => c.Name == x || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); foreach (Client user in clients) { if (moreThanOne) builder.Append(", "); moreThanOne = true; @@ -254,7 +254,7 @@ CommandHandler.RegisterCommand("ban", args => { Client[] clients = (args[0].Trim() == "*" ? server.Clients.Where(c => c.Connected) : server.Clients.Where(c => - c.Connected && args.Any(x => c.Name.StartsWith(x) || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); + c.Connected && args.Any(x => c.Name == x || (Guid.TryParse(x, out Guid result) && result == c.Id)))).ToArray(); foreach (Client user in clients) { if (moreThanOne) builder.Append(", "); moreThanOne = true;