Ejemplo n.º 1
0
        private bool onSelfLeaveRoom(WorldServiceEvents.SelfLeaveRoomEvent evt)
        {
            DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;

            if (!localPlayerHandle.IsNull)
            {
                dataEntityCollection.RemoveComponent <LocalPlayerInZoneData>(localPlayerHandle);
            }
            return(false);
        }
Ejemplo n.º 2
0
        private bool onLocalPlayerSpawned(PlayerSpawnedEvents.LocalPlayerSpawned evt)
        {
            if (LocalPlayerPropUser == null)
            {
                LocalPlayerPropUser = evt.LocalPlayerGameObject.GetComponent <PropUser>();
            }
            SessionIdData component = dataEntityCollection.GetComponent <SessionIdData>(evt.Handle);

            if (component != null)
            {
                userIdToPropUser[component.SessionId] = LocalPlayerPropUser;
                DHeldObject heldObject = dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityCollection.LocalPlayerHandle).HeldObject;
                if (heldObject != null && heldObject.ObjectId != null)
                {
                    onPlayerPropRetrieved(heldObject.ObjectId, GetPropDefinition(heldObject.ObjectId).PropAssetContentKey, component.SessionId);
                }
                loadExistingPlayerHeldExperiences(component.SessionId);
                loadExistingWorldExperiences();
                if (dataEntityCollection.TryGetComponent <PropToBeRestoredData>(evt.Handle, out var component2))
                {
                    LocalPlayerRetrieveProp(component2.PropId);
                    dataEntityCollection.RemoveComponent <PropToBeRestoredData>(evt.Handle);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
 public void RemoveLocalPlayerAirBubbleData()
 {
     if (isLocalPlayer)
     {
         DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;
         dataEntityCollection.RemoveComponent <AirBubbleData>(localPlayerHandle);
     }
 }
    private void Start()
    {
        stateMachine = GetComponent <StateMachine>();
        if (stateMachine == null)
        {
            Log.LogErrorFormatted(this, "Ensure this component is added to gameobject that will contain a StateMachine component. Currently its on {0} gameobject", base.gameObject.name);
            return;
        }
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        if (cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out SEDFSMStartEventData component))
        {
            stateMachine.SendEvent(component.EventName);
            cPDataEntityCollection.RemoveComponent <SEDFSMStartEventData>(cPDataEntityCollection.LocalPlayerHandle);
        }
    }
Ejemplo n.º 5
0
    private void onPlayerRemoved(RemotePlayerData component)
    {
        component.PlayerRemoved -= onPlayerRemoved;
        playerRemovedListeners.Remove(component);
        DataEntityHandle entityByComponent = dataEntityCollection.GetEntityByComponent(component);

        if (entityByComponent.IsNull)
        {
            Log.LogError(this, "RemotePlayerData removed, but the handle could not be found for the component");
        }
        if (dataEntityCollection.TryGetComponent(entityByComponent, out LODRequestReference component2))
        {
            Service.Get <LODService>().RemoveRequest(component2.Request);
        }
        avatarViewReady.Remove(entityByComponent);
        hasBeenPlaced.Remove(entityByComponent);
        dataEntityCollection.RemoveComponent <GameObjectReferenceData>(entityByComponent);
    }
Ejemplo n.º 6
0
        private void onEvalJavaScriptFinished(string result)
        {
            if (string.IsNullOrEmpty(result) || result.Equals("undefined"))
            {
                return;
            }
            Dictionary <string, string> dictionary = jsonService.Deserialize <Dictionary <string, string> >(result);

            if (dictionary != null && dictionary.ContainsKey("type") && dictionary.ContainsKey("status") && dictionary.ContainsKey("timestamp") && dictionary["type"].Equals("tokenLogin") && !receivedInitialLoginFunctionResponse && dictionary["status"] == "success")
            {
                webView.IsReadyToShow = true;
                receivedInitialLoginFunctionResponse = true;
                PlayerPrefs.SetInt("newsfeed_login_timestamp", Convert.ToInt32(dictionary["timestamp"]));
                dataEntityCollection.RemoveComponent <NewPostData>(dataEntityCollection.LocalPlayerHandle);
                if (this.NewsfeedLoginSucceeded != null)
                {
                    this.NewsfeedLoginSucceeded();
                    this.NewsfeedLoginSucceeded = null;
                }
            }
        }
Ejemplo n.º 7
0
 public void RemoveAccountFlowData()
 {
     CPDataEntityCollection cPDataEntityCollection = Service.Get<CPDataEntityCollection>();
     cPDataEntityCollection.RemoveComponent<AccountFlowData>(cPDataEntityCollection.LocalPlayerHandle);
 }
Ejemplo n.º 8
0
    public void RemoveLocalPlayerRaceData()
    {
        DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;

        dataEntityCollection.RemoveComponent <RaceData>(localPlayerHandle);
    }
        public bool RemoveActiveSceneLayout()
        {
            DataEntityHandle activeHandle = GetActiveHandle();

            return(dataEntityCollection.RemoveComponent <SceneLayoutData>(activeHandle));
        }
Ejemplo n.º 10
0
    private void spawnLocalPlayerInZone()
    {
        if (Service.Get <ZoneTransitionService>().CurrentZone.AlwaysSpawnPlayerAtDefaultLocation)
        {
            spawnNearDefaultLocation();
            return;
        }
        actionOnSpawned = null;
        Quaternion   rotation   = Quaternion.identity;
        PositionData component3 = default(PositionData);

        if (playerDataHandle.Handle == dataEntityCollection.LocalPlayerHandle)
        {
            Vector3   vector = Vector3.zero;
            bool      flag   = false;
            SpawnData component2;
            if (dataEntityCollection.TryGetComponent(dataEntityCollection.LocalPlayerHandle, out PausedStateData component))
            {
                if (component.ShouldSkipResume)
                {
                    component.ShouldSkipResume = false;
                }
                else
                {
                    vector = component.Position;
                    flag   = true;
                }
            }
            else if (dataEntityCollection.TryGetComponent(dataEntityCollection.LocalPlayerHandle, out component2))
            {
                vector                 = component2.Position;
                rotation               = component2.Rotation;
                actionOnSpawned        = component2.SpawnedAction;
                actionOnSpawned.Reward = component2.PendingReward;
                flag = true;
                dataEntityCollection.RemoveComponent <SpawnData>(dataEntityCollection.LocalPlayerHandle);
            }
            if (flag && dataEntityCollection.TryGetComponent(dataEntityCollection.LocalPlayerHandle, out component3))
            {
                component3.Position     = vector;
                localPlayerSpawnPostion = vector;
                base.transform.SetPositionAndRotation(vector, rotation);
                if (actionOnSpawned != null && (actionOnSpawned.Action != 0 || actionOnSpawned.Reward != null))
                {
                    eventDispatcher.AddListener <HudEvents.HudInitComplete>(onHudInitCompleted);
                }
                return;
            }
        }
        if (isSpawnNearPlayer())
        {
            Service.Get <EventDispatcher>().AddListener <FriendsServiceEvents.FriendLocationInRoomReceived>(onFriendLocationReceived);
            Service.Get <EventDispatcher>().AddListener <FriendsServiceEvents.FriendNotInRoom>(onFriendNotInRoom);
            Service.Get <INetworkServicesManager>().FriendsService.GetFriendLocationInRoom(dataEntityCollection.GetComponent <SpawnAtPlayerData>(playerDataHandle.Handle).PlayerSWID);
            return;
        }
        bool flag2 = false;

        component3 = dataEntityCollection.GetComponent <PositionData>(playerDataHandle.Handle);
        if (!flag2 && component3 != null && component3.Position != Vector3.zero)
        {
            LocomotionActionEvent action = default(LocomotionActionEvent);
            action.Type      = LocomotionAction.Move;
            action.Position  = component3.Position;
            action.Direction = Vector3.zero;
            Service.Get <INetworkServicesManager>().PlayerActionService.LocomotionAction(action);
            flag2 = true;
        }
        if (!flag2)
        {
            spawnAtSceneLocation();
        }
    }