Esempio n. 1
0
    private bool createRemotePlayer(DataEntityHandle remotePlayerHandle, bool attemptSpawn = true)
    {
        if (!dataEntityCollection.HasComponent <GameObjectReferenceData>(remotePlayerHandle))
        {
            dataEntityCollection.AddComponent <GameObjectReferenceData>(remotePlayerHandle);
        }
        if (!dataEntityCollection.HasComponent <AirBubbleData>(remotePlayerHandle))
        {
            dataEntityCollection.AddComponent <AirBubbleData>(remotePlayerHandle);
        }
        PositionData     component  = dataEntityCollection.GetComponent <PositionData>(remotePlayerHandle);
        RemotePlayerData component2 = dataEntityCollection.GetComponent <RemotePlayerData>(remotePlayerHandle);

        component2.PlayerRemoved += onPlayerRemoved;
        playerRemovedListeners.Add(component2);
        PresenceData component3 = dataEntityCollection.GetComponent <PresenceData>(remotePlayerHandle);

        if (component3 != null)
        {
            component3.PresenceDataUpdated += onPresenceDataUpdated;
        }
        if (!dataEntityCollection.HasComponent <LODRequestReference>(remotePlayerHandle))
        {
            LODRequestData requestData = new LODRequestData(LODSystem.REMOTE_PLAYER, remotePlayerHandle, component);
            requestData.OnGameObjectGeneratedEvent += onLODGameObjectGenerated;
            requestData.OnGameObjectRevokedEvent   += onLODGameObjectRevoked;
            LODRequest request = Service.Get <LODService>().Request(requestData, attemptSpawn);
            dataEntityCollection.AddComponent <LODRequestReference>(remotePlayerHandle).Request = request;
        }
        return(false);
    }
Esempio n. 2
0
        private bool onOnlinePlayerSwidListReceived(PlayerStateServiceEvents.OnlinePlayerSwidListReceived evt)
        {
            onlineStatusReceived = true;
            ProfileData component;

            for (int i = 0; i < allPlayersList.Count; i++)
            {
                if (!dataEntityCollection.TryGetComponent <ProfileData>(allPlayersList[i], out component))
                {
                    component = dataEntityCollection.AddComponent <ProfileData>(allPlayersList[i]);
                }
                component.IsOnline = false;
            }
            for (int i = 0; i < evt.Swids.Count; i++)
            {
                DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntity <SwidData, string>(evt.Swids[i]);
                if (!dataEntityHandle.IsNull)
                {
                    if (!dataEntityCollection.TryGetComponent <ProfileData>(dataEntityHandle, out component))
                    {
                        component = dataEntityCollection.AddComponent <ProfileData>(dataEntityHandle);
                    }
                    component.IsOnline = true;
                }
            }
            sortPlayers(visiblePlayersList);
            if (playerItemPrefab != null)
            {
                initializePool();
            }
            return(false);
        }
Esempio n. 3
0
 private SavedIgloosMetaData getSavedIgloosMetaData()
 {
     if (!dataEntityCollection.TryGetComponent <SavedIgloosMetaData>(dataEntityCollection.LocalPlayerHandle, out var component))
     {
         return(dataEntityCollection.AddComponent <SavedIgloosMetaData>(dataEntityCollection.LocalPlayerHandle));
     }
     return(component);
 }
