Beispiel #1
0
        private void Start()
        {
            Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "06", "welcome");
            PenguinName.text = Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayName;
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (!(SceneManager.GetActiveScene().name == "Boot"))
            {
                avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>();
                DataEntityHandle     localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle;
                AvatarAnimationFrame avatarFrame       = new AvatarAnimationFrame("Base Layer.Interactions.PassPortPoses_CelebrateAnimation", 0f);
                if (cPDataEntityCollection.TryGetComponent <AvatarDetailsData>(localPlayerHandle, out var component))
                {
                    avatarRenderer.RenderAvatar(component, avatarFrame);
                }
                else
                {
                    avatarRenderer.RenderAvatar(new DCustomEquipment[0], avatarFrame);
                }
            }
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.SkipWelcome = true;
            StartCoroutine(AutoTransition());
        }
        public void OnLoginClicked()
        {
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.LoginViaRestore = true;
            Service.Get <EventDispatcher>().AddListener <SessionEvents.ReturnToRestorePurchases>(checkMembership);
            LoginController.SkipAutoLogin = true;
            Service.Get <MixLoginCreateService>().LogoutLastSession();
            Service.Get <GameStateController>().ShowAccountSystemLogin();
        }
        public void OnCreateClicked()
        {
            if (createController.CheckRegConfigReady())
            {
                Service.Get <ICPSwrveService>().Action("game.account_creation", "submit_clicked");
                CoroutineRunner.StopAllForOwner(this);
                CoroutineRunner.Start(submitActions(), this, "CreateFormSubmitValidation");
            }
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.FlowType = AccountFlowType.create;
        }
        private void onSoftLoginSuccess(ISession session)
        {
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.FlowType = AccountFlowType.autologin;
            if (base.IsInHandledState)
            {
                removeListeners();
                nextAccountSystemEvent = gameStateController.LoginSuccessEvent;
                eventDispatcher.AddListener <NetworkControllerEvents.LocalPlayerDataReadyEvent>(onLocalPlayerDataReady);
                sessionManager.AddMixSession(session);
            }
        }
        private bool onLocalPlayerDataReady(NetworkControllerEvents.LocalPlayerDataReadyEvent evt)
        {
            eventDispatcher.RemoveListener <NetworkControllerEvents.LocalPlayerDataReadyEvent>(onLocalPlayerDataReady);
            if (!base.IsInHandledState)
            {
                return(false);
            }
            gameStateController.ShowAccountSystem(nextAccountSystemEvent);
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.FlowType = AccountFlowType.autologin;
            return(false);
        }
Beispiel #6
0
        private void setDisplayName()
        {
            string text  = DisplayNameInputField.TextInput.text;
            string text2 = null;

            if (referAFriendEnabled)
            {
                text2 = ReferrerDisplayNameField.TextInput.text;
            }
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();

            accountFlowData.Referrer = text2;
            createController.UpdateDisplayName(text, text2);
        }
Beispiel #7
0
 protected void performLogin(DLoginPayload loginPayload)
 {
     if (!isLoggingIn)
     {
         loginController.OnLoginError += onLoginError;
         this.loginPayload             = loginPayload;
         toggleInteraction(isInteractable: false);
         showGeneralError(string.Empty);
         CoroutineRunner.StopAllForOwner(this);
         CoroutineRunner.Start(submitActions(loginPayload), this, "LoginFormSubmitValidation");
         AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
         accountFlowData.FlowType = AccountFlowType.login;
     }
 }
Beispiel #8
0
 public void OnStateChanged(string state)
 {
     if (state == HandledState && rootStateMachine != null)
     {
         CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
         if (cPDataEntityCollection == null || cPDataEntityCollection.LocalPlayerHandle.IsNull)
         {
             throw new Exception("Unable to resolve data entity collection");
         }
         bool flag = false;
         if (!cPDataEntityCollection.TryGetComponent <ProfileData>(cPDataEntityCollection.LocalPlayerHandle, out var component) || !cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out var component2))
         {
             throw new MissingReferenceException("No profile data or membership data found for local player");
         }
         MembershipService membershipService = Service.Get <MembershipService>();
         AccountFlowData   accountFlowData   = membershipService.GetAccountFlowData();
         bool   flag2 = Service.Get <SessionManager>().LocalUser.RegistrationProfile.AccountStatus == AccountStatus.AwaitingParentalConsent;
         bool   flag3 = component2.MembershipType == MembershipType.Member;
         string text;
         if (!membershipService.IsPurchaseFunnelAvailable())
         {
             text = SkipMembershipEvent;
         }
         else if (!flag3 && showAllAccess() && !membershipService.LoginViaMembership)
         {
             text = ShowAllAccessEvent;
         }
         else if (!flag3 && showAllAccessOver() && !membershipService.LoginViaMembership)
         {
             text = ShowAllAccessOverEvent;
         }
         else if (flag || (membershipService.LoginViaMembership && !flag3 && !flag2) || (component.IsFirstTimePlayer && !component2.IsMember && !accountFlowData.SkipMembership && !flag2))
         {
             accountFlowData.SkipMembership = true;
             text = ((!component.IsFirstTimePlayer || membershipService.LoginViaMembership) ? ShowMembershipEvent : EndMembershipFlowEvent);
         }
         else
         {
             text = SkipMembershipEvent;
         }
         Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "22", "check_showmembership", text);
         rootStateMachine.SendEvent(text);
     }
 }
