[raknet] Match RakPeer::OnConnectionRequest(...)

This commit is contained in:
RD42 2024-08-19 23:31:19 +08:00
parent 98c0a1d2ef
commit 87bb74c55d

View File

@ -2585,7 +2585,7 @@ void RakPeer::OnConnectionRequest( RakPeer::RemoteSystemStruct *remoteSystem, un
} }
#endif #endif
RakNet::BitStream bitStream(sizeof(unsigned char)+sizeof(unsigned short)+sizeof(unsigned int)+sizeof(unsigned short)+sizeof(PlayerIndex)); RakNet::BitStream bitStream(sizeof(unsigned char)+sizeof(unsigned short)+sizeof(unsigned int)+sizeof(unsigned short)+sizeof(PlayerIndex)+sizeof(unsigned int));
bitStream.Write((unsigned char)ID_CONNECTION_REQUEST_ACCEPTED); bitStream.Write((unsigned char)ID_CONNECTION_REQUEST_ACCEPTED);
//#ifdef __USE_IO_COMPLETION_PORTS //#ifdef __USE_IO_COMPLETION_PORTS
// bitStream.Write((unsigned short)myPlayerId.port + ( unsigned short ) index + ( unsigned short ) 1); // bitStream.Write((unsigned short)myPlayerId.port + ( unsigned short ) index + ( unsigned short ) 1);
@ -2596,6 +2596,7 @@ void RakPeer::OnConnectionRequest( RakPeer::RemoteSystemStruct *remoteSystem, un
bitStream.Write(remoteSystem->playerId.port); bitStream.Write(remoteSystem->playerId.port);
bitStream.Write(( PlayerIndex ) GetIndexFromPlayerID( remoteSystem->playerId, true )); bitStream.Write(( PlayerIndex ) GetIndexFromPlayerID( remoteSystem->playerId, true ));
bitStream.Write((unsigned int)0);
SendImmediate((char*)bitStream.GetData(), bitStream.GetNumberOfBitsUsed(), SYSTEM_PRIORITY, RELIABLE, 0, remoteSystem->playerId, false, false, RakNet::GetTime()); SendImmediate((char*)bitStream.GetData(), bitStream.GetNumberOfBitsUsed(), SYSTEM_PRIORITY, RELIABLE, 0, remoteSystem->playerId, false, false, RakNet::GetTime());