- 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" />
|
<Lua File="%ModDir%/Lua/LuaSetup.lua" IsAutorun="true" />
|
||||||
<Config File="%ModDir%/Config/SettingsShared.xml"/>
|
<Config File="%ModDir%/Config/SettingsShared.xml"/>
|
||||||
<Assembly File="%ModDir%/Publicized/BarotraumaCore.dll" IsReferenceModeOnly="true"/>
|
<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"/>
|
<Assembly File="%ModDir%/Publicized/DedicatedServer.dll" Target="Server" IsReferenceModeOnly="true"/>
|
||||||
</ModConfig>
|
</ModConfig>
|
||||||
|
|||||||
+28
-2
@@ -5,6 +5,7 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FarseerPhysics.Common;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
@@ -191,7 +192,14 @@ public sealed partial class ModConfigFileParserService :
|
|||||||
}
|
}
|
||||||
else
|
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 })
|
if (_storageService.DirectoryExists(folderPath.FullPath) is { IsSuccess: true, Value: true })
|
||||||
{
|
{
|
||||||
var files = _storageService.FindFilesInPackage(srcOwner, folderPath.Value, fileExtension, 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
|
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