Snapshot for release 2026.11.2.1 (internal 8d9795d)
This commit is contained in:
parent
b1c182b05d
commit
00ee01167e
29 changed files with 925 additions and 52 deletions
|
|
@ -105,6 +105,7 @@ internal static class Program
|
|||
("sense", "sense compact", "sense frob on"),
|
||||
("characters", "chars", "characters now"),
|
||||
("itemcount", "itemhud", "itemcount now"),
|
||||
("itemtool", "itemtool", "itemtool now"),
|
||||
("resetbar", "barreset", "resetbar now"),
|
||||
("actionstate", "actions", "actionstate now"),
|
||||
("unlockactions", "unlock", "unlockactions now"),
|
||||
|
|
|
|||
|
|
@ -38,6 +38,21 @@ internal static unsafe partial class Program
|
|||
? string.Join(",", ids.Select(i => (i & 0xFFFF).ToString("X")))
|
||||
: "unknown";
|
||||
|
||||
// The order file as engines before version 2 wrote it: no player id after the list count.
|
||||
private static byte[] OldFormatFile((uint Container, bool Slot, uint[] Ids)[] lists)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
var w = new BinaryWriter(ms);
|
||||
w.Write(0x44524F49u); w.Write(1u); w.Write((uint)lists.Length);
|
||||
foreach ((uint c, bool slot, uint[] ids) in lists)
|
||||
{
|
||||
w.Write(c); w.Write(slot ? (byte)1 : (byte)0); w.Write((uint)ids.Length);
|
||||
foreach (uint id in ids) w.Write(id);
|
||||
}
|
||||
w.Flush();
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] MessageWithGuid(uint opcode, uint guid)
|
||||
{
|
||||
var b = new byte[8];
|
||||
|
|
@ -118,6 +133,49 @@ internal static unsafe partial class Program
|
|||
Check(!InventoryOrder.Restore(saved.AsSpan(0, saved.Length - 3)), "a truncated file is refused");
|
||||
Eq(Order(Player, false) + "|" + Order(Player, true), before, "and a refused file changes nothing");
|
||||
|
||||
Case("inventory order: after a restore the player's lists are still never dropped for room");
|
||||
Check(InventoryOrder.Restore(saved), "restored");
|
||||
Eq(InventoryOrder.Player, Player, "the file says whose lists they are");
|
||||
for (uint c = 0; c < 200; c++)
|
||||
InventoryOrder.Observe(GameEvent(0x0196, 0x90000000 + c, 1, 0xA0000000 + c, 0));
|
||||
Eq(Order(Player, false) + "|" + Order(Player, true), before, "the main pack and the pack column survive 200 corpses");
|
||||
|
||||
Case("inventory order: a version 1 file (no player in it) still keeps the player's lists");
|
||||
byte[] v1 = OldFormatFile(new[] { (Player, false, new uint[] { 0x80000001 }), (Player, true, new uint[] { 0x80000004, 0x80000005 }),
|
||||
(0x80000004u, false, new uint[] { 0x80000009 }), (0x80000004u, true, Array.Empty<uint>()) });
|
||||
Check(InventoryOrder.Restore(v1), "a version 1 file is accepted");
|
||||
Eq(InventoryOrder.Player, Player, "the player is the one container in the player id range with a pack column");
|
||||
for (uint c = 0; c < 200; c++)
|
||||
InventoryOrder.Observe(GameEvent(0x0196, 0x90000000 + c, 1, 0xA0000000 + c, 0));
|
||||
Eq(Order(Player, true), "4,5", "its pack column survives 200 corpses");
|
||||
Eq(InventoryOrder.PlayerOf(new[] { (Player, true), (Player + 1, true) }), 0u, "two candidates: none guessed");
|
||||
Eq(InventoryOrder.PlayerOf(new[] { (0x80000004u, true) }), 0u, "an item id is never the player");
|
||||
|
||||
Case("inventory order: a saved file is this client's when written after it started, however old");
|
||||
var start = new DateTime(2026, 10, 30, 12, 0, 0, DateTimeKind.Utc);
|
||||
Check(InventoryOrder.SavedFileIsOurs(start.AddDays(2), start), "written two days ago by this client: used");
|
||||
Check(InventoryOrder.SavedFileIsOurs(start.AddSeconds(-20), start), "clock rounding: used");
|
||||
Check(!InventoryOrder.SavedFileIsOurs(start.AddHours(-1), start), "written before this client started (a recycled pid): not used");
|
||||
Check(InventoryOrder.SavedFileIsOurs(start, null), "start time unknown: used");
|
||||
|
||||
Case("inventory order: a list's hash changes when the list does");
|
||||
InventoryOrder.Reset();
|
||||
Eq(InventoryOrder.ListHash(Player, true), 0u, "unknown: 0");
|
||||
InventoryOrder.Observe(PlayerDescriptionMsg(40, new uint[] { 0x80000001, 0x80000004, 0x80000005 }, new uint[] { 0, 1, 1 }, 0));
|
||||
uint h1 = InventoryOrder.ListHash(Player, true);
|
||||
Check(h1 != 0, "known: not 0");
|
||||
InventoryOrder.Observe(GameEvent(0x0022, 0x80000005, Player, 0, 1));
|
||||
Eq(Order(Player, true), "5,4", "a pack moved to the top of the column");
|
||||
Check(InventoryOrder.ListHash(Player, true) != h1, "and the hash changed");
|
||||
|
||||
Case("inventory order: side packs sorted into the pack column's order");
|
||||
uint[] packs = { Player, 0x80000002, 0x80000003, 0x80000004 };
|
||||
Check(InventoryOrder.SortByColumn(packs, 1, x => x, new uint[] { 0x80000004, 0x80000F01, 0x80000002, 0x80000003 }), "a column naming every pack (a focus between)");
|
||||
Eq(string.Join(",", packs.Select(x => (x & 0xFFFF).ToString("X"))), "1,4,2,3", "main pack stays first, the top pack next");
|
||||
uint[] packs2 = { Player, 0x80000002, 0x80000003 };
|
||||
Check(!InventoryOrder.SortByColumn(packs2, 1, x => x, new uint[] { 0x80000003 }), "a pack the column lacks: refused");
|
||||
Eq(string.Join(",", packs2.Select(x => (x & 0xFFFF).ToString("X"))), "1,2,3", "and left in id order");
|
||||
|
||||
Case("inventory order: junk never throws and never invents a list");
|
||||
InventoryOrder.Reset();
|
||||
var rng = new Random(5);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
RynthCoreSdkApiVersion all match PluginContractVersion.Current;
|
||||
- PluginPaths de-duplication (src\RynthCore.Engine\Plugins\PluginPathDedupe.cs, compiled in):
|
||||
the same DLL listed twice (any case or slashes) loads once; the same file name from two
|
||||
folders keeps the first and warns.
|
||||
folders keeps the first and warns;
|
||||
- the plugin file prefetch list (src\RynthCore.Engine\Plugins\PluginFilePrefetchList.cs, compiled in):
|
||||
listed plugins first, then each plugin folder's DLLs and PDBs, then PluginShared's DLLs.
|
||||
Extra arguments are plugin DLLs to read and check (e.g. a RynthSuite publish folder's).
|
||||
Never loads a plugin, never touches %APPDATA% or C:\Games.
|
||||
Run: dotnet run -c Release [plugin.dll ...] (arguments after a double dash) (exit 0 = pass, 1 = fail)
|
||||
|
|
@ -39,6 +41,7 @@
|
|||
<Compile Include="..\..\src\RynthCore.Engine\Plugins\PluginContractVersion.cs" Link="Engine\PluginContractVersion.cs" />
|
||||
<Compile Include="..\..\src\RynthCore.Engine\Plugins\PluginManifestGate.cs" Link="Engine\PluginManifestGate.cs" />
|
||||
<Compile Include="..\..\src\RynthCore.Engine\Plugins\PluginPathDedupe.cs" Link="Engine\PluginPathDedupe.cs" />
|
||||
<Compile Include="..\..\src\RynthCore.Engine\Plugins\PluginFilePrefetchList.cs" Link="Engine\PluginFilePrefetchList.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ internal static class Program
|
|||
Run(nameof(DedupeSameNameTwoFolders), DedupeSameNameTwoFolders);
|
||||
Run(nameof(DedupeAgainstAlreadyLoaded), DedupeAgainstAlreadyLoaded);
|
||||
Run(nameof(DedupeKeepsOrderAndText), DedupeKeepsOrderAndText);
|
||||
Run(nameof(PrefetchListOrderAndScope), PrefetchListOrderAndScope);
|
||||
foreach (string dll in args)
|
||||
Run("Plugin " + Path.GetFileName(dll), () => CheckBuiltPlugin(dll));
|
||||
}
|
||||
|
|
@ -783,6 +784,35 @@ internal static class Program
|
|||
Eq(PluginPathDedupe.Dedupe(Array.Empty<string>()).Load.Count, 0, "empty list");
|
||||
}
|
||||
|
||||
// ── Prefetch file list (src\RynthCore.Engine\Plugins\PluginFilePrefetchList.cs) ──
|
||||
|
||||
private static void PrefetchListOrderAndScope()
|
||||
{
|
||||
string suite = Path.Combine(_root, "prefetch");
|
||||
string ai = Path.Combine(suite, "RynthAi"), chat = Path.Combine(suite, "RynthChat"), shared = Path.Combine(suite, "PluginShared");
|
||||
foreach (string d in new[] { ai, chat, shared, Path.Combine(ai, "Sub") }) Directory.CreateDirectory(d);
|
||||
void Touch(string path) => File.WriteAllText(path, "x");
|
||||
string aiDll = Path.Combine(ai, "RynthCore.Plugin.RynthAi.dll"), chatDll = Path.Combine(chat, "RynthCore.Plugin.RynthChat.dll");
|
||||
Touch(aiDll); Touch(Path.Combine(ai, "RynthCore.Plugin.RynthAi.pdb")); Touch(Path.Combine(ai, "ImGui.NET.dll"));
|
||||
Touch(Path.Combine(ai, "settings.json")); Touch(Path.Combine(ai, "Sub", "Nested.dll"));
|
||||
Touch(chatDll); Touch(Path.Combine(chat, "ImGui.NET.dll"));
|
||||
Touch(Path.Combine(shared, "RynthCore.PluginSdk.dll")); Touch(Path.Combine(shared, "RynthCore.PluginSdk.pdb"));
|
||||
|
||||
string[] listed = { chatDll, Path.Combine(suite, "Missing", "RynthCore.Plugin.Missing.dll"), Path.Combine(ai, "RYNTHCORE.PLUGIN.RYNTHAI.DLL"), "" };
|
||||
List<string> files = PluginFilePrefetchList.Build(listed, shared);
|
||||
string Rel(string f) => Path.GetRelativePath(suite, f).Replace('\\', '/');
|
||||
string got = string.Join("|", files.Select(Rel));
|
||||
Eq(Rel(files[0]), "RynthChat/RynthCore.Plugin.RynthChat.dll", "listed plugins first, in list order");
|
||||
Check(Rel(files[1]).Equals("RynthAi/RynthCore.Plugin.RynthAi.dll", StringComparison.OrdinalIgnoreCase), $"second listed plugin second: {got}");
|
||||
Eq(files.Count(f => f.EndsWith("RynthCore.Plugin.RynthAi.dll", StringComparison.OrdinalIgnoreCase)), 1, "a plugin listed in another case is opened once");
|
||||
Check(files.Any(f => Rel(f) == "RynthAi/RynthCore.Plugin.RynthAi.pdb") && files.Any(f => Rel(f) == "RynthAi/ImGui.NET.dll")
|
||||
&& files.Any(f => Rel(f) == "RynthChat/ImGui.NET.dll"), $"each plugin folder's DLLs and PDBs: {got}");
|
||||
Check(!files.Any(f => f.EndsWith(".json")) && !files.Any(f => f.Contains("Nested")), $"no other files, no subfolders: {got}");
|
||||
Check(!files.Any(f => f.Contains("Missing")), "a missing plugin adds nothing");
|
||||
Eq(Rel(files[^1]), "PluginShared/RynthCore.PluginSdk.dll", "the shared folder's DLLs last, without PDBs");
|
||||
Eq(PluginFilePrefetchList.Build(Array.Empty<string>(), null).Count, 0, "nothing listed, nothing opened");
|
||||
}
|
||||
|
||||
private static string FindUp(string relative)
|
||||
{
|
||||
for (DirectoryInfo? d = new(AppContext.BaseDirectory); d != null; d = d.Parent)
|
||||
|
|
|
|||
|
|
@ -173,13 +173,20 @@ internal static class Program
|
|||
Check(hand.ModeFor("X/Z") == VideoPatchMode.Off, "a hand-written 'all' loads as off (a start never hides AC's UI)");
|
||||
}
|
||||
|
||||
// 2026-11-02: Off chosen in Settings came back as "World when unfocused" on the next login: the
|
||||
// character's line was removed and the Default line applied. A character's off is now kept.
|
||||
private static void OffRemovesTheLine()
|
||||
{
|
||||
Case("OffRemovesTheLine");
|
||||
var m = VideoPatchPolicy.Parse(null);
|
||||
var m = VideoPatchPolicy.Parse(new[] { "Default=unfocused" });
|
||||
m.Set("X/Y", VideoPatchMode.World);
|
||||
m.Set("X/Y", VideoPatchMode.Off);
|
||||
Check(!VideoPatchPolicy.Serialize(m).Any(l => l.StartsWith("X/Y")), "off leaves no line");
|
||||
Check(VideoPatchPolicy.Serialize(m).Contains("X/Y=off"), "a character's off is a line of its own");
|
||||
var back = RoundTripModel(m);
|
||||
Check(back.ModeFor("X/Y") == VideoPatchMode.Off, "and it wins over Default=unfocused after a reload");
|
||||
Check(back.ModeFor("X/Q") == VideoPatchMode.Unfocused, "a character without a line still gets Default");
|
||||
back.Set("Default", VideoPatchMode.Off);
|
||||
Check(!VideoPatchPolicy.Serialize(back).Any(l => l.StartsWith("Default=")), "Default's off removes its line");
|
||||
}
|
||||
|
||||
private static void DefaultLineAndUnknownLines()
|
||||
|
|
|
|||
Loading…
Reference in a new issue