示例#1
0
        public bool start_bot(string server_name)
        {
            bool server_started = false;
            bot  bot            = get_bot_instance(server_name);

            if (bot != null)
            {
                if (bot.connected == false && bot.connecting == false && bot.disconnected == true && bot.Conf.Server_Name.Equals(server_name))
                {
                    server_started = true;
                    bot.start_bot();
                }
            }
            return(server_started);
        }
示例#2
0
        public bool init_server(string server_name, bool manual)
        {
            bool server_initiated = false;
            bot  bot = get_bot_instance(server_name);

            if (File.Exists(servers_config_path) && bot == null)
            {
                BotConfig bot_conf = get_bot_conf(server_name);
                if (bot_conf.Auto_Connect || manual)
                {
                    bot bot_instance = new bot(this, bot_conf);
                    bot_instance.start_bot();
                    bot_instances.Add(bot_instance);
                    server_initiated = true;
                }
            }
            return(server_initiated);
        }