mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-20 04:36:01 +08:00
[raknet] Match RakPeer::NotifyAndFlagForDisconnect(...)
This commit is contained in:
@ -2624,17 +2624,22 @@ void RakPeer::OnConnectionRequest( RakPeer::RemoteSystemStruct *remoteSystem, un
|
|||||||
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
void RakPeer::NotifyAndFlagForDisconnect( const PlayerID playerId, bool performImmediate, unsigned char orderingChannel )
|
void RakPeer::NotifyAndFlagForDisconnect( const PlayerID playerId, bool performImmediate, unsigned char orderingChannel )
|
||||||
{
|
{
|
||||||
|
if (playerId == UNASSIGNED_PLAYER_ID) return;
|
||||||
|
|
||||||
RakNet::BitStream temp( sizeof(unsigned char) );
|
RakNet::BitStream temp( sizeof(unsigned char) );
|
||||||
temp.Write( (unsigned char) ID_DISCONNECTION_NOTIFICATION );
|
temp.Write( (unsigned char) ID_DISCONNECTION_NOTIFICATION );
|
||||||
if (performImmediate)
|
if (performImmediate)
|
||||||
{
|
{
|
||||||
SendImmediate((char*)temp.GetData(), temp.GetNumberOfBitsUsed(), LOW_PRIORITY, RELIABLE_ORDERED, orderingChannel, playerId, false, false, RakNet::GetTime());
|
RemoteSystemStruct *rss=GetRemoteSystemFromPlayerID(playerId, false, true);
|
||||||
RemoteSystemStruct *rss=GetRemoteSystemFromPlayerID(playerId, true, true);
|
if (rss)
|
||||||
|
{
|
||||||
|
SendImmediate((char*)temp.GetData(), temp.GetNumberOfBitsUsed(), HIGH_PRIORITY, UNRELIABLE, orderingChannel, playerId, false, false, RakNet::GetTime());
|
||||||
rss->connectMode=RemoteSystemStruct::DISCONNECT_ASAP;
|
rss->connectMode=RemoteSystemStruct::DISCONNECT_ASAP;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SendBuffered((const char*)temp.GetData(), temp.GetNumberOfBitsUsed(), LOW_PRIORITY, RELIABLE_ORDERED, orderingChannel, playerId, false, RemoteSystemStruct::DISCONNECT_ASAP);
|
SendBuffered((const char*)temp.GetData(), temp.GetNumberOfBitsUsed(), HIGH_PRIORITY, UNRELIABLE, orderingChannel, playerId, false, RemoteSystemStruct::DISCONNECT_ASAP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user