refactor(world): extract live entity hydration
This commit is contained in:
parent
27dcd0ecb7
commit
d10c5f2d54
17 changed files with 4310 additions and 1269 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue