feat(engine): inventory bar declutter, in-world hotreload hold, chat combat filters, Enl planner
Inventory: Item Count / GInv / RSort off the bar (Inventory + Mini Remote), Mini Remote under Inventory. Hotreload: hold FileWatcher and ERl while in-world (MayHotReload / ReloadInWorldGate) to stop CoreCLR AV on gen2. Chat: UB-IT combat standard filters (melee/missile/magic, reckless/sneak, vitals). Skills Progression: Enl calculator UI (levels, materials, sigil chain) from ILT JSON.
This commit is contained in:
parent
f893c54721
commit
a188f2a322
37 changed files with 1343 additions and 80 deletions
|
|
@ -99,6 +99,7 @@ namespace EngineSettingsTests
|
|||
Console.WriteLine("ImGuiBackend=" + EngineSettings.EnableImGuiBackend);
|
||||
Console.WriteLine("ServerMessageStream=" + EngineSettings.ServerMessageStream);
|
||||
Console.WriteLine("MaxHotReloads=" + EngineSettings.MaxHotReloads);
|
||||
Console.WriteLine("AllowInWorldAutoHotReload=" + EngineSettings.AllowInWorldAutoHotReload);
|
||||
Console.WriteLine("CloseOnServerDisconnect=" + EngineSettings.CloseOnServerDisconnect);
|
||||
Console.WriteLine("IltServerNames=" + (EngineSettings.IltServerNames is { } n ? string.Join("|", n) : "(none)"));
|
||||
break;
|
||||
|
|
|
|||
95
tools/ReloadInWorldGateTests/Program.cs
Normal file
95
tools/ReloadInWorldGateTests/Program.cs
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
using RynthCore.Engine;
|
||||
|
||||
namespace ReloadInWorldGateTests;
|
||||
|
||||
/// <summary>
|
||||
/// Offline checks for ReloadInWorldGate (automatic hot reload must not tear the engine
|
||||
/// down mid-session). See the csproj comment for the cases.
|
||||
/// </summary>
|
||||
internal static class Program
|
||||
{
|
||||
private static int _checks, _failed;
|
||||
private static string _case = "";
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
ShouldHoldRules();
|
||||
ClearWhenNotInWorld();
|
||||
WaitsUntilLeftWorld();
|
||||
ThrowingHoldNeverWedges();
|
||||
|
||||
Console.WriteLine($"{_checks} check(s), {_failed} failed.");
|
||||
return _failed == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
private static void Check(bool ok, string what)
|
||||
{
|
||||
_checks++;
|
||||
if (ok) return;
|
||||
_failed++;
|
||||
Console.WriteLine($"[FAIL] {_case}: {what}");
|
||||
}
|
||||
|
||||
private static void ShouldHoldRules()
|
||||
{
|
||||
_case = "ShouldHold";
|
||||
Check(ReloadInWorldGate.ShouldHold(byHand: true, allowInWorldAuto: false, inWorld: true), "by hand + in world: still hold (ERl must not bypass)");
|
||||
Check(!ReloadInWorldGate.ShouldHold(byHand: false, allowInWorldAuto: true, inWorld: true), "allow in-world auto: never hold");
|
||||
Check(!ReloadInWorldGate.ShouldHold(byHand: false, allowInWorldAuto: false, inWorld: false), "out of world: never hold");
|
||||
Check(ReloadInWorldGate.ShouldHold(byHand: false, allowInWorldAuto: false, inWorld: true), "auto + in world: hold");
|
||||
}
|
||||
|
||||
private static void ClearWhenNotInWorld()
|
||||
{
|
||||
_case = "clear";
|
||||
var logs = new List<string>();
|
||||
var outcome = ReloadInWorldGate.Run(
|
||||
stillHold: () => false,
|
||||
log: logs.Add,
|
||||
notify: null,
|
||||
waited: out TimeSpan waited,
|
||||
clock: () => new DateTime(2026, 10, 16, 9, 0, 0, DateTimeKind.Utc),
|
||||
sleep: _ => { });
|
||||
Check(outcome == ReloadInWorldGate.Outcome.Clear, $"Clear (got {outcome})");
|
||||
Check(waited == TimeSpan.Zero, "no wait");
|
||||
Check(logs.Count == 0, "nothing logged");
|
||||
}
|
||||
|
||||
private static void WaitsUntilLeftWorld()
|
||||
{
|
||||
_case = "wait then clear";
|
||||
var now = new DateTime(2026, 10, 16, 9, 0, 0, DateTimeKind.Utc);
|
||||
int polls = 0;
|
||||
var logs = new List<string>();
|
||||
var notes = new List<string>();
|
||||
var outcome = ReloadInWorldGate.Run(
|
||||
stillHold: () => ++polls <= 5, // hold for 5 polls, then clear
|
||||
log: logs.Add,
|
||||
notify: notes.Add,
|
||||
waited: out TimeSpan waited,
|
||||
clock: () => now,
|
||||
sleep: t => now += t,
|
||||
poll: TimeSpan.FromSeconds(2),
|
||||
logEvery: TimeSpan.FromSeconds(30));
|
||||
Check(outcome == ReloadInWorldGate.Outcome.ClearedAfterWait, $"ClearedAfterWait (got {outcome})");
|
||||
Check(Math.Abs(waited.TotalSeconds - 10) < 0.01, $"waited 10 s (got {waited.TotalSeconds})");
|
||||
Check(logs.Count >= 2 && logs[0].Contains("player is in the world", StringComparison.Ordinal),
|
||||
$"first log names the world: {logs.FirstOrDefault()}");
|
||||
Check(logs[^1].Contains("left the world", StringComparison.Ordinal), $"last log: {logs[^1]}");
|
||||
Check(notes.Count == 1 && notes[0].Contains("in the world", StringComparison.Ordinal), "chat notify once");
|
||||
}
|
||||
|
||||
private static void ThrowingHoldNeverWedges()
|
||||
{
|
||||
_case = "throwing stillHold";
|
||||
var outcome = ReloadInWorldGate.Run(
|
||||
stillHold: () => throw new InvalidOperationException("boom"),
|
||||
log: _ => { },
|
||||
notify: null,
|
||||
waited: out TimeSpan waited,
|
||||
clock: () => DateTime.UtcNow,
|
||||
sleep: _ => { });
|
||||
Check(outcome == ReloadInWorldGate.Outcome.Clear, "throwing query fails open to Clear");
|
||||
Check(waited == TimeSpan.Zero, "no wait on throw");
|
||||
}
|
||||
}
|
||||
23
tools/ReloadInWorldGateTests/ReloadInWorldGateTests.csproj
Normal file
23
tools/ReloadInWorldGateTests/ReloadInWorldGateTests.csproj
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!--
|
||||
Offline checks for the in-world automatic hot-reload gate (2026-10-16):
|
||||
src\RynthCore.Engine\ReloadInWorldGate.cs. Automatic reloads wait while the player is
|
||||
in the world; manual / AllowInWorldAutoHotReload skip; leaving the world clears; a
|
||||
throwing stillHold never wedges. Clock and sleep are fakes.
|
||||
Run: dotnet run -c Release (exit 0 = pass, 1 = fail)
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<RootNamespace>ReloadInWorldGateTests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\src\RynthCore.Engine\ReloadInWorldGate.cs" Link="Engine\ReloadInWorldGate.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Loading…
Reference in a new issue