summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Chai <electromatter@gmail.com>2015-09-06 15:58:18 +0200
committerEric Chai <electromatter@gmail.com>2015-09-06 15:58:18 +0200
commit1ef6bd816903bc0e0e497c03404ab21c3ae34c6d (patch)
treea2866ac74636d095a0041332d2abdb6b2d422c5b
parentFixed pack-list for buildservers. (diff)
downloadcuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar.gz
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar.bz2
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar.lz
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar.xz
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.tar.zst
cuberite-1ef6bd816903bc0e0e497c03404ab21c3ae34c6d.zip
-rw-r--r--src/Protocol/Protocol18x.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 115028fa9..7a754abce 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -109,6 +109,20 @@ cProtocol180::cProtocol180(cClientHandle * a_Client, const AString & a_ServerAdd
m_IsEncrypted(false),
m_LastSentDimension(dimNotSet)
{
+
+ // BungeeCord handling:
+ // If BC is setup with ip_forward == true, it sends additional data in the login packet's ServerAddress field:
+ // hostname\00ip-address\00uuid\00profile-properties-as-json
+ AStringVector Params;
+ if (cRoot::Get()->GetServer()->ShouldAllowBungeeCord() && SplitZeroTerminatedStrings(a_ServerAddress, Params) && (Params.size() == 4))
+ {
+ LOGD("Player at %s connected via BungeeCord", Params[1].c_str());
+ m_ServerAddress = Params[0];
+ m_Client->SetIPString(Params[1]);
+ m_Client->SetUUID(cMojangAPI::MakeUUIDShort(Params[2]));
+ m_Client->SetProperties(Params[3]);
+ }
+
// Create the comm log file, if so requested:
if (g_ShouldLogCommIn || g_ShouldLogCommOut)
{