refactor(kv): 整理存档接线并清理迁移冗余实现
This commit is contained in:
@@ -11,7 +11,7 @@ using UnityEngine.UI;
|
||||
|
||||
public class BindAccountPopupPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
private Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
IUserService userService;
|
||||
Button btn_close;
|
||||
@@ -29,7 +29,7 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
ItemData itemData;
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
userService = GContext.container.Resolve<IUserService>();
|
||||
btn_close1 = transform.Find("btn_close").GetComponent<Button>();
|
||||
btn_close = transform.Find("mask").GetComponent<Button>();
|
||||
@@ -206,7 +206,10 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
{
|
||||
UIManager.ShowWaitingBlock("BindAccountPopupPanel::OnlinkSns");
|
||||
var (code, userid) = await userService.LinkAccount(accountType);
|
||||
if (this == null || !saveStore.IsCurrent) return false;
|
||||
if (this == null || !saveStore.IsCurrent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code == 0)
|
||||
{
|
||||
@@ -215,10 +218,21 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
}
|
||||
else if (code == -1 && userid != int.Parse(userService.CustomId))
|
||||
{
|
||||
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;
|
||||
PlayFabTools.PFPlayerInfo info;
|
||||
if (userService is KvUserService kvUserService)
|
||||
{
|
||||
info = await kvUserService.GetBindConflictPreview(userid);
|
||||
}
|
||||
else
|
||||
{
|
||||
var config = GContext.container.Resolve<IConfig>();
|
||||
var titleId = config.Get<string>(GConstant.K_PlayFab_Title, GConstant.V_Debug_PF_Title);
|
||||
info = await PlayFabTools.GetPFPlayerInfoBySDKId(userid, titleId);
|
||||
}
|
||||
if (this == null || !saveStore.IsCurrent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!info.IsAccountValid || !info.IsDataValid)
|
||||
{
|
||||
Debug.LogWarning(
|
||||
@@ -228,7 +242,10 @@ public class BindAccountPopupPanel : MonoBehaviour
|
||||
}
|
||||
|
||||
var switchPanelGo = await UIManager.Instance.GetUIAsync(UITypes.AccountSwitchPopupPanel);
|
||||
if (this == null || !saveStore.IsCurrent) return false;
|
||||
if (this == null || !saveStore.IsCurrent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switchPanelGo.GetComponent<AccountSwitchPopupPanel>()
|
||||
.SetData(info.DisplayName, info.Avatar, info.Level, userid, accountType);
|
||||
UIManager.Instance.DestroyUI(UITypes.BindAccountPopupPanel);
|
||||
|
||||
Reference in New Issue
Block a user