- Fixed publicized Barotrauma.dll missing error on DedicatedServer.
- Fixed non-implemented folder search for ModConfig resources.
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
<Lua File="%ModDir%/Lua/LuaSetup.lua" IsAutorun="true" />
|
||||
<Config File="%ModDir%/Config/SettingsShared.xml"/>
|
||||
<Assembly File="%ModDir%/Publicized/BarotraumaCore.dll" IsReferenceModeOnly="true"/>
|
||||
<Assembly File="%ModDir%/Publicized/Barotrauma.dll" Target="Client" IsReferenceModeOnly="true"/>
|
||||
<Assembly File="%ModDir%/Publicized/Barotrauma.dll" Target="Client" IsReferenceModeOnly="true" IsFileRequired="false"/>
|
||||
<Assembly File="%ModDir%/Publicized/DedicatedServer.dll" Target="Server" IsReferenceModeOnly="true"/>
|
||||
</ModConfig>
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using FarseerPhysics.Common;
|
||||
using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
@@ -191,7 +192,14 @@ public sealed partial class ModConfigFileParserService :
|
||||
}
|
||||
else
|
||||
{
|
||||
res.WithError($"{srcOwner.Name}: The file '{filePath}' is missing!");
|
||||
if (srcElement.GetAttributeBool("IsFileRequired", true))
|
||||
{
|
||||
res.WithError($"{srcOwner.Name}: The file '{filePath}' is missing!");
|
||||
}
|
||||
else
|
||||
{
|
||||
res.WithSuccess($"Skipped missing not-required file: '{filePath}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,10 +208,28 @@ public sealed partial class ModConfigFileParserService :
|
||||
if (_storageService.DirectoryExists(folderPath.FullPath) is { IsSuccess: true, Value: true })
|
||||
{
|
||||
var files = _storageService.FindFilesInPackage(srcOwner, folderPath.Value, fileExtension, true);
|
||||
if (files.IsFailed)
|
||||
{
|
||||
res.WithError($"{srcOwner.Name}: Failed to load files from {folderPath}!");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var file in files.Value)
|
||||
{
|
||||
builder.Add(ContentPath.FromRaw(srcOwner, $"%ModDir%/{System.IO.Path.GetRelativePath(System.IO.Path.GetFullPath(srcOwner.Dir), file)}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.WithError($"{srcOwner.Name}: The folder '{filePath}' is missing!");
|
||||
if (srcElement.GetAttributeBool("IsFileRequired", true))
|
||||
{
|
||||
res.WithError($"{srcOwner.Name}: The file '{folderPath}' is missing!");
|
||||
}
|
||||
else
|
||||
{
|
||||
res.WithSuccess($"Skipped missing not-required folder: '{folderPath}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user