LobbyServer.Program.ProccessCommand C# (CSharp) Method

ProccessCommand() static private method

static private ProccessCommand ( string command ) : void
command string
return void
        static void ProccessCommand(string command)
        {
            if (command == "/commands")
            {
                Log.Enter();
                Console.WriteLine("Available commands:");
                Console.WriteLine("/commands - shows this list of commands");
                Console.WriteLine("/shutdown - shuts down server");
                Console.WriteLine("/clients - total clients connected");
                Console.WriteLine("/worlds - total world servers connected");
                Console.WriteLine("/clear console - clear console from logs");
            }
            else if (command.Contains("/shutdown"))
            {
                Console.WriteLine("Login server shutting down in 3 seconds...");
                System.Threading.Thread.Sleep(3000);
                Environment.Exit(2);
            }
            else if (command.Contains("/clients"))
            {
                Byte count = 0;
                foreach (LobbyClient client in clients)
                {
                    count++;
                    Console.WriteLine("Name: " + client.Account.Username);
                    Console.WriteLine("ID: " + count);
                    Console.WriteLine("isGM: " + client.Account.IsAdmin);
                }
                Log.Enter();
                Console.WriteLine("Total clients connected to login server: " + count);
                count = 0;
            }
            else if (command.Contains("/worlds"))
            {
                Console.WriteLine("Total worlds connected to login server: " + worlds.Count);
            }
            else if (command.Contains("/clear console"))
            {
                Console.Clear();
            }
            else Console.WriteLine("ERROR: Unknown command \"" + command + "\"");
        }