test(upserver): 归档存档迁移与玩法闭环回归工具

This commit is contained in:
Liubing\LB
2026-09-28 18:16:14 +08:00
parent c4ae02def9
commit a6f5e107f8
232 changed files with 12903 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
--- Client/Assets/Scripts/Services/UserService.cs (reviewed baseline)
+++ Client/Assets/Scripts/Services/UserService.cs
@@ -155,6 +155,9 @@
GContext.OnEvent<EvtAPISvrUnauthorized>().Subscribe(evt =>
{
if (evt.SessionVersion != customServerMgr.SessionVersion) return;
+#if UNITY_EDITOR && !SERVICE_HOST
+ if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) { game.PlayerDataStorage.PlayerKVGameplayLoop.Fault("API unauthorized; restart required."); return; }
+#endif
InternalId = 0;
if (PlayFabClientAPI.IsClientLoggedIn()) _ = LoginApiServer();
});
@@ -185,6 +188,9 @@
private async Task<ELoginStep> LoginCore(Action<int> progress, int generation)
{
+#if UNITY_EDITOR && !SERVICE_HOST
+ if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) return await LoginKVGameplayLoopAsync(progress,generation);
+#endif
if (IsLogin)
{
progress?.Invoke(2);
@@ -344,7 +350,11 @@
var info_request_parameters = new GetPlayerCombinedInfoRequestParams
{
GetUserAccountInfo = true,
+#if UNITY_EDITOR && !SERVICE_HOST
+ GetUserData = !game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled,
+#else
GetUserData = true,
+#endif
GetPlayerProfile = true,
ProfileConstraints = new PlayerProfileViewConstraints()
{
@@ -507,6 +517,9 @@
//InitData should invoke after local time adjusted.
//save login time to local storage.
+#if UNITY_EDITOR && !SERVICE_HOST
+ if(!game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled)
+#endif
InitData(playfabUserData, UserId);
return true;
@@ -546,6 +559,9 @@
return false;
}
customServerMgr.UseAccountSession(session);
+#if UNITY_EDITOR && !SERVICE_HOST
+ if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) return true; // Identity is published only after all KV modules load.
+#endif
InternalId = session.InternalId;
GContext.Publish(new EvtAPISvrLoginSuccess
{
@@ -655,6 +671,9 @@
public virtual void Logout()
{
+#if UNITY_EDITOR && !SERVICE_HOST
+ if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) { _=StopKVGameplayLoopAsync(); return; }
+#endif
if(kvControlledInstance)
{
logoutGeneration++; InternalId=0; UserId=null; DisplayName=null; AvatarUrl=null;