示例#1
0
        public Server()
        {
            SettingsLoader = new SettingsLoader();
            LoadSettings();

            CommandHandler = new CommandHandler();
            CommandHandler.AddCommand(new CommandHandler.Command("quit", () => Stop()));
            CommandHandler.AddCommand(new CommandHandler.Command("reloadsettings", () => LoadSettings()));
        }
示例#2
0
        public void Start()
        {
            config = new ConfigLoad();
            data_exchange = new DataExchange(this);
            command_handler = new CommandHandler(this);
            queue_command = new Queue<DataXMLPackage>();

            thread_data = new Thread(data_exchange.dataConector);// поток для приема и передачи данных
            thread_data.Start();
            thread_command = new Thread(command_handler.ReadCommandClient);// поток для обработки комманд клиента
            thread_command.Start();

            System.Console.WriteLine("Сервер запущен!"); //\"" + config.vars["S_SERVER_NAME"] + "\"
            command_handler.ReadCommandConsole();
        }