Esempio n. 4
0
 private void newPostCheck()
 {
     if (!dataEntityCollection.TryGetComponent <NewPostData>(dataEntityCollection.LocalPlayerHandle, out var _))
     {
         if (PlayerPrefs.GetInt("newsfeed_login_timestamp") <= 0)
         {
             dataEntityCollection.AddComponent <NewPostData>(dataEntityCollection.LocalPlayerHandle);
         }
         else
         {
             Service.Get <INetworkServicesManager>().NewsfeedService.GetLatestPostTime(localizer.Language.ToString());
         }
     }
 }
        protected virtual bool onRoomJoined(WorldServiceEvents.SelfRoomJoinedEvent evt)
        {
            DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;

            if (localPlayerHandle.IsNull)
            {
                throw new MissingReferenceException("The local player handle does not exist!");
            }
            PlayerDataEntityFactory.AddCommonDataComponents(dataEntityCollection, localPlayerHandle);
            PlayerDataEntityFactory.AddCommonZoneScopeDataComponents(dataEntityCollection, localPlayerHandle);
            dataEntityCollection.AddComponent <LocalPlayerInZoneData>(localPlayerHandle);
            PresenceData component2 = dataEntityCollection.GetComponent <PresenceData>(localPlayerHandle);

            if (string.IsNullOrEmpty(evt.Room.zoneId.instanceId))
            {
                component2.World             = evt.Room.world;
                component2.Room              = evt.Room.zoneId.name;
                component2.ContentIdentifier = evt.Room.contentIdentifier;
                component2.InstanceRoom      = null;
            }
            else
            {
                component2.InstanceRoom = evt.Room.zoneId;
            }
            DataEntityHandle[] remotePlayerHandles = dataEntityCollection.GetRemotePlayerHandles();
            for (int i = 0; i < remotePlayerHandles.Length; i++)
            {
                PresenceData component3 = dataEntityCollection.GetComponent <PresenceData>(remotePlayerHandles[i]);
                if (string.IsNullOrEmpty(evt.Room.zoneId.instanceId))
                {
                    component3.World             = evt.Room.world;
                    component3.Room              = evt.Room.zoneId.name;
                    component3.ContentIdentifier = evt.Room.contentIdentifier;
                    component3.InstanceRoom      = null;
                }
                else
                {
                    component3.InstanceRoom = evt.Room.zoneId;
                }
            }
            if (dataEntityCollection.TryGetComponent <SessionIdData>(localPlayerHandle, out var component4))
            {
                component4.SessionId = evt.SessionId;
            }
            else
            {
                component4 = dataEntityCollection.AddComponent(localPlayerHandle, delegate(SessionIdData component)
                {
                    component.SessionId = evt.SessionId;
                });
            }
            eventDispatcher.DispatchEvent(new NetworkControllerEvents.LocalPlayerJoinedRoomEvent(localPlayerHandle, evt.Room.world, evt.Room.zoneId.name));
            return(false);
        }
Esempio n. 6
0
 private void Start()
 {
     dispatcher           = Service.Get <EventDispatcher>();
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     determineIfLocalPlayer();
     if (isLocalPlayer)
     {
         DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;
         if (dataEntityCollection.TryGetComponent <AirBubbleData>(localPlayerHandle, out localPlayerAirBubbleData))
         {
             AirSupply = localPlayerAirBubbleData.AirBubble.value;
         }
         else
         {
             localPlayerAirBubbleData = dataEntityCollection.AddComponent <AirBubbleData>(localPlayerHandle);
             AirBubble airBubble = new AirBubble();
             airBubble.value = 10f;
             localPlayerAirBubbleData.AirBubble = airBubble;
         }
         if (isLocalPenguinSpawned())
         {
             initializeDiving();
         }
         else
         {
             dispatcher.AddListener <PlayerSpawnedEvents.LocalPlayerSpawned>(onLocalPlayerSpawned);
         }
     }
     else
     {
         initializeDiving();
     }
 }
 private IEnumerator setScrollRectPersistentPosition()
 {
     if (!dataEntityCollection.TryGetComponent <PersistentIglooUIPositionData>(sceneDataHandle, out persistentPositionData))
     {
         persistentPositionData = dataEntityCollection.AddComponent <PersistentIglooUIPositionData>(sceneDataHandle);
     }
     if (persistentPositionData.ScreenName != base.name)
     {
         persistentPositionData.ScreenName = base.name;
         yield break;
     }
     while (!PooledScrollRect.IsInitialized)
     {
         yield return(null);
     }
     scrollRect.normalizedPosition = persistentPositionData.Position;
 }
Esempio n. 8
0
    private void setupLocalPlayer()
    {
        DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;
        AvatarDataHandle avatarDataHandle  = LocalPlayerGameObject.AddComponent <AvatarDataHandle>();

        avatarDataHandle.SetHandle(localPlayerHandle, isLocalPlayer: true);
        GameObjectReferenceData gameObjectReferenceData = dataEntityCollection.AddComponent <GameObjectReferenceData>(localPlayerHandle);

        gameObjectReferenceData.GameObject = LocalPlayerGameObject;
    }
