summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-09 19:02:30 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-09 19:02:30 +0100
commitb5e33c5424c0b148a7076bb0f3019cfb0ef9c824 (patch)
treedabb3041abd9b8513570111310903992254d8063 /src/Protocol
parentFix IsThread destructor (diff)
parentFixed #778 - stack overflow.com (diff)
downloadcuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.gz
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.bz2
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.lz
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.xz
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.zst
cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol125.cpp11
-rw-r--r--src/Protocol/Protocol125.h1
-rw-r--r--src/Protocol/Protocol16x.cpp11
-rw-r--r--src/Protocol/Protocol17x.cpp10
4 files changed, 30 insertions, 3 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index e032e4050..50ebb6d43 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -1375,7 +1375,16 @@ int cProtocol125::ParseEntityAction(void)
{
HANDLE_PACKET_READ(ReadBEInt, int, EntityID);
HANDLE_PACKET_READ(ReadChar, char, ActionID);
- m_Client->HandleEntityAction(EntityID, ActionID);
+
+ switch (ActionID)
+ {
+ case 1: m_Client->HandleEntityCrouch(EntityID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(EntityID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(EntityID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(EntityID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(EntityID, false); break; // Stop sprinting
+ }
+
return PARSE_OK;
}
diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h
index 66f3227b0..aca24c03a 100644
--- a/src/Protocol/Protocol125.h
+++ b/src/Protocol/Protocol125.h
@@ -11,6 +11,7 @@
#include "Protocol.h"
#include "../ByteBuffer.h"
+#include "../Entities/Painting.h"
diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp
index cfa27b3c4..f6ec0a199 100644
--- a/src/Protocol/Protocol16x.cpp
+++ b/src/Protocol/Protocol16x.cpp
@@ -184,7 +184,16 @@ int cProtocol161::ParseEntityAction(void)
HANDLE_PACKET_READ(ReadBEInt, int, EntityID);
HANDLE_PACKET_READ(ReadChar, char, ActionID);
HANDLE_PACKET_READ(ReadBEInt, int, UnknownHorseVal);
- m_Client->HandleEntityAction(EntityID, ActionID);
+
+ switch (ActionID)
+ {
+ case 1: m_Client->HandleEntityCrouch(EntityID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(EntityID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(EntityID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(EntityID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(EntityID, false); break; // Stop sprinting
+ }
+
return PARSE_OK;
}
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 8e0d33227..a72da776d 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1732,7 +1732,15 @@ void cProtocol172::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer)
HANDLE_READ(a_ByteBuffer, ReadBEInt, int, PlayerID);
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Action);
HANDLE_READ(a_ByteBuffer, ReadBEInt, int, JumpBoost);
- m_Client->HandleEntityAction(PlayerID, Action);
+
+ switch (Action)
+ {
+ case 1: m_Client->HandleEntityCrouch(PlayerID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(PlayerID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(PlayerID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(PlayerID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(PlayerID, false); break; // Stop sprinting
+ }
}