From 791bf732fd490700748f798c617ecac1af152cd4 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 8 Jul 2013 12:59:15 +0000 Subject: 1.6.2 protocol implemented, both in MCServer and in ProtoProxy git-svn-id: http://mc-server.googlecode.com/svn/trunk@1669 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol/Protocol125.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/Protocol/Protocol125.cpp') 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); -- cgit v1.2.3