Beispiel #9
0
        private void Start()
        {
            Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "05", "display_name");
            createController = GetComponentInParent <AbstractCreateController>();
            createController.OnUpdateDisplayNameError += OnUpdateDisplayNameError;
            referAFriendEnabled = true;
            if (Service.Get <SessionManager>().LocalUser != null && (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Rejected || (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Pending && Service.Get <SessionManager>().LocalUser.RegistrationProfile.ProposedDisplayName.StartsWith("DNAME-REJ-"))))
            {
                Instructions.text   = Service.Get <Localizer>().GetTokenTranslation("Account.DisplayName.DisplayNameRejected");
                referAFriendEnabled = false;
            }
            if (ReferAFriendSection != null)
            {
                ReferAFriendSection.SetActive(referAFriendEnabled);
            }
            else
            {
                referAFriendEnabled = false;
            }
            setDisplayNameValid = false;
            AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
            SessionManager  sessionManager  = Service.Get <SessionManager>();

            if (!string.IsNullOrEmpty(sessionManager.LocalUser.RegistrationProfile.Username) && accountFlowData.PreValidatedDisplayNames.Contains(sessionManager.LocalUser.RegistrationProfile.Username))
            {
                DisplayNameInputField.TextInput.text       = sessionManager.LocalUser.RegistrationProfile.Username;
                DisplayNameInputField.HasError             = false;
                DisplayNameInputField.IsValidationComplete = true;
                setDisplayNameValid = true;
            }
            AvatarRenderTextureComponent componentInChildren    = GetComponentInChildren <AvatarRenderTextureComponent>();
            CPDataEntityCollection       cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle             localPlayerHandle      = cPDataEntityCollection.LocalPlayerHandle;

            if (!localPlayerHandle.IsNull && cPDataEntityCollection.TryGetComponent <AvatarDetailsData>(localPlayerHandle, out var component))
            {
                componentInChildren.RenderAvatar(component);
            }
            else
            {
                componentInChildren.RenderAvatar(new DCustomEquipment[0]);
            }
        }
Beispiel #10
0
        public void ShowGiftMessage(List <ServerAddedReward> rewards)
        {
            string text     = "";
            string bodyText = "";
            string i18nText = "";
            string tier     = "";

            if (rewards.Count > 1)
            {
                bodyText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B2");
                using (List <ServerAddedReward> .Enumerator enumerator = rewards.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        string text2 = string.Format(arg0: enumerator.Current.instanceId, format: Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B2.Header"));
                        text = text + text2 + "\n";
                    }
                }
                i18nText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B3");
                tier     = "thankyou_multiple";
            }
            else if (rewards.Count == 1)
            {
                ServerAddedReward serverAddedReward = rewards[0];
                if (serverAddedReward.instanceId == getCurrentDisplayName())
                {
                    AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
                    text     = string.Format(Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referee.A"), accountFlowData.Referrer);
                    bodyText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referee.A1");
                    i18nText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.PopUp.A");
                    tier     = "welcome";
                }
                else
                {
                    text     = string.Format(Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B.Header"), serverAddedReward.instanceId);
                    bodyText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B.Body");
                    i18nText = Service.Get <Localizer>().GetTokenTranslation("Playercard.FriendInvite.Referrer.B3");
                    tier     = "thankyou_single";
                }
            }
            DPrompt     data      = default(DPrompt);
            ref DPrompt reference = ref data;
Beispiel #11
0
 public void OnStateChanged(string state)
 {
     if (!base.gameObject.IsDestroyed() && state == HandledState && rootStateMachine != null)
     {
         CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
         if (cPDataEntityCollection == null || DataEntityHandle.IsNullValue(cPDataEntityCollection.LocalPlayerHandle))
         {
             Log.LogError(this, "Unable to resolve data entity collection");
         }
         if (cPDataEntityCollection.TryGetComponent <ProfileData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
         {
             AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
             string          text            = ((component.PenguinAgeInDays >= 1 || accountFlowData.SkipWelcome || !component.IsFirstTimePlayer) ? SkipWelcomeEvent : ShowWelcomeEvent);
             Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "23", "check_showwelcome", text);
             rootStateMachine.SendEvent(text);
         }
         else
         {
             Log.LogError(this, "No profile data found for local player");
         }
     }
 }
 private void OnEnable()
 {
     accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
     if (accountFlowData.FlowType == AccountFlowType.create)
     {
         NoticeContainer.SetActive(value: true);
         ResendContainer.SetActive(value: false);
         SentContainer.SetActive(value: false);
     }
     else
     {
         NoticeContainer.SetActive(value: false);
         ResendContainer.SetActive(value: true);
         ResendButton.interactable = true;
         SentContainer.SetActive(value: false);
     }
     sessionManager        = Service.Get <SessionManager>();
     mixLoginCreateService = Service.Get <MixLoginCreateService>();
     Text[] parentEmailTextObjects = ParentEmailTextObjects;
     foreach (Text text in parentEmailTextObjects)
     {
         text.text = sessionManager.LocalUser.RegistrationProfile.ParentEmail;
     }
 }
 public void MembershipOfferContinueClick()
 {
     accountFlowData = membershipService.GetAccountFlowData();
     accountFlowData.SkipMembership = true;
     rootStateMachine.SendEvent(offerContinueEvent);
 }