AutoId review fixes: tag before send, pack waits out combat, sweep retries
- The flight tag is registered BEFORE _requestId again, so a 0xC8 that AC puts on the wire inside the call is still tagged. EngineSend returns a token; a call that returns false or throws hands it to EngineSendFailed, which retires the entry (a no-op once it was matched, or when the slot now holds another id). FlightRecorderTests: a synchronous send is tagged, a failed send leaves no live entry, a retire for another id or a bad token is a no-op. - Inventory sends wait (WaitCombat, kept, counted once) while a target is selected, a cast is in flight (CastGate.GetCastBusyState) or an attack runs (ClientActionGates.TryReadAttacking). Each 0xC8 raises AC's busy count, which plugins gate casts on. The selected target and an open container are not held; All mode is unchanged. combat= in the minute line, combat in /rc autoid status. - The login sweep looks into containers only (ItemsCapacity > 0 in the PWD snapshot, the engine's own pack rule), skips a tick while the pending list is full, and is marked done only when nothing overflowed; otherwise it runs again once there is room. - CollectOwnedIdsFromSnapshot has its doc comment back; HasPwdSnapshot and the new IsContainerInSnapshot have their own. LiveWorld's send is renamed QueueIdentify and block-bodied, so check_offthread_mutators.py scans it and its allow-list entry no longer also covers the create-path Enqueue. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c9bbafbfb4
commit
8668f2a3ca
11 changed files with 224 additions and 50 deletions
|
|
@ -27,7 +27,8 @@
|
|||
// a client crashed in AC's CreateObject handling during the
|
||||
// login create burst). A container the player opened after the last
|
||||
// transition ended is not deferred. Inventory sends are capped at 5 a
|
||||
// second. Creatures, ground items, other players: never.
|
||||
// second and wait while a target is selected or a cast or attack is in
|
||||
// flight. Creatures, ground items, other players: never.
|
||||
// Off nothing, the selected target included.
|
||||
// Plugins calling the host RequestId are not limited by any of this.
|
||||
//
|
||||
|
|
@ -97,6 +98,8 @@ internal static class AutoIdPolicy
|
|||
WaitRate,
|
||||
/// <summary>Place unknown and the object snapshot still empty: keep it (up to UnknownMaxWaitMs).</summary>
|
||||
WaitSnapshot,
|
||||
/// <summary>Inventory while in combat (a target selected, a cast or an attack in flight): keep it.</summary>
|
||||
WaitCombat,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -110,9 +113,12 @@ internal static class AutoIdPolicy
|
|||
/// <paramref name="inventoryRateOk"/>: Inventory only, the send rate allows one now (<see cref="InventoryRateAllows"/>).
|
||||
/// <paramref name="snapshotWarm"/>: Unknown only, the object snapshot has been filled (an
|
||||
/// object missing from a warm snapshot is not coming; one missing from a cold one may be).
|
||||
/// <paramref name="combatBusy"/>: Inventory only, a target is selected or a cast or attack is in
|
||||
/// flight. Each 0xC8 raises AC's busy count, which plugins gate casts on, so the pack waits.
|
||||
/// </summary>
|
||||
public static Verdict Decide(AutoIdMode mode, Class cls, long ageMs, bool inDefer, bool openedAfterSettle,
|
||||
bool fresh, bool cached, bool inventoryRateOk = true, bool snapshotWarm = true)
|
||||
bool fresh, bool cached, bool inventoryRateOk = true, bool snapshotWarm = true,
|
||||
bool combatBusy = false)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
|
|
@ -139,6 +145,7 @@ internal static class AutoIdPolicy
|
|||
if (cached) return Verdict.SkipFresh;
|
||||
if (ageMs < MinAgeMs) return Verdict.WaitAge;
|
||||
if (inDefer) return Verdict.WaitDefer;
|
||||
if (combatBusy) return Verdict.WaitCombat;
|
||||
if (!inventoryRateOk) return Verdict.WaitRate;
|
||||
return Verdict.Send;
|
||||
case Class.Unknown:
|
||||
|
|
|
|||
Loading…
Reference in a new issue