refactor(world): extract live entity hydration

This commit is contained in:
Erik 2026-07-21 17:32:45 +02:00
parent 27dcd0ecb7
commit d10c5f2d54
17 changed files with 4310 additions and 1269 deletions

View file

@ -101,16 +101,31 @@ public static class ObjectTableWiring
/// owning runtime accepts its physics generation. Internal for a
/// socket-free conformance test of the subscription body.
/// </summary>
public static void ApplyEntitySpawn(
public static bool ApplyEntitySpawn(
ClientObjectTable table,
WorldSession.EntitySpawn spawn,
bool replaceGeneration = false)
bool replaceGeneration = false,
Func<bool>? accepting = null)
{
ArgumentNullException.ThrowIfNull(table);
if (accepting?.Invoke() == false)
return false;
WeenieData data = ToWeenieData(spawn);
if (replaceGeneration)
table.ReplaceGeneration(data, spawn.InstanceSequence);
{
return table.ReplaceGeneration(
data,
spawn.InstanceSequence,
accepting) is not null;
}
else
table.Ingest(data);
// Ingest publishes ObjectAdded/ObjectUpdated synchronously. A nested
// replacement wins; report the invalidated outer application so its
// remaining CreateObject tail cannot run.
return accepting?.Invoke() != false;
}
/// <summary>