mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-21 05:06:02 +08:00
[raknet] Add TCPInterface class
* Adds TCPInterface ctor * Adds `TCPInterface::Receive()` * Adds `TCPInterface::HasLostConnection()`
This commit is contained in:
28
raknet/TCPInterface.cpp
Normal file
28
raknet/TCPInterface.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
// TODO: Implement TCPInterface.cpp
|
||||
|
||||
#include "TCPInterface.h"
|
||||
|
||||
TCPInterface::TCPInterface()
|
||||
{
|
||||
}
|
||||
|
||||
Packet* TCPInterface::Receive( void )
|
||||
{
|
||||
if (isStarted==false)
|
||||
return 0;
|
||||
return incomingMessages.ReadLock();
|
||||
}
|
||||
PlayerID TCPInterface::HasLostConnection(void)
|
||||
{
|
||||
PlayerID *out;
|
||||
out = lostConnections.ReadLock();
|
||||
if (out)
|
||||
{
|
||||
lostConnections.ReadUnlock();
|
||||
return *out;
|
||||
}
|
||||
else
|
||||
{
|
||||
return UNASSIGNED_PLAYER_ID;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user