RynthCore as of 2026-10-05 (internal 0d3c210): dashboard slide-outs on the left (Ranges with the selected monster, Files, Patrol), fixed draggable vital bar, click an item to add a loot rule, loot rules by WCID, chat and loot editor typing no longer leaks into the game, title-bar text size, plugin API v76 (close container), plugin exception traces, plates drawn under the game UI (in testing), launcher account passwords encrypted with Windows DPAPI (in testing), release 2026.10.5.1

This commit is contained in:
Tom Bohar 2026-10-05 08:03:08 -04:00
commit c3e15480e5
50 changed files with 3315 additions and 490 deletions

View file

@ -5,7 +5,9 @@
(src\RynthCore.App\AppSettingsStore.cs and DecalAccountModes.cs, compiled in): the choice
lives in decal-accounts.json, appsettings.json never holds a value an older launcher can't
read, migration of a file that does, and what happens when an older launcher edits the
accounts. Works in a temp folder, never in %APPDATA%\RynthCore.
accounts; and saved account passwords (DPAPI-encrypted, AccountPasswordProtection.cs): round
trip, migration of a plain-text file, undecryptable blobs, nothing leaking into files or notes.
Works in a temp folder, never in %APPDATA%\RynthCore. Windows only (DPAPI).
Run: dotnet run -c Release (exit 0 = pass, 1 = fail)
-->
<PropertyGroup>
@ -23,7 +25,9 @@
<Compile Include="..\..\src\RynthCore.App\DecalAccountModes.cs" Link="App\DecalAccountModes.cs" />
<Compile Include="..\..\src\RynthCore.App\InjectionMode.cs" Link="App\InjectionMode.cs" />
<Compile Include="..\..\src\RynthCore.App\LaunchAccountProfile.cs" Link="App\LaunchAccountProfile.cs" />
<Compile Include="..\..\src\RynthCore.App\AccountPasswordProtection.cs" Link="App\AccountPasswordProtection.cs" />
<Compile Include="..\..\src\RynthCore.App\LaunchServerProfile.cs" Link="App\LaunchServerProfile.cs" />
<Compile Include="..\..\src\RynthCore.App\AcLaunchArgumentBuilder.cs" Link="App\AcLaunchArgumentBuilder.cs" />
</ItemGroup>
</Project>

View file

