diff options
author | madmaxoft <github@xoft.cz> | 2013-07-30 22:48:59 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-07-30 22:48:59 +0200 |
commit | e9f18f8b4fcf4ae7891b631765bcc49a4a183220 (patch) | |
tree | 8e44bb38c5602e8b36d595434c03bb00dc396287 /source/Protocol/Protocol132.cpp | |
parent | Added the "Edit Sign" packet sent to the client placing a sign. (diff) | |
download | cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar.gz cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar.bz2 cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar.lz cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar.xz cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.tar.zst cuberite-e9f18f8b4fcf4ae7891b631765bcc49a4a183220.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Protocol/Protocol132.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/source/Protocol/Protocol132.cpp b/source/Protocol/Protocol132.cpp index 9a985ec1f..7a3975537 100644 --- a/source/Protocol/Protocol132.cpp +++ b/source/Protocol/Protocol132.cpp @@ -70,6 +70,7 @@ enum PACKET_BLOCK_BREAK_ANIM = 0x37, PACKET_SOUND_EFFECT = 0x3e, PACKET_SOUND_PARTICLE_EFFECT = 0x3d, + PACKET_TAB_COMPLETION = 0xcb, PACKET_LOCALE_VIEW_DISTANCE = 0xcc, PACKET_CLIENT_STATUSES = 0xcd, PACKET_ENCRYPTION_KEY_RESP = 0xfc, @@ -426,6 +427,31 @@ void cProtocol132::SendSpawnMob(const cMonster & a_Mob) +void cProtocol132::SendTabCompletionResults(const AStringVector & a_Results) +{ + if (a_Results.empty()) + { + // No results to send + return; + } + + AString Serialized(a_Results[0]); + for (AStringVector::const_iterator itr = a_Results.begin() + 1, end = a_Results.end(); itr != end; ++itr) + { + Serialized.push_back(0); + Serialized.append(*itr); + } // for itr - a_Results[] + + cCSLock Lock(m_CSPacket); + WriteByte(PACKET_TAB_COMPLETION); + WriteString(Serialized); + Flush(); +} + + + + + void cProtocol132::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) { // Not used in 1.3.2 @@ -484,9 +510,10 @@ int cProtocol132::ParsePacket(unsigned char a_PacketType) switch (a_PacketType) { default: return super::ParsePacket(a_PacketType); // off-load previously known packets into cProtocol125 - case PACKET_LOCALE_VIEW_DISTANCE: return ParseLocaleViewDistance(); case PACKET_CLIENT_STATUSES: return ParseClientStatuses(); case PACKET_ENCRYPTION_KEY_RESP: return ParseEncryptionKeyResponse(); + case PACKET_LOCALE_VIEW_DISTANCE: return ParseLocaleViewDistance(); + case PACKET_TAB_COMPLETION: return ParseTabCompletion(); } } @@ -632,6 +659,17 @@ int cProtocol132::ParsePlayerAbilities(void) +int cProtocol132::ParseTabCompletion(void) +{ + HANDLE_PACKET_READ(ReadBEUTF16String16, AString, Text); + m_Client->HandleTabCompletion(Text); + return PARSE_OK; +} + + + + + void cProtocol132::SendData(const char * a_Data, int a_Size) { m_DataToSend.append(a_Data, a_Size); |