MP cross-pod damage ROOT-CAUSED: EntityID localID corrupted by hostID on the wire (task #47)
Traced the dispatched-message delivery end to end with BT_MP_NET / BT_MP_FORCE_DMG. Everything works except one wire step: - A's Entity::Dispatch reroutes the replicant's TakeDamage (application->SendMessage(ownerID=3, EntityManager, msg)); POST-Dispatch the message carries entityID=3:22 (host:local) -- the replicant's own ID, matching B's master (GetEntityID()==3:22). VERIFIED sent. - On B the message ARRIVES, GetEntityPointer finds an entity, Posts it, the event drains (ProcessEventTask = ProcessOneEvent(0)), Event::Process runs, Receive finds+calls a handler. VERIFIED the full deliver chain. - BUG: B receives entityID=3:19, NOT 3:22 -- the localID dropped by exactly the hostID (3) between A's send and B's receive. So GetEntityPointer(3:19) returns the WRONG entity (classID 48, not the mech 0xBB9), whose base handler ignores the unaimed hit -> 0 damage. Auto-replicated UPDATE records (msgID 18) arrive with the correct 3:22 and find the mech, so the corruption is specific to the dispatched- message wire path/direction. Next: the host-relative EntityID (de)serialization on the dispatched-msg path (RoutePacket / packet EntityID encoding) -- diff vs the update path which translates correctly. Diagnostics retained (all BT_MP_NET-gated, off in solo -- verified: solo 22 hits, 0 probe noise). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
a9c3e96f20
commit
c78662a0f1
@@ -241,6 +241,13 @@ void
|
||||
// If this is a replicant instance, reroute the message to the master
|
||||
//-------------------------------------------------------------------
|
||||
//
|
||||
if (getenv("BT_MP_NET") && message->messageID != 6)
|
||||
DEBUG_STREAM << "[mp-disp] Entity::Dispatch msgID=" << (int)message->messageID
|
||||
<< " inst=" << (int)GetInstance()
|
||||
<< (GetInstance() == ReplicantInstance ? " REPLICANT -> reroute to master"
|
||||
: (IsValid() ? " master/valid -> local Receive" : " INVALID -> Post"))
|
||||
<< "\n" << std::flush;
|
||||
|
||||
if (GetInstance() == ReplicantInstance)
|
||||
{
|
||||
application->SendMessage(
|
||||
|
||||
Reference in New Issue
Block a user