Esempio n. 9
0
 public AccountFlowData GetAccountFlowData()
 {
     CPDataEntityCollection cPDataEntityCollection = Service.Get<CPDataEntityCollection>();
     if (!cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out AccountFlowData component))
     {
         component = cPDataEntityCollection.AddComponent<AccountFlowData>(cPDataEntityCollection.LocalPlayerHandle);
         component.Initialize();
     }
     return component;
 }
Esempio n. 10
0
        public RememberMeData GetRememberMeData()
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (!cPDataEntityCollection.TryGetComponent <RememberMeData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
            {
                component = cPDataEntityCollection.AddComponent <RememberMeData>(cPDataEntityCollection.LocalPlayerHandle);
                component.OnAccountDataUpdated += onAccountDataUpdated;
            }
            return(component);
        }
        public SceneLayoutData AddNewActiveLayout()
        {
            DataEntityHandle activeHandle = GetActiveHandle();

            if (dataEntityCollection.HasComponent <SceneLayoutData>(activeHandle))
            {
                return(null);
            }
            return(dataEntityCollection.AddComponent <SceneLayoutData>(activeHandle));
        }
Esempio n. 12
0
        private static ActiveQuestData getSessionPersistentContainer()
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       dataEntityHandle       = cPDataEntityCollection.GetEntityByType <ActiveQuestData>();

            if (dataEntityHandle.IsNull)
            {
                dataEntityHandle = cPDataEntityCollection.AddEntity("ActiveQuestData");
                cPDataEntityCollection.AddComponent <ActiveQuestData>(dataEntityHandle);
            }
            return(cPDataEntityCollection.GetComponent <ActiveQuestData>(dataEntityHandle));
        }
Esempio n. 13
0
    public void LoadIgloo(ZoneId zoneId, Language language, SceneStateData.SceneState sceneState, string transitionScene = null, string onJoinNotificationTag = null)
    {
        ZoneDefinition zone = GetZone(zoneId.name);

        if (isSceneTransitionValid(zone.SceneName))
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            dictionary.Add(SceneTransitionService.SceneArgs.LoadingScreenOverride.ToString(), IglooSplashScreen.Key);
            sceneTransition(zone.SceneName, transitionScene, dictionary);
            connectToIgloo(zoneId, zone, language, onJoinNotificationTag);
        }
        DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

        if (dataEntityHandle.IsNull)
        {
            dataEntityHandle = dataEntityCollection.AddEntity("ActiveSceneData");
        }
        if (!dataEntityCollection.TryGetComponent(dataEntityHandle, out SceneStateData component))
        {
            component = dataEntityCollection.AddComponent <SceneStateData>(dataEntityHandle);
        }
        component.State = sceneState;
    }
Esempio n. 14
0
        private bool onIglooServiceEventsDecorationsLoaded(IglooServiceEvents.DecorationsLoaded evt)
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            int count = evt.DecorationInventory.items.Count;

            if (!cPDataEntityCollection.TryGetComponent <DecorationInventoryData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
            {
                component = cPDataEntityCollection.AddComponent <DecorationInventoryData>(cPDataEntityCollection.LocalPlayerHandle);
            }
            Dictionary <int, int> dictionary = new Dictionary <int, int>(count);

            for (int i = 0; i < count; i++)
            {
                DecorationId decorationId = evt.DecorationInventory.items[i].decorationId;
                if (decorationId.type == DecorationType.Decoration && !decorationId.customId.HasValue)
                {
                    dictionary.Add(decorationId.definitionId, evt.DecorationInventory.items[i].count);
                }
            }
            component.Decorations = dictionary;
            if (!cPDataEntityCollection.TryGetComponent <StructureInventoryData>(cPDataEntityCollection.LocalPlayerHandle, out var component2))
            {
                component2 = cPDataEntityCollection.AddComponent <StructureInventoryData>(cPDataEntityCollection.LocalPlayerHandle);
            }
            Dictionary <int, int> dictionary2 = new Dictionary <int, int>(count);

            for (int i = 0; i < count; i++)
            {
                DecorationId decorationId = evt.DecorationInventory.items[i].decorationId;
                if (decorationId.type == DecorationType.Structure && !decorationId.customId.HasValue)
                {
                    dictionary2.Add(decorationId.definitionId, evt.DecorationInventory.items[i].count);
                }
            }
            component2.Structures = dictionary2;
            return(false);
        }
