Beispiel #1
0
        private void InitConfig()
        {
            string serverPath = $"{ExecutePath}\\ServerProperties.yml";

            this.serverConfig = YamlStaticConfig.Load <ServerConfig>(serverPath);

            string minePath = $"{ExecutePath}\\MineNET.yml";

            this.mineNETConfig = YamlStaticConfig.Load <MineNETConfig>(minePath);

            LangManager.Lang = this.mineNETConfig.Language;

            string banPath = $"{ExecutePath}\\banned-players.yml";

            this.BanConfig = YamlConfig.Load(banPath);

            string banIpPath = $"{ExecutePath}\\banned-ips.yml";

            this.BanIpConfig = YamlConfig.Load(banIpPath);

            string opPath = $"{ExecutePath}\\ops.yml";

            this.OpsConfig = YamlConfig.Load(opPath);

            string whitelistPath = $"{ExecutePath}\\whitelist.yml";

            this.WhitelistConfig = YamlConfig.Load(whitelistPath);
        }
        private void LoadConfigs()
        {
            string mPath = $"{Server.ExecutePath}\\MineNET.yml";

            this.Config                    = YamlStaticConfig.Load <MineNETConfig>(mPath);
            LangManager.Language           = this.Config.Language;
            MineNET.Utils.LangManager.Lang = this.Config.Language;
        }
Beispiel #3
0
        private void ConfigLoad()
        {
            MainForm.Config = YamlStaticConfig.Load <MineNETGUIConfig>($"{Environment.CurrentDirectory}\\MineNET_GUI.yml");

            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(0, MainForm.Config.OutputOption.Log);
            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(1, MainForm.Config.OutputOption.Info);
            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(2, MainForm.Config.OutputOption.Notice);
            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(3, MainForm.Config.OutputOption.Warning);
            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(4, MainForm.Config.OutputOption.Error);
            this.inputOutput1.OutputOptionCheckBox.SetItemChecked(5, MainForm.Config.OutputOption.Fatal);
            this.inputOutput1.InputModeComboBox.SelectedIndex = MainForm.Config.InputModeIndex;
        }
Beispiel #4
0
        public void LoadConfig()
        {
            string file = $"{ExecutePath}\\MineNET_GUI.yml";

            if (!File.Exists(file))
            {
                this.Config = YamlStaticConfig.Load <MineNETGUIConfig>(file);

                ConfigSetupModal modal = new ConfigSetupModal();
                modal.ShowDialog();

                this.Config.CheckVersion = modal.CheckBoxResult1;
                this.Config.ShowNews     = modal.CheckBoxResult2;
                this.Config.Save <MineNETGUIConfig>();
            }
            else
            {
                this.Config = YamlStaticConfig.Load <MineNETGUIConfig>(file);
            }
        }
Beispiel #5
0
        public void LoadLanguage()
        {
            string        file   = $"{ExecutePath}\\MineNET.yml";
            MineNETConfig config = null;

            if (!File.Exists(file))
            {
                config = YamlStaticConfig.Load <MineNETConfig>(file);
                LanguageSelectModal modal = new LanguageSelectModal();
                modal.ShowDialog();

                config.Language = modal.SelectResult.Code;
                config.Save <MineNETConfig>();
            }
            else
            {
                config = YamlStaticConfig.Load <MineNETConfig>(file);
            }

            string language = config.Language;

            LanguageService.LangCode = language;
        }
Beispiel #6
0
 private void LoadConfigs()
 {
     this.Config         = YamlStaticConfig.Load <MineNETConfig>($"{ExecutePath}/MineNET.yml");
     this.ServerProperty = YamlStaticConfig.Load <ServerConfig>($"{ExecutePath}/ServerProperties.yml");
 }