mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[raknet] Match RakPeer::Receive()
This commit is contained in:
parent
3fe35198d1
commit
c17f510bb7
@ -908,10 +908,14 @@ Packet* RakPeer::Receive( void )
|
|||||||
{
|
{
|
||||||
Packet *packet = ReceiveIgnoreRPC();
|
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)))
|
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)))
|
||||||
|
{
|
||||||
|
if (packet->playerId != UNASSIGNED_PLAYER_ID)
|
||||||
{
|
{
|
||||||
// Do RPC calls from the user thread, not the network update thread
|
// 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
|
// 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 );
|
HandleRPCPacket( ( char* ) packet->data, packet->length, packet->playerId );
|
||||||
|
}
|
||||||
|
|
||||||
DeallocatePacket( packet );
|
DeallocatePacket( packet );
|
||||||
|
|
||||||
packet = ReceiveIgnoreRPC();
|
packet = ReceiveIgnoreRPC();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user