Esempio n. 15
0
    private bool onLoginSuccess(PlayerStateServiceEvents.MigrationDataRecieved recievedData)
    {
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
        DataEntityHandle       localPlayerHandle      = cPDataEntityCollection.LocalPlayerHandle;

        if (recievedData.Data != null && !localPlayerHandle.IsNull)
        {
            if (!cPDataEntityCollection.TryGetComponent(localPlayerHandle, out ProfileData component))
            {
                component = cPDataEntityCollection.AddComponent <ProfileData>(localPlayerHandle);
            }
            component.IsMigratedPlayer = true;
            if (!cPDataEntityCollection.TryGetComponent(localPlayerHandle, out LegacyProfileData component2))
            {
                component2 = cPDataEntityCollection.AddComponent <LegacyProfileData>(localPlayerHandle);
            }
            component2.IsMember     = recievedData.Data.legacyAccountData.member;
            component2.Username     = recievedData.Data.legacyAccountData.username;
            component2.CreatedDate  = recievedData.Data.legacyAccountData.createdDate;
            component2.MigratedDate = recievedData.Data.migratedDate;
        }
        rootStateMachine.SendEvent(MigrateSuccessEvent);
        return(false);
    }
Esempio n. 16
0
 private bool onSessionPaused(SessionEvents.SessionPausedEvent evt)
 {
     if (IsLocalUserUsingProp())
     {
         PropCancel component = LocalPlayerPropUser.Prop.GetComponent <PropCancel>();
         if (component != null && LocalPlayerPropUser.Prop != null && isPropRestorable(LocalPlayerPropUser.Prop.PropDef))
         {
             dataEntityCollection.AddComponent(dataEntityCollection.LocalPlayerHandle, delegate(PropToBeRestoredData restoreData)
             {
                 restoreData.PropId = LocalPlayerPropUser.Prop.PropId;
             });
             component.UnequipProp(immediate: true);
         }
     }
     return(false);
 }
 private bool onSessionPaused(SessionEvents.SessionPausedEvent evt)
 {
     if (isInvitationLocalPlayer && dataEntityCollection.TryGetComponent <HeldObjectsData>(dataEntityCollection.LocalPlayerHandle, out var component))
     {
         DHeldObject heldObject = component.HeldObject;
         if (heldObject != null)
         {
             dataEntityCollection.AddComponent(dataEntityCollection.LocalPlayerHandle, delegate(PropToBeRestoredData restoreData)
             {
                 restoreData.PropId = heldObject.ObjectId;
             });
             removeItem();
         }
     }
     return(false);
 }
        private bool onClaimedReward(RewardServiceEvents.ClaimedReward evt)
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (!cPDataEntityCollection.TryGetComponent <ClaimedRewardIdsData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
            {
                component = cPDataEntityCollection.AddComponent <ClaimedRewardIdsData>(cPDataEntityCollection.LocalPlayerHandle);
            }
            component.RewardIds.Add(EventItemDefinition.Id);
            if (this.CollectItemSucceeded != null)
            {
                this.CollectItemSucceeded();
                this.CollectItemSucceeded = null;
            }
            return(false);
        }
Esempio n. 19
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();
     }
 }
    private bool onClaimedReward(RewardServiceEvents.ClaimedReward evt)
    {
        int num = rewardsToClaimById.Dequeue();
        ClaimableRewardDefinition claimableRewardDefinition = this.claimableRewardDefinition[num];
        ClaimableRewardData       item = new ClaimableRewardData(claimableRewardDefinition.TitleToken, claimableRewardDefinition.Reward.ToReward());

        rewardsToShow.Enqueue(item);
        ClaimedRewardIdsData claimedRewardIdsData = dataEntityCollection.GetComponent <ClaimedRewardIdsData>(dataEntityCollection.LocalPlayerHandle);

        if (claimedRewardIdsData == null)
        {
            claimedRewardIdsData = dataEntityCollection.AddComponent <ClaimedRewardIdsData>(dataEntityCollection.LocalPlayerHandle);
        }
        claimedRewardIdsData.RewardIds.Add(num);
        claimNextReward();
        return(false);
    }
