refactor(kv): 整理存档接线并清理迁移冗余实现

This commit is contained in:
Liubing\LB
2026-10-13 20:38:41 +08:00
parent 144e7f739f
commit edb8a056c7
166 changed files with 3828 additions and 13267 deletions

View File

@@ -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
{