feat(upserver): 保存M2客户端KV迁移至本人统计写检查点
保存独立KV用户服务、固定会话存档与原业务接线,以及C3d资料缓存和C3e本人统计写。 保留原PF/AGG路线、业务公式和时序;榜单读取、好友资料、公告、匹配及首场景闸仍待完成。 验证:ServiceHost两条件各33组646断言;Unity CLI Loop编译0错误269警告。 包含相关方案、评审裁决、测试及状态文档。未操作服务器、正式账号或打包。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
@@ -11,6 +11,8 @@ using UnityEngine.UI;
|
||||
|
||||
public class BindAccountPopupPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
|
||||
IUserService userService;
|
||||
Button btn_close;
|
||||
Button btn_close1;
|
||||
@@ -27,6 +29,7 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
ItemData itemData;
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
userService = GContext.container.Resolve<IUserService>();
|
||||
btn_close1 = transform.Find("btn_close").GetComponent<Button>();
|
||||
btn_close = transform.Find("mask").GetComponent<Button>();
|
||||
@@ -203,10 +206,11 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
{
|
||||
UIManager.ShowWaitingBlock("BindAccountPopupPanel::OnlinkSns");
|
||||
var (code, userid) = await userService.LinkAccount(accountType);
|
||||
if (this == null || !saveStore.IsCurrent) return false;
|
||||
|
||||
if (code == 0)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(accountType.ToString(), "1");
|
||||
saveStore.Write(accountType.ToString(), "1").RequireAccepted();
|
||||
ToastPanel.Show(LocalizationMgr.GetText("UI_BindAccountPopupPanel_101007"));
|
||||
}
|
||||
else if (code == -1 && userid != int.Parse(userService.CustomId))
|
||||
@@ -214,6 +218,7 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
var config = GContext.container.Resolve<IConfig>();
|
||||
var titleId = config.Get<string>(GConstant.K_PlayFab_Title, GConstant.V_Debug_PF_Title);
|
||||
var info = await PlayFabTools.GetPFPlayerInfoBySDKId(userid, titleId);
|
||||
if (this == null || !saveStore.IsCurrent) return false;
|
||||
if (!info.IsAccountValid || !info.IsDataValid)
|
||||
{
|
||||
Debug.LogWarning(
|
||||
@@ -223,6 +228,7 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
}
|
||||
|
||||
var switchPanelGo = await UIManager.Instance.GetUIAsync(UITypes.AccountSwitchPopupPanel);
|
||||
if (this == null || !saveStore.IsCurrent) return false;
|
||||
switchPanelGo.GetComponent<AccountSwitchPopupPanel>()
|
||||
.SetData(info.DisplayName, info.Avatar, info.Level, userid, accountType);
|
||||
UIManager.Instance.DestroyUI(UITypes.BindAccountPopupPanel);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using GameCore;
|
||||
@@ -11,6 +11,8 @@ using UnityEngine.UI;
|
||||
|
||||
public class PlayerHeadPopupPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
|
||||
IUserService userService;
|
||||
public Button btn_mask;
|
||||
public Button btn_close;
|
||||
@@ -30,6 +32,7 @@ public class PlayerHeadPopupPanel : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
userAvatars = GContext.container.Resolve<Tables>().TbUserAvatar.DataList;
|
||||
userService = GContext.container.Resolve<IUserService>();
|
||||
btn_mask = transform.Find("mask").GetComponent<Button>();
|
||||
@@ -196,9 +199,10 @@ public class PlayerHeadPopupPanel : MonoBehaviour
|
||||
}
|
||||
}
|
||||
var result = await userService.LinkAccount(EAccoutType.hwFacebook);
|
||||
if (this == null || !saveStore.IsCurrent) return;
|
||||
if (result.code == 0)
|
||||
{
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(EAccoutType.hwFacebook.ToString(), "1");
|
||||
saveStore.Write(EAccoutType.hwFacebook.ToString(), "1").RequireAccepted();
|
||||
Dictionary<string, string> EAccoutUrl = userService.EAccoutUrl;
|
||||
if (EAccoutUrl != null && EAccoutUrl.Count > 0)
|
||||
{
|
||||
|
||||
@@ -8,19 +8,47 @@ public class SettingNotificationsGradePopupPanel : MonoBehaviour
|
||||
{
|
||||
public Button btn_ok;
|
||||
public Button btn_cancel;
|
||||
ISettingService settings;
|
||||
ILocalNotificationService notifications;
|
||||
bool handling;
|
||||
bool completed;
|
||||
private void Start()
|
||||
{
|
||||
settings = GContext.container.Resolve<ISettingService>();
|
||||
notifications = GContext.container.Resolve<ILocalNotificationService>();
|
||||
btn_ok.onClick.AddListener(OnBtnOk);
|
||||
btn_cancel.onClick.AddListener(DestroyUI);
|
||||
}
|
||||
private void OnBtnOk()
|
||||
{
|
||||
DestroyUI();
|
||||
GContext.container.Resolve<ILocalNotificationService>().OpenSettings();
|
||||
HandlePrompt(true);
|
||||
}
|
||||
void DestroyUI()
|
||||
{
|
||||
GContext.container.Resolve<ISettingService>().ShowNotice = true;
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
HandlePrompt(false);
|
||||
}
|
||||
async void HandlePrompt(bool openSettings)
|
||||
{
|
||||
if (this == null || handling || completed) return;
|
||||
handling = true;
|
||||
try
|
||||
{
|
||||
(settings as DefaultSettingService)?.RequirePromptOwner();
|
||||
(notifications as LocalNotificationService)?.RequirePromptOwner(settings);
|
||||
settings.ShowNotice = true;
|
||||
if (openSettings && settings is DefaultSettingService bound && bound.HasKVPromptOwner)
|
||||
{
|
||||
await ((LocalNotificationService)notifications).OpenSettingsAsync();
|
||||
if (this == null) return;
|
||||
bound.RequirePromptOwner();
|
||||
}
|
||||
(settings as DefaultSettingService)?.RequirePromptOwner();
|
||||
completed = true;
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
if (openSettings && !(settings is DefaultSettingService kv && kv.HasKVPromptOwner))
|
||||
notifications.OpenSettings();
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
finally { handling = false; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,19 +7,48 @@ public class SettingNotificationsPopupPanel : MonoBehaviour
|
||||
{
|
||||
public Button btn_ok;
|
||||
public Button btn_cancel;
|
||||
ILocalNotificationService notifications;
|
||||
bool handling;
|
||||
bool completed;
|
||||
private void Start()
|
||||
{
|
||||
notifications = GContext.container.Resolve<ILocalNotificationService>();
|
||||
btn_ok.onClick.AddListener(OnBtnOk);
|
||||
btn_cancel.onClick.AddListener(DestroyUI);
|
||||
}
|
||||
private void OnBtnOk()
|
||||
private async void OnBtnOk()
|
||||
{
|
||||
DestroyUI();
|
||||
ILocalNotificationService service = GContext.container.Resolve<ILocalNotificationService>();
|
||||
service.OpenSettings();
|
||||
if (this == null || handling || completed) return;
|
||||
handling = true;
|
||||
try
|
||||
{
|
||||
if (notifications is LocalNotificationService local && local.HasKVPromptOwner)
|
||||
{
|
||||
local.RequirePromptOwner();
|
||||
await local.OpenSettingsAsync();
|
||||
if (this == null) return;
|
||||
local.RequirePromptOwner();
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyUI();
|
||||
notifications.OpenSettings();
|
||||
return;
|
||||
}
|
||||
DestroyUI();
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
finally { handling = false; }
|
||||
}
|
||||
void DestroyUI()
|
||||
{
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
if (this == null || completed) return;
|
||||
try
|
||||
{
|
||||
(notifications as LocalNotificationService)?.RequirePromptOwner();
|
||||
completed = true;
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ using UnityEngine.UI;
|
||||
public class SettingPopupPanel : MonoBehaviour
|
||||
{
|
||||
ISettingService settingService;
|
||||
ILocalNotificationService notificationService;
|
||||
public Button btn_close;
|
||||
public Button btn_mask;
|
||||
public BtnSwitch music;
|
||||
@@ -55,6 +56,7 @@ public class SettingPopupPanel : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
settingService = GContext.container.Resolve<ISettingService>();
|
||||
notificationService = GContext.container.Resolve<ILocalNotificationService>();
|
||||
config = GContext.container.Resolve<IConfig>();
|
||||
}
|
||||
|
||||
@@ -214,15 +216,15 @@ public class SettingPopupPanel : MonoBehaviour
|
||||
}
|
||||
private void OnToggleNotification(bool isOn)
|
||||
{
|
||||
if (isOn)
|
||||
try
|
||||
{
|
||||
GContext.container.Resolve<ILocalNotificationService>().OpenSettings();
|
||||
// NotificationCenter.OpenNotificationSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.Instance.ShowUI(new UIType("SettingNotificationsPopupPanel"));
|
||||
if (this == null) return;
|
||||
(settingService as DefaultSettingService)?.RequirePromptOwner();
|
||||
(notificationService as LocalNotificationService)?.RequirePromptOwner(settingService);
|
||||
if (isOn) notificationService.OpenSettings();
|
||||
else UIManager.Instance.ShowUI(new UIType("SettingNotificationsPopupPanel"));
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
}
|
||||
|
||||
private void OnChangeLanguage(ChangeLanguageEvent changeLanguageEvent = null)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using asap.core;
|
||||
using asap.core;
|
||||
using GameCore;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
Reference in New Issue
Block a user