diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs index c598a8d..65e3d8b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs @@ -65,11 +65,12 @@ internal class FsmInitialize : IStateNode // 联机运行模式 if (playMode == EPlayMode.HostPlayMode) { + string defaultHostServer = GetHostServerURL(); + string fallbackHostServer = GetHostServerURL(); var createParameters = new HostPlayModeParameters(); createParameters.DecryptionServices = new GameDecryptionServices(); createParameters.QueryServices = new GameQueryServices(); - createParameters.DefaultHostServer = GetHostServerURL(); - createParameters.FallbackHostServer = GetHostServerURL(); + createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer); initializationOperation = package.InitializeAsync(createParameters); } @@ -115,6 +116,30 @@ internal class FsmInitialize : IStateNode #endif } + + /// + /// 远端资源地址查询服务类 + /// + private class RemoteServices : IRemoteServices + { + private readonly string _defaultHostServer; + private readonly string _fallbackHostServer; + + public RemoteServices(string defaultHostServer, string fallbackHostServer) + { + _defaultHostServer = defaultHostServer; + _fallbackHostServer = fallbackHostServer; + } + string IRemoteServices.GetRemoteFallbackURL(string fileName) + { + return $"{_defaultHostServer}/{fileName}"; + } + string IRemoteServices.GetRemoteMainURL(string fileName) + { + return $"{_fallbackHostServer}/{fileName}"; + } + } + /// /// 资源文件解密服务类 ///