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 @@
#if UNITY_EDITOR && !SERVICE_HOST
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -152,9 +152,6 @@ namespace game.PlayerDataStorage
CheckRewardEnvironment(p.Data,false);
if(p.Activities!=ActivityStamp(GContext.container.Resolve<Tables>())) throw Stop("Activity changed during fishing reward.");
}
internal static bool RewardRunCurrent => RewardCurrent(rewardAction);
internal static bool RewardCanAdvance => !Enabled || (FishingCurrent(fishingAction) &&
(rewardAction==null || (!rewardAction.Cancelled && !rewardAction.Sealed)));
internal static bool BeginRewardDrawing(object controller)
{
if(Permit?.AllowsReward!=true || !FishingCurrent(fishingAction) || !fishingAction.Confirmed || !fishingAction.Continued)
@@ -187,7 +184,6 @@ namespace game.PlayerDataStorage
}
internal static bool RewardCurrent(FishingRewardAction a) => a!=null && ReferenceEquals(a,rewardAction) &&
!a.Cancelled && FishingCurrent(a.Consumption);
internal static bool RewardPanelCurrent(FishingRewardAction a,object panel) => RewardCurrent(a) && ReferenceEquals(a.Panel,panel);
sealed class RewardSegment : IDisposable
{
readonly FishingRewardAction action;
@@ -222,17 +218,6 @@ namespace game.PlayerDataStorage
else if(key!="NewPlayerDataDic" && key!=a.Plan.MapKey && !rewardTaskKeys.Contains(key))
throw Stop("Unexpected fishing reward key: "+key);
}
internal static void CheckCaughtFishSave(int fish,int count)
{
var a=rewardAction;
if(!RewardCurrent(a) || a.SegmentName!="reward" || a.Plan.Fish!=fish ||
count!=checked(a.BeforeFishCount+GContext.container.Resolve<PlayerData>().GetMagnification()))
throw Stop("Caught fish final save must contain exactly this catch's increment.");
}
internal static void CheckRewardMainSave()
{
if(!RewardCurrent(rewardAction) || rewardAction.SegmentName!="reward") throw Stop("Final reward save outside reward segment.");
}
internal static void RecordRewardGuideNotification()
{
var a=rewardAction;
@@ -253,9 +238,6 @@ namespace game.PlayerDataStorage
using(var timeout=new CancellationTokenSource(TimeSpan.FromSeconds(30)))
{
var owner=a.Consumption.Owner;
var flush=await KVMgr.FlushKVAsync(owner,timeout.Token);
if(!RewardCurrent(a) || flush.Unknown>0 || flush.Blocked>0 || flush.TransportError!=PlayerKVError.None)
throw Stop("Reward flush: "+flush.TransportError);
foreach(var r in a.Records)
{
var t=r.Edit.Ticket;if(t==null)continue;