update space shooter

pull/134/head
hevinci 2023-07-12 19:15:36 +08:00
parent 472a5ae97a
commit 5931d91b5f
1 changed files with 27 additions and 2 deletions

View File

@ -65,11 +65,12 @@ internal class FsmInitialize : IStateNode
// 联机运行模式 // 联机运行模式
if (playMode == EPlayMode.HostPlayMode) if (playMode == EPlayMode.HostPlayMode)
{ {
string defaultHostServer = GetHostServerURL();
string fallbackHostServer = GetHostServerURL();
var createParameters = new HostPlayModeParameters(); var createParameters = new HostPlayModeParameters();
createParameters.DecryptionServices = new GameDecryptionServices(); createParameters.DecryptionServices = new GameDecryptionServices();
createParameters.QueryServices = new GameQueryServices(); createParameters.QueryServices = new GameQueryServices();
createParameters.DefaultHostServer = GetHostServerURL(); createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
createParameters.FallbackHostServer = GetHostServerURL();
initializationOperation = package.InitializeAsync(createParameters); initializationOperation = package.InitializeAsync(createParameters);
} }
@ -115,6 +116,30 @@ internal class FsmInitialize : IStateNode
#endif #endif
} }
/// <summary>
/// 远端资源地址查询服务类
/// </summary>
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}";
}
}
/// <summary> /// <summary>
/// 资源文件解密服务类 /// 资源文件解密服务类
/// </summary> /// </summary>