3.3 KiB
Object-sound lifecycle admission
The source-opcode audit marks SMSG_PLAY_OBJECT_SOUND (0x278) state-dependent with three historical unhandled observations and no test references. Current ownership was checked in outbox/queue, and this route was claimed before edits. Historical counters are not themselves a bug reproduction.
Contract and reproduced bug
Reuse source WorldObject::PlayDistanceSound, Object.cpp:2550: the 12-byte body is uint32 sound kit followed by uint64 object GUID. Its explicit source comment says the client ignores the sound if the unit is not loaded. The preserved 70334 PlayObjectSound declaration in the codec-statbonus closure and maintained MiscPackets.cpp:508 establish the existing writer fields: kit, source GUID, target GUID, XYZ, BroadcastTextID. File digests are recorded in receipt.json. No new binary scan or inferred opcode remap was performed. This is a lifecycle correction to the existing native route; the packet opcode and layout remain unchanged. Actual client audio playback is not claimed.
The general native_guid() synthesizes player GUIDs without requiring their presentation and returns a zero GUID for source zero. bindings() also admits sent actors without checking current map/realm or world lifecycle. Consequently case0x278 emitted spatial sound packets for unknown players, stale actors, inactive world state, and the selected player even after genuine source logout.
Change
Only case0x278 now requires an active self-created world, location and realm, with no completed logout or pending near/far transfer. The emitter must be the selected self or a current sent, eligible world actor with nonzero generation/GUID and matching presentation map/realm. Inventory kinds cannot serve as spatial emitters. The general GUID resolver and all other opcode routes are unchanged. No sound buffering or replay is introduced.
Validation
The exact final test runs33 checks. Against the unchanged completed host library it reports20 failures; with the changed translation unit it reports0. Positive cases compare the entire native packet for self, peer, creature and gameobject. Negative cases cover unknown/zero source, pre-self/missing-location/logout/near-transfer/far-transfer states, unsent/ineligible/zero-generation/empty-GUID/wrong-map/wrong-realm/inventory actors, and malformed12-byte framing. Genuine Source DESTROY_OBJECT retires the binding; a replacement generation emits its new native GUID. Genuine Source LOGOUT_COMPLETE prevents the former self fallback.
Compiled the changed world_translation.cpp once with the parent's exact host flags/profile definitions and own source/include paths, using -Wall -Wextra -Wpedantic -Werror. Linked that object into the focused executable ahead of the completed rollup shared library and static protocol dependency, so the tested translate method is the changed one; all unchanged dependencies were reused read-only. No complete native/codec build or gate was repeated. Raw build logs remain under this worktree's build/object-sound.
CMake registers native-object-sound-lifecycle with15-second timeout. Parent integration should build the registered target normally. Native rebuild is required to ship the runtime fix; codec and client content are unchanged. Claude retains all client/shipping acceptance.