summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorsatoshinm <snmatsutake@yahoo.co.jp>2017-08-27 23:10:20 +0200
committerMattes D <github@xoft.cz>2017-08-27 23:10:20 +0200
commit6bc503151746ea05842009983c7de932fa80cd03 (patch)
treea7ce87c25b2acb9c5f76cd1a25180b77ebf16f26 /src/ClientHandle.cpp
parentImplement anvil chunk sparsing (diff)
downloadcuberite-6bc503151746ea05842009983c7de932fa80cd03.tar
cuberite-6bc503151746ea05842009983c7de932fa80cd03.tar.gz
cuberite-6bc503151746ea05842009983c7de932fa80cd03.tar.bz2
cuberite-6bc503151746ea05842009983c7de932fa80cd03.tar.lz
cuberite-6bc503151746ea05842009983c7de932fa80cd03.tar.xz
cuberite-6bc503151746ea05842009983c7de932fa80cd03.tar.zst
cuberite-6bc503151746ea05842009983c7de932fa80cd03.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index caa2d8fd8..dbd6d4b4e 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -64,6 +64,7 @@ float cClientHandle::FASTBREAK_PERCENTAGE;
cClientHandle::cClientHandle(const AString & a_IPString, int a_ViewDistance) :
m_LastSentDimension(dimNotSet),
+ m_ForgeHandshake(this),
m_CurrentViewDistance(a_ViewDistance),
m_RequestedViewDistance(a_ViewDistance),
m_IPString(a_IPString),
@@ -320,7 +321,6 @@ void cClientHandle::Authenticate(const AString & a_Name, const cUUID & a_UUID, c
// Atomically increment player count (in server thread)
cRoot::Get()->GetServer()->PlayerCreated();
- cWorld * World;
{
cCSLock lock(m_CSState);
/*
@@ -351,6 +351,25 @@ void cClientHandle::Authenticate(const AString & a_Name, const cUUID & a_UUID, c
// Send login success (if the protocol supports it):
m_Protocol->SendLoginSuccess();
+ if (m_ForgeHandshake.m_IsForgeClient)
+ {
+ m_ForgeHandshake.BeginForgeHandshake(a_Name, a_UUID, a_Properties);
+ }
+ else
+ {
+ FinishAuthenticate(a_Name, a_UUID, a_Properties);
+ }
+ }
+}
+
+
+
+
+
+void cClientHandle::FinishAuthenticate(const AString & a_Name, const cUUID & a_UUID, const Json::Value & a_Properties)
+{
+ cWorld * World;
+ {
// Spawn player (only serversided, so data is loaded)
m_PlayerPtr = cpp14::make_unique<cPlayer>(m_Self, GetUsername());
m_Player = m_PlayerPtr.get();
@@ -854,6 +873,10 @@ void cClientHandle::HandlePluginMessage(const AString & a_Channel, const AString
{
UnregisterPluginChannels(BreakApartPluginChannels(a_Message));
}
+ else if (a_Channel == "FML|HS")
+ {
+ m_ForgeHandshake.DataReceived(this, a_Message.c_str(), a_Message.size());
+ }
else if (!HasPluginChannel(a_Channel))
{
// Ignore if client sent something but didn't register the channel first