update space shooter

pull/150/head
hevinci 2023-08-15 18:19:07 +08:00
parent a2d4691f04
commit 995b0c8050
3 changed files with 21 additions and 25 deletions

View File

@ -69,7 +69,8 @@ internal class FsmInitialize : IStateNode
string fallbackHostServer = 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.BuildinQueryServices = new GameQueryServices();
createParameters.DeliveryQueryServices = new DefaultDeliveryQueryServices();
createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer); createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
initializationOperation = package.InitializeAsync(createParameters); initializationOperation = package.InitializeAsync(createParameters);
} }
@ -81,7 +82,7 @@ internal class FsmInitialize : IStateNode
string fallbackHostServer = GetHostServerURL(); string fallbackHostServer = GetHostServerURL();
var createParameters = new WebPlayModeParameters(); var createParameters = new WebPlayModeParameters();
createParameters.DecryptionServices = new GameDecryptionServices(); createParameters.DecryptionServices = new GameDecryptionServices();
createParameters.QueryServices = new GameQueryServices(); createParameters.BuildinQueryServices = new GameQueryServices();
createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer); createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
initializationOperation = package.InitializeAsync(createParameters); initializationOperation = package.InitializeAsync(createParameters);
} }
@ -178,4 +179,19 @@ internal class FsmInitialize : IStateNode
return 1024; return 1024;
} }
} }
/// <summary>
/// 默认的分发资源查询服务类
/// </summary>
private class DefaultDeliveryQueryServices : IDeliveryQueryServices
{
public DeliveryFileInfo GetDeliveryFileInfo(string packageName, string fileName)
{
throw new NotImplementedException();
}
public bool QueryDeliveryFiles(string packageName, string fileName)
{
return false;
}
}
} }

View File

@ -6,18 +6,8 @@ using YooAsset;
/// <summary> /// <summary>
/// 资源文件查询服务类 /// 资源文件查询服务类
/// </summary> /// </summary>
public class GameQueryServices : IQueryServices public class GameQueryServices : IBuildinQueryServices
{ {
public DeliveryFileInfo GetDeliveryFileInfo(string packageName, string fileName)
{
throw new System.NotImplementedException();
}
public bool QueryDeliveryFiles(string packageName, string fileName)
{
return false;
}
public bool QueryStreamingAssets(string packageName, string fileName) public bool QueryStreamingAssets(string packageName, string fileName)
{ {
// 注意fileName包含文件格式 // 注意fileName包含文件格式

View File

@ -9,18 +9,8 @@ using YooAsset;
/// <summary> /// <summary>
/// 资源文件查询服务类 /// 资源文件查询服务类
/// </summary> /// </summary>
public class GameQueryServices2 : IQueryServices public class GameQueryServices2 : IBuildinQueryServices
{ {
public DeliveryFileInfo GetDeliveryFileInfo(string packageName, string fileName)
{
throw new System.NotImplementedException();
}
public bool QueryDeliveryFiles(string packageName, string fileName)
{
return false;
}
public bool QueryStreamingAssets(string packageName, string fileName) public bool QueryStreamingAssets(string packageName, string fileName)
{ {
return StreamingAssetsHelper2.FileExists($"{StreamingAssetsDefine.RootFolderName}/{packageName}/{fileName}"); return StreamingAssetsHelper2.FileExists($"{StreamingAssetsDefine.RootFolderName}/{packageName}/{fileName}");