[Milestone] PackageManagementService completed.
- ContentPackageInfoLookup Service completed. - Implemented ModConfigService.cs - Implemented some of the resource processors.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Networking;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Networking;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Barotrauma.LuaCs.Services;
|
||||
|
||||
internal delegate void NetMessageReceived(IReadMessage netMessage);
|
||||
|
||||
internal interface INetworkingService : IReusableService, ILuaCsNetworking
|
||||
internal partial interface INetworkingService : IReusableService, ILuaCsNetworking
|
||||
{
|
||||
bool IsActive { get; }
|
||||
bool IsSynchronized { get; }
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
|
||||
public interface IPackageInfoLookupService : IReusableService
|
||||
{
|
||||
Task<FluentResults.Result<IPackageInfo>> Lookup(string packageName);
|
||||
Task<FluentResults.Result<IPackageInfo>> Lookup(string packageName, ulong steamWorkshopId);
|
||||
Task<FluentResults.Result<IPackageInfo>> Lookup(ulong steamWorkshopId);
|
||||
Task<FluentResults.Result<IPackageInfo>> Lookup(ContentPackage package);
|
||||
void RefreshPackageLists();
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
|
||||
public interface IPackageListRetrievalService : IService
|
||||
{
|
||||
IEnumerable<ContentPackage> GetEnabledContentPackages();
|
||||
IEnumerable<ContentPackage> GetAllContentPackages();
|
||||
}
|
||||
+6
-4
@@ -17,20 +17,22 @@ public interface IPackageManagementService : IReusableService, ILocalizationsRes
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads and parses the provided <see cref="ContentPackage"/> for <see cref="IResourceInfo"/> supported by the current runtime environment.
|
||||
/// Will overwrite any existing package data.
|
||||
/// </summary>
|
||||
/// <param name="packages"></param>
|
||||
/// <param name="packages">Package to load.</param>
|
||||
/// <returns></returns>
|
||||
Task<FluentResults.Result> LoadPackageInfosAsync(ContentPackage packages);
|
||||
Task<FluentResults.Result> LoadPackageInfosAsync(ContentPackage package);
|
||||
/// <summary>
|
||||
/// Loads and parses the provided <see cref="ContentPackage"/> collection for <see cref="IResourceInfo"/> supported by the current runtime environment.
|
||||
/// Will overwrite any existing package data.
|
||||
/// </summary>
|
||||
/// <param name="packages"></param>
|
||||
/// <param name="packages">List of packages to load.</param>
|
||||
/// <returns></returns>
|
||||
Task<IReadOnlyList<(ContentPackage, FluentResults.Result)>> LoadPackagesInfosAsync(IReadOnlyList<ContentPackage> packages);
|
||||
IReadOnlyList<ContentPackage> GetAllLoadedPackages();
|
||||
void DisposePackageInfos(ContentPackage package);
|
||||
void DisposePackagesInfos(IReadOnlyList<ContentPackage> packages);
|
||||
void DisposeAllPackagesInfos();
|
||||
FluentResults.Result<IPackageDependency> GetPackageDependencyInfo(ContentPackage ownerPackage, string packageName, ulong steamWorkshopId);
|
||||
|
||||
// single
|
||||
FluentResults.Result<IAssembliesResourcesInfo> GetAssembliesInfos(ContentPackage package, bool onlySupportedResources = true);
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface IReusableService : IService
|
||||
/// <summary>
|
||||
/// Base interface inherited by all services.
|
||||
/// </summary>
|
||||
/// <exception cref="ObjectDisposedException">Throws exception if `IsDisposed` return true.</exception>
|
||||
public interface IService : IDisposable
|
||||
{
|
||||
bool IsDisposed { get; }
|
||||
|
||||
@@ -32,6 +32,7 @@ public interface IStorageService : IService
|
||||
ImmutableArray<(string, FluentResults.Result<byte[]>)> LoadPackageBinaryFiles(ContentPackage package, ImmutableArray<string> localFilePaths);
|
||||
ImmutableArray<(string, FluentResults.Result<string>)> LoadPackageTextFiles(ContentPackage package, ImmutableArray<string> localFilePaths);
|
||||
FluentResults.Result<ImmutableArray<string>> FindFilesInPackage(ContentPackage package, string localSubfolder, string regexFilter, bool searchRecursively);
|
||||
FluentResults.Result<string> GetAbsFromPackage(ContentPackage package, string localFilePath);
|
||||
// async
|
||||
// singles
|
||||
Task<FluentResults.Result<XDocument>> LoadPackageXmlAsync(ContentPackage package, string localFilePath);
|
||||
@@ -50,6 +51,8 @@ public interface IStorageService : IService
|
||||
FluentResults.Result TrySaveText(string filePath, in string text, Encoding encoding = null);
|
||||
FluentResults.Result TrySaveBinary(string filePath, in byte[] bytes);
|
||||
FluentResults.Result<bool> FileExists(string filePath);
|
||||
FluentResults.Result<bool> DirectoryExists(string directoryPath);
|
||||
|
||||
//async
|
||||
Task<FluentResults.Result<XDocument>> TryLoadXmlAsync(string filePath, Encoding encoding = null);
|
||||
Task<FluentResults.Result<string>> TryLoadTextAsync(string filePath, Encoding encoding = null);
|
||||
|
||||
Reference in New Issue
Block a user