예제 #1
0
        public bool IsTutorialAvailable(TutorialDefinition tutorial)
        {
            bool flag = true;

            flag = !isTutorialComplete(tutorial.Id);
            if (flag && MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel != 0)
            {
                flag = false;
            }
            if (flag && Disabled && tutorial.Id != 0)
            {
                flag = false;
            }
            if (flag && tutorial.IsMemberOnly)
            {
                flag = dataEntityCollection.IsLocalPlayerMember();
            }
            if (flag && tutorial.MinimumPenguinAge > 0 && PlayerAgeInDays < tutorial.MinimumPenguinAge)
            {
                flag = false;
            }
            if (flag)
            {
                flag = isTutorialRequirementsComplete(tutorial);
            }
            return(flag);
        }
예제 #2
0
        private bool onLocalPlayerDataReceived(PlayerStateServiceEvents.LocalPlayerDataReceived evt)
        {
            if (dataEntityCollection == null)
            {
                return(false);
            }
            DataEntityHandle localPlayerHandle = dataEntityCollection.LocalPlayerHandle;
            bool             flag = !dataEntityCollection.HasComponent <DisplayNameData>(localPlayerHandle);

            PlayerDataEntityFactory.AddLocalPlayerProfileDataComponents(dataEntityCollection, evt.Data, isOnline: true);
            if (flag)
            {
                PlayerDataEntityFactory.AddCommonDataComponents(dataEntityCollection, localPlayerHandle);
                PlayerDataEntityFactory.AddLocalPlayerSessionScopeDataComponents(dataEntityCollection, localPlayerHandle);
                doFTUECheck(localPlayerHandle);
                ILocalUser localUser = Service.Get <SessionManager>().LocalUser;
                networkServicesManager.FriendsService.SetLocalUser(localUser);
                setLocalUser(localUser);
                string text = "free";
                if (dataEntityCollection.IsLocalPlayerMember())
                {
                    text = "member";
                }
                string tier = (EnvironmentManager.AreHeadphonesConnected ? "headphone_on" : "headphone_off");
                Service.Get <ICPSwrveService>().Action("login", text, localUser.HashedId, tier);
                Dictionary <string, string> dictionary = new Dictionary <string, string>();
                dictionary.Add("status", text);
                Service.Get <ICPSwrveService>().UserUpdate(dictionary);
                eventDispatcher.DispatchEvent(new NetworkControllerEvents.LocalPlayerDataReadyEvent(localPlayerHandle));
            }
            if (evt.Data.minigameProgress != null)
            {
                foreach (MinigameProgress item in evt.Data.minigameProgress)
                {
                    dataEntityCollection.GetComponent <MiniGamePlayCountData>(localPlayerHandle)?.SetMinigamePlayCount(item.gameId, item.playCount);
                }
            }
            return(false);
        }
예제 #3
0
    private void addBreadcrumbsForReward(Reward reward)
    {
        addBreadCrumbsForReward <PropDefinition, DurableReward, int>(reward, breadcrumbIdentifiers.GearType, breadcrumbIdentifiers.Gear);
        addBreadCrumbsForReward <TemplateDefinition, EquipmentTemplateReward, int>(reward, breadcrumbIdentifiers.TemplateType, breadcrumbIdentifiers.Template);
        addBreadCrumbsForReward <FabricDefinition, FabricReward, int>(reward, breadcrumbIdentifiers.FabricType, breadcrumbIdentifiers.Fabric);
        addBreadCrumbsForReward <DecalDefinition, DecalReward, int>(reward, breadcrumbIdentifiers.DecalType, breadcrumbIdentifiers.Decal);
        addBreadCrumbsForReward <TubeDefinition, TubeReward, int>(reward, breadcrumbIdentifiers.TubeType, breadcrumbIdentifiers.Tube);
        addBreadCrumbsForReward <DecorationDefinition, DecorationReward, int>(reward, breadcrumbIdentifiers.DecorationType, breadcrumbIdentifiers.Decoration);
        addBreadCrumbsForReward <StructureDefinition, StructureReward, int>(reward, breadcrumbIdentifiers.StructureType, breadcrumbIdentifiers.Structure);
        addBreadCrumbsForReward <MusicTrackDefinition, MusicTrackReward, int>(reward, breadcrumbIdentifiers.MusicTrackType, breadcrumbIdentifiers.MusicTrack);
        addBreadCrumbsForReward <LightingDefinition, LightingReward, int>(reward, breadcrumbIdentifiers.LightingType, breadcrumbIdentifiers.Lighting);
        if (reward.TryGetValue(out EquipmentInstanceReward rewardable) && !rewardable.IsEmpty())
        {
            bool flag = false;
            for (int i = 0; i < rewardable.EquipmentInstances.Count; i++)
            {
                if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <TemplateDefinition, int>(rewardable.EquipmentInstances[i].definitionId))
                {
                    NotificationBreadcrumbController      obj           = notificationBreadcrumbController;
                    PersistentBreadcrumbTypeDefinitionKey inventoryType = breadcrumbIdentifiers.InventoryType;
                    long equipmentId = rewardable.EquipmentInstances[i].equipmentId;
                    obj.AddPersistentBreadcrumb(inventoryType, equipmentId.ToString());
                    flag = true;
                }
            }
            if (flag)
            {
                notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Inventory);
            }
        }
        if (!reward.TryGetValue(out ConsumableInstanceReward rewardable2) || rewardable2.IsEmpty())
        {
            return;
        }
        Dictionary <string, int> .Enumerator enumerator = rewardable2.Consumables.GetEnumerator();
        bool flag2 = false;
        bool flag3 = false;

        while (enumerator.MoveNext())
        {
            if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <PropDefinition, int>(RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key)))
            {
                PersistentBreadcrumbTypeDefinitionKey type;
                if (RewardUtils.IsConsumablePartyGame(enumerator.Current.Key))
                {
                    type  = breadcrumbIdentifiers.PartyGameType;
                    flag3 = true;
                }
                else
                {
                    type  = breadcrumbIdentifiers.ConsumableType;
                    flag2 = true;
                }
                notificationBreadcrumbController.AddPersistentBreadcrumb(type, RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key).ToString());
            }
        }
        if (flag2)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Consumable);
        }
        if (flag3)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.PartyGame);
        }
    }