public void OnStateChanged(string state)
 {
     if (state == HandledState)
     {
         Service.Get <GameStateController>().StartGame();
         AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
         componentInParent.OnClosePopup();
     }
 }
 public void OnStateChanged(string state)
 {
     if (state == HandledState)
     {
         Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "08", "ftue_continue");
         Service.Get <ICPSwrveService>().Action("game.completed_registration");
         Service.Get <GameStateController>().ContinueFTUE();
         AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
         componentInParent.OnClosePopup();
     }
 }
Exemplo n.º 3
0
 public void OnStateChanged(string state)
 {
     if (state == HandledState)
     {
         Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "01", "ftue_intro");
         CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
         if (!cPDataEntityCollection.TryGetComponent <AvatarDetailsData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
         {
             component           = cPDataEntityCollection.AddComponent <AvatarDetailsData>(cPDataEntityCollection.LocalPlayerHandle);
             component.BodyColor = AvatarService.DefaultBodyColor;
             component.Outfit    = new DCustomEquipment[0];
         }
         Service.Get <GameStateController>().StartFTUE();
         AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
         componentInParent.OnClosePopup();
     }
 }
        public void OnStateChanged(string state)
        {
            if (!(state == HandledState) || !(rootStateMachine != null))
            {
                return;
            }
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (cPDataEntityCollection == null || cPDataEntityCollection.LocalPlayerHandle.IsNull)
            {
                throw new Exception("Unable to resolve data entity collection");
            }
            if (cPDataEntityCollection.TryGetComponent <ProfileData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
            {
                MembershipService membershipService = Service.Get <MembershipService>();
                string            text;
                if (component.IsFirstTimePlayer && !membershipService.LoginViaMembership && !membershipService.LoginViaRestore)
                {
                    QuestService        questService        = Service.Get <QuestService>();
                    GameStateController gameStateController = Service.Get <GameStateController>();
                    text = ((questService.ActiveQuest == null || !(questService.ActiveQuest.Id == gameStateController.FTUEConfig.FtueQuestId)) ? FirstTimePlayerEvent : ReturnPlayerEvent);
                }
                else
                {
                    if (membershipService.LoginViaRestore)
                    {
                        SessionManager sessionManager = Service.Get <SessionManager>();
                        if (sessionManager.HasSession)
                        {
                            sessionManager.ReturnToRestorePurchases();
                        }
                        Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "21", "check_cpremixprofile", "ReturnToSettings");
                        AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
                        componentInParent.OnClosePopup();
                        return;
                    }
                    text = ReturnPlayerEvent;
                }
                Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "21", "check_cpremixprofile", text);
                rootStateMachine.SendEvent(text);
                return;
            }
            throw new MissingReferenceException("No profile data found for local player");
        }
Exemplo n.º 5
0
 public void OnStateChanged(string state)
 {
     if (state == HandledState)
     {
         Service.Get <SessionManager>().Logout();
         Service.Get <GameStateController>().ResetStateMachine();
         Service.Get <EventDispatcher>().DispatchEvent(default(AccountSystemEvents.AccountSystemEnded));
         AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
         componentInParent.OnClosePopup();
         string homeSceneName = SceneManager.GetActiveScene().name;
         GameStateController gameStateController = Service.Get <GameStateController>();
         if (SceneManager.GetActiveScene().name != gameStateController.SceneConfig.HomeSceneName)
         {
             Service.Get <SceneTransitionService>().LoadScene(gameStateController.SceneConfig.HomeSceneName, gameStateController.SceneConfig.TransitionSceneName);
             homeSceneName = gameStateController.SceneConfig.HomeSceneName;
         }
         Service.Get <ICPSwrveService>().NavigationAction("account_statemachine.gameStateController.close_button_logout", SceneManager.GetActiveScene().name, homeSceneName);
     }
 }
 public void OnStateChanged(string state)
 {
     if (state == HandledState)
     {
         AccountPopupController componentInParent = GetComponentInParent <AccountPopupController>();
         componentInParent.OnClosePopup();
         GameStateController gameStateController = Service.Get <GameStateController>();
         string homeSceneName = SceneManager.GetActiveScene().name;
         if (!Service.Get <SessionManager>().HasSession&& SceneManager.GetActiveScene().name != gameStateController.SceneConfig.HomeSceneName && !Service.Get <MembershipService>().LoginViaMembership)
         {
             Service.Get <GameStateController>().ResetStateMachine();
             Service.Get <SceneTransitionService>().LoadScene(gameStateController.SceneConfig.HomeSceneName, gameStateController.SceneConfig.TransitionSceneName);
             homeSceneName = gameStateController.SceneConfig.HomeSceneName;
         }
         else if (!Service.Get <SessionManager>().HasSession&& SceneManager.GetActiveScene().name == gameStateController.SceneConfig.HomeSceneName)
         {
             Service.Get <GameStateController>().ResetStateMachine();
             homeSceneName = gameStateController.SceneConfig.HomeSceneName;
         }
         Service.Get <ICPSwrveService>().NavigationAction("account_statemachine.close_button", SceneManager.GetActiveScene().name, homeSceneName);
     }
 }