test(upserver): 归档存档迁移与玩法闭环回归工具
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
--- Client/Assets/Scripts/Services/UserService.KVLoad.cs (reviewed baseline)
|
||||
|
||||
+++ Client/Assets/Scripts/Services/UserService.KVLoad.cs
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
|
||||
internal string CaptureSaveBackend() => config==null ? "playfab" : config.Get<string>("SaveBackend","playfab");
|
||||
internal bool RejectSaveBackend(string backend)
|
||||
{
|
||||
+#if UNITY_EDITOR && !SERVICE_HOST
|
||||
+ if(PlayerKVGameplayLoop.Enabled && backend=="kv-loop" && !kvControlledInstance)
|
||||
+ { KVLastError=PlayerKVGameLoadError.None; return false; }
|
||||
+#endif
|
||||
KVLastError=backend=="kv" ? PlayerKVGameLoadError.BackendNotEnabled : backend!="playfab" ? PlayerKVGameLoadError.BackendUnsupported :
|
||||
kvControlledInstance ? PlayerKVGameLoadError.Input : PlayerKVGameLoadError.None;
|
||||
return KVLastError!=PlayerKVGameLoadError.None;
|
||||
@@ -75,14 +79,23 @@
|
||||
|
||||
|
||||
internal virtual void ResetForKVLoad()
|
||||
{
|
||||
- if(!kvControlledInstance || InternalId!=0 || apiSession!=null)
|
||||
+ bool admitted=kvControlledInstance, sessionAllowed=apiSession==null;
|
||||
+#if UNITY_EDITOR && !SERVICE_HOST
|
||||
+ admitted=admitted || KVLoopLoading;
|
||||
+ sessionAllowed=sessionAllowed || KVLoopLoading;
|
||||
+#endif
|
||||
+ if(!admitted || InternalId!=0 || !sessionAllowed)
|
||||
throw new InvalidOperationException("Unstarted controlled identity required.");
|
||||
KVIntents?.Discard(); KVIntents=null; KVLoadingCopy=null;
|
||||
MMTestValue=0; EAccoutUrl=new Dictionary<string,string>(StringComparer.Ordinal); KVTapJoyBalance=0;
|
||||
}
|
||||
internal void ReplaceFromKVDecoded(PlayerKVLoginState state,long epoch,IReadOnlyDictionary<string,string> raw)
|
||||
{
|
||||
- if(!kvControlledInstance || state==null || raw==null) throw new InvalidOperationException("Controlled login state required.");
|
||||
+ bool admitted=kvControlledInstance;
|
||||
+#if UNITY_EDITOR && !SERVICE_HOST
|
||||
+ admitted=admitted || KVLoopLoading;
|
||||
+#endif
|
||||
+ if(!admitted || state==null || raw==null) throw new InvalidOperationException("Controlled login state required.");
|
||||
var copy=raw.ToDictionary(p=>p.Key,p=>p.Value,StringComparer.Ordinal);
|
||||
var intents=new PlayerKVInitializationIntents(epoch,state.Channel);
|
||||
foreach(var pair in state.Normalizations) { copy[pair.Key]=pair.Value; intents.Add(epoch,pair.Key,pair.Value); }
|
||||
Reference in New Issue
Block a user