From 5931d91b5fb0e1ec0b7692b497fb0ef00181be9e Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 12 Jul 2023 19:15:36 +0800 Subject: [PATCH] update space shooter --- .../PatchLogic/FsmNode/FsmInitialize.cs | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) 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}"; + } + } + /// /// 资源文件解密服务类 ///