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 System;
using System;
using System.Linq;
using asap.core;
using cfg;
@@ -48,10 +48,8 @@ public class BlackFridayCouponData
ZZTimeHelper.UtcNow() <= ActivateTime + TimeSpan.FromSeconds(EventDuration) && !IsBought;
public int Multiplier => GContext.container.Resolve<Tables>().TbEventCoupon[RedirectId].Multiple;
public int EventDuration => GContext.container.Resolve<Tables>().TbEventCoupon[RedirectId].Time;
internal void ResetForKVLoad()
{ ActivateTime=default; EventId=0; RedirectId=0; _isBought=false; DoesPop=true; }
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVCouponState state)
{ if(state==null) throw new ArgumentNullException(nameof(state)); ActivateTime=state.ActivateTime; EventId=state.EventId; RedirectId=state.RedirectId; _isBought=state.Bought; }
public void LoadData(string s)
{

View File

@@ -1,4 +1,4 @@
using asap.core;
using asap.core;
using cfg;
using GameCore;
namespace GameCore
@@ -11,9 +11,7 @@ namespace GameCore
}
public class ChainPackWithProgressMigrationData : ThanksGivingPackData
{
internal new static game.PlayerDataStorage.PlayerKVProgressPackState DecodeForKVLoad(System.Collections.Generic.IReadOnlyDictionary<string,string> raw,
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) =>
game.PlayerDataStorage.PlayerKVSaveSchema.DecodeProgressPack(raw,true,errors);
public new const string Key = "ThanksGivingPackMigrationData";
public override string RedPointKey => "thanks_giving";
protected override string key => Key;

View File

@@ -16,8 +16,7 @@ public class GiftNoticePanel : MonoBehaviour
Button btn_watch2;
public RewardItemNew[] rewardItemNews;
private Tables _tables;
ILocalNotificationService notificationService;
bool handlingNotification;
private ILocalNotificationService notificationService;
private void Awake()
{
@@ -61,29 +60,15 @@ public class GiftNoticePanel : MonoBehaviour
PlayerPrefs.SetInt("GiftNoticePanel", 1);
OnClose();
}
async void OnClickYES()
void OnClickYES()
{
if (this == null || handlingNotification) return;
handlingNotification = true;
try
if (this == null)
{
if (notificationService is LocalNotificationService local && local.HasKVPromptOwner)
{
local.RequirePromptOwner();
await local.OpenSettingsAsync();
if (this == null) return;
local.RequirePromptOwner();
}
else
{
OnClose();
notificationService.OpenSettings();
return;
}
OnClose();
return;
}
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
finally { handlingNotification = false; }
(notificationService as LocalNotificationService)?.RequirePromptOwner();
OnClose();
notificationService.OpenSettings();
}
void OnClose()
{

View File

@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -27,18 +27,10 @@ public class ThanksGivingPackData : IProgressChainPackData
protected Data _data = new Data(0, 0, 0, 0);
internal static game.PlayerDataStorage.PlayerKVProgressPackState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) =>
game.PlayerDataStorage.PlayerKVSaveSchema.DecodeProgressPack(raw,false,errors);
internal void ResetForKVLoad() { _data = null; }
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVProgressPackState state)
{
if (state == null) throw new ArgumentNullException(nameof(state));
_data = state.IsPresent ? new Data(state.EventId,state.RedirectId,state.TokenProgress,state.ChainProgress) : null;
}
internal game.PlayerDataStorage.PlayerKVProgressPackState SnapshotForKVValidation() => _data == null
? new game.PlayerDataStorage.PlayerKVProgressPackState(false,0,0,0,0)
: new game.PlayerDataStorage.PlayerKVProgressPackState(true,_data.EventId,_data.RedirectId,_data.TokenProgress,_data.ChainProgress);
/// <summary>
/// Starts with 0, representing the first unclaimed reward.
/// </summary>