Пример #1
0
        private void PC_StartGame()
        {
            if (Directory.Exists($"Launcher/{FileManager.Modpacks.ProjectCenturos}"))
            {
                MCClient_Login.MODPACK = (int)FileManager.Modpacks.ProjectCenturos;

                if (File.Exists($"Launcher/{FileManager.Modpacks.ProjectCenturos}/Login.txt"))
                {
                    MC_Game.Login((FileManager.Modpacks)MCClient_Login.MODPACK);
                }
                else
                {
                    PC_ClientState(3);
                    MCClient_Login.main = this;
                    MCClient_Login mcClient = new MCClient_Login();
                    mcClient.Show();
                }
            }
            else
            {
                PC_ClientState(0);

                Dispatcher.Invoke(() =>
                {
                    MessageBox.Show($"Failed to start {FileManager.Modpacks.ProjectCenturos}!");
                });
            }
        }
        public static void Login(FileManager.Modpacks modpack)
        {
            var login = new MLogin();

            string[] userData = File.ReadAllText("Launcher/BlockyCrafters/Login.txt").Split(' ');
            var      response = login.Authenticate(userData[0], userData[1]);

            if (!response.IsSuccess)
            {
                MCClient_Login mcClient = new MCClient_Login();
                mcClient.Show();
                mcClient.GetError($"Login Failed!\n" +
                                  "E-Mail or Password invalid!");
            }
            else
            {
                SESSION = response.Session;
                _       = LaunchGameAsync(modpack);
            }
        }