diff --git a/RP_L4/RPL4PB.cpp b/RP_L4/RPL4PB.cpp index 86ae448..f275dc1 100644 --- a/RP_L4/RPL4PB.cpp +++ b/RP_L4/RPL4PB.cpp @@ -419,6 +419,47 @@ void NetworkManager *net_mgr = GetNetworkManager(); Check(net_mgr); NetworkClient *client = net_mgr->GetNetworkClientPointer(packet->clientID); + + // + // Say what is being routed where, for the first few. + // + // Playback dies inside Mission::Mission, reached through the egg file + // handler, while dispatching spooled packets - so a packet is arriving + // at a client that is not the one it was recorded for. Client IDs and + // message IDs are both small integers counted from the same base + // (NetworkClient::NextMessageID is 3, so the interest manager's + // NewDynamicEntity and the network manager's ReceiveEggFile are BOTH + // message 3), which makes a mis-routed packet look perfectly valid to + // whoever receives it. Naming the pair and the client it resolved to + // ends the guessing. + // + // A NULL client is the other candidate: Check() is a no-op in a + // release build, so a missing interest manager would be a call through + // nothing rather than a complaint. + // + { + static int said = 0; + + if (said < 24) + { + ++said; + DEBUG_STREAM << "Playback: packet client=" << (int) packet->clientID + << " message=" << (int) packet->messageData.messageID + << " length=" << (int) packet->messageData.messageLength + << " -> client " << (void *) client + << (client == NULL ? " (NULL!)" : "") + << (client == (NetworkClient *) net_mgr ? " = the NETWORK MANAGER" : "") + << (client == (NetworkClient *) this ? " = the application" : "") + << (client == (NetworkClient *) GetInterestManager() + ? " = the interest manager" : "") + << "\n" << std::flush; + } + } + + if (client == NULL) + { + return; + } Check(client); client->ReceiveNetworkPacket(packet, &packet->messageData); Check_Fpu();