feat(upserver): 保存M2客户端KV迁移至本人统计写检查点

保存独立KV用户服务、固定会话存档与原业务接线,以及C3d资料缓存和C3e本人统计写。
保留原PF/AGG路线、业务公式和时序;榜单读取、好友资料、公告、匹配及首场景闸仍待完成。

验证:ServiceHost两条件各33组646断言;Unity CLI Loop编译0错误269警告。
包含相关方案、评审裁决、测试及状态文档。未操作服务器、正式账号或打包。
This commit is contained in:
Liubing\LB
2026-09-30 19:19:05 +08:00
parent 1c0cdf7a99
commit 6813da149a
511 changed files with 151858 additions and 2376 deletions

View File

@@ -1,4 +1,4 @@
#if UNITY_EDITOR && !SERVICE_HOST
#if UNITY_EDITOR && !SERVICE_HOST
using System;
using System.Collections.Generic;
using System.IO;
@@ -152,6 +152,9 @@ namespace game.PlayerDataStorage
pfShell=new GameObject("KV inactive guide Init fixture");pfShell.SetActive(false);pfShell.hideFlags=HideFlags.HideAndDontSave;
var pf=pfShell.AddComponent<PlayFabMgr>();
Check(pf.IsUnstartedForKVLoad,"guide fixture never starts PF lifecycle");pfField.SetValue(null,pf);
var store=new PlayFabPlayerSaveStore(pf,CancellationToken.None);
container.RegisterInstance<IPlayerSaveStore>(store);
player.playerSaveStore=store;eventData.playerSaveStore=store;guideState.playerSaveStore=store;
var initErrors=new List<string>();var initWarnings=new List<string>();int completeEvents=0;
Application.LogCallback onLog=(message,stack,type)=>{if(type==LogType.Exception || type==LogType.Error)initErrors.Add(message);if(type==LogType.Warning)initWarnings.Add(message);};
Application.logMessageReceived+=onLog;
@@ -270,6 +273,9 @@ namespace game.PlayerDataStorage
typeof(PlayerFishData).GetField("mapFishData",fields).SetValue(fish,new Dictionary<int,Dictionary<int,FishWeightData>>{{102,data}});
pfShell=new GameObject("KV reward unstarted PF fixture");pfShell.SetActive(false);pfShell.hideFlags=HideFlags.HideAndDontSave;
var pf=pfShell.AddComponent<PlayFabMgr>();Check(pf.IsUnstartedForKVLoad,"PF lifecycle never starts");pfField.SetValue(null,pf);
var store=new PlayFabPlayerSaveStore(pf,CancellationToken.None);
container.RegisterInstance<IPlayerSaveStore>(store);
player.playerSaveStore=store;fish.playerSaveStore=store;
rewardAction.BeforeFishCount=scenario=="new-fish"?0:20;
using(BeginRewardSegment("strike")){}rewardAction.Ending=true;using(BeginRewardSegment("ending")){}
rewardAction.Applying=true;
@@ -519,8 +525,14 @@ namespace game.PlayerDataStorage
var pf=shell.AddComponent<PlayFabMgr>();
if(!pf.IsUnstartedForKVLoad)throw new InvalidOperationException("No PF lifecycle may start in this fixture.");
PF.SetValue(null,pf);
var store=new PlayFabPlayerSaveStore(pf,CancellationToken.None);
container.RegisterInstance<IPlayerSaveStore>(store);
container.Resolve<PlayerData>().playerSaveStore=store;
container.Resolve<PlayerFishData>().playerSaveStore=store;
container.Resolve<SmallGameData>().playerSaveStore=store;
events.playerSaveStore=store;
var items=new PlayerItemData(tables);container.RegisterInstance(items);
var data=new BattlePassData(tables);
var data=new BattlePassData(tables){playerSaveStore=store};
data.BattlePassRecord.ID=tables.TbFishingEvent.DataList.First(e=>tables.TbBattlePassMain.GetOrDefault(e.RedirectID)!=null).ID;
data.BattlePassRecord.Level=1;
foreach(var t in tables.TbBattlePassTask.DataList.Where(t=>rewardConditions.Contains(t.Type)))data.BattleTask.dic_dailyTasks.Add(t.TaskID,0);