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,10 +1,17 @@
using System;
using System;
using System.Linq;
using asap.core;
using cfg;
public class BlackFridayCouponData
{
private game.PlayerDataStorage.IPlayerSaveStore saveStore;
internal void BindSaveStore(game.PlayerDataStorage.IPlayerSaveStore store)
{
if (saveStore != null && !ReferenceEquals(saveStore, store)) throw new System.InvalidOperationException("Archive store cannot change login.");
saveStore = store;
}
private readonly Tables _tables = GContext.container.Resolve<Tables>();
private readonly TbEventCoupon _tableCoupon = GContext.container.Resolve<Tables>().TbEventCoupon;
public DateTime ActivateTime = new DateTime(1996, 11, 28);
@@ -70,7 +77,7 @@ public class BlackFridayCouponData
{
string s =
$"{ActivateTime.Year},{ActivateTime.Month},{ActivateTime.Day},{ActivateTime.Hour},{ActivateTime.Minute},{ActivateTime.Second},{EventId},{RedirectId},{(IsBought ? 1 : 0)}";
PlayFabMgr.Instance.UpdateUserDataValue(PlayFabDataKey, s);
saveStore.Write(PlayFabDataKey, s).RequireAccepted();
}
public void UpdateData(FishingEvent e)
{

View File

@@ -1,4 +1,4 @@
using asap.core;
using asap.core;
using cfg;
using GameCore;
namespace GameCore
@@ -27,7 +27,7 @@ public class ChainPackWithProgressMigrationData : ThanksGivingPackData
&& oldData.PackId == packId)
{
_data = new Data(eventId: eventId, redirectId: packId, tokenProgress: oldData.TokenProgress, chainProgress: oldData.ChainProgress);
PlayFabMgr.Instance.UpdateUserDataValue(ThanksGivingPackData.Key, "");
saveStore.Write(ThanksGivingPackData.Key, "").RequireAccepted();
}
else
_data = new Data(eventId: eventId, redirectId: packId, tokenProgress: 0, chainProgress: 0);

View File

@@ -16,10 +16,13 @@ public class GiftNoticePanel : MonoBehaviour
Button btn_watch2;
public RewardItemNew[] rewardItemNews;
private Tables _tables;
ILocalNotificationService notificationService;
bool handlingNotification;
private void Awake()
{
_tables = GContext.container.Resolve<Tables>();
notificationService = GContext.container.Resolve<ILocalNotificationService>();
btn_close = transform.Find("btn_close").GetComponent<Button>();
btn_mask = transform.Find("mask").GetComponent<Button>();
btn_watch1 = transform.Find("root/btn_watch1/btn_green").GetComponent<Button>();
@@ -58,12 +61,29 @@ public class GiftNoticePanel : MonoBehaviour
PlayerPrefs.SetInt("GiftNoticePanel", 1);
OnClose();
}
void OnClickYES()
async void OnClickYES()
{
//开启通知
OnClose();
GContext.container.Resolve<ILocalNotificationService>().OpenSettings();
// NotificationCenter.OpenNotificationSettings();
if (this == null || handlingNotification) return;
handlingNotification = true;
try
{
if (notificationService is LocalNotificationService local && local.HasKVPromptOwner)
{
local.RequirePromptOwner();
await local.OpenSettingsAsync();
if (this == null) return;
local.RequirePromptOwner();
}
else
{
OnClose();
notificationService.OpenSettings();
return;
}
OnClose();
}
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
finally { handlingNotification = false; }
}
void OnClose()
{

View File

@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -18,6 +18,13 @@ namespace GameCore
}
public class ThanksGivingPackData : IProgressChainPackData
{
protected game.PlayerDataStorage.IPlayerSaveStore saveStore;
internal void BindSaveStore(game.PlayerDataStorage.IPlayerSaveStore store)
{
if (saveStore != null && !ReferenceEquals(saveStore, store)) throw new System.InvalidOperationException("Archive store cannot change login.");
saveStore = store;
}
protected Data _data = new Data(0, 0, 0, 0);
internal static game.PlayerDataStorage.PlayerKVProgressPackState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
@@ -149,7 +156,7 @@ public class ThanksGivingPackData : IProgressChainPackData
public void UploadData()
{
PlayFabMgr.Instance.UpdateUserDataValue(key, _data.Serialize());
saveStore.Write(key, _data.Serialize()).RequireAccepted();
}
public void LoadData(string s)
{