chore(m2): 保存功能验收及后续清理前检查点

This commit is contained in:
Liubing\LB
2026-10-10 20:40:27 +08:00
parent d3c5394a55
commit 144e7f739f
110 changed files with 12672 additions and 7514 deletions

View File

@@ -1,4 +1,4 @@
using asap.core;
using asap.core;
using cfg;
using game;
using LitJson;
@@ -55,28 +55,9 @@ namespace GameCore
//VIP 等级叠加
public Dictionary<string, GiftVIPDData> giftVIPDData = new Dictionary<string, GiftVIPDData>();
internal static game.PlayerDataStorage.PlayerKVTriggerState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) => game.PlayerDataStorage.PlayerKVSaveSchema.DecodeTriggers(raw,errors);
internal void ResetForKVLoad()
{
triggerPackList=new List<TriggerPackBuyData>();
giftVIPDData=new Dictionary<string,GiftVIPDData>(StringComparer.Ordinal);
fixedTimeShopDic=new Dictionary<int,FixedTimeEvent>();
}
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVTriggerState state)
{
if(state==null) throw new ArgumentNullException(nameof(state));
var packs=state.Packs.Select(p=>new TriggerPackBuyData {
ID=p.ID,index=p.index,lastID=p.lastID,vipLevel=p.vipLevel,mapID=p.mapID,time=p.time }).ToList();
var gifts=state.Gifts.ToDictionary(p=>p.Key,p=>new GiftVIPDData {
oldVipLevel=p.Value.oldVipLevel,curVipLevel=p.Value.curVipLevel,timer=p.Value.timer },StringComparer.Ordinal);
var fixedValues=state.Fixed.ToDictionary(p=>p.Key,p=>new FixedTimeEvent { id=p.Value.id,endTime=p.Value.endTime });
triggerPackList=packs; giftVIPDData=gifts; fixedTimeShopDic=fixedValues;
}
#if UNITY_EDITOR
internal FixedTimeEvent FixedForKVValidation(int key) => fixedTimeShopDic.TryGetValue(key,out var value) ? value : null;
internal bool IsEmptyForKVValidation => triggerPackList.Count==0 && giftVIPDData.Count==0 && fixedTimeShopDic.Count==0;
#endif
public void Init()
{
playerShopData = GContext.container.Resolve<PlayerShopData>();