summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_9.cpp
diff options
context:
space:
mode:
authorMat <mail@mathias.is>2020-04-07 23:23:54 +0200
committerGitHub <noreply@github.com>2020-04-07 23:23:54 +0200
commit6a21bf979c5ef4ad473971257f59fe9101397cd6 (patch)
treec8d2c94a59982b7a80a36542e77ae872158a6814 /src/Protocol/Protocol_1_9.cpp
parentFilter blocks to add to redstone sim's wake queue (#4621) (diff)
downloadcuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar.gz
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar.bz2
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar.lz
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar.xz
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.tar.zst
cuberite-6a21bf979c5ef4ad473971257f59fe9101397cd6.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol_1_9.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index b6dba378b..9f786b02d 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -1233,6 +1233,25 @@ void cProtocol_1_9_0::SendResetTitle(void)
+void cProtocol_1_9_0::SendResourcePack(const AString & a_ResourcePackUrl)
+{
+ cPacketizer Pkt(*this, pktResourcePack);
+
+ cSha1Checksum Checksum;
+ Checksum.Update(reinterpret_cast<const Byte *>(a_ResourcePackUrl.c_str()), a_ResourcePackUrl.size());
+ Byte Digest[20];
+ Checksum.Finalize(Digest);
+ AString Sha1Output;
+ cSha1Checksum::DigestToHex(Digest, Sha1Output);
+
+ Pkt.WriteString(a_ResourcePackUrl);
+ Pkt.WriteString(Sha1Output);
+}
+
+
+
+
+
void cProtocol_1_9_0::SendRespawn(eDimension a_Dimension)
{
cPacketizer Pkt(*this, pktRespawn);
@@ -2209,6 +2228,7 @@ UInt32 cProtocol_1_9_0::GetPacketID(cProtocol::ePacketType a_Packet)
case pktPlayerMoveLook: return 0x2e;
case pktPluginMessage: return 0x18;
case pktRemoveEntityEffect: return 0x31;
+ case pktResourcePack: return 0x32;
case pktRespawn: return 0x33;
case pktScoreboardObjective: return 0x3f;
case pktSpawnExperienceOrb: return 0x01;
@@ -2299,7 +2319,7 @@ bool cProtocol_1_9_0::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketTy
case 0x13: HandlePacketBlockDig (a_ByteBuffer); return true;
case 0x14: HandlePacketEntityAction (a_ByteBuffer); return true;
case 0x15: HandlePacketSteerVehicle (a_ByteBuffer); return true;
- case 0x16: break; // Resource pack status - not yet implemented
+ case 0x16: HandlePacketResourcePackStatus (a_ByteBuffer); return true;
case 0x17: HandlePacketSlotSelect (a_ByteBuffer); return true;
case 0x18: HandlePacketCreativeInventoryAction(a_ByteBuffer); return true;
case 0x19: HandlePacketUpdateSign (a_ByteBuffer); return true;
@@ -2804,6 +2824,16 @@ void cProtocol_1_9_0::HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer)
+void cProtocol_1_9_0::HandlePacketResourcePackStatus(cByteBuffer & a_ByteBuffer)
+{
+ HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Hash);
+ HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, Status);
+}
+
+
+
+
+
void cProtocol_1_9_0::HandlePacketSlotSelect(cByteBuffer & a_ByteBuffer)
{
HANDLE_READ(a_ByteBuffer, ReadBEInt16, Int16, SlotNum);