Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <RCONServer.h>
Public Member Functions | |
cConnection (cRCONServer &a_RCONServer, const AString &a_IPAddress) | |
Public Member Functions inherited from cTCPLink::cCallbacks | |
virtual void | OnTlsHandshakeCompleted (void) |
Called when the TLS handshake has been completed and communication can continue regularly. More... | |
virtual | ~cCallbacks () |
Protected Member Functions | |
virtual void | OnError (int a_ErrorCode, const AString &a_ErrorMsg) override |
Called when an error is detected on the connection. More... | |
virtual void | OnLinkCreated (cTCPLinkPtr a_Link) override |
Called when the cTCPLink for the connection is created. More... | |
virtual void | OnReceivedData (const char *a_Data, size_t a_Length) override |
Called when there's data incoming from the remote peer. More... | |
virtual void | OnRemoteClosed (void) override |
Called when the remote end closes the connection. More... | |
bool | ProcessPacket (UInt32 a_RequestID, UInt32 a_PacketType, UInt32 a_PayloadLength, const char *a_Payload) |
Processes the given packet and sends the response; returns true if successful, false if the connection is to be dropped. More... | |
void | SendResponse (UInt32 a_RequestID, UInt32 a_PacketType, UInt32 a_PayloadLength, const char *a_Payload) |
Sends a RCON packet back to the client. More... | |
UInt32 | UIntFromBuffer (const char *a_Buffer) |
Reads 4 bytes from a_Buffer and returns the LE UInt32 they represent. More... | |
void | UIntToBuffer (UInt32 a_Value, char *a_Buffer) |
Puts 4 bytes representing the int into the buffer. More... | |
Protected Attributes | |
AString | m_Buffer |
Buffer for the incoming data. More... | |
AString | m_IPAddress |
Address of the client. More... | |
bool | m_IsAuthenticated |
Set to true if the client has successfully authenticated. More... | |
cTCPLinkPtr | m_Link |
The TCP link to the client. More... | |
cRCONServer & | m_RCONServer |
Server that owns this connection and processes requests. More... | |
Friends | |
class | cRCONCommandOutput |
Definition at line 38 of file RCONServer.h.
cRCONServer::cConnection::cConnection | ( | cRCONServer & | a_RCONServer, |
const AString & | a_IPAddress | ||
) |
Definition at line 184 of file RCONServer.cpp.
|
overrideprotectedvirtual |
Called when an error is detected on the connection.
Implements cTCPLink::cCallbacks.
Definition at line 256 of file RCONServer.cpp.
|
overrideprotectedvirtual |
Called when the cTCPLink for the connection is created.
The callback may store the cTCPLink instance for later use, but it should remove it in OnError(), OnRemoteClosed() or right after Close().
Implements cTCPLink::cCallbacks.
Definition at line 195 of file RCONServer.cpp.
|
overrideprotectedvirtual |
Called when there's data incoming from the remote peer.
Implements cTCPLink::cCallbacks.
Definition at line 204 of file RCONServer.cpp.
|
overrideprotectedvirtual |
Called when the remote end closes the connection.
The link is still available for connection information query (IP / port). Sending data on the link is not an error, but the data won't be delivered.
Implements cTCPLink::cCallbacks.
Definition at line 247 of file RCONServer.cpp.
|
protected |
Processes the given packet and sends the response; returns true if successful, false if the connection is to be dropped.
Definition at line 266 of file RCONServer.cpp.
|
protected |
Sends a RCON packet back to the client.
Definition at line 339 of file RCONServer.cpp.
|
protected |
Reads 4 bytes from a_Buffer and returns the LE UInt32 they represent.
Definition at line 317 of file RCONServer.cpp.
|
protected |
Puts 4 bytes representing the int into the buffer.
Definition at line 327 of file RCONServer.cpp.
|
friend |
Definition at line 45 of file RCONServer.h.
|
protected |
Buffer for the incoming data.
Definition at line 51 of file RCONServer.h.
|
protected |
Address of the client.
Definition at line 60 of file RCONServer.h.
|
protected |
Set to true if the client has successfully authenticated.
Definition at line 48 of file RCONServer.h.
|
protected |
The TCP link to the client.
Definition at line 57 of file RCONServer.h.
|
protected |
Server that owns this connection and processes requests.
Definition at line 54 of file RCONServer.h.