Merge pull request 'fix(bridge): resolve cliloc file case-insensitively on Linux shards' (#38) from fix/cliloc-case-insensitive-resolve into main
All checks were successful
Release overlay / release (push) Successful in 14s
All checks were successful
Release overlay / release (push) Successful in 14s
Reviewed-on: #38 Reviewed-by: Colby Whitlock <whitlocktech@gmail.com>
This commit is contained in:
@@ -236,18 +236,32 @@ namespace Server.Custom.Bridge
|
|||||||
|
|
||||||
private static string ResolvePath(string lang)
|
private static string ResolvePath(string lang)
|
||||||
{
|
{
|
||||||
|
string name = "cliloc." + lang;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// ServUO's own `Scripts/Misc/DataPath.cs` calls `Files.SetMulPath` for every
|
// ServUO's own `Scripts/Misc/DataPath.cs` calls `Files.SetMulPath` for every
|
||||||
// configured data directory at Configure time, so this resolves against the
|
// configured data directory at Configure time, so this resolves against the
|
||||||
// client the SHARD is running on — including on Linux, where `Ultima.Files`'s
|
// client the SHARD is running on — including on Linux, where `Ultima.Files`'s
|
||||||
// registry lookup finds nothing on its own.
|
// registry lookup finds nothing on its own.
|
||||||
return Files.GetFilePath("cliloc." + lang);
|
string path = Files.GetFilePath(name);
|
||||||
|
|
||||||
|
if (path != null)
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return null;
|
// fall through to the case-insensitive resolver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// `Ultima.Files` probes for exactly `cliloc.<lang>` (lowercase). A Windows client
|
||||||
|
// tree copied onto a case-sensitive Linux filesystem ships it as `Cliloc.enu`, so
|
||||||
|
// that probe misses and `GetFilePath` returns null even though the file is right
|
||||||
|
// there and readable. Fall back to the same case-insensitive, by-enumeration
|
||||||
|
// resolver the UOP animation packages already use — see BridgeUop.FindClientFile
|
||||||
|
// ("the gargoyles import on my machine and not on the server"). Windows is
|
||||||
|
// unchanged: the primary GetFilePath still answers there.
|
||||||
|
return BridgeUop.FindClientFile(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── the decoded table ────────────────────────────────────────────────────────────────
|
// ── the decoded table ────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user