Esempio n. 21
0
        private bool onJoinPlayer(PlayerCardEvents.JoinPlayer evt)
        {
            PresenceData component  = dataEntityCollection.GetComponent <PresenceData>(Handle);
            PresenceData component2 = dataEntityCollection.GetComponent <PresenceData>(dataEntityCollection.LocalPlayerHandle);

            if (component == null || component2 == null)
            {
                return(false);
            }
            if (isLocalAndRemoteInTheSameRoom(component, component2))
            {
                eventChannel.AddListener <FriendsServiceEvents.FriendLocationInRoomReceived>(onFriendLocationReceived);
                eventChannel.AddListener <FriendsServiceEvents.FriendNotInRoom>(onFriendNotInRoom);
                Service.Get <INetworkServicesManager>().FriendsService.GetFriendLocationInRoom(dataEntityCollection.GetComponent <SwidData>(Handle).Swid);
            }
            else
            {
                SpawnAtPlayerData spawnAtPlayerData = dataEntityCollection.AddComponent <SpawnAtPlayerData>(dataEntityCollection.LocalPlayerHandle);
                spawnAtPlayerData.PlayerSWID = dataEntityCollection.GetComponent <SwidData>(Handle).Swid;
                string onJoinNotificationTag = string.Empty;
                if (component.World != component2.World)
                {
                    onJoinNotificationTag = "GlobalUI.Notification.WorldSwitched";
                }
                if (component.IsInInstancedRoom)
                {
                    Language        language = Service.Get <Localizer>().Language;
                    WorldDefinition world    = Service.Get <ZoneTransitionService>().GetWorld(component.World);
                    if (world != null)
                    {
                        language = world.Language;
                    }
                    Service.Get <ZoneTransitionService>().LoadIgloo(component.InstanceRoom, language, SceneStateData.SceneState.Play, "Loading", onJoinNotificationTag);
                }
                else
                {
                    Service.Get <ZoneTransitionService>().LoadZone(component.Room, "Loading", component.World, onJoinNotificationTag);
                }
            }
            Service.Get <ICPSwrveService>().Action("game.friends", "jump");
            return(false);
        }
Esempio n. 22
0
    private void Start()
    {
        dispatcher           = Service.Get <EventDispatcher>();
        dataEntityCollection = Service.Get <CPDataEntityCollection>();
        dispatcher.DispatchEvent(default(RaceGameEvents.Start));
        DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;

        if (dataEntityCollection.TryGetComponent(localPlayerHandle, out localPlayerRaceData))
        {
            CompletionTime      = localPlayerRaceData.RaceResults.CompletionTime;
            RaceResultsCategory = localPlayerRaceData.RaceResults.raceResultsCategory;
            return;
        }
        localPlayerRaceData = dataEntityCollection.AddComponent <RaceData>(localPlayerHandle);
        RaceResults raceResults = new RaceResults();

        raceResults.CompletionTime      = 0L;
        raceResults.raceResultsCategory = RaceResults.RaceResultsCategory.Incomplete;
        localPlayerRaceData.RaceResults = raceResults;
    }
Esempio n. 23
0
        public void Show(Transform parentTransform = null)
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (!cPDataEntityCollection.TryGetComponent <GateData>(cPDataEntityCollection.LocalPlayerHandle, out gateData))
            {
                gateData            = cPDataEntityCollection.AddComponent <GateData>(cPDataEntityCollection.LocalPlayerHandle);
                gateData.GateStatus = new Dictionary <Type, bool>();
            }
            bool value = false;

            gateData.GateStatus.TryGetValue(GetType(), out value);
            this.parentTransform = parentTransform;
            if (value)
            {
                Continue();
            }
            else
            {
                initializePopup(GateContentKey);
            }
        }
Esempio n. 24
0
    private bool showAllAccess()
    {
        AllAccessService allAccessService = Service.Get <AllAccessService>();

        if (allAccessService.IsAllAccessActive())
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            if (cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out DisplayNameData component))
            {
                string allAccessEventKey = allAccessService.GetAllAccessEventKey();
                if (!AllAccessHelper.HasSeenAllAccessFlow(allAccessEventKey, component.DisplayName))
                {
                    AllAccessHelper.SetHasSeenAllAccessFlow(allAccessEventKey, component.DisplayName);
                    DataEntityHandle         handle = cPDataEntityCollection.AddEntity("AllAccessCelebrationData");
                    AllAccessCelebrationData allAccessCelebrationData = cPDataEntityCollection.AddComponent <AllAccessCelebrationData>(handle);
                    allAccessCelebrationData.ShowAllAccessCelebration = true;
                    return(true);
                }
            }
        }
        return(false);
    }
