summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ForgeHandshake.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-10-02 22:27:32 +0200
committerGitHub <noreply@github.com>2021-10-02 22:27:32 +0200
commit1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa (patch)
treebb20f3445773dca9c348ee2939ddc5609e8dbfa0 /src/Protocol/ForgeHandshake.h
parentBlaze shoot sound fix (diff)
downloadcuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.gz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.bz2
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.lz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.xz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.zst
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/ForgeHandshake.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/Protocol/ForgeHandshake.h b/src/Protocol/ForgeHandshake.h
index 061369c15..7c3969b96 100644
--- a/src/Protocol/ForgeHandshake.h
+++ b/src/Protocol/ForgeHandshake.h
@@ -9,6 +9,10 @@
#include "../UUID.h"
#include "json/json.h"
+
+
+
+
// fwd:
class cClientHandle;
@@ -19,38 +23,32 @@ class cClientHandle;
class cForgeHandshake
{
public:
+
/** True if the client advertised itself as a Forge client. */
- bool m_IsForgeClient;
+ bool IsForgeClient;
- cForgeHandshake(cClientHandle * client);
+ cForgeHandshake();
/** Add the registered Forge mods to the server ping list packet. */
- void AugmentServerListPing(Json::Value & ResponseValue);
+ void AugmentServerListPing(cClientHandle & a_Client, Json::Value & ResponseValue);
/** Begin the Forge Modloader Handshake (FML|HS) sequence. */
- void BeginForgeHandshake(const AString & a_Name, const cUUID & a_UUID, const Json::Value & a_Properties);
+ void BeginForgeHandshake(cClientHandle & a_Client);
/** Send the ServerHello packet in the Forge handshake. */
- void SendServerHello();
+ void SendServerHello(cClientHandle & a_Client);
/** Process received data from the client advancing the Forge handshake. */
- void DataReceived(cClientHandle * a_Client, ContiguousByteBufferView a_Data);
+ void DataReceived(cClientHandle & a_Client, ContiguousByteBufferView a_Data);
private:
+
/** True if the Forge handshake is in an errored state. */
bool m_Errored;
- /** The client handle undergoing this Forge handshake. */
- cClientHandle * m_Client;
-
- /** Values saved from BeginForgeHandshake() for continuing the normal handshake after Forge completes. */
- AString m_Name;
- cUUID m_UUID;
- Json::Value m_Properties;
-
- void HandleClientHello(cClientHandle * a_Client, ContiguousByteBufferView a_Data);
- void HandleModList(cClientHandle * a_Client, ContiguousByteBufferView a_Data);
- void HandleHandshakeAck(cClientHandle * a_Client, ContiguousByteBufferView a_Data);
+ void HandleClientHello(cClientHandle & a_Client, ContiguousByteBufferView a_Data);
+ void HandleModList(cClientHandle & a_Client, ContiguousByteBufferView a_Data);
+ void HandleHandshakeAck(cClientHandle & a_Client, ContiguousByteBufferView a_Data);
/** Set errored state to prevent further handshake message processing. */
void SetError(const AString & message);