[raknet] Match RakPeer::Receive()

This commit is contained in:
RD42 2024-08-19 22:28:50 +08:00
parent 3fe35198d1
commit c17f510bb7

View File

@ -909,9 +909,13 @@ Packet* RakPeer::Receive( void )
Packet *packet = ReceiveIgnoreRPC();
while (packet && (packet->data[ 0 ] == ID_RPC || (packet->length>sizeof(unsigned char)+sizeof(RakNetTime) && packet->data[0]==ID_TIMESTAMP && packet->data[sizeof(unsigned char)+sizeof(RakNetTime)]==ID_RPC)))
{
// Do RPC calls from the user thread, not the network update thread
// If we are currently blocking on an RPC reply, send ID_RPC to the blocker to handle rather than handling RPCs automatically
HandleRPCPacket( ( char* ) packet->data, packet->length, packet->playerId );
if (packet->playerId != UNASSIGNED_PLAYER_ID)
{
// Do RPC calls from the user thread, not the network update thread
// If we are currently blocking on an RPC reply, send ID_RPC to the blocker to handle rather than handling RPCs automatically
HandleRPCPacket( ( char* ) packet->data, packet->length, packet->playerId );
}
DeallocatePacket( packet );
packet = ReceiveIgnoreRPC();