Beispiel #1
0
        private async void EnterKingdom_Clicked(object sender, EventArgs e)
        {
            //[-- ALi.w --]
            ThereIsConstants.Forming.GameClient.GameCurrentMusic.Stop();
            ThereIsConstants.Forming.GameClient.LoadingSandBox = new YuiLoadingSandbox(this);
            ThereIsConstants.Forming.GameClient.ShowingSandBox.
            SetTheHighestSandBox(ThereIsConstants.Forming.GameClient.LoadingSandBox);
            ThereIsConstants.Forming.GameClient.LoadingSandBox.Location =
                new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                          (ThereIsConstants.Forming.GameClient.LoadingSandBox.Width / 2),
                          (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                          (ThereIsConstants.Forming.GameClient.LoadingSandBox.Height / 2));
            ThereIsConstants.Forming.GameClient.LoadingSandBox.FormClosed +=
                ThereIsConstants.Forming.GameClient.LoadingSandBox_FormClosed;
            ThereIsConstants.Forming.GameClient.LoadingSandBox.Show();
            ThereIsConstants.Forming.GameClient.LoadingSandBox.TopMost = true;
            await ThereIsServer.GameObjects.MyProfile.ReloadMe();

            await ThereIsServer.GameObjects.MyProfile.ReloadPlayerInfo();

            if (ThereIsServer.GameObjects.MyProfile.PlayerHeroes == null)
            {
                ThereIsServer.GameObjects.MyProfile.PlayerHeroes =
                    await HeroManager.GetHeroManager();

                if (ThereIsServer.GameObjects.MyProfile.PlayerHeroes == null)
                {
                    NoInternetConnectionSandBox.PrepareConnectionClosedSandBox();
                }
            }
            else
            {
                await ThereIsServer.GameObjects.MyProfile.PlayerHeroes.ReloadHeroes();
            }
            ThereIsServer.GameObjects.MyProfile.SetPlayerStoryStep(StorySteps.TheFirstChurchStory);
            ThereIsServer.GameObjects.MyProfile.SetPlayerKingdom((SAO_Kingdoms)(KingdomInfo.Index));
            ThereIsServer.GameObjects.MyProfile.ResumePlayerPower();
            await ThereIsServer.GameObjects.MyProfile.PlayerHeroes.AddHero(
                Hero.GenerateHero(ThereIsServer.GameObjects.MyProfile.ThePlayerElement));

            await ThereIsServer.GameObjects.MyProfile.UpdatePlayerInfo();

            await ThereIsServer.GameObjects.MyProfile.UpdateMe();

            if (ThereIsConstants.Forming.GameClient.LoadingSandBox is YuiLoadingSandbox mySand)
            {
                mySand.Close(true);
            }
            ThereIsConstants.Forming.GameClient.DialogBoxProvider.CleaningUp();
            ThereIsConstants.Forming.GameClient.DialogBoxProvider  = null;
            ThereIsConstants.Forming.GameClient.IsShowingDialogBox = false;
            this.Close(true);
            ThereIsConstants.Forming.GameClient.Controls.Clear();
            ThereIsConstants.Forming.GameClient.ShowFirstChurch();
        }
Beispiel #2
0
        private async void PlayerHeroesLoadingTimer_Tick(object sender, EventArgs e)
        {
            //--------------------
            ((Timer)sender).Enabled = false;
            ((Timer)sender).Dispose();
            //--------------------
            ThereIsServer.GameObjects.MyProfile.PlayerHeroes =
                await HeroManager.GetHeroManager();

            //MessageBox.Show("4");
            //--------------------
            this.IsLoadingEnded4 = true;
        }