public DataEntityHandle GetActiveHandle()
        {
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

            if (dataEntityHandle.IsNull)
            {
                dataEntityHandle = dataEntityCollection.AddEntity("ActiveSceneData");
            }
            return(dataEntityHandle);
        }
Exemple #2
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));
        }
        private DataEntityHandle addServerObjectWithItemData(CPMMOItem item)
        {
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntity <ServerObjectItemData, CPMMOItemId>(item.Id);

            if (dataEntityHandle.IsNull)
            {
                dataEntityHandle = dataEntityCollection.AddEntity(ServerObjectItemData.GetEntityName(item.Id));
            }
            if (!dataEntityHandle.IsNull)
            {
                dataEntityCollection.AddComponent(dataEntityHandle, delegate(ServerObjectItemData component)
                {
                    component.Item = item;
                });
            }
            return(dataEntityHandle);
        }
Exemple #4
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);
    }
Exemple #5
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;
    }