Exemplo n.º 1
0
 public void RecreateLoginFile()
 {
     if (HasLoginBackupData)
     {
         Loginfile = LocalDatManager.CreateNewFileAutomated(AccountID.ToString(), Email, Password);
     }
 }
Exemplo n.º 2
0
 public static void Close()
 {
     AddOnManager.SaveAddons(LBAddonPath);
     Hotkeys.UnregisterAll();
     //Local Dat Cleanup
     LocalDatManager.CleanUp();
 }
Exemplo n.º 3
0
 private void SwapLocalDat()
 {
     if (account.Settings.Loginfile != null)
     {
         LocalDatManager.Apply(account.Settings.Loginfile);
     }
 }
Exemplo n.º 4
0
        public static void Close()
        {
            AddOnManager.SaveAddons(LBAddonPath);
            AccountManager.SaveAccounts();
            Hotkeys.UnregisterAll();
            //Local Dat Cleanup
            LocalDatManager.CleanUp();

            PluginManager.OnLBClose(null);
        }
Exemplo n.º 5
0
 public static void UpdateAccountFiles()
 {
     foreach (Account acc in Accounts.Where <Account>(x => x.Settings.Loginfile != null))
     {
         if (!acc.Settings.Loginfile.IsUpToDate)
         {
             LocalDatManager.UpdateLocalDat(acc.Settings.Loginfile);
         }
     }
 }
Exemplo n.º 6
0
 private void UpdateLoginFile()
 {
     if (account.Settings.Loginfile != null)
     {
         if (!account.Settings.Loginfile.IsUpToDate)
         {
             LocalDatManager.UpdateLocalDat(account.Settings.Loginfile);
         }
     }
 }
Exemplo n.º 7
0
 public void SetLoginFile()
 {
     Loginfile = LocalDatManager.CreateNewFile(AccountID.ToString());
 }
Exemplo n.º 8
0
        public void Launch()
        {
            try
            {
                while (Status < ClientStatus.Running)
                {
                    //Check if it crashed/closed in between a step
                    if (Status > ClientStatus.Created)
                    {
                        if (!ProcessExists())
                        {
                            MessageBoxResult win = MessageBox.Show("Client " + account.Nickname + " got closed or crashed before a clean Start. Do you want to retry to start this Client?", "Client Retry", MessageBoxButton.YesNo, MessageBoxImage.Question);
                            if (win.ToString() == "Yes")
                            {
                                Status = ClientStatus.None;
                            }
                            else
                            {
                                Account.Settings.RelaunchesLeft = 0;
                                Status = ClientStatus.Crash;
                            }
                        }
                    }

                    switch (Status)
                    {
                    case var expression when(Status < ClientStatus.Configured):
                        ConfigureProcess();

                        SwapGFX();
                        SwapLocalDat();
                        Status = ClientStatus.Configured;
                        break;

                    case var expression when(Status < ClientStatus.Created):
                        Process.Start();

                        Suspend();
                        Status = ClientStatus.Created;
                        break;

                    case var expression when(Status < ClientStatus.Injected):
                        InjectDlls();

                        Resume();
                        Status = ClientStatus.Injected;
                        break;

                    case var expression when(Status < ClientStatus.MutexClosed):
                        CloseMutex();

                        Status = ClientStatus.MutexClosed;
                        break;

                    case var expression when(Status < ClientStatus.Login):
                        if (Account.Settings.Loginfile != null)
                        {
                            PressLoginButton();
                            LocalDatManager.ToDefault();
                        }
                        Status = ClientStatus.Login;
                        break;

                    case var expression when(Status < ClientStatus.Running):
                        RestoreGFX();

                        SetProcessPriority();
                        Status = ClientStatus.Running;
                        try { Focus(); } catch { }
                        try { if (account.Settings.WinConfig != null)
                              {
                                  new Thread(Window_Init).Start();
                              }
                        } catch { }
                        account.Settings.AccountInformation.SetLastLogin();
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Account: " + account.Nickname + "\n\n" + e.Message);
                Status = ClientStatus.None;
                CrashReporter.ReportCrashToAll(e);
            }
            if (Status.HasFlag(ClientStatus.Crash))
            {
                Status = ClientStatus.None;
            }
        }