diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2016-02-06 11:37:34 +0100 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2016-02-06 11:37:34 +0100 |
commit | 6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch) | |
tree | 7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/RCONServer.h | |
parent | Merge pull request #2958 from LogicParrot/fence (diff) | |
parent | Bulk clearing of whitespace (diff) | |
download | cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2 cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip |
Diffstat (limited to '')
-rw-r--r-- | src/RCONServer.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/RCONServer.h b/src/RCONServer.h index ecd936eeb..2aba6ebf2 100644 --- a/src/RCONServer.h +++ b/src/RCONServer.h @@ -28,64 +28,64 @@ class cRCONServer public: cRCONServer(cServer & a_Server); virtual ~cRCONServer(); - + void Initialize(cSettingsRepositoryInterface & a_Settings); - + protected: friend class cRCONCommandOutput; friend class cRCONListenCallbacks; - + class cConnection : public cTCPLink::cCallbacks { public: cConnection(cRCONServer & a_RCONServer, const AString & a_IPAddress); - + protected: friend class cRCONCommandOutput; - + /** Set to true if the client has successfully authenticated */ bool m_IsAuthenticated; - + /** Buffer for the incoming data */ AString m_Buffer; - + /** Server that owns this connection and processes requests */ cRCONServer & m_RCONServer; - + /** The TCP link to the client */ cTCPLinkPtr m_Link; - + /** Address of the client */ AString m_IPAddress; - + // cTCPLink::cCallbacks overrides: virtual void OnLinkCreated(cTCPLinkPtr a_Link) override; virtual void OnReceivedData(const char * a_Data, size_t a_Length) override; virtual void OnRemoteClosed(void) override; virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) override; - + /** Processes the given packet and sends the response; returns true if successful, false if the connection is to be dropped */ bool ProcessPacket(UInt32 a_RequestID, UInt32 a_PacketType, UInt32 a_PayloadLength, const char * a_Payload); - + /** Reads 4 bytes from a_Buffer and returns the LE UInt32 they represent */ UInt32 UIntFromBuffer(const char * a_Buffer); - + /** Puts 4 bytes representing the int into the buffer */ void UIntToBuffer(UInt32 a_Value, char * a_Buffer); - + /** Sends a RCON packet back to the client */ void SendResponse(UInt32 a_RequestID, UInt32 a_PacketType, UInt32 a_PayloadLength, const char * a_Payload); } ; - - + + /** The server object that will process the commands received */ cServer & m_Server; - + /** The sockets for accepting RCON connections (one socket per port). */ cServerHandlePtrs m_ListenServers; - + /** Password for authentication */ AString m_Password; } ; |