Beispiel #1
0
        static BmclCore()
        {
            BmclVersion = Application.ResourceAssembly.GetName().Version.ToString();
            Logger.Log("BMCLNG Ver." + BmclVersion + "正在启动");
            if (!Directory.Exists(MinecraftDirectory))
            {
                Logger.Log($"{MinecraftDirectory}不存在,正在创建");
                Directory.CreateDirectory(MinecraftDirectory);
            }

            if (!Directory.Exists(TempDirectory))
            {
                Directory.CreateDirectory(TempDirectory);
            }

            GameManager = new GameManager();
            Config      = Config.Load(Cfgfile);
            if (Config.Passwd == null)
            {
                Config.Passwd = new byte[0];                  //V2的密码存储兼容
            }
            Logger.Log($"加载{Cfgfile}文件");
            Logger.Log(Config);
            LangManager.LoadLanguage();
            LangManager.ChangeLanguage(Config.Lang);
            Logger.Log("加载默认配置");
            if (!Directory.Exists(BaseDirectory + ".minecraft"))
            {
                Directory.CreateDirectory(BaseDirectory + ".minecraft");
            }

            if (Config.Javaw == "autosearch")
            {
                Config.Javaw = Config.GetJavaDir();
            }

            if (Config.Javaxmx == "autosearch")
            {
                Config.Javaxmx = (Config.GetMemory() / 4).ToString(CultureInfo.InvariantCulture);
            }

            LangManager.UseLanguage(Config.Lang);
            if (!App.SkipPlugin)
            {
                PluginManager.LoadOldAuthPlugin(LangManager.GetLangFromResource("LangName"));
            }
            ServicePointManager.DefaultConnectionLimit = int.MaxValue;
            ReleaseCheck();
        }
Beispiel #2
0
        static BmclCore()
        {
            BmclVersion = Application.ResourceAssembly.FullName.Split('=')[1];
            BmclVersion = BmclVersion.Substring(0, BmclVersion.IndexOf(','));
            Logger.Log("BMCLNG Ver." + BmclVersion + "正在启动");
            if (!Directory.Exists(MinecraftDirectory))
            {
                Logger.Log($"{MinecraftDirectory}不存在,正在创建");
                Directory.CreateDirectory(MinecraftDirectory);
            }
            GameManager = new GameManager();
            Config      = Config.Load(Cfgfile);
            if (Config.Passwd == null)
            {
                Config.Passwd = new byte[0];   //V2的密码存储兼容
            }
            Logger.Log($"加载{Cfgfile}文件");
            Logger.Log(Config);
            LangManager.LoadLanguage();
            LangManager.ChangeLanguage(Config.Lang);
            Logger.Log("加载默认配置");
            if (!Directory.Exists(BaseDirectory + ".minecraft"))
            {
                Directory.CreateDirectory(BaseDirectory + ".minecraft");
            }
            if (Config.Javaw == "autosearch")
            {
                Config.Javaw = Config.GetJavaDir();
            }
            if (Config.Javaxmx == "autosearch")
            {
                Config.Javaxmx = (Config.GetMemory() / 4).ToString(CultureInfo.InvariantCulture);
            }
            LangManager.UseLanguage(Config.Lang);
            if (!App.SkipPlugin)
            {
                PluginManager.LoadOldAuthPlugin(LangManager.GetLangFromResource("LangName"));
            }
#if DEBUG
#else
            ReleaseCheck();
#endif
        }
Beispiel #3
0
 public void ChangeLanguage(int ID)
 {
     langManager.ChangeLanguage((Language)ID);
 }
Beispiel #4
0
    //---------------------------------------------------------------------------------------------

    public void ChangeLanguage(string langCode)
    {
        LangManager.ChangeLanguage(langCode);
    }