@ -148,6 +148,136 @@ internal static class Program
Check(SidecarIds().SequenceEqual(new[] { "a", "b" }), "rewritten when the list changed");
CheckSharedFilesSafe();
});
// ── saved account passwords (DPAPI) ─────────────────────────────────
// Test-only passwords; nothing here touches the real settings file.
const string Pw = "t3st pw \"quoted\" ü";
const string Pw2 = "Second-Test-Pw";
Scenario("password round trip", root, () =>
{
AppSettings s = Sample();
s.AccountProfiles[0].SetPassword(Pw);
AppSettingsStore.Save(s);
AppSettingsStore.Save(s); // .bak too
CheckNoPlainText(Pw);
CheckNoPlainText("t3st pw");
Check(!RawAccount("a").ContainsKey("Password"), "no plain \"Password\" field written");
Check(!string.IsNullOrEmpty((string?)RawAccount("a")["PasswordProtected"]), "PasswordProtected written");
Check(OldLauncherCanRead(Main_), "the old launcher can still read the file");
AppSettings loaded = AppSettingsStore.Load();
LaunchAccountProfile a = loaded.AccountProfiles.First(x => x.Id == "a");
Check(a.TryGetPasswordForLaunch(out string got, out _) && got == Pw, "decrypts to the saved password");
Check(!a.PasswordNeedsReentry && a.HasSavedPassword, "saved, readable");
Check(AppSettingsStore.LastPasswordMigrationNote == null && AppSettingsStore.LastPasswordProblemNote == null, "no password notes");
var builder = new AcLaunchArgumentBuilder();
LaunchServerProfile ace = Server(AcEmulatorKind.Ace), gdle = Server(AcEmulatorKind.Gdle);
Check(builder.BuildArguments(ace, a).Contains("-v \"t3st pw \\\"quoted\\\" ü\""), "ACE args carry the password (-v)");
Check(builder.BuildArguments(gdle, a).Contains("-a \"A:t3st pw \\\"quoted\\\" ü\""), "GDLE args carry account:password (-a)");
string preview = builder.BuildMaskedArguments(ace, a);
Check(!preview.Contains("t3st") && preview.Contains("-v " + AcLaunchArgumentBuilder.PasswordMask), "preview masked: " + preview);
LaunchAccountProfile noPw = loaded.AccountProfiles.First(x => x.Id == "b");
Check(builder.BuildMaskedArguments(ace, noPw).Contains("-v \"\""), "preview of an account without a password");
Check(builder.BuildArguments(ace, noPw).Contains("-v \"\""), "no saved password still launches as before (empty)");
LaunchAccountProfile copy = a.Clone();
Check(copy.PasswordProtected == a.PasswordProtected, "Clone keeps the encrypted password");
copy.SetPassword(Pw2);
Check(copy.TryGetPasswordForLaunch(out string got2, out _) && got2 == Pw2, "a new password replaces it");
copy.ClearPassword();
Check(!copy.HasSavedPassword && copy.TryGetPasswordForLaunch(out string none, out _) && none.Length == 0, "clear");
Check(AccountPasswordProtection.Protect(Pw) != AccountPasswordProtection.Protect(Pw), "each encryption differs (salted blobs)");
});
Scenario("migrate plain-text passwords from an older file", root, () =>
{
string legacy = """
{ "EnginePath": "X", "AccountProfiles": [
{ "Id": "a", "AccountName": "A", "Password": "PLAIN-PW-ONE", "InjectionMode": "RynthCore" },
{ "Id": "b", "AccountName": "B", "Password": "PLAIN-PW-TWO", "InjectionMode": "RynthCore" },
{ "Id": "c", "AccountName": "C", "Password": "", "InjectionMode": "Decal" },
{ "Id": "d", "AccountName": "D" } ] }
""";
File.WriteAllText(Main_, legacy);
File.WriteAllText(Bak, legacy);
File.WriteAllText(Sidecar, """{ "DecalBridgeAccountIds": [ "b" ] }""");
File.WriteAllText(Main_ + ".corrupt-20260101-000000", "{ old quarantined file");
AppSettings loaded = AppSettingsStore.Load();
Check(AppSettingsStore.LastPasswordMigrationNote?.StartsWith("migrated 2 account password(s) to encrypted storage") == true,
"one note: " + AppSettingsStore.LastPasswordMigrationNote);
Check(AppSettingsStore.LastPasswordMigrationNote?.Contains("corrupt-") == true, "note points at the quarantined file");
Check(PwOf(loaded, "a") == "PLAIN-PW-ONE" && PwOf(loaded, "b") == "PLAIN-PW-TWO", "passwords kept");
Check(!loaded.AccountProfiles.First(x => x.Id == "c").HasSavedPassword, "empty plain password = none saved");
Check(loaded.AccountProfiles.All(x => x.LegacyPlainPassword == null), "no plain text left on the profiles");
CheckNoPlainText("PLAIN-PW-ONE");
CheckNoPlainText("PLAIN-PW-TWO");
Check(!File.ReadAllText(Main_).Contains("\"Password\"") && !File.ReadAllText(Bak).Contains("\"Password\""),
"no \"Password\" field in appsettings.json or .bak");
Check(Mode(loaded, "b") == InjectionMode.DecalBridge && SidecarIds().SequenceEqual(new[] { "b" }),
"decal-accounts.json survives the migration save");
Check(loaded.EnginePath == "X", "other settings kept");
CheckNotesClean("PLAIN-PW-ONE", "PLAIN-PW-TWO");
AppSettings again = AppSettingsStore.Load();
Check(AppSettingsStore.LastPasswordMigrationNote == null, "second load: nothing left to migrate");
Check(PwOf(again, "a") == "PLAIN-PW-ONE", "second load decrypts");
});
Scenario("undecryptable password (copied from another Windows user or PC)", root, () =>
{
AppSettings s = Sample();
s.AccountProfiles[0].SetPassword(Pw);
s.AccountProfiles[1].SetPassword(Pw2);
s.AccountProfiles[2].SetPassword(Pw2);
AppSettingsStore.Save(s);
// Blobs this user can't open: a valid one with a byte changed (DPAPI's integrity
// check fails as it does with another user's key), random bytes, and non-base64.
byte[] blob = Convert.FromBase64String(s.AccountProfiles[0].PasswordProtected);
blob[^5] ^= 0x5A;
SetRaw("a", Convert.ToBase64String(blob));
SetRaw("b", Convert.ToBase64String(Guid.NewGuid().ToByteArray()));
SetRaw("c", "not base64 !!");
AppSettings loaded = AppSettingsStore.Load(); // must not throw
Check(AppSettingsStore.LastLoadDiagnostic == null, "the file is not taken for corrupt");
Check(loaded.AccountProfiles.All(x => x.PasswordNeedsReentry), "all three marked \"password needs re-entering\"");
Check(AppSettingsStore.LastPasswordProblemNote?.Contains("3 saved account password(s)") == true &&
AppSettingsStore.LastPasswordProblemNote.Contains("need re-entering"),
"problem note: " + AppSettingsStore.LastPasswordProblemNote);
LaunchAccountProfile a = loaded.AccountProfiles.First(x => x.Id == "a");
var builder = new AcLaunchArgumentBuilder();
LaunchServerProfile ace = Server(AcEmulatorKind.Ace);
string? error = null;
try { builder.BuildArguments(ace, a); }
catch (InvalidOperationException ex) { error = ex.Message; }
Check(error?.Contains("needs re-entering") == true, "launch refused, not launched with an empty password: " + error);
Check(builder.BuildMaskedArguments(ace, a).Contains("needs re-entering"), "preview says so");
Check(!a.TryGetPasswordForLaunch(out string empty, out _) && empty.Length == 0, "TryGetPasswordForLaunch false");
a.SetPassword(Pw2); // re-entered in the account editor
Check(!a.PasswordNeedsReentry && a.TryGetPasswordForLaunch(out string got, out _) && got == Pw2, "re-entering fixes it");
AppSettingsStore.Save(loaded);
AppSettings reloaded = AppSettingsStore.Load();
Check(!reloaded.AccountProfiles.First(x => x.Id == "a").PasswordNeedsReentry, "fixed after reload");
Check(reloaded.AccountProfiles.First(x => x.Id == "b").PasswordNeedsReentry, "the others still need re-entering");
CheckNoPlainText(Pw2);
});
Scenario("nothing leaks into notes, previews or other files", root, () =>
{
File.WriteAllText(Main_, """{ "AccountProfiles": [ { "Id": "a", "AccountName": "A", "Password": "LEAK-CHECK-PW" } ] }""");
AppSettings loaded = AppSettingsStore.Load();
CheckNotesClean("LEAK-CHECK-PW");
Check(!loaded.AccountProfiles[0].ToString().Contains("LEAK-CHECK-PW"), "display name has no password");
Check(!new AcLaunchArgumentBuilder().BuildMaskedArguments(Server(AcEmulatorKind.Gdle), loaded.AccountProfiles[0]).Contains("LEAK-CHECK-PW"),
"GDLE preview masked");
AppSettingsStore.Save(loaded);
CheckNoPlainText("LEAK-CHECK-PW");
});
}
finally
{
@ -247,6 +377,45 @@ internal static class Program
catch (JsonException) { return false; }
}
private static LaunchServerProfile Server(AcEmulatorKind kind) => new()
{
Id = "s", Name = "Test", Host = "127.0.0.1", Port = 9000, Emulator = kind
};
private static string PwOf(AppSettings s, string id) =>
s.AccountProfiles.First(a => a.Id == id).TryGetPasswordForLaunch(out string pw, out _) ? pw : "<unreadable>";
private static JsonObject RawAccount(string id) =>
JsonNode.Parse(File.ReadAllText(Main_))!["AccountProfiles"]!.AsArray()
.First(a => (string?)a!["Id"] == id)!.AsObject();
private static void SetRaw(string id, string passwordProtected)
{
JsonNode root = JsonNode.Parse(File.ReadAllText(Main_))!;
foreach (JsonNode? a in root["AccountProfiles"]!.AsArray())
if ((string?)a!["Id"] == id) a["PasswordProtected"] = passwordProtected;
File.WriteAllText(Main_, root.ToJsonString());
}
/// <summary>No file the store wrote in the test folder (settings, .bak, .tmp, decal-accounts) holds the password.</summary>
private static void CheckNoPlainText(string password)
{
foreach (string file in Directory.GetFiles(_dir))
{
if (file.Contains(".corrupt-")) continue; // planted by the test itself
Check(!File.ReadAllText(file).Contains(password), $"{Path.GetFileName(file)} has no plain-text password");
}
}
/// <summary>The store's notes (what the launcher logs and shows in the activity panel) hold no password.</summary>
private static void CheckNotesClean(params string[] passwords)
{
foreach (string? note in new[] { AppSettingsStore.LastLoadDiagnostic, AppSettingsStore.LastMigrationNote,
AppSettingsStore.LastPasswordMigrationNote, AppSettingsStore.LastPasswordProblemNote })
foreach (string pw in passwords)
Check(note == null || !note.Contains(pw), "note has no password: " + note);
}
private static void Check(bool ok, string what)
{
_checks++;

View file

@ -62,6 +62,8 @@ MUTATOR_DELEGATES = {
"_eventStackableMerge", "_addTextToScroll",
# CM_Inventory sends (inventory game actions): give, wield, drop (Inventory panel)
"_eventGiveObjectRequest", "_eventGetAndWieldItem", "_eventDropItem",
# CM_Inventory::Event_NoLongerViewingContents (0x0195, close a corpse/chest; v76 CloseContainer)
"_eventNoLongerViewingContents",
"_setAutoRun", "_turnToHeading", "_stopCompletely", "_setMotion",
"_changeCombatMode",
"_sendShopEvent", # VendorTrade: gmVendorUI::SendShopEvent (vendor buy/sell + busy count)

View file

@ -1,191 +0,0 @@
"""Offline tests for gen_locations.py: the coordinate conversion (checked with
towns whose map coordinates every player knows), the place classification,
and a small fake world through build(). No server needed.
Run: python tools/navdata/test_gen_locations.py
"""
import json
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import gen_locations as g # noqa: E402
class CoordinateTests(unittest.TestCase):
def check(self, cell, x, y, ns, ew):
got_ns, got_ew = g.cell_to_map(cell, x, y)
self.assertAlmostEqual(got_ns, ns, delta=0.051, msg='NS of %08X' % cell)
self.assertAlmostEqual(got_ew, ew, delta=0.051, msg='EW of %08X' % cell)
def test_known_towns(self):
# The towns' drop points (the server's points_of_interest) against their
# well-known map coordinates.
self.check(0xA9B40019, 84.0, 7.1, 42.1, 33.6) # Holtburg 42.1N 33.6E
self.check(0x7D64000D, 31.9, 104.6, -21.5, -1.8) # Yaraq 21.5S 1.8W
self.check(0xDA55001D, 84.8, 99.0, -33.5, 72.8) # Shoushi 33.5S 72.8E
def test_landblock_corners(self):
# The map's centre line: landblock 0x7F7F at x = y = 84 is 0.0, 0.0 ... 0x7F*8 = 1016,
# 1016 + 84/24 = 1019.5.
self.check(0x7F7F0001, 84.0, 84.0, 0.0, 0.0)
# The south-west corner of the world.
self.check(0x00000001, 0.0, 0.0, -101.95, -101.95)
def test_format(self):
self.assertEqual(g.fmt_coord(42.08, 33.6), '42.1N, 33.6E')
self.assertEqual(g.fmt_coord(-21.51, -1.82), '21.5S, 1.8W')
def test_outdoor_cell(self):
self.assertTrue(g.is_outdoor_cell(0xA9B40019))
self.assertTrue(g.is_outdoor_cell(0x828E0000))
self.assertFalse(g.is_outdoor_cell(0xA9B40100))
self.assertFalse(g.is_outdoor_cell(0x016C01BC))
class PlaceTests(unittest.TestCase):
def setUp(self):
# Landblock A9B4 has outdoor objects whose lowest stands at z 40.
self.world = g.World([(0xA9B4, 40.0, 60.0, 12)])
def test_places(self):
w = self.world
self.assertEqual(w.place(0xA9B40019, 42.0), 'outdoor')
self.assertEqual(w.place(0xA9B40105, 41.0), 'building')
self.assertEqual(w.place(0xA9B40105, 10.0), 'underground')
self.assertEqual(w.place(0x016C01BC, 0.0), 'dungeon')
self.assertTrue(w.is_surface(0xA9B40105, 41.0))
self.assertFalse(w.is_surface(0x016C01BC, 0.0))
def test_dungeon_names(self):
self.assertEqual(g.dungeon_name('Portal to Mines of Despair'), 'Mines of Despair')
self.assertEqual(g.dungeon_name('Mines of Despair Portal'), 'Mines of Despair')
self.assertEqual(g.dungeon_name('Four Towers Entrance'), 'Four Towers')
self.assertEqual(g.dungeon_name('Portal'), 'Portal')
def test_unescape(self):
self.assertIsNone(g.unescape('NULL'))
self.assertEqual(g.unescape('a\\tb\\nc\\\\d'), 'a\tb\nc\\d')
def fake_rows():
"""A tiny world: Holtburg and Yaraq with portals both ways, a dungeon under
a portal near Holtburg, a lifestone, a vendor, an NPC and a monster."""
def t(*v):
return [None if x is None else str(x) for x in v]
return {
'surface': [t(0xA9B4, 40.0, 60.0, 10), t(0x7D64, 5.0, 9.0, 10), t(0xA9B3, 30.0, 50.0, 3)],
'poi': [t('Holtburg', 42820, 0xA9B40019, 84.0, 7.1, 42.0), t('Yaraq', 42824, 0x7D64000D, 31.9, 104.6, 6.0),
t('Marketplace', 23032, 0x016C01BC, 49.2, -31.9, 0.0)],
'portals': [
# guid wcid cell x y z name dcell dx dy dz minlvl maxlvl quest desc bitmask
t(1, 100, 0xA9B40020, 90.0, 20.0, 42.0, 'Yaraq Portal', 0x7D64000D, 31.9, 104.6, 6.0, None, None, None, None, 1),
t(2, 101, 0x7D640010, 40.0, 100.0, 6.0, 'Holtburg Portal', 0xA9B40019, 84.0, 7.1, 42.0, None, None, None, None, 1),
t(3, 102, 0xA9B30005, 30.0, 30.0, 31.0, 'Portal to Glimmering Cave', 0x01AB0100, 10.0, -10.0, 0.0, 12, None, None,
'A cave.', 1),
t(4, 103, 0x01AB0105, 12.0, -12.0, 0.0, 'Holtburg', 0xA9B40019, 84.0, 7.1, 42.0, None, None, None, None, 1),
t(5, 104, 0xA9B40021, 95.0, 25.0, 42.0, 'Quest Portal', 0x7D64000D, 31.9, 104.6, 6.0, None, None, 'flag', None, 1),
t(6, 105, 0xA9B40022, 96.0, 26.0, 42.0, 'Sealed Portal', 0x7D64000D, 31.9, 104.6, 6.0, None, None, None, None, 0),
t(7, 100, 0xA9B40020, 90.0, 20.0, 42.0, 'Yaraq Portal', 0x7D64000D, 31.9, 104.6, 6.0, None, None, None, None, 1),
],
'places': [
# guid wcid wtype cell x y z name template attackable
t(10, 509, 25, 0xA9B40018, 80.0, 10.0, 42.0, 'Life Stone', None, None),
t(11, 600, 12, 0xA9B40150, 70.0, 30.0, 44.0, 'Shopkeeper Renald', 'Shopkeeper', None),
t(12, 601, 10, 0xA9B4001A, 60.0, 40.0, 42.0, 'Town Crier', 'Herald', 0),
t(13, 602, 10, 0xA9B4001B, 61.0, 41.0, 42.0, 'Drudge Skulker', None, 1),
t(14, 603, 10, 0xA9B4001C, 62.0, 42.0, 42.0, 'Invisible Event Controller', None, 0),
t(15, 604, 10, 0x01AB0110, 20.0, -20.0, 0.0, 'Cave Hermit', None, 0),
],
'recalls': [
t(2041, 'Aerlinthe Recall', 0xBAE8001D, 84.0, 105.0, 26.0),
t(4907, 'Celestial Hand Stronghold Recall', 0x016002A5, 80.0, -160.0, 0.0),
t(4213, 'Colosseum Recall', 0x00AF0118, 40.0, -13.2, 0.0),
],
}
class BuildTests(unittest.TestCase):
def setUp(self):
self.locs, self.recalls, self.route = g.build(fake_rows())
self.by_name = {}
for l in self.locs:
self.by_name.setdefault((l['type'], l['name']), l)
def test_towns(self):
h = self.by_name[('Town', 'Holtburg')]
self.assertAlmostEqual(h['ns'], 42.08, delta=0.01)
self.assertAlmostEqual(h['ew'], 33.6, delta=0.01)
m = self.by_name[('Landmark', 'Marketplace')]
self.assertNotIn('ns', m) # a dungeon: no map position
def test_portals_and_dungeons(self):
p = self.by_name[('Portal', 'Yaraq Portal')]
self.assertEqual(p['dest']['place'], 'outdoor')
self.assertEqual(sum(1 for l in self.locs if l['name'] == 'Yaraq Portal'), 1) # duplicate dropped
d = self.by_name[('Dungeon', 'Glimmering Cave')]
self.assertEqual(d['lb'], '01AB')
self.assertEqual(d['minLevel'], 12)
cave = self.by_name[('Portal', 'Portal to Glimmering Cave')]
self.assertEqual(cave['dest']['name'], 'Glimmering Cave')
exit_ = self.by_name[('Portal', 'Holtburg')]
self.assertNotIn('ns', exit_)
self.assertIn('Glimmering Cave', exit_['desc'])
self.assertTrue(self.by_name[('Portal', 'Quest Portal')]['quest'])
self.assertTrue(self.by_name[('Portal', 'Sealed Portal')]['closed'])
def test_places(self):
self.assertIn(('Lifestone', 'Life Stone'), self.by_name)
v = self.by_name[('Vendor', 'Shopkeeper Renald')]
self.assertEqual(v['place'], 'building')
self.assertNotIn(('NPC', 'Drudge Skulker'), self.by_name) # attackable: a monster
self.assertNotIn(('NPC', 'Invisible Event Controller'), self.by_name) # not a person
self.assertEqual(self.by_name[('NPC', 'Town Crier')]['desc'], 'Herald.')
self.assertIn('Glimmering Cave', self.by_name[('NPC', 'Cave Hermit')]['desc'])
def test_recalls(self):
spells = {r['spell']: r for r in self.recalls}
self.assertIn(2041, spells)
self.assertNotIn(4907, spells) # placeholder destination
self.assertEqual(spells[4213]['place'], 'dungeon')
self.assertAlmostEqual(spells[2041]['ns'], 84.09, delta=0.01)
def test_routing_list(self):
names = [r[4] for r in self.route]
# Surface to surface only; no quest-locked, closed, dungeon or duplicate portals.
self.assertEqual(sorted(names), ['Holtburg Portal', 'Yaraq Portal'])
y = [r for r in self.route if r[4] == 'Yaraq Portal'][0]
self.assertAlmostEqual(y[2], -21.51, delta=0.01)
self.assertAlmostEqual(y[3], -1.82, delta=0.01)
def test_outputs(self):
import tempfile
with tempfile.TemporaryDirectory() as d:
g.write_outputs(d, self.locs, self.recalls, self.route, 'test')
doc = json.load(open(os.path.join(d, 'locations.json'), encoding='utf-8'))
self.assertEqual(doc['version'], 1)
self.assertEqual(len(doc['locations']), len(self.locs))
lines = open(os.path.join(d, 'portals.tsv'), encoding='utf-8').read().splitlines()
self.assertEqual(len(lines), 2)
self.assertEqual(len(lines[0].split('\t')), 5)
class GeneratedDataTests(unittest.TestCase):
"""Checks the committed output (tools/navdata/NavData), when it is there."""
PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'NavData', 'locations.json')
def test_known_towns_in_data(self):
if not os.path.exists(self.PATH):
self.skipTest('no generated locations.json')
doc = json.load(open(self.PATH, encoding='utf-8'))
towns = {l['name']: l for l in doc['locations'] if l['type'] == 'Town'}
for name, ns, ew in (('Holtburg', 42.1, 33.6), ('Yaraq', -21.5, -1.8), ('Shoushi', -33.5, 72.8)):
self.assertIn(name, towns)
self.assertAlmostEqual(towns[name]['ns'], ns, delta=0.1, msg=name)
self.assertAlmostEqual(towns[name]['ew'], ew, delta=0.1, msg=name)
if __name__ == '__main__':
unittest.main(verbosity=1)

View file

@ -303,7 +303,10 @@ def _compat_dir():
def parse_engine_patterns():
srcs = {}
for f in glob.glob(os.path.join(_compat_dir(), "*.cs")):
# Compatibility/ holds nearly every hook; D3D9/AcUiPassHook.cs (RenderUI::RenderObjects)
# is the one function hook that lives with the render code.
engine_dir = os.path.dirname(_compat_dir())
for f in glob.glob(os.path.join(_compat_dir(), "*.cs")) + glob.glob(os.path.join(engine_dir, "D3D9", "*.cs")):
with open(f, "r", encoding="utf-8") as fh:
# Strip // line comments so commas / brackets inside an inline disasm
# comment (e.g. `0x84, 0xC0 // MOV AL,[ESP+4]; TEST AL,AL`) can't corrupt