refactor(kv): 整理存档接线并清理迁移冗余实现
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Assets.Scripts.UI.AdWheel
|
||||
{
|
||||
public class AdWheelManager:IDisposable
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
|
||||
public AdWheelManager()
|
||||
|
||||
@@ -19,7 +19,7 @@ public class AdvertData
|
||||
}
|
||||
public class AdvertPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
Button btn_close;
|
||||
TMP_Text txt_energy, txt_money, txt_ticket;
|
||||
@@ -37,7 +37,7 @@ public class AdvertPanel : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
txt_ticket = transform.Find("top_area/resource/icon_ticket/text_num").GetComponent<TMP_Text>();
|
||||
txt_energy = transform.Find("top_area/resource/icon_energy/text_num").GetComponent<TMP_Text>();
|
||||
txt_money = transform.Find("top_area/resource/icon_money/text_num").GetComponent<TMP_Text>();
|
||||
|
||||
@@ -14,7 +14,7 @@ using Activity.Event;
|
||||
|
||||
public class DeBugPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
static public bool isShow = true;
|
||||
private CanvasGroup _canvasGroup;
|
||||
@@ -113,7 +113,7 @@ public class DeBugPanel : MonoBehaviour
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
inputField_itemId = transform.Find("root/InputField_icon").GetComponent<TMP_InputField>();
|
||||
inputField_itemCount = transform.Find("root/InputField_icon_num").GetComponent<TMP_InputField>();
|
||||
btn_addItem = transform.Find("root/btn_sure2/btn_green").GetComponent<Button>();
|
||||
@@ -582,7 +582,7 @@ public class DeBugPanel : MonoBehaviour
|
||||
private void ChangeMMT()
|
||||
{
|
||||
var userService = GContext.container.Resolve<game.IUserService>();
|
||||
if (userService is not game.PlayFabUserService && userService is not game.KVUserService)
|
||||
if (userService is not game.PlayFabUserService && userService is not game.KvUserService)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ public class DeBugPanel : MonoBehaviour
|
||||
value |= 1 << (mmDatas[i].ID - 1001);
|
||||
}
|
||||
}
|
||||
if (userService is game.KVUserService kvUserService)
|
||||
if (userService is game.KvUserService kvUserService)
|
||||
{
|
||||
kvUserService.GMMMT(value);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Assets.Scripts.UI.JigsawPuzzle
|
||||
{
|
||||
public class JigsawPuzzleManager:IDisposable
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
public const string PriceImgName = "separate_icon_eventjigsawpuzzle_piece_";
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace OfferStoryChain
|
||||
{
|
||||
public class Manager
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
#region RedPoint
|
||||
public bool DoNeedRedPoint
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Assets.Scripts.UI.OfferSweep
|
||||
{
|
||||
public class OfferSweepManager : IDisposable,IOrderReplenishment
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
public OfferSweepManager()
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace OfferTreasureAscent
|
||||
{
|
||||
public class Manager
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
private int _status = 0, _eventId, _redirectId;
|
||||
private List<int> _failedPurchaseRewardIndices;
|
||||
|
||||
@@ -15,7 +15,7 @@ using UniRx;
|
||||
|
||||
public class EventPartnerData
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
private bool _lock = false, _whole = false;
|
||||
private MetaData _data;
|
||||
@@ -1365,7 +1365,7 @@ public class EventPartnerData
|
||||
|
||||
public class EventPartnerPlayfabData
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
[JsonIgnore]
|
||||
public const string Key = "EventPartnerData";
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Collections.Generic;
|
||||
|
||||
public class EventPartnerEntryButton : EventButtonResource
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
[SerializeField] private TMP_Text _textTimer;
|
||||
[SerializeField] private Button _btn;
|
||||
@@ -20,7 +20,7 @@ public class EventPartnerEntryButton : EventButtonResource
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
// Debug.Log($"<color=#e23f31>[EventPartner] Icon Awake</color>");
|
||||
GContext.OnEvent<EventPartnerDataLoaded>().Subscribe(_ => OnDataLoaded()).AddTo(this);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using UnityEngine;
|
||||
|
||||
public class EventPartnerStatuePlayfabData
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
public int EventId;
|
||||
public int TicketCount;
|
||||
@@ -99,7 +99,7 @@ public class EventPartnerStatuePlayfabData
|
||||
|
||||
public static EventPartnerStatuePlayfabData Load()
|
||||
{
|
||||
var s = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>().Read(Key).ValueOrThrow();
|
||||
var s = GContext.container.Resolve<Core.KV.IPlayerSaveStore>().Read(Key).ValueOrThrow();
|
||||
return Deserialize(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class EventPartnerStatueTokenExchangeFishRaid
|
||||
|
||||
public class EventPartnerStatueTokenExchangeData
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
#region State
|
||||
private int _eventId = 0;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace game
|
||||
{
|
||||
public class EventPinataPackDataManager:IOrderReplenishment,IOrderSuccess
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PinballUncountable
|
||||
{
|
||||
public class Manager : IHasMultiplier
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
private int _score, _ticketCount, _hitCountLeft, _hitCountRight;
|
||||
private float _inflationRate = 0f;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -11,7 +11,7 @@ using UnityEngine.UI;
|
||||
|
||||
public class PlayerHeadPopupPanel : MonoBehaviour
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
IUserService userService;
|
||||
public Button btn_mask;
|
||||
@@ -32,7 +32,7 @@ public class PlayerHeadPopupPanel : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
userAvatars = GContext.container.Resolve<Tables>().TbUserAvatar.DataList;
|
||||
userService = GContext.container.Resolve<IUserService>();
|
||||
btn_mask = transform.Find("mask").GetComponent<Button>();
|
||||
|
||||
@@ -8,7 +8,7 @@ using GameCore;
|
||||
|
||||
public class EventShootingRangeData : IChainPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private RawData _data = new RawData();
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ using cfg;
|
||||
|
||||
public class BlackFridayCouponData
|
||||
{
|
||||
private game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
internal void BindSaveStore(game.PlayerDataStorage.IPlayerSaveStore store)
|
||||
private Core.KV.IPlayerSaveStore saveStore;
|
||||
internal void BindSaveStore(Core.KV.IPlayerSaveStore store)
|
||||
{
|
||||
if (saveStore != null && !ReferenceEquals(saveStore, store)) throw new System.InvalidOperationException("Archive store cannot change login.");
|
||||
saveStore = store;
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace GameCore
|
||||
}
|
||||
public class ThanksGivingPackData : IProgressChainPackData
|
||||
{
|
||||
protected game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
internal void BindSaveStore(game.PlayerDataStorage.IPlayerSaveStore store)
|
||||
protected Core.KV.IPlayerSaveStore saveStore;
|
||||
internal void BindSaveStore(Core.KV.IPlayerSaveStore store)
|
||||
{
|
||||
if (saveStore != null && !ReferenceEquals(saveStore, store)) throw new System.InvalidOperationException("Archive store cannot change login.");
|
||||
saveStore = store;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace game
|
||||
{
|
||||
public class FishingFriendAddPanel : MonoBehaviour, IEnhancedScrollerDelegate
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
|
||||
|
||||
#region 分享
|
||||
@@ -632,7 +632,7 @@ namespace game
|
||||
#region 生命周期
|
||||
void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
loading = transform.Find("loading").gameObject;
|
||||
empty = transform.Find("add").gameObject;
|
||||
empty.SetActive(false);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Assets.Scripts.UI.SocialRush
|
||||
{
|
||||
public class SocialRushArchitecture
|
||||
{
|
||||
readonly game.PlayerDataStorage.IPlayerSaveStore saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
readonly Core.KV.IPlayerSaveStore saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
|
||||
private Model _model = new Model();
|
||||
private TableContext _tableContext;
|
||||
|
||||
@@ -17,7 +17,7 @@ using System.Threading.Tasks;
|
||||
|
||||
public class FishingTurntablePanel : BasePanel
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore saveStore;
|
||||
Core.KV.IPlayerSaveStore saveStore;
|
||||
Tables _tables;
|
||||
FishingEventData _fishingEventData;
|
||||
CanvasGroup canvasGroup;
|
||||
@@ -90,7 +90,7 @@ public class FishingTurntablePanel : BasePanel
|
||||
|
||||
void Awake()
|
||||
{
|
||||
saveStore = GContext.container.Resolve<game.PlayerDataStorage.IPlayerSaveStore>();
|
||||
saveStore = GContext.container.Resolve<Core.KV.IPlayerSaveStore>();
|
||||
_tables = GContext.container.Resolve<Tables>();
|
||||
_fishingEventData = GContext.container.Resolve<FishingEventData>();
|
||||
canvasGroup = GetComponent<CanvasGroup>();
|
||||
|
||||
Reference in New Issue
Block a user