refactor(kv): 整理存档接线并清理迁移冗余实现
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
|
||||
public class BargainPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private readonly Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private readonly TbEventPackManager _epm = GContext.container.Resolve<Tables>().TbEventPackManager;
|
||||
|
||||
@@ -33,7 +33,7 @@ public struct BpVipUnlock
|
||||
|
||||
public class BattlePassData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
public BattlePassRecord BattlePassRecord;
|
||||
public BattleTask BattleTask;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
|
||||
public class BuffDataCenter
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private cfg.Tables _tables;
|
||||
public BuffDataCenter(cfg.Tables tables)
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace GameCore
|
||||
{
|
||||
public partial class FishingEventData : IDisposable
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore boundSaveStore;
|
||||
[Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore
|
||||
Core.KV.IPlayerSaveStore boundSaveStore;
|
||||
[Inject] public Core.KV.IPlayerSaveStore playerSaveStore
|
||||
{
|
||||
get => boundSaveStore;
|
||||
set
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace GameCore
|
||||
}
|
||||
public class GuideDataCenter : IDisposable
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
Tables _tables;
|
||||
PlayerData playerData;
|
||||
public GuideDataCenter(cfg.Tables tables, PlayerData playerData)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using Core.KV;
|
||||
using asap.core;
|
||||
using asap.playfab.async;
|
||||
using cfg;
|
||||
using game;
|
||||
using game.PlayerDataStorage;
|
||||
using game.KV;
|
||||
using PlayFab.ClientModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -164,9 +165,9 @@ namespace GameCore
|
||||
{
|
||||
Statistics.Add(new StatisticUpdate() { StatisticName = names[i], Value = value[i] });
|
||||
}
|
||||
if (userService is KVUserService kvUser)
|
||||
if (userService is KvUserService kvUser)
|
||||
{
|
||||
var store = kvUser.SaveStore as KVPlayerSaveStore;
|
||||
var store = kvUser.SaveStore as KvSaveStore;
|
||||
var writtenNames = new HashSet<string>(StringComparer.Ordinal);
|
||||
var data = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (var statistic in Statistics)
|
||||
@@ -175,7 +176,7 @@ namespace GameCore
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!KVSnapshot.ValidKey(statistic.StatisticName))
|
||||
if (!KvSnapshot.ValidKey(statistic.StatisticName))
|
||||
{
|
||||
Debug.LogError("KV statistic write failed: " + statistic.StatisticName + ": Validation");
|
||||
continue;
|
||||
@@ -199,7 +200,7 @@ namespace GameCore
|
||||
}
|
||||
public async Task<GetLeaderboardResult> GetLeadboardData(string leaderboardNaem, int maxCount = 50)
|
||||
{
|
||||
if (userService is KVUserService)
|
||||
if (userService is KvUserService)
|
||||
{
|
||||
var json = await customServerMgr.CustomServerPost("leaderboard/GetLeaderboard",
|
||||
Newtonsoft.Json.JsonConvert.SerializeObject(new
|
||||
@@ -214,7 +215,7 @@ namespace GameCore
|
||||
}
|
||||
try
|
||||
{
|
||||
var response = Newtonsoft.Json.JsonConvert.DeserializeObject<KVLeaderboardResponse>(json);
|
||||
var response = Newtonsoft.Json.JsonConvert.DeserializeObject<KvLeaderboardResponse>(json);
|
||||
if (response == null || response.Code != 1 || response.Leaderboard == null ||
|
||||
response.Leaderboard.Any(entry => entry == null || entry.Profile == null))
|
||||
{
|
||||
@@ -244,7 +245,7 @@ namespace GameCore
|
||||
return await PlayFabClientAsyncAPI.GetLeaderboardAsync(reques);
|
||||
}
|
||||
|
||||
private sealed class KVLeaderboardResponse
|
||||
private sealed class KvLeaderboardResponse
|
||||
{
|
||||
public int Code
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace GameCore
|
||||
{
|
||||
public class PlayerData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
MMTService _MMService;
|
||||
public PlayerData(cfg.Tables tables, MMTService mmService)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace GameCore
|
||||
}
|
||||
public partial class PlayerFishData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
private ICustomServerMgr customServerMgr;
|
||||
public PlayerFishData(cfg.Tables tables, ICustomServerMgr customServerMgr)
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace GameCore
|
||||
}
|
||||
public partial class PlayerShopData : IDisposable
|
||||
{
|
||||
game.PlayerDataStorage.IPlayerSaveStore boundSaveStore;
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore
|
||||
Core.KV.IPlayerSaveStore boundSaveStore;
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore
|
||||
{
|
||||
get => boundSaveStore;
|
||||
set { CouponData.BindSaveStore(value); boundSaveStore = value; }
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace GameCore
|
||||
}
|
||||
public class SigninData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private cfg.Tables _tables;
|
||||
public SigninData(cfg.Tables tables)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace GameCore
|
||||
}
|
||||
public class SmallGameData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private cfg.Tables _tables;
|
||||
IUserService userService;
|
||||
ICustomServerMgr customServerMgr;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace GameCore
|
||||
}
|
||||
public class TriggerPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
Tables _tables;
|
||||
PlayerShopData playerShopData;
|
||||
|
||||
@@ -3,7 +3,7 @@ using GameCore;
|
||||
using cfg;
|
||||
public class EventPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private struct Data
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace DataCenter
|
||||
// EventPartnerGather 管理器
|
||||
public class EventPartnerGatherManager : IAutoMatchManagerContext
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
private const bool EnableTraceLogs = false;
|
||||
public const string SaveKey = "EventPartnerGatherData";
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace game
|
||||
{
|
||||
public class EventPinballDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace game
|
||||
{
|
||||
public class EventPotionDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
private bool m_IsSyncData = true;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace game
|
||||
{
|
||||
public class EventScratchTicketDataManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
#if UNITY_EDITOR
|
||||
private bool m_IsCheckCondition = true;
|
||||
private bool m_IsSyncData = true;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class FishingChallengeData
|
||||
|
||||
public class FishingChallengeManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore SaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore SaveStore { get; set; }
|
||||
|
||||
//
|
||||
private const string SaveKey = "FishingChallengeData";
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace DataCenter
|
||||
|
||||
public class OfferChainsChestManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
|
||||
public const string SaveKey = "OfferChainsChestData";
|
||||
[Inject] public Tables _tables { get; set; }
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace DataCenter
|
||||
// Disco Manager
|
||||
public class OfferDiscoPartyManager
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
public const string SaveKey = "OfferDiscoPartyManager";
|
||||
|
||||
// 免费抽奖次数
|
||||
|
||||
@@ -8,7 +8,7 @@ using game;
|
||||
using System.Linq;
|
||||
public class PiggyBankPackData
|
||||
{
|
||||
[asap.core.Inject] public game.PlayerDataStorage.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
[asap.core.Inject] public Core.KV.IPlayerSaveStore playerSaveStore { get; set; }
|
||||
private readonly Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private readonly TbEventPackManager _epm
|
||||
= GContext.container.Resolve<Tables>().TbEventPackManager;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace GameCore
|
||||
}
|
||||
public class TotalRechargeManager
|
||||
{
|
||||
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 TotalRechargeDataKey = "EventTotalRecharge";
|
||||
public TotalRechargeData GetEventData()
|
||||
|
||||
Reference in New Issue
Block a user