protected override void SetOfflineData(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
        {
            IglooEntity value = offlineDatabase.Read <IglooEntity>();

            value.Data = SignedResponseBody.Data;
            offlineDatabase.Write(value);
        }
예제 #2
0
 protected override void SetOfflineData(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
 {
     if (offlineDefinitions.IsOwnIgloo(IglooId))
     {
         IglooEntity value = offlineDatabase.Read <IglooEntity>();
         value.Data.activeLayout = SignedJoinRoomData.Data.extraLayoutData;
         offlineDatabase.Write(value);
     }
 }
예제 #3
0
        protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
        {
            IglooEntity value = offlineDatabase.Read <IglooEntity>();

            value.Init();
            offlineDatabase.Write(value);
            SceneLayoutEntity value2 = offlineDatabase.Read <SceneLayoutEntity>();

            value2.Init();
            offlineDatabase.Write(value2);
        }
예제 #4
0
    protected override void SetOfflineData(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        SceneLayoutEntity value = offlineDatabase.Read <SceneLayoutEntity>();

        if (value.Layouts.Count == 0)
        {
            IglooEntity value2 = offlineDatabase.Read <IglooEntity>();
            value2.Data.activeLayout   = ResponseBody;
            value2.Data.activeLayoutId = ResponseBody.layoutId;
            offlineDatabase.Write(value2);
        }
        value.Layouts.Add(ResponseBody);
        offlineDatabase.Write(value);
    }
예제 #5
0
    protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        SceneLayoutEntity value = offlineDatabase.Read <SceneLayoutEntity>();
        int    count            = value.Layouts.Count;
        Random random           = new Random();

        byte[] array = new byte[8];
        random.NextBytes(array);
        SavedSceneLayout savedSceneLayout = new SavedSceneLayout();

        savedSceneLayout.createdDate       = DateTime.UtcNow.GetTimeInMilliseconds();
        savedSceneLayout.decorationsLayout = RequestBody.decorationsLayout;
        savedSceneLayout.extraInfo         = RequestBody.extraInfo;
        savedSceneLayout.lastModifiedDate  = DateTime.UtcNow.GetTimeInMilliseconds();
        savedSceneLayout.layoutId          = BitConverter.ToInt64(array, 0);
        savedSceneLayout.lightingId        = RequestBody.lightingId;
        savedSceneLayout.memberOnly        = true;
        savedSceneLayout.musicId           = RequestBody.musicId;
        savedSceneLayout.name   = RequestBody.name;
        savedSceneLayout.zoneId = RequestBody.zoneId;
        SavedSceneLayout savedSceneLayout2 = savedSceneLayout;

        if (savedSceneLayout2.decorationsLayout == null)
        {
            savedSceneLayout2.decorationsLayout = new List <DecorationLayout>();
        }
        if (savedSceneLayout2.extraInfo == null)
        {
            savedSceneLayout2.extraInfo = new Dictionary <string, string>();
        }
        if (count == 0)
        {
            IglooEntity value2 = offlineDatabase.Read <IglooEntity>();
            value2.Data.activeLayout   = savedSceneLayout2;
            value2.Data.activeLayoutId = savedSceneLayout2.layoutId;
            offlineDatabase.Write(value2);
        }
        value.Layouts.Add(savedSceneLayout2);
        offlineDatabase.Write(value);
        ResponseBody = savedSceneLayout2;
    }
        protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
        {
            IglooEntity value = offlineDatabase.Read <IglooEntity>();

            if (RequestBody.visibility.HasValue)
            {
                value.Data.visibility = RequestBody.visibility;
            }
            if (RequestBody.activeLayoutId.HasValue)
            {
                SceneLayoutEntity sceneLayoutEntity = offlineDatabase.Read <SceneLayoutEntity>();
                if (sceneLayoutEntity[RequestBody.activeLayoutId.Value] != null)
                {
                    value.Data.activeLayout   = sceneLayoutEntity[RequestBody.activeLayoutId.Value];
                    value.Data.activeLayoutId = RequestBody.activeLayoutId;
                }
            }
            offlineDatabase.Write(value);
            SignedResponseBody = new SignedResponse <IglooData>
            {
                Data = value.Data
            };
        }
예제 #7
0
    protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        IglooEntity iglooEntity = offlineDatabase.Read <IglooEntity>();

        ResponseBody = iglooEntity.Data.activeLayout;
    }
        protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
        {
            ResponseBody        = new LocalPlayerData();
            ResponseBody.member = true;
            ResponseBody.membershipExpireDate       = DateTime.UtcNow.AddMonths(1).GetTimeInMilliseconds();
            ResponseBody.trialAvailable             = false;
            ResponseBody.subscriptionPaymentPending = false;
            ResponseBody.id = new PlayerId
            {
                id   = offlineDatabase.AccessToken,
                type = PlayerId.PlayerIdType.SWID
            };
            ClubPenguin.Net.Offline.Profile profile = offlineDatabase.Read <ClubPenguin.Net.Offline.Profile>();
            ResponseBody.profile = new ClubPenguin.Net.Domain.Profile
            {
                colour  = profile.Colour,
                daysOld = profile.DaysOld
            };
            ResponseBody.outfit           = offlineDatabase.Read <ClubPenguin.Net.Offline.PlayerOutfitDetails>().Parts;
            ResponseBody.mascotXP         = offlineDatabase.Read <ClubPenguin.Net.Offline.PlayerAssets>().Assets.mascotXP;
            ResponseBody.minigameProgress = new List <MinigameProgress>();
            ResponseBody.quests           = SetProgressOperation.GetQuestStateCollection(offlineDatabase.Read <QuestStates>(), offlineDefinitions, includeComplete: true);
            ResponseBody.tutorialData     = new List <sbyte>(offlineDatabase.Read <TutorialData>().Bytes);
            List <Breadcrumb> list = new List <Breadcrumb>();

            foreach (Breadcrumb breadcrumb in offlineDatabase.Read <BreadcrumbCollection>().breadcrumbs)
            {
                list.Add(new Breadcrumb
                {
                    id             = breadcrumb.id,
                    breadcrumbType = breadcrumb.breadcrumbType
                });
            }
            ResponseBody.breadcrumbs = new BreadcrumbsResponse
            {
                breadcrumbs = list
            };
            RegistrationProfile registrationProfile = offlineDatabase.Read <RegistrationProfile>();

            ResponseBody.name = registrationProfile.displayName;
            if (string.IsNullOrEmpty(ResponseBody.name))
            {
                ResponseBody.name = registrationProfile.userName;
            }
            ResponseBody.claimedRewardIds = offlineDatabase.Read <ClaimableRewardData>().ClimedRewards;
            ZoneId zoneId = new ZoneId();

            zoneId.name       = "DefaultIgloo";
            zoneId.instanceId = registrationProfile.Id();
            ZoneId      zoneId2     = zoneId;
            IglooEntity iglooEntity = offlineDatabase.Read <IglooEntity>();

            if (iglooEntity.Data.activeLayout != null)
            {
                string zoneId3 = iglooEntity.Data.activeLayout.zoneId;
                if (!string.IsNullOrEmpty(zoneId3))
                {
                    zoneId2.name = zoneId3;
                }
            }
            ResponseBody.zoneId = zoneId2;
            List <SavedIglooLayoutSummary> list2 = new List <SavedIglooLayoutSummary>();

            foreach (SavedSceneLayout layout in offlineDatabase.Read <SceneLayoutEntity>().Layouts)
            {
                list2.Add(new SavedIglooLayoutSummary
                {
                    createdDate     = layout.createdDate.GetValueOrDefault(0L),
                    lastUpdatedDate = layout.lastModifiedDate.GetValueOrDefault(0L),
                    layoutId        = layout.layoutId,
                    lot             = layout.zoneId,
                    memberOnly      = layout.memberOnly,
                    name            = layout.name
                });
            }
            ResponseBody.iglooLayouts = new SavedIglooLayoutsSummary
            {
                activeLayoutId = iglooEntity.Data.activeLayoutId,
                activeLayoutServerChangeNotification = ActiveLayoutServerChangeNotification.NoServerChange,
                visibility = iglooEntity.Data.visibility.GetValueOrDefault(IglooVisibility.PRIVATE),
                layouts    = list2
            };
            ClubPenguin.Net.Offline.DailySpinData dailySpinData = offlineDatabase.Read <ClubPenguin.Net.Offline.DailySpinData>();
            ResponseBody.dailySpinData = new ClubPenguin.Net.Domain.DailySpinData
            {
                currentChestId = dailySpinData.CurrentChestId,
                numChestsReceivedOfCurrentChestId = dailySpinData.NumChestsReceivedOfCurrentChestId,
                numPunchesOnCurrentChest          = dailySpinData.NumPunchesOnCurrentChest,
                timeOfLastSpinInMilliseconds      = dailySpinData.TimeOfLastSpinInMilliseconds
            };
            ClubPenguin.Net.Offline.SessionData sessionData = offlineDatabase.Read <ClubPenguin.Net.Offline.SessionData>();
            if (sessionData.Data.sessionId != 0)
            {
                ResponseBody.onlineLocation = sessionData.CurrentRoom;
            }
        }