summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-08 14:59:15 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-08 14:59:15 +0200
commit791bf732fd490700748f798c617ecac1af152cd4 (patch)
tree2ca9be2cebeeb560b60c108959e805126d3173ed /source/Protocol/Protocol125.cpp
parentPickups have an initial health of 5 (diff)
downloadcuberite-791bf732fd490700748f798c617ecac1af152cd4.tar
cuberite-791bf732fd490700748f798c617ecac1af152cd4.tar.gz
cuberite-791bf732fd490700748f798c617ecac1af152cd4.tar.bz2
cuberite-791bf732fd490700748f798c617ecac1af152cd4.tar.lz
cuberite-791bf732fd490700748f798c617ecac1af152cd4.tar.xz
cuberite-791bf732fd490700748f798c617ecac1af152cd4.tar.zst
cuberite-791bf732fd490700748f798c617ecac1af152cd4.zip
Diffstat (limited to 'source/Protocol/Protocol125.cpp')
-rw-r--r--source/Protocol/Protocol125.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index f4976b9d8..97c193e97 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -86,6 +86,7 @@ enum
PACKET_UPDATE_SIGN = 0x82,
PACKET_PLAYER_LIST_ITEM = 0xC9,
PACKET_PLAYER_ABILITIES = 0xca,
+ PACKET_PLUGIN_MESSAGE = 0xfa,
PACKET_PING = 0xfe,
PACKET_DISCONNECT = 0xff
} ;
@@ -1039,6 +1040,7 @@ int cProtocol125::ParsePacket(unsigned char a_PacketType)
case PACKET_PLAYER_MOVE_LOOK: return ParsePlayerMoveLook();
case PACKET_PLAYER_ON_GROUND: return ParsePlayerOnGround();
case PACKET_PLAYER_POS: return ParsePlayerPosition();
+ case PACKET_PLUGIN_MESSAGE: return ParsePluginMessage();
case PACKET_RESPAWN: return ParseRespawn();
case PACKET_SLOT_SELECTED: return ParseSlotSelected();
case PACKET_UPDATE_SIGN: return ParseUpdateSign();
@@ -1330,6 +1332,28 @@ int cProtocol125::ParsePlayerPosition(void)
+int cProtocol125::ParsePluginMessage(void)
+{
+ HANDLE_PACKET_READ(ReadBEUTF16String16, AString, ChannelName);
+ HANDLE_PACKET_READ(ReadBEShort, short, Length);
+ AString Data;
+ if (!m_ReceivedData.ReadString(Data, Length))
+ {
+ m_ReceivedData.CheckValid();
+ return PARSE_INCOMPLETE;
+ }
+ m_ReceivedData.CheckValid();
+
+ // TODO: Process the data
+ LOGD("Received %d bytes of plugin data on channel \"%s\".", Length, ChannelName.c_str());
+
+ return PARSE_OK;
+}
+
+
+
+
+
int cProtocol125::ParseRespawn(void)
{
HANDLE_PACKET_READ(ReadBEInt, int, Dimension);