refactor(world): extract live entity hydration
This commit is contained in:
parent
27dcd0ecb7
commit
d10c5f2d54
17 changed files with 4310 additions and 1269 deletions
|
|
@ -576,7 +576,10 @@ public sealed class ClientObjectTable
|
|||
/// Atomically replaces the retained qualities for a newer server object
|
||||
/// incarnation while publishing a generation-specific teardown event.
|
||||
/// </summary>
|
||||
public ClientObject ReplaceGeneration(WeenieData data, ushort generation)
|
||||
public ClientObject? ReplaceGeneration(
|
||||
WeenieData data,
|
||||
ushort generation,
|
||||
Func<bool>? canInstallReplacement = null)
|
||||
{
|
||||
RemoveCore(
|
||||
data.Guid,
|
||||
|
|
@ -584,6 +587,13 @@ public sealed class ClientObjectTable
|
|||
generation,
|
||||
notifyObjectRemoved: true);
|
||||
|
||||
// Removal observers may synchronously accept a newer CreateObject for
|
||||
// this GUID. The outer generation must not resume and merge its stale
|
||||
// qualities into that replacement. The authoritative live-identity
|
||||
// owner supplies the exact-incarnation predicate.
|
||||
if (canInstallReplacement?.Invoke() == false)
|
||||
return null;
|
||||
|
||||
return Ingest(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue