public static void ban(string[] s) { if (s.Length == 2) { Console.WriteLine(Filemanager.blacklist(s[1], "")); kick(s, 1); } else { Console.WriteLine("Wrong number of arguments"); } }
public static void banip(string[] s) { if (s.Length == 2) { if (Program.manager.usernames.Contains(s[1])) { int index = Program.manager.usernames.IndexOf(s[1]); string ip = Program.clients[index].Client.RemoteEndPoint.ToString().Split(':')[0]; Console.WriteLine(Filemanager.blacklist(s[1], ip)); kick(s, 1); } else { Console.WriteLine($"User {s[1]} is not connected."); } } else { Console.WriteLine("Wrong number of arguments"); } }