From 87bb74c55dc23a7c5216ae66b148aa322e3c45c8 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:31:19 +0800 Subject: [PATCH] [raknet] Match `RakPeer::OnConnectionRequest(...)` --- raknet/RakPeer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raknet/RakPeer.cpp b/raknet/RakPeer.cpp index 9c89b3d..595a311 100644 --- a/raknet/RakPeer.cpp +++ b/raknet/RakPeer.cpp @@ -2585,7 +2585,7 @@ void RakPeer::OnConnectionRequest( RakPeer::RemoteSystemStruct *remoteSystem, un } #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); //#ifdef __USE_IO_COMPLETION_PORTS // 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(( 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());