feat(upserver): 保存M2客户端KV迁移至本人统计写检查点
保存独立KV用户服务、固定会话存档与原业务接线,以及C3d资料缓存和C3e本人统计写。 保留原PF/AGG路线、业务公式和时序;榜单读取、好友资料、公告、匹配及首场景闸仍待完成。 验证:ServiceHost两条件各33组646断言;Unity CLI Loop编译0错误269警告。 包含相关方案、评审裁决、测试及状态文档。未操作服务器、正式账号或打包。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using UnityEngine;
|
||||
@@ -8,6 +8,8 @@ using System.Collections.Generic;
|
||||
|
||||
public class BargainPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private readonly Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private readonly TbEventPackManager _epm = GContext.container.Resolve<Tables>().TbEventPackManager;
|
||||
private readonly TbSpecialPack _spp = GContext.container.Resolve<Tables>().TbSpecialPack;
|
||||
@@ -178,8 +180,8 @@ public class BargainPackData
|
||||
public void SaveData()
|
||||
{
|
||||
//Debug.LogError("Testing, data not saved for debug purpose.");
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("GeneralEventPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data));
|
||||
SaveStore.Write("GeneralEventPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data)).RequireAccepted();
|
||||
}
|
||||
|
||||
public void LoadData(GeneralEventPackData data)
|
||||
|
||||
@@ -33,6 +33,7 @@ public struct BpVipUnlock
|
||||
|
||||
public class BattlePassData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
public BattlePassRecord BattlePassRecord;
|
||||
public BattleTask BattleTask;
|
||||
|
||||
@@ -114,7 +115,7 @@ public class BattlePassData
|
||||
{
|
||||
string battlePassRecord = BattlePassRecord.SerializeObject();
|
||||
string battleTask = BattleTask.SerializeObject();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("BattlePassRecordTask", battlePassRecord + "#" + battleTask);
|
||||
playerSaveStore.Write("BattlePassRecordTask", battlePassRecord + "#" + battleTask).RequireAccepted();
|
||||
}
|
||||
public void SaveBattlePassRecord()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using System;
|
||||
@@ -6,6 +6,8 @@ using System.Collections.Generic;
|
||||
|
||||
public class BuffDataCenter
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private cfg.Tables _tables;
|
||||
public BuffDataCenter(cfg.Tables tables)
|
||||
{
|
||||
@@ -202,7 +204,7 @@ public class BuffDataCenter
|
||||
DateTime now = ZZTimeHelper.UtcNow().UtcNowOffset();
|
||||
mapBuffData.buffEndTime = now.AddSeconds(buffData.CountDown);
|
||||
mapBuffDataList.Add(mapID, mapBuffData);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("BuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(mapBuffDataList));
|
||||
SaveStore.Write("BuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(mapBuffDataList)).RequireAccepted();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -291,12 +293,12 @@ public class BuffDataCenter
|
||||
if (targetBuffDataList[i].buffID == fishBuffTimeData.buffID && targetBuffDataList[i].sourceID == fishBuffTimeData.sourceID)
|
||||
{
|
||||
targetBuffDataList[i] = fishBuffTimeData;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList));
|
||||
SaveStore.Write("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList)).RequireAccepted();
|
||||
return;
|
||||
}
|
||||
}
|
||||
targetBuffDataList.Add(fishBuffTimeData);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList));
|
||||
SaveStore.Write("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -307,7 +309,7 @@ public class BuffDataCenter
|
||||
public void ClearTargetBuff()
|
||||
{
|
||||
targetBuffDataList.Clear();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList));
|
||||
SaveStore.Write("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList)).RequireAccepted();
|
||||
}
|
||||
/// <summary>
|
||||
/// CollectionTargetWeight的特殊处理
|
||||
@@ -345,7 +347,7 @@ public class BuffDataCenter
|
||||
else if (fishItemId == eTKeepsake.FishIDList[collectionTargetWeight.TargetFishIndex - 1])
|
||||
{
|
||||
item.isEnd = true;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList));
|
||||
SaveStore.Write("TargetBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(targetBuffDataList)).RequireAccepted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -455,7 +457,7 @@ public class BuffDataCenter
|
||||
fishBuffTimeData.addDown = buff.CountDown;
|
||||
showFishBuffIds.Add(fishBuffTimeData);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("GlobalBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(globalBuffDataList));
|
||||
SaveStore.Write("GlobalBuffDataList", Newtonsoft.Json.JsonConvert.SerializeObject(globalBuffDataList)).RequireAccepted();
|
||||
GContext.Publish(new AddGlobalBuffEvent(buffID));
|
||||
}
|
||||
}
|
||||
@@ -559,7 +561,7 @@ public class BuffDataCenter
|
||||
}
|
||||
AddGlobalBuff(buff.BuffID);
|
||||
fishDailyBuff.isEnd = false;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FishDailyBuff", Newtonsoft.Json.JsonConvert.SerializeObject(fishDailyBuff));
|
||||
SaveStore.Write("FishDailyBuff", Newtonsoft.Json.JsonConvert.SerializeObject(fishDailyBuff)).RequireAccepted();
|
||||
return fishDailyBuff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Activity.Services;
|
||||
using Activity.Services;
|
||||
using asap.core;
|
||||
using Assets.Scripts.UI.SocialRush;
|
||||
using cfg;
|
||||
@@ -56,6 +56,17 @@ namespace GameCore
|
||||
{
|
||||
public partial class FishingEventData : IDisposable
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore boundSaveStore;
|
||||
[Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore
|
||||
{
|
||||
get => boundSaveStore;
|
||||
set
|
||||
{
|
||||
ThanksGivingPackData.BindSaveStore(value);
|
||||
ChainPackWithProgressMigrationData.BindSaveStore(value);
|
||||
boundSaveStore = value;
|
||||
}
|
||||
}
|
||||
private cfg.Tables _tables;
|
||||
private MMTService _mmtService;
|
||||
private IEventTokenService _eventTokenService;
|
||||
@@ -578,7 +589,7 @@ namespace GameCore
|
||||
id = t.ID,
|
||||
endTime = ZZTimeHelper.UtcNow().UtcNowOffset().AddSeconds(fixedTime.StartTime).ToString(),
|
||||
};
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FixedTimeEventDic", JsonMapper.ToJson(fixedTimeEventDic));
|
||||
playerSaveStore.Write("FixedTimeEventDic", JsonMapper.ToJson(fixedTimeEventDic)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
switch (t.Type)
|
||||
@@ -846,7 +857,7 @@ namespace GameCore
|
||||
|
||||
private bool Condition_NoRechargeSeconds(int timeSeconds)
|
||||
{
|
||||
var lastPaymentStr = PlayFabMgr.Instance.GetLocalData("LastPaymentTime");
|
||||
var lastPaymentStr = playerSaveStore.Read("LastPaymentTime").ValueOrThrow();
|
||||
DateTime curTime = ZZTimeHelper.UtcNow().UtcNowOffset();
|
||||
DateTime endTime = curTime;
|
||||
if (string.IsNullOrEmpty(lastPaymentStr) || !lastPaymentStr.Contains("__"))
|
||||
@@ -866,7 +877,8 @@ namespace GameCore
|
||||
}
|
||||
public static bool Condition_NoRechargeDay(int timeDay = 7)
|
||||
{
|
||||
var lastPaymentStr = PlayFabMgr.Instance.GetLocalData("LastPaymentTime");
|
||||
var store = GContext.container.Resolve<FishingEventData>().playerSaveStore;
|
||||
var lastPaymentStr = store.Read("LastPaymentTime").ValueOrThrow();
|
||||
if (!string.IsNullOrEmpty(lastPaymentStr) && lastPaymentStr.Contains("__"))
|
||||
return false;
|
||||
DateTime curTime = ZZTimeHelper.UtcNow();
|
||||
@@ -1052,7 +1064,7 @@ namespace GameCore
|
||||
case 2:
|
||||
// Debug.Log($"[EventBreak] Id {e.ID} activated.");
|
||||
EventBreakAct.Ctx = EventBreakTableContext.ReadTables(e.ID, GContext.container.Resolve<Tables>());
|
||||
var playfabData = EventBreakPfData.Deserialize(PlayFabMgr.Instance.GetLocalData(EventBreakPfData.PfKey));
|
||||
var playfabData = EventBreakPfData.Deserialize(playerSaveStore.Read(EventBreakPfData.PfKey).ValueOrThrow());
|
||||
var eventBreakModel = GContext.container.Resolve<DrillModel>();
|
||||
if (eventBreakModel == null)
|
||||
{
|
||||
@@ -1074,7 +1086,7 @@ namespace GameCore
|
||||
break;
|
||||
case 4:
|
||||
var canModel = GContext.container.Resolve<EventCanModel>();
|
||||
var ecPlayfabString = PlayFabMgr.Instance.GetLocalData(EventCanPlayfabData.PlayFabKey);
|
||||
var ecPlayfabString = playerSaveStore.Read(EventCanPlayfabData.PlayFabKey).ValueOrThrow();
|
||||
var ecPpString = PlayerPrefs.GetString(EventCanPlayerPreferenceData.PlayerPrefsKey);
|
||||
var ecPlayfabData = EventCanPlayfabData.Deserialize(ecPlayfabString);
|
||||
var ecPlayerPrefsData = EventCanPlayerPreferenceData.Deserialize(ecPpString);
|
||||
@@ -1150,7 +1162,7 @@ namespace GameCore
|
||||
SetTurntable(t);
|
||||
break;
|
||||
case 3:
|
||||
var pfString = PlayFabMgr.Instance.GetLocalData(EventLuckMagicPlayfabData.Key);
|
||||
var pfString = playerSaveStore.Read(EventLuckMagicPlayfabData.Key).ValueOrThrow();
|
||||
var pfData = EventLuckMagicPlayfabData.Deserialize(pfString);
|
||||
var ppString = PlayerPrefs.GetString(EventLuckMagicPlayerPreferenceData.Key);
|
||||
var ppData = EventLuckMagicPlayerPreferenceData.Deserialize(ppString);
|
||||
@@ -1339,7 +1351,7 @@ namespace GameCore
|
||||
SaveTransitionData(turntableEvent.ID, TurntableCoupon);
|
||||
}
|
||||
TurntableRed();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TurntableRoll", TurntableCoupon.ToString());
|
||||
playerSaveStore.Write("TurntableRoll", TurntableCoupon.ToString()).RequireAccepted();
|
||||
}
|
||||
public void RewardTurntableRoll(int value, bool remote = true)
|
||||
{
|
||||
@@ -1358,7 +1370,7 @@ namespace GameCore
|
||||
.AddContent("change_num", value);
|
||||
}
|
||||
#endif
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TurntableRoll", TurntableCoupon.ToString(), remote);
|
||||
playerSaveStore.Write("TurntableRoll", TurntableCoupon.ToString(), remote).RequireAccepted();
|
||||
}
|
||||
|
||||
public void TurntableRed()
|
||||
@@ -1443,7 +1455,7 @@ namespace GameCore
|
||||
|
||||
void SetLimitedTimeEventDic()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("LimitedTimeEventDic", Newtonsoft.Json.JsonConvert.SerializeObject(limitedTimeEventDic));
|
||||
playerSaveStore.Write("LimitedTimeEventDic", Newtonsoft.Json.JsonConvert.SerializeObject(limitedTimeEventDic)).RequireAccepted();
|
||||
}
|
||||
|
||||
#region 目标奖励活动
|
||||
@@ -1615,10 +1627,14 @@ namespace GameCore
|
||||
|
||||
public async Task<bool> CheckResourceLoadQueue(string key, List<string> label)
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
if (!store.IsCurrent) return false;
|
||||
if (!collectingTargetResoure)
|
||||
{
|
||||
ILoadResourceService loadResourceService = GContext.container.Resolve<ILoadResourceService>();
|
||||
collectingTargetResoure = await loadResourceService.CheckResourceLoadQueue(key, label);
|
||||
var loaded = await loadResourceService.CheckResourceLoadQueue(key, label);
|
||||
if (!store.IsCurrent) return false;
|
||||
collectingTargetResoure = loaded;
|
||||
}
|
||||
return collectingTargetResoure;
|
||||
}
|
||||
@@ -2241,8 +2257,8 @@ namespace GameCore
|
||||
|
||||
public void UpdateTurnTableData()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount));
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelLevelFreeCount", freecount.ToString());
|
||||
playerSaveStore.Write("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount)).RequireAccepted();
|
||||
playerSaveStore.Write("WheelLevelFreeCount", freecount.ToString()).RequireAccepted();
|
||||
}
|
||||
/// <summary>
|
||||
/// Add item by dropId and multiplier, or just return that item without giving to player, if doAdd is false.
|
||||
@@ -2263,10 +2279,10 @@ namespace GameCore
|
||||
{
|
||||
IncreaseScore(score * multiplier);
|
||||
WheelOperateCount++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelOperateCount", WheelOperateCount.ToString());
|
||||
playerSaveStore.Write("WheelOperateCount", WheelOperateCount.ToString()).RequireAccepted();
|
||||
AllWheelOperateCount += multiplier;
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("AllWheelOperateCount", AllWheelOperateCount.ToString());
|
||||
playerSaveStore.Write("AllWheelOperateCount", AllWheelOperateCount.ToString()).RequireAccepted();
|
||||
}
|
||||
public void IncreaseScore(int score)
|
||||
{
|
||||
@@ -2283,7 +2299,7 @@ namespace GameCore
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount));
|
||||
playerSaveStore.Write("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount)).RequireAccepted();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2305,7 +2321,7 @@ namespace GameCore
|
||||
{
|
||||
freecount = 0;
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelLevelFreeCount", freecount.ToString());
|
||||
playerSaveStore.Write("WheelLevelFreeCount", freecount.ToString()).RequireAccepted();
|
||||
}
|
||||
//转盘等级增加函数
|
||||
public void IncreaseWheelLevel()
|
||||
@@ -2325,7 +2341,7 @@ namespace GameCore
|
||||
// 更新积分进度
|
||||
WheelLevelCount[wheelLevel.Level] = progress;
|
||||
TurntableRed();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount));
|
||||
playerSaveStore.Write("WheelLevelCount", JsonMapper.ToJson(WheelLevelCount)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace GameCore
|
||||
}
|
||||
public class GuideDataCenter : IDisposable
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
Tables _tables;
|
||||
PlayerData playerData;
|
||||
public GuideDataCenter(cfg.Tables tables, PlayerData playerData)
|
||||
@@ -94,7 +95,10 @@ namespace GameCore
|
||||
}
|
||||
public async void Init()
|
||||
{
|
||||
guidanceDefineSetting = (GuidanceDefineSetting)await Addressables.LoadAssetAsync<object>("GuidanceConfig");
|
||||
var store = playerSaveStore;
|
||||
var setting = (GuidanceDefineSetting)await Addressables.LoadAssetAsync<object>("GuidanceConfig");
|
||||
if (disposed || !store.IsCurrent) return;
|
||||
guidanceDefineSetting = setting;
|
||||
if (guidanceDefineSetting != null)
|
||||
{
|
||||
bool isUpdate = false;
|
||||
@@ -495,7 +499,9 @@ namespace GameCore
|
||||
}
|
||||
async void TriggerGuide(string groupName, string curPanelName, GuidanceGroupDefine guidanceGroupDefine)
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
await System.Threading.Tasks.Task.Delay(200);
|
||||
if (disposed || !store.IsCurrent) return;
|
||||
curSaveData = new GuideSaveData();
|
||||
curSaveData.groupName = groupName;
|
||||
GuideSaveDataDic[groupName] = curSaveData;
|
||||
@@ -642,6 +648,7 @@ namespace GameCore
|
||||
}
|
||||
async void ShowPanel(string PanelName)
|
||||
{
|
||||
if (disposed || !playerSaveStore.IsCurrent) return;
|
||||
if (curDefine.fingerType != FingerType.None)
|
||||
{
|
||||
disposable3 = GContext.OnEvent<GuideNextEvent>().Subscribe(GuideNextEvent);
|
||||
@@ -652,10 +659,13 @@ namespace GameCore
|
||||
|
||||
public async void ShowGuidancePopupPanel(string nodeName)
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
if (disposed || !store.IsCurrent) return;
|
||||
popupPanelNode = nodeName;
|
||||
if (!string.IsNullOrEmpty(popupPanelNode))
|
||||
{
|
||||
await UIManager.Instance.ShowUI(UITypes.GuidancePopupPanel);
|
||||
if (disposed || !store.IsCurrent) return;
|
||||
UIManager.Instance.HideUI(UITypes.GuidancePanel);
|
||||
}
|
||||
}
|
||||
@@ -712,11 +722,13 @@ namespace GameCore
|
||||
{
|
||||
List<string> strings = GuideSaveDataDic.Select(kv => kv.Key + "|" + kv.Value.guideSubIndex + "|" + (kv.Value.isFinish ? "1" : "0")).ToList();
|
||||
string value = string.Join(";", strings);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("GuideSaveDataNew", value);
|
||||
playerSaveStore.Write("GuideSaveDataNew", value).RequireAccepted();
|
||||
}
|
||||
|
||||
bool disposed;
|
||||
public void Dispose()
|
||||
{
|
||||
disposed = true;
|
||||
disposable?.Dispose();
|
||||
disposable = null;
|
||||
disposable2?.Dispose();
|
||||
|
||||
@@ -2,9 +2,11 @@ using asap.core;
|
||||
using asap.playfab.async;
|
||||
using cfg;
|
||||
using game;
|
||||
using game.PlayerDataStorage;
|
||||
using PlayFab.ClientModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using tysdk;
|
||||
@@ -162,6 +164,27 @@ namespace GameCore
|
||||
{
|
||||
Statistics.Add(new StatisticUpdate() { StatisticName = names[i], Value = value[i] });
|
||||
}
|
||||
if (userService is KVUserService kvUser)
|
||||
{
|
||||
var store = kvUser.SaveStore;
|
||||
var writtenNames = new HashSet<string>(StringComparer.Ordinal);
|
||||
bool accepted = false;
|
||||
foreach (var statistic in Statistics)
|
||||
{
|
||||
if (!writtenNames.Add(statistic.StatisticName)) continue;
|
||||
var write = store.Write(statistic.StatisticName, statistic.Value.ToString(CultureInfo.InvariantCulture));
|
||||
if (write.Accepted) accepted = true;
|
||||
else Debug.LogError("KV statistic write failed: " + statistic.StatisticName + ": " + write.Error);
|
||||
}
|
||||
if (accepted)
|
||||
{
|
||||
var confirmation = await store.FlushAsync();
|
||||
if (confirmation.Status != PlayerSaveStatus.Confirmed)
|
||||
Debug.LogError("KV statistic save not confirmed: " + string.Join(",", writtenNames) +
|
||||
": " + confirmation.Status + ": " + confirmation.Error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
UpdatePlayerStatisticsRequest request = new UpdatePlayerStatisticsRequest()
|
||||
{
|
||||
Statistics = Statistics,
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace GameCore
|
||||
{
|
||||
public class PlayerData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
MMTService _MMService;
|
||||
public PlayerData(cfg.Tables tables, MMTService mmService)
|
||||
@@ -336,7 +337,7 @@ namespace GameCore
|
||||
if (!newRodList.Contains(id))
|
||||
{
|
||||
newRodList.Add(id);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("NewRodList", JsonMapper.ToJson(newRodList));
|
||||
playerSaveStore.Write("NewRodList", JsonMapper.ToJson(newRodList)).RequireAccepted();
|
||||
if (addShowNewRod)
|
||||
{
|
||||
showNewRodList.Add(id);
|
||||
@@ -367,7 +368,7 @@ namespace GameCore
|
||||
public void RewardNewRod(int id)
|
||||
{
|
||||
newRodList.Remove(id);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("NewRodList", JsonMapper.ToJson(newRodList));
|
||||
playerSaveStore.Write("NewRodList", JsonMapper.ToJson(newRodList)).RequireAccepted();
|
||||
GContext.container.Resolve<PlayerFishData>().SetRedPoint();
|
||||
}
|
||||
|
||||
@@ -1233,7 +1234,7 @@ namespace GameCore
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) return game.PlayerDataStorage.PlayerKVGameplayLoop.Write("NewPlayerDataDic",Newtonsoft.Json.JsonConvert.SerializeObject(NewPlayerDataDic),remote);
|
||||
#endif
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("NewPlayerDataDic", Newtonsoft.Json.JsonConvert.SerializeObject(NewPlayerDataDic), remote);
|
||||
playerSaveStore.Write("NewPlayerDataDic", Newtonsoft.Json.JsonConvert.SerializeObject(NewPlayerDataDic), remote).RequireAccepted();
|
||||
return null;
|
||||
}
|
||||
public void Init()
|
||||
@@ -1392,13 +1393,14 @@ namespace GameCore
|
||||
}
|
||||
public async void CoRecoveryEnergy(int energyRecoveryTime)
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
tokenSource?.Cancel();
|
||||
tokenSource = new System.Threading.CancellationTokenSource();
|
||||
var token = tokenSource.Token;
|
||||
_isRecoveryEnergy = true;
|
||||
int initEnergyRestorationSpeed = _tables.TbGlobalConfig.InitEnergyRestorationSpeed * 60;
|
||||
|
||||
while (Energy < MaxEnergy && !token.IsCancellationRequested)
|
||||
while (Energy < MaxEnergy && !token.IsCancellationRequested && store.IsCurrent)
|
||||
{
|
||||
if (energyRecoveryTime >= initEnergyRestorationSpeed)
|
||||
{
|
||||
@@ -1431,7 +1433,7 @@ namespace GameCore
|
||||
SavePlayerData();
|
||||
}
|
||||
await Awaiters.Seconds(1);
|
||||
if (token.IsCancellationRequested)
|
||||
if (token.IsCancellationRequested || !store.IsCurrent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1502,14 +1504,17 @@ namespace GameCore
|
||||
|
||||
public async void OpenAppraisePopupPanel(int fishId)
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
if (!store.IsCurrent) return;
|
||||
if (lastMapId != _tables.TbMapData.DataList[0].ID && !IsOpenAppraise)
|
||||
{
|
||||
var fishData = _tables.TbFishData.GetOrDefault(fishId);
|
||||
if (fishData != null && fishData.Quality >= 5)
|
||||
{
|
||||
await UIManager.Instance.ShowUI(UITypes.AppraisePopupPanel);
|
||||
if (!store.IsCurrent) return;
|
||||
IsOpenAppraise = true;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("IsOpenAppraise", "true");
|
||||
playerSaveStore.Write("IsOpenAppraise", "true").RequireAccepted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace GameCore
|
||||
}
|
||||
public partial class PlayerFishData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
private ICustomServerMgr customServerMgr;
|
||||
public PlayerFishData(cfg.Tables tables, ICustomServerMgr customServerMgr)
|
||||
@@ -426,7 +427,7 @@ namespace GameCore
|
||||
{
|
||||
GContext.container.Resolve<PlayerData>().AddNewRod(id);
|
||||
rodData.Add(id, 0);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodData", JsonMapper.ToJson(rodData));
|
||||
playerSaveStore.Write("RodData", JsonMapper.ToJson(rodData)).RequireAccepted();
|
||||
//鱼竿红点数据修改
|
||||
RedPointManager.Instance.SetRedPointState(RedPointName.Home_Rod, true);
|
||||
}
|
||||
@@ -527,7 +528,7 @@ namespace GameCore
|
||||
.AddContent("rod_chips_consume", 0);
|
||||
}
|
||||
#endif
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodLevelData", JsonMapper.ToJson(rodLevelData));
|
||||
playerSaveStore.Write("RodLevelData", JsonMapper.ToJson(rodLevelData)).RequireAccepted();
|
||||
|
||||
GContext.container.Resolve<PlayerData>().SetPearl(GContext.container.Resolve<PlayerData>().pearl - count);
|
||||
}
|
||||
@@ -586,7 +587,7 @@ namespace GameCore
|
||||
}
|
||||
//鱼竿红点数据修改
|
||||
CheckRodRedPointUp();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodData", JsonMapper.ToJson(rodData));
|
||||
playerSaveStore.Write("RodData", JsonMapper.ToJson(rodData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public int GetRodPiece(int id)
|
||||
@@ -616,7 +617,7 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodData", JsonMapper.ToJson(rodData));
|
||||
playerSaveStore.Write("RodData", JsonMapper.ToJson(rodData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public void GMSetStarAll(int lv)
|
||||
@@ -642,7 +643,7 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodData", JsonMapper.ToJson(rodData));
|
||||
playerSaveStore.Write("RodData", JsonMapper.ToJson(rodData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public void GMAddAllFishMastery(bool all = false)
|
||||
@@ -1221,7 +1222,7 @@ namespace GameCore
|
||||
void MapNewUpdateUserDataValue(int mapID, Dictionary<int, FishWeightData> keyValuePairs)
|
||||
{
|
||||
Dictionary<int, string> mapData = keyValuePairs.ToDictionary(_ => _.Key, _ => _.Value.Serialize());
|
||||
PlayFabMgr.Instance.UpdateUserDataValue($"Map_5_{mapID}", JsonMapper.ToJson(mapData));
|
||||
playerSaveStore.Write($"Map_5_{mapID}", JsonMapper.ToJson(mapData)).RequireAccepted();
|
||||
}
|
||||
public int GetFishLevelByMap(int mapId)
|
||||
{
|
||||
@@ -1354,10 +1355,10 @@ namespace GameCore
|
||||
if (fishId != 0)
|
||||
{
|
||||
fishSwimToMapCount[id] = 0;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FishSwimToMapCount", JsonMapper.ToJson(fishSwimToMapCount));
|
||||
playerSaveStore.Write("FishSwimToMapCount", JsonMapper.ToJson(fishSwimToMapCount)).RequireAccepted();
|
||||
}
|
||||
fishSwimToMap[id] = fishId;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FishSwimToMap", JsonMapper.ToJson(fishSwimToMap));
|
||||
playerSaveStore.Write("FishSwimToMap", JsonMapper.ToJson(fishSwimToMap)).RequireAccepted();
|
||||
}
|
||||
public void SetFishSwimToMapCount(int id, int count)
|
||||
{
|
||||
@@ -1368,7 +1369,7 @@ namespace GameCore
|
||||
{
|
||||
SetFishSwimToMap(id, 0);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FishSwimToMapCount", JsonMapper.ToJson(fishSwimToMapCount));
|
||||
playerSaveStore.Write("FishSwimToMapCount", JsonMapper.ToJson(fishSwimToMapCount)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
//===========================鱼图鉴===========================
|
||||
@@ -1438,7 +1439,7 @@ namespace GameCore
|
||||
}
|
||||
|
||||
GContext.container.Resolve<PlayerItemData>().AddItemByDropList(dorpList, null);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("MapProgress", Newtonsoft.Json.JsonConvert.SerializeObject(mapProgress));
|
||||
playerSaveStore.Write("MapProgress", Newtonsoft.Json.JsonConvert.SerializeObject(mapProgress)).RequireAccepted();
|
||||
}
|
||||
|
||||
public int GetAllPTSByMap(int mapID)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using cfg;
|
||||
using cfg;
|
||||
using asap.core;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using CodeStage.AntiCheat.ObscuredTypes;
|
||||
using game;
|
||||
@@ -73,6 +73,13 @@ namespace GameCore
|
||||
}
|
||||
public partial class PlayerShopData : IDisposable
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore boundSaveStore;
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore
|
||||
{
|
||||
get => boundSaveStore;
|
||||
set { CouponData.BindSaveStore(value); boundSaveStore = value; }
|
||||
}
|
||||
|
||||
[Inject]
|
||||
public cfg.Tables _tables { get; set; }
|
||||
[Inject]
|
||||
@@ -250,7 +257,7 @@ namespace GameCore
|
||||
public void AddVoucher(int value)
|
||||
{
|
||||
Voucher = Voucher + value;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("Voucher", Voucher.ToString());
|
||||
SaveStore.Write("Voucher", Voucher.ToString()).RequireAccepted();
|
||||
}
|
||||
public void Init()
|
||||
{
|
||||
@@ -369,10 +376,10 @@ namespace GameCore
|
||||
if (Voucher >= iAPItemList.CostToken)
|
||||
{
|
||||
Voucher = Voucher - iAPItemList.CostToken;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("Voucher", Voucher.ToString());
|
||||
SaveStore.Write("Voucher", Voucher.ToString()).RequireAccepted();
|
||||
//二次弹窗
|
||||
//回调
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{0}");
|
||||
SaveStore.Write("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{0}").RequireAccepted();
|
||||
BuySuccess(buyType, iAPItemList, itemDataGift, rewardShowType, true);
|
||||
OrderManager.OrderManager.OnOrderSuccess(buyType, iAPItemList, itemDataGift, rewardShowType, true);
|
||||
if (!buyType.NoShow)
|
||||
@@ -429,7 +436,7 @@ namespace GameCore
|
||||
|
||||
if (result.isSuccess)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{sku.price}");
|
||||
SaveStore.Write("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{sku.price}").RequireAccepted();
|
||||
BuySuccess(buyType, iAPItemList, itemDataGift, rewardShowType);
|
||||
OrderManager.OrderManager.OnOrderSuccess(buyType, iAPItemList, itemDataGift, rewardShowType);
|
||||
if (!buyType.NoShow)
|
||||
@@ -604,7 +611,7 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{data.ProdPrice}");
|
||||
SaveStore.Write("LastPaymentTime", $"{ZZTimeHelper.UtcNow()}__{data.ProdPrice}").RequireAccepted();
|
||||
BuySuccess(data.BuyType, iAPItemList, itemDataGift, data.ShowType);
|
||||
if (data.BuyType.extraPurcheData != null)
|
||||
{
|
||||
@@ -628,7 +635,7 @@ namespace GameCore
|
||||
buyData[0] += iAPItemList.PaymentAmount;
|
||||
}
|
||||
buyData.Add(iAPItemList.ID);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("BuyData", JsonMapper.ToJson(buyData));
|
||||
SaveStore.Write("BuyData", JsonMapper.ToJson(buyData)).RequireAccepted();
|
||||
#if AGG
|
||||
GEvent.SetUserProp("Total_consumption", buyData[0]);
|
||||
#endif
|
||||
@@ -699,7 +706,7 @@ namespace GameCore
|
||||
}
|
||||
TurntableAdData = null;
|
||||
shopPackDailyBuyCount["0"] = ZZTimeHelper.UtcNow().UtcNowOffset().DayOfYear;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ShopPackBuyCount", JsonMapper.ToJson(shopPackDailyBuyCount));
|
||||
SaveStore.Write("ShopPackBuyCount", JsonMapper.ToJson(shopPackDailyBuyCount)).RequireAccepted();
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -729,7 +736,7 @@ namespace GameCore
|
||||
{
|
||||
shopPackDailyBuyCount["0"] = ZZTimeHelper.UtcNow().UtcNowOffset().DayOfYear;
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ShopPackBuyCount", JsonMapper.ToJson(shopPackDailyBuyCount));
|
||||
SaveStore.Write("ShopPackBuyCount", JsonMapper.ToJson(shopPackDailyBuyCount)).RequireAccepted();
|
||||
}
|
||||
public int GetShopPackBuyCount(int id)
|
||||
{
|
||||
@@ -786,7 +793,7 @@ namespace GameCore
|
||||
{
|
||||
shopGiftBuyCount.Add(id, count);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ShopGiftBuyCount", JsonMapper.ToJson(shopGiftBuyCount));
|
||||
SaveStore.Write("ShopGiftBuyCount", JsonMapper.ToJson(shopGiftBuyCount)).RequireAccepted();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -855,7 +862,7 @@ namespace GameCore
|
||||
index = 0,
|
||||
time = time.ToString()
|
||||
};
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ChainPackDataNew", JsonMapper.ToJson(ChainPackData));
|
||||
SaveStore.Write("ChainPackDataNew", JsonMapper.ToJson(ChainPackData)).RequireAccepted();
|
||||
chainPackM = null;
|
||||
}
|
||||
if (chainPackM == null)
|
||||
@@ -897,7 +904,7 @@ namespace GameCore
|
||||
{
|
||||
AddAllPackCount(chainPackM.ID, 1);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ChainPackDataNew", JsonMapper.ToJson(ChainPackData));
|
||||
SaveStore.Write("ChainPackDataNew", JsonMapper.ToJson(ChainPackData)).RequireAccepted();
|
||||
//链式礼包 特殊处理
|
||||
GContext.Publish(new TargetEvent(chainPackM.ID, 3, 10));
|
||||
}
|
||||
@@ -927,7 +934,7 @@ namespace GameCore
|
||||
shopAllPackBuyCount.Add(id, count);
|
||||
}
|
||||
GContext.Publish(new ConditionTypeEvent(ConditionType.BuyPack, count));
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("ShopAllPackBuyCount", JsonMapper.ToJson(shopAllPackBuyCount));
|
||||
SaveStore.Write("ShopAllPackBuyCount", JsonMapper.ToJson(shopAllPackBuyCount)).RequireAccepted();
|
||||
}
|
||||
#endregion
|
||||
//========================================礼包========================================
|
||||
@@ -965,7 +972,7 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
#endif
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("AdvertAllCount", JsonMapper.ToJson(advertCount));
|
||||
SaveStore.Write("AdvertAllCount", JsonMapper.ToJson(advertCount)).RequireAccepted();
|
||||
GContext.Publish(new ResAddEvent(1006));
|
||||
}
|
||||
public int GetAdticketCount()
|
||||
@@ -991,7 +998,7 @@ namespace GameCore
|
||||
{
|
||||
advertCount.Add(id, 1);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("AdvertAllCount", JsonMapper.ToJson(advertCount));
|
||||
SaveStore.Write("AdvertAllCount", JsonMapper.ToJson(advertCount)).RequireAccepted();
|
||||
return advertCount[id];
|
||||
}
|
||||
public void ClearAdvertCount()
|
||||
@@ -1006,7 +1013,7 @@ namespace GameCore
|
||||
advertCount[-1] = ZZTimeHelper.UtcNow().UtcNowOffset().DayOfYear;
|
||||
advertCount[0] = allCount;
|
||||
advertCount[-2] = ticket;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("AdvertAllCount", JsonMapper.ToJson(advertCount));
|
||||
SaveStore.Write("AdvertAllCount", JsonMapper.ToJson(advertCount)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1050,7 +1057,7 @@ namespace GameCore
|
||||
AdConfig adConfig1 = adConfigs[VIPAdPackData.index - 1];
|
||||
VIPAdPackData.cdTime = ZZTimeHelper.UtcNow().UtcNowOffset().AddSeconds(adConfig1.Interval).ToString();
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("VIPAdPackData", JsonMapper.ToJson(VIPAdPackData));
|
||||
SaveStore.Write("VIPAdPackData", JsonMapper.ToJson(VIPAdPackData)).RequireAccepted();
|
||||
//GContext.Publish(new VIPAdPackDataEvent());
|
||||
}
|
||||
public DateTime GetVIPAdPackTime()
|
||||
@@ -1082,7 +1089,7 @@ namespace GameCore
|
||||
VIPAdPackData = new AdvertData();
|
||||
VIPAdPackData.day = ZZTimeHelper.UtcNow().UtcNowOffset().DayOfYear;
|
||||
VIPAdPackData.isOpen = true;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("VIPAdPackData", JsonMapper.ToJson(VIPAdPackData));
|
||||
SaveStore.Write("VIPAdPackData", JsonMapper.ToJson(VIPAdPackData)).RequireAccepted();
|
||||
}
|
||||
public bool IsOpenAdPack()
|
||||
{
|
||||
@@ -1139,7 +1146,7 @@ namespace GameCore
|
||||
// {
|
||||
// isOverForToday = true;
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TurntableAdData", Newtonsoft.Json.JsonConvert.SerializeObject(TurntableAdData));
|
||||
SaveStore.Write("TurntableAdData", Newtonsoft.Json.JsonConvert.SerializeObject(TurntableAdData)).RequireAccepted();
|
||||
// GContext.Publish(new VIPAdPackDataEvent());
|
||||
}
|
||||
public bool IsTurntableAdMaxOut()
|
||||
@@ -1233,7 +1240,7 @@ namespace GameCore
|
||||
{
|
||||
_diamondShopItemRecords[itemShopId].hasBought = 1;
|
||||
SetItemShopRedPoint();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("DiamondShopItemRecords", JsonConvert.SerializeObject(_diamondShopItemRecords));
|
||||
SaveStore.Write("DiamondShopItemRecords", JsonConvert.SerializeObject(_diamondShopItemRecords)).RequireAccepted();
|
||||
}
|
||||
|
||||
|
||||
@@ -1248,7 +1255,7 @@ namespace GameCore
|
||||
{
|
||||
RefreshItemShop();
|
||||
_diamondShopRefreshCount++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("DiamondShopRefreshCount", _diamondShopRefreshCount.ToString());
|
||||
SaveStore.Write("DiamondShopRefreshCount", _diamondShopRefreshCount.ToString()).RequireAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1288,8 +1295,8 @@ namespace GameCore
|
||||
_diamondShopRefreshTime = new DateTime(now.Year, now.Month, now.Day).AddDays(1) + timeSpan;
|
||||
|
||||
_diamondShopRefreshCount = 0;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("DiamondShopRefreshCount", _diamondShopRefreshCount.ToString());
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("DiamondShopRefreshTime", _diamondShopRefreshTime.ToString());
|
||||
SaveStore.Write("DiamondShopRefreshCount", _diamondShopRefreshCount.ToString()).RequireAccepted();
|
||||
SaveStore.Write("DiamondShopRefreshTime", _diamondShopRefreshTime.ToString()).RequireAccepted();
|
||||
RefreshItemShop();
|
||||
}
|
||||
private void RefreshItemShop()
|
||||
@@ -1364,7 +1371,7 @@ namespace GameCore
|
||||
}
|
||||
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("DiamondShopItemRecords", JsonConvert.SerializeObject(_diamondShopItemRecords));
|
||||
SaveStore.Write("DiamondShopItemRecords", JsonConvert.SerializeObject(_diamondShopItemRecords)).RequireAccepted();
|
||||
SetItemShopRedPoint();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using LitJson;
|
||||
@@ -29,6 +29,8 @@ namespace GameCore
|
||||
}
|
||||
public class SigninData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private cfg.Tables _tables;
|
||||
public SigninData(cfg.Tables tables)
|
||||
{
|
||||
@@ -102,7 +104,7 @@ namespace GameCore
|
||||
}
|
||||
if (isSave)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("MonthlySignEvent", JsonMapper.ToJson(_monthlySignEvent));
|
||||
SaveStore.Write("MonthlySignEvent", JsonMapper.ToJson(_monthlySignEvent)).RequireAccepted();
|
||||
}
|
||||
bool isReward = CanDailySign();
|
||||
if (isReward)
|
||||
@@ -154,7 +156,7 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
//GContext.Publish(new ShowData());
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("MonthlySignEvent", JsonMapper.ToJson(_monthlySignEvent));
|
||||
SaveStore.Write("MonthlySignEvent", JsonMapper.ToJson(_monthlySignEvent)).RequireAccepted();
|
||||
GContext.Publish(new OnSignEvent() { itemDataList = monthlySignReward });
|
||||
}
|
||||
return isSign;
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace GameCore
|
||||
}
|
||||
public class SmallGameData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
IUserService userService;
|
||||
ICustomServerMgr customServerMgr;
|
||||
@@ -76,7 +77,7 @@ namespace GameCore
|
||||
public void SaveHeistGameCount()
|
||||
{
|
||||
_heistGameCount++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("HeistGameCount", _heistGameCount.ToString());
|
||||
playerSaveStore.Write("HeistGameCount", _heistGameCount.ToString()).RequireAccepted();
|
||||
}
|
||||
public void SetBombGameCount(int value)
|
||||
{
|
||||
@@ -85,7 +86,7 @@ namespace GameCore
|
||||
public void SaveBombGameCount()
|
||||
{
|
||||
_bombGameCount++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("BombGameCount", _bombGameCount.ToString());
|
||||
playerSaveStore.Write("BombGameCount", _bombGameCount.ToString()).RequireAccepted();
|
||||
}
|
||||
public void SetFishHuntGameCount(int value)
|
||||
{
|
||||
@@ -94,7 +95,7 @@ namespace GameCore
|
||||
public void SaveFishHuntGameCount()
|
||||
{
|
||||
_fishHuntGameCount++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FishHuntGameCount", _fishHuntGameCount.ToString());
|
||||
playerSaveStore.Write("FishHuntGameCount", _fishHuntGameCount.ToString()).RequireAccepted();
|
||||
}
|
||||
#region 小游戏仇人
|
||||
public List<OpponentItemData> opponentItemDatas = new List<OpponentItemData>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using LitJson;
|
||||
@@ -38,6 +38,8 @@ namespace GameCore
|
||||
}
|
||||
public class TriggerPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
Tables _tables;
|
||||
PlayerShopData playerShopData;
|
||||
public TriggerPackData(Tables tables)
|
||||
@@ -220,7 +222,7 @@ namespace GameCore
|
||||
id = t.ID,
|
||||
endTime = dateTime.AddSeconds(fixedTime.EndTime).ToString(),
|
||||
};
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic));
|
||||
SaveStore.Write("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic)).RequireAccepted();
|
||||
|
||||
TriggerPackBuyData _newSignEvent = null;
|
||||
for (int i = 0; i < triggerPackList.Count; i++)
|
||||
@@ -251,7 +253,7 @@ namespace GameCore
|
||||
_newSignEvent.vipLevel = GetVIPLevel(t.PackType);
|
||||
}
|
||||
GContext.container.Resolve<IFaceUIService>().AddGiftFaceUIOnLogin(_newSignEvent.ID, UITypes.AdsPackPanel, _newSignEvent.lastID);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TriggerPackDataList", JsonMapper.ToJson(triggerPackList));
|
||||
SaveStore.Write("TriggerPackDataList", JsonMapper.ToJson(triggerPackList)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +289,7 @@ namespace GameCore
|
||||
endTime = time,
|
||||
};
|
||||
fixedTimeShopDic[t.ID] = fixedTimeEvent;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic));
|
||||
SaveStore.Write("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic)).RequireAccepted();
|
||||
}
|
||||
else if (t.TimeDefinition is LimitedTime)
|
||||
{
|
||||
@@ -306,7 +308,7 @@ namespace GameCore
|
||||
};
|
||||
triggerPackList.Insert(0, _newSignEvent);
|
||||
playerShopData.AddShopPackDailyBuyCount(t.PackType, 1, false);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TriggerPackDataList", JsonMapper.ToJson(triggerPackList));
|
||||
SaveStore.Write("TriggerPackDataList", JsonMapper.ToJson(triggerPackList)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -337,7 +339,7 @@ namespace GameCore
|
||||
endTime = ZZTimeHelper.UtcNow().UtcNowOffset().AddSeconds(fixedTime.StartTime).ToString(),
|
||||
};
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic));
|
||||
SaveStore.Write("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic)).RequireAccepted();
|
||||
}
|
||||
if (FixedTimeEventExpired(t.ID))
|
||||
{
|
||||
@@ -370,7 +372,7 @@ namespace GameCore
|
||||
endTime = ZZTimeHelper.UtcNow().UtcNowOffset().AddSeconds(fixedTime.StartTime).ToString(),
|
||||
};
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic));
|
||||
SaveStore.Write("FixedTimeShopDic", JsonMapper.ToJson(fixedTimeShopDic)).RequireAccepted();
|
||||
}
|
||||
if (FixedTimeEventExpired(t.ID))
|
||||
{
|
||||
@@ -472,7 +474,7 @@ namespace GameCore
|
||||
}
|
||||
if (isUpdate)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("GiftVIPDData", JsonMapper.ToJson(giftVIPDData));
|
||||
SaveStore.Write("GiftVIPDData", JsonMapper.ToJson(giftVIPDData)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -516,7 +518,7 @@ namespace GameCore
|
||||
};
|
||||
}
|
||||
giftVIPDData[PackType] = giftVIPD;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("GiftVIPDData", JsonMapper.ToJson(giftVIPDData));
|
||||
SaveStore.Write("GiftVIPDData", JsonMapper.ToJson(giftVIPDData)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
#region 触发礼包
|
||||
@@ -573,7 +575,7 @@ namespace GameCore
|
||||
};
|
||||
triggerPackList.Insert(0, _newSignEvent);
|
||||
playerShopData.AddShopPackDailyBuyCount(t.PackType, 1, false);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TriggerPackDataList", JsonMapper.ToJson(triggerPackList));
|
||||
SaveStore.Write("TriggerPackDataList", JsonMapper.ToJson(triggerPackList)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
public void AddTriggerPackCount(int id)
|
||||
@@ -586,7 +588,7 @@ namespace GameCore
|
||||
{
|
||||
triggerPackList.Remove(triggerPackList[i]);
|
||||
}
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TriggerPackDataList", JsonMapper.ToJson(triggerPackList));
|
||||
SaveStore.Write("TriggerPackDataList", JsonMapper.ToJson(triggerPackList)).RequireAccepted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -641,7 +643,7 @@ namespace GameCore
|
||||
{
|
||||
triggerPackList.Remove(dailySignEvent);
|
||||
GContext.Publish(new TriggerPackEvent());
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("TriggerPackDataList", JsonMapper.ToJson(triggerPackList));
|
||||
SaveStore.Write("TriggerPackDataList", JsonMapper.ToJson(triggerPackList)).RequireAccepted();
|
||||
}
|
||||
return endTime - curTime;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using GameCore;
|
||||
using cfg;
|
||||
public class EventPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private struct Data
|
||||
{
|
||||
@@ -100,8 +101,8 @@ public class EventPackData
|
||||
}
|
||||
public void SaveEventPackData()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("EventPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data));
|
||||
playerSaveStore.Write("EventPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data)).RequireAccepted();
|
||||
}
|
||||
private void TriggerEventPack()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
@@ -100,6 +100,8 @@ namespace DataCenter
|
||||
// EventPartnerGather 管理器
|
||||
public class EventPartnerGatherManager : IAutoMatchManagerContext
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private const bool EnableTraceLogs = false;
|
||||
public const string SaveKey = "EventPartnerGatherData";
|
||||
internal static game.PlayerDataStorage.PlayerKVPartnerState DecodeForKVLoad(
|
||||
@@ -864,7 +866,7 @@ namespace DataCenter
|
||||
Trace($"SaveData eventId={EventId}");
|
||||
#endif
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(SaveKey, JsonConvert.SerializeObject(GatherData));
|
||||
SaveStore.Write(SaveKey, JsonConvert.SerializeObject(GatherData)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
public void LoadData(string dataValue)
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace game
|
||||
{
|
||||
public class EventPinballDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
@@ -375,7 +376,7 @@ namespace game
|
||||
public void SyncData()
|
||||
{
|
||||
if (!m_IsSyncData) return;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(EventPinballConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_PinballData));
|
||||
playerSaveStore.Write(EventPinballConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_PinballData)).RequireAccepted();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace game
|
||||
{
|
||||
public class EventPotionDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
private bool m_IsSyncData = true;
|
||||
@@ -572,7 +573,7 @@ namespace game
|
||||
public void SyncData()
|
||||
{
|
||||
if (!m_IsSyncData) return;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(EventPotionConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_PotionData));
|
||||
playerSaveStore.Write(EventPotionConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_PotionData)).RequireAccepted();
|
||||
}
|
||||
public PotionItemData GetOperationItemData()
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace game
|
||||
{
|
||||
public class EventScratchTicketDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
private bool m_IsSyncData = true;
|
||||
@@ -594,7 +595,7 @@ namespace game
|
||||
public void SyncData()
|
||||
{
|
||||
if (!m_IsSyncData) return;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(EventScratchTicketConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_ScratchTicketData));
|
||||
playerSaveStore.Write(EventScratchTicketConfig.SAVE_DATA_KEY, Newtonsoft.Json.JsonConvert.SerializeObject(m_ScratchTicketData)).RequireAccepted();
|
||||
}
|
||||
|
||||
List<int> magList = new List<int>() { 1, 5, 10, 20 };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using GameCore;
|
||||
@@ -40,6 +40,8 @@ public class FishingChallengeData
|
||||
|
||||
public class FishingChallengeManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
//
|
||||
private const string SaveKey = "FishingChallengeData";
|
||||
|
||||
@@ -69,7 +71,11 @@ public class FishingChallengeManager
|
||||
game.PlayerDataStorage.PlayerKVSaveSchema.DecodeChallenge(raw,snapshot,errors);
|
||||
internal void ResetForKVLoad()
|
||||
{
|
||||
fishingChallengeData=null; IsInit=false; PrefabName=null; TopRankTier=Rank=FullStep=PlayerFullNumber=PreScore=_cheatingScore=0;
|
||||
fishingChallengeData=null; IsInit=false; PrefabName=null;
|
||||
#if UNITY_EDITOR
|
||||
_cheatingScore=0;
|
||||
#endif
|
||||
TopRankTier=Rank=FullStep=PlayerFullNumber=PreScore=0;
|
||||
CurFishingEventData=null; StartTime=EndTime=default; eventChallengeMain=null; eventChallengeConfig=null; challengeMapData=null; itemDataList=null;
|
||||
_stageDropList.Clear(); _eliminateListScore.Clear(); _eventTrackStageList=new List<int>(); _eventTrackNormalRewardList=new List<int>(); InVisibleReason=string.Empty;
|
||||
}
|
||||
@@ -1081,7 +1087,7 @@ public class FishingChallengeManager
|
||||
|
||||
private void DoSave()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(SaveKey, JsonConvert.SerializeObject(fishingChallengeData));
|
||||
SaveStore.Write(SaveKey, JsonConvert.SerializeObject(fishingChallengeData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public string GetOpenEventKey()
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace GameCore
|
||||
{
|
||||
if (Pack1A1Data == null)
|
||||
{
|
||||
string json_duelData = PlayFabMgr.Instance.GetLocalData(Pack1A1DataKey);
|
||||
string json_duelData = playerSaveStore.Read(Pack1A1DataKey).ValueOrThrow();
|
||||
if (json_duelData != null)
|
||||
{
|
||||
Pack1A1Data = Newtonsoft.Json.JsonConvert.DeserializeObject<TriggerPackBuyData>(json_duelData);
|
||||
@@ -42,7 +42,7 @@ namespace GameCore
|
||||
};
|
||||
RedPointManager.Instance.SetRedPointState(HomeBtnOneOnePack.redKey, false);
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data));
|
||||
playerSaveStore.Write(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data)).RequireAccepted();
|
||||
}
|
||||
public void SetPack1A1Index(int index)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace GameCore
|
||||
GContext.Publish(new TargetEvent(Pack1A1Data.lastID, 3, 11));
|
||||
}
|
||||
RedPointManager.Instance.SetRedPointState(HomeBtnOneOnePack.redKey, Pack1A1Data.index == 1);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data));
|
||||
playerSaveStore.Write(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data)).RequireAccepted();
|
||||
}
|
||||
public int GetPack1A1Index()
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace GameCore
|
||||
{
|
||||
if (Pack1A2Data == null)
|
||||
{
|
||||
string json_duelData = PlayFabMgr.Instance.GetLocalData(Pack1A2DataKey);
|
||||
string json_duelData = playerSaveStore.Read(Pack1A2DataKey).ValueOrThrow();
|
||||
if (json_duelData != null)
|
||||
{
|
||||
Pack1A2Data = Newtonsoft.Json.JsonConvert.DeserializeObject<Pack1A2Data>(json_duelData);
|
||||
@@ -74,7 +74,7 @@ namespace GameCore
|
||||
SetType();
|
||||
SetRodDstId();
|
||||
SetChainPackRed();
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A2DataKey, JsonMapper.ToJson(Pack1A2Data));
|
||||
playerSaveStore.Write(Pack1A2DataKey, JsonMapper.ToJson(Pack1A2Data)).RequireAccepted();
|
||||
}
|
||||
void SetType()
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace GameCore
|
||||
return;
|
||||
}
|
||||
Pack1A2Data.index++;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A2DataKey, JsonMapper.ToJson(Pack1A2Data));
|
||||
playerSaveStore.Write(Pack1A2DataKey, JsonMapper.ToJson(Pack1A2Data)).RequireAccepted();
|
||||
SetChainPackRed();
|
||||
}
|
||||
void SetChainPackRed()
|
||||
|
||||
@@ -87,9 +87,12 @@ namespace GameCore
|
||||
}
|
||||
public async void ShowRankTierChange()
|
||||
{
|
||||
var store = playerSaveStore;
|
||||
if (!store.IsCurrent) return;
|
||||
if (rankTierChangeState > 0 && curSolomain != null)
|
||||
{
|
||||
GameObject go = await UIManager.Instance.ShowUI(UITypes.EventFishingDuelRankChangePopupPanel);
|
||||
if (!store.IsCurrent) return;
|
||||
EventFishingDuelRankChangePopupPanel changePopupPanel = go.GetComponent<EventFishingDuelRankChangePopupPanel>();
|
||||
changePopupPanel.SetRank(rankTierChangeState == 1, curSolomain);
|
||||
rankTierChangeState = 0;
|
||||
@@ -98,7 +101,7 @@ namespace GameCore
|
||||
}
|
||||
public void SoloCheckClaimReward()
|
||||
{
|
||||
string json_duelData = PlayFabMgr.Instance.GetLocalData(FishingDuelManager.SoloDataKey);
|
||||
string json_duelData = playerSaveStore.Read(FishingDuelManager.SoloDataKey).ValueOrThrow();
|
||||
if (json_duelData != null)
|
||||
{
|
||||
duelData = Newtonsoft.Json.JsonConvert.DeserializeObject<DuelData>(json_duelData);
|
||||
@@ -120,7 +123,7 @@ namespace GameCore
|
||||
duelData.rewardEventID = 0;
|
||||
duelData.preProgress = 0;
|
||||
string json_duelData = Newtonsoft.Json.JsonConvert.SerializeObject(duelData);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(FishingDuelManager.SoloDataKey, json_duelData);
|
||||
playerSaveStore.Write(FishingDuelManager.SoloDataKey, json_duelData).RequireAccepted();
|
||||
}
|
||||
}
|
||||
public void GMAddSoloProgress(int count)
|
||||
@@ -133,7 +136,7 @@ namespace GameCore
|
||||
}
|
||||
public void InitSoloData(FishingEvent t)
|
||||
{
|
||||
string json_duelData = PlayFabMgr.Instance.GetLocalData(FishingDuelManager.SoloDataKey);
|
||||
string json_duelData = playerSaveStore.Read(FishingDuelManager.SoloDataKey).ValueOrThrow();
|
||||
if (json_duelData != null)
|
||||
{
|
||||
duelData = Newtonsoft.Json.JsonConvert.DeserializeObject<DuelData>(json_duelData);
|
||||
@@ -262,7 +265,7 @@ namespace GameCore
|
||||
public void AddPVPToken(int value)
|
||||
{
|
||||
PVPToken += value;
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("PVPToken", PVPToken.ToString());
|
||||
playerSaveStore.Write("PVPToken", PVPToken.ToString()).RequireAccepted();
|
||||
if (value < 0 && duelData != null)
|
||||
{
|
||||
duelData.rePVPToken -= value;
|
||||
@@ -272,7 +275,7 @@ namespace GameCore
|
||||
public void SaveDuelData()
|
||||
{
|
||||
string json_duelData = Newtonsoft.Json.JsonConvert.SerializeObject(duelData);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(FishingDuelManager.SoloDataKey, json_duelData);
|
||||
playerSaveStore.Write(FishingDuelManager.SoloDataKey, json_duelData).RequireAccepted();
|
||||
}
|
||||
#endregion SoloData
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace DataCenter
|
||||
|
||||
public class OfferChainsChestManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
|
||||
public const string SaveKey = "OfferChainsChestData";
|
||||
[Inject] public Tables _tables { get; set; }
|
||||
@@ -277,7 +278,7 @@ namespace DataCenter
|
||||
private void SaveData()
|
||||
{
|
||||
ELog($"SaveData-> {JsonConvert.SerializeObject(OfferChainsData)}");
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(SaveKey, JsonConvert.SerializeObject(OfferChainsData));
|
||||
playerSaveStore.Write(SaveKey, JsonConvert.SerializeObject(OfferChainsData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public void LoadData(string dataValue)
|
||||
@@ -289,6 +290,7 @@ namespace DataCenter
|
||||
// 进入游戏舞台
|
||||
public async void OnEnterGameAct()
|
||||
{
|
||||
if (!playerSaveStore.IsCurrent) return;
|
||||
Log("OnEnterGameAct()");
|
||||
IsFirstOpen = false;
|
||||
await UIManager.Instance.ShowUI(new UIType(OfferChainsChestMain.UIPanel));
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace DataCenter
|
||||
// Disco Manager
|
||||
public class OfferDiscoPartyManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
public const string SaveKey = "OfferDiscoPartyManager";
|
||||
|
||||
// 免费抽奖次数
|
||||
@@ -291,7 +292,7 @@ namespace DataCenter
|
||||
|
||||
private void SaveData()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(SaveKey, JsonConvert.SerializeObject(OfferDiscoPartyData));
|
||||
playerSaveStore.Write(SaveKey, JsonConvert.SerializeObject(OfferDiscoPartyData)).RequireAccepted();
|
||||
}
|
||||
|
||||
public void LoadData(string dataValue)
|
||||
@@ -309,6 +310,7 @@ namespace DataCenter
|
||||
|
||||
public async void OnEnterGameAct()
|
||||
{
|
||||
if (!playerSaveStore.IsCurrent) return;
|
||||
ELog("OnEnterGameAct()");
|
||||
IsFirstOpen = false;
|
||||
await UIManager.Instance.ShowUI(new UIType(OfferDiscoParty.UIPanel));
|
||||
|
||||
@@ -8,6 +8,7 @@ using game;
|
||||
using System.Linq;
|
||||
public class PiggyBankPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private readonly Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private readonly TbEventPackManager _epm
|
||||
= GContext.container.Resolve<Tables>().TbEventPackManager;
|
||||
@@ -193,8 +194,8 @@ public class PiggyBankPackData
|
||||
}
|
||||
public void SaveData()
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("PiggyBankPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data));
|
||||
playerSaveStore.Write("PiggyBankPackData",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(_data)).RequireAccepted();
|
||||
}
|
||||
public bool AddProgress(int fishTier, int magnification)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace GameCore
|
||||
public void SaveInitRodAccessoriesData()
|
||||
{
|
||||
string value = Newtonsoft.Json.JsonConvert.SerializeObject(rodAccessoriesData);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(InitRodAccessoriesDataKey, value);
|
||||
playerSaveStore.Write(InitRodAccessoriesDataKey, value).RequireAccepted();
|
||||
}
|
||||
/// <summary>
|
||||
/// 手是否解锁
|
||||
@@ -272,7 +272,7 @@ namespace GameCore
|
||||
.AddContent("rod_chips_consume", rquiredFragments);
|
||||
}
|
||||
#endif
|
||||
PlayFabMgr.Instance.UpdateUserDataValue("RodData", JsonMapper.ToJson(rodData));
|
||||
playerSaveStore.Write("RodData", JsonMapper.ToJson(rodData)).RequireAccepted();
|
||||
//鱼竿红点数据修改
|
||||
CheckRodRedPointUp();
|
||||
//合成鱼竿
|
||||
@@ -354,7 +354,7 @@ namespace GameCore
|
||||
public void SaveHonorLevelData()
|
||||
{
|
||||
string value = Newtonsoft.Json.JsonConvert.SerializeObject(_honorlevel);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(HonorLevelDataKey, value);
|
||||
playerSaveStore.Write(HonorLevelDataKey, value).RequireAccepted();
|
||||
}
|
||||
|
||||
#endregion 荣耀等级
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using System;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using LitJson;
|
||||
@@ -17,12 +17,14 @@ namespace GameCore
|
||||
}
|
||||
public class TotalRechargeManager
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
|
||||
public const string TotalRechargeDataKey = "EventTotalRecharge";
|
||||
public TotalRechargeData GetEventData()
|
||||
{
|
||||
var totalRechargeData = new TotalRechargeData();
|
||||
|
||||
string data = PlayFabMgr.Instance.GetLocalData(TotalRechargeDataKey);
|
||||
string data = saveStore.Read(TotalRechargeDataKey).ValueOrThrow();
|
||||
if (!string.IsNullOrEmpty(data))
|
||||
{
|
||||
try
|
||||
@@ -175,7 +177,7 @@ namespace GameCore
|
||||
|
||||
void SaveTotalRechargeData(TotalRechargeData totalRechargeData)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(TotalRechargeDataKey, JsonMapper.ToJson(totalRechargeData));
|
||||
saveStore.Write(TotalRechargeDataKey, JsonMapper.ToJson(totalRechargeData)).RequireAccepted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user