Esempio n. 25
0
    public void SpawnPlayer(SpawnPlayerParams spawnPlayerParams)
    {
        if (spawnPlayerParams.Zone != null || !string.IsNullOrEmpty(spawnPlayerParams.SceneName))
        {
            bool                  flag                  = false;
            PresenceData          component             = dataEntityCollection.GetComponent <PresenceData>(dataEntityCollection.LocalPlayerHandle);
            ZoneTransitionService zoneTransitionService = Service.Get <ZoneTransitionService>();
            if (spawnPlayerParams.Zone != null)
            {
                ZoneDefinition zoneBySceneName = zoneTransitionService.GetZoneBySceneName(component.Room);
                flag = (zoneBySceneName != null && string.Equals(spawnPlayerParams.Zone.ZoneName, zoneBySceneName.ZoneName));
            }
            else if (!string.IsNullOrEmpty(spawnPlayerParams.SceneName))
            {
                flag = ((!zoneTransitionService.IsInIgloo) ? string.Equals(component.Room, spawnPlayerParams.SceneName) : string.Equals(zoneTransitionService.CurrentZone.SceneName, spawnPlayerParams.SceneName));
            }
            if (!flag)
            {
                if (!dataEntityCollection.TryGetComponent(dataEntityCollection.LocalPlayerHandle, out SpawnData component2))
                {
                    component2 = dataEntityCollection.AddComponent <SpawnData>(dataEntityCollection.LocalPlayerHandle);
                }
                if (spawnPlayerParams.SpawnedAction != null)
                {
                    component2.SpawnedAction = spawnPlayerParams.SpawnedAction;
                }
                component2.Position      = spawnPlayerParams.Position;
                component2.Rotation      = spawnPlayerParams.Rotation;
                component2.PendingReward = spawnPlayerParams.PendingReward;
                if (spawnPlayerParams.Zone != null)
                {
                    zoneTransitionService.LoadZone(spawnPlayerParams.Zone, "Loading");
                }
                else
                {
                    zoneTransitionService.LoadZone(spawnPlayerParams.SceneName, "Loading");
                }
                return;
            }
        }
        if (spawnPlayerParams.PendingReward != null)
        {
            Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.MyRewardEarned(RewardSource.QUICK_NOTIFICATION, "", spawnPlayerParams.PendingReward));
        }
        if (Vector3.Distance(base.transform.position, spawnPlayerParams.Position) <= 3f)
        {
            if (spawnPlayerParams.SpawnedAction != null)
            {
                executeSpawedAction(spawnPlayerParams.SpawnedAction);
            }
            return;
        }
        LocomotionTracker component3 = base.gameObject.GetComponent <LocomotionTracker>();

        if (component3.IsCurrentControllerOfType <SlideController>())
        {
            component3.SetCurrentController <RunController>();
        }
        else if (spawnPlayerParams.GetOutOfSwimming && component3.IsCurrentControllerOfType <SwimController>())
        {
            Animator component4 = base.gameObject.GetComponent <Animator>();
            component4.SetTrigger(AnimationHashes.Params.SwimToWalk);
            component3.SetCurrentController <RunController>();
        }
        Vector3 zero = Vector3.zero;

        if (spawnPlayerParams.NudgePlayer && component3.IsCurrentControllerOfType <RunController>())
        {
            zero.y = 0.5f;
        }
        base.transform.position = spawnPlayerParams.Position + zero;
        ClubPenguin.Core.SceneRefs.Get <BaseCamera>().Snap();
        if (spawnPlayerParams.NudgePlayer)
        {
            actionOnSpawned = spawnPlayerParams.SpawnedAction;
            CoroutineRunner.Start(LocomotionUtils.nudgePlayer(component3, onNudgePlayerDone), component3.gameObject, "MoveAfterJump");
        }
        else if (spawnPlayerParams.SpawnedAction != null)
        {
            executeSpawedAction(spawnPlayerParams.SpawnedAction);
        }
    }