From 7b0872aeccc2be460e8af5cd4a14b0660a83c1ed Mon Sep 17 00:00:00 2001 From: Ethan Jones Date: Thu, 23 Sep 2021 14:09:52 -0600 Subject: BungeeGuard style proxy security and OnlyAllowBungee config (#5291) --- src/ClientHandle.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 1a48e0458..132cc7225 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -101,6 +101,10 @@ public: // tolua_export We use Version-3 UUIDs for offline UUIDs, online UUIDs are Version-4, thus we can tell them apart. */ static bool IsUUIDOnline(const cUUID & a_UUID); // Exported in ManualBindings.cpp + /** Function to mark bungee / proxy connection on this client, and to add proxy-related data */ + void ProxyInit(const AString & a_IPString, const cUUID & a_UUID); + void ProxyInit(const AString & a_IPString, const cUUID & a_UUID, const Json::Value & a_Properties); + /** Flushes all buffered outgoing data to the network. */ void ProcessProtocolOut(); @@ -114,6 +118,9 @@ public: // tolua_export void Kick(const AString & a_Reason); // tolua_export + /** Authenticates the specified user with the bungee proxy server */ + bool BungeeAuthenticate(); + /** Authenticates the specified user, called by cAuthenticator */ void Authenticate(const AString & a_Name, const cUUID & a_UUID, const Json::Value & a_Properties); @@ -470,6 +477,8 @@ private: Otherwise, this contains an arbitrary value which should not be used. */ cChunkCoords m_CachedSentChunk; + bool m_ProxyConnection; ///< True if player connected from a proxy (Bungee / Velocity) + bool m_HasSentDC; ///< True if a Disconnect packet has been sent in either direction // Chunk position when the last StreamChunks() was called; used to avoid re-streaming while in the same chunk -- cgit v1.2.3