Пример #1
0
        public MinecraftHandler(String rules, String kits, String banlist, String playerlist, String adminlist, String config)
        {
            _strRulesList = rules;
            _strBanList = banlist;
            _strPlayerList = playerlist;
            try
            {
                Config = XObject<Config>.Load(Config.ConfigFolder + Config.ConfigFile);
            }
            catch
            {
                Config = new Config();
            }
            try
            {
                PricedBlocks = BlockCollection.Load(Config.ConfigFolder + BlockCollection.PricedBlocksFile);
                if (PricedBlocks == null)
                {
                    PricedBlocks = new BlockCollection();
                }
            }
            catch
            {
                PricedBlocks = new BlockCollection();
            }
            String badBlocksFile = Path.Combine(Config.ConfigFolder,BlockCollection.BadBlocksFile);
            if (!File.Exists(badBlocksFile))
            {
                new BlockCollection().Save(badBlocksFile);
            }

            Plugins = AddonLoader.GetInstance(this).Plugins;
            timerCommandReader.Interval = 1000;
            timerCommandReader.Enabled = true;
        }
Пример #2
0
 public void Execute(Config config)
 {
     if (UpdateGuid)
     {
         config.GuidString = Guid.NewGuid().ToString();
         config.Save();
         UpdateGuid = false;
         this.Save(Path.Combine(Config.ConfigFolder, StartupActions.File));
     }
 }