Exemplo n.º 1
0
        public void Run()
        {
            string input = AsyncConsoleReader.ReadLine();

            while (input != "")
            {
                try
                {
                    DarkLog.Normal("Command input: " + input);
                    if (input.StartsWith("/"))
                    {
                        HandleServerInput(input.Substring(1));
                    }
                    else
                    {
                        if (input != "")
                        {
                            m_commands["say"].func(input);
                        }
                    }

                    input = AsyncConsoleReader.ReadLine();
                }
                catch (Exception e)
                {
                    if (Server.serverRunning)
                    {
                        DarkLog.Fatal("Error in command handler thread, Exception: " + e);
                        throw;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public CommandHandler()
        {
            AsyncConsoleReader.Initialize();

            RegisterCommand("help", DisplayHelp, "Displays this help");
            RegisterCommand("say", Say, "Broadcasts a message to clients");
            RegisterCommand("dekessler", Dekessler.RunDekessler, "Clears out debris from the server");
            RegisterCommand("nukeksc", NukeKSC.RunNukeKSC, "Clears ALL vessels from KSC and the Runway");
            RegisterCommand("listclients", ListClients, "Lists connected clients");
            RegisterCommand("countclients", CountClients, "Counts connected clients");
        }