summaryrefslogtreecommitdiffstats
path: root/source/Protocol
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-18 17:48:50 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-18 17:48:50 +0100
commitd47ff5520373acb359590fb036b6a761af58cf75 (patch)
tree63f68f88d8bf8730da1dd32880ec526dc889bc6c /source/Protocol
parentRemoved all E_ITEM_ symbols equivalent to E_BLOCK_, and all obsolete item and block symbols. (diff)
downloadcuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar.gz
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar.bz2
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar.lz
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar.xz
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.tar.zst
cuberite-d47ff5520373acb359590fb036b6a761af58cf75.zip
Diffstat (limited to 'source/Protocol')
-rw-r--r--source/Protocol/Protocol.h1
-rw-r--r--source/Protocol/Protocol125.cpp20
-rw-r--r--source/Protocol/Protocol125.h1
-rw-r--r--source/Protocol/Protocol14x.cpp22
-rw-r--r--source/Protocol/Protocol14x.h1
-rw-r--r--source/Protocol/ProtocolRecognizer.cpp10
-rw-r--r--source/Protocol/ProtocolRecognizer.h1
7 files changed, 56 insertions, 0 deletions
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h
index 52f3f2e3f..ab35adbb5 100644
--- a/source/Protocol/Protocol.h
+++ b/source/Protocol/Protocol.h
@@ -84,6 +84,7 @@ public:
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;
virtual void SendSpawnMob (const cMonster & a_Mob) = 0;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ, Byte a_Yaw, Byte a_Pitch) = 0;
+ virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType) = 0;
virtual void SendTeleportEntity (const cEntity & a_Entity) = 0;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) = 0;
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index 0bed151ed..d45ea8837 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -670,6 +670,26 @@ void cProtocol125::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType,
+void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte (PACKET_SPAWN_OBJECT);
+ WriteInt (a_Vehicle.GetUniqueID());
+ WriteByte (a_VehicleType);
+ WriteInt ((int)(a_Vehicle.GetPosX() * 32));
+ WriteInt ((int)(a_Vehicle.GetPosY() * 32));
+ WriteInt ((int)(a_Vehicle.GetPosZ() * 32));
+ WriteInt (1);
+ WriteShort(0); // TODO: SpeedX
+ WriteShort(0); // TODO: SpeedY
+ WriteShort(0); // TODO: SpeedZ
+ Flush();
+}
+
+
+
+
+
void cProtocol125::SendTeleportEntity(const cEntity & a_Entity)
{
cCSLock Lock(m_CSPacket);
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h
index ec0d976e5..47923235b 100644
--- a/source/Protocol/Protocol125.h
+++ b/source/Protocol/Protocol125.h
@@ -61,6 +61,7 @@ public:
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnMob (const cMonster & a_Mob) override;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ, Byte a_Yaw, Byte a_Pitch) override;
+ virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType) override;
virtual void SendTeleportEntity (const cEntity & a_Entity) override;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
diff --git a/source/Protocol/Protocol14x.cpp b/source/Protocol/Protocol14x.cpp
index 912a1a266..b70d6e0aa 100644
--- a/source/Protocol/Protocol14x.cpp
+++ b/source/Protocol/Protocol14x.cpp
@@ -235,3 +235,25 @@ void cProtocol146::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType,
+void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_SPAWN_OBJECT);
+ WriteInt (a_Vehicle.GetUniqueID());
+ WriteByte(a_VehicleType);
+ WriteInt ((int)(a_Vehicle.GetPosX() * 32));
+ WriteInt ((int)(a_Vehicle.GetPosY() * 32));
+ WriteInt ((int)(a_Vehicle.GetPosZ() * 32));
+ WriteInt (1);
+ WriteShort(0); // TODO: SpeedX
+ WriteShort(0); // TODO: SpeedY
+ WriteShort(0); // TODO: SpeedZ
+ WriteByte (0); // TODO: Yaw
+ WriteByte (0); // TODO: Pitch
+ Flush();
+}
+
+
+
+
+
diff --git a/source/Protocol/Protocol14x.h b/source/Protocol/Protocol14x.h
index 02888e61f..383544f8f 100644
--- a/source/Protocol/Protocol14x.h
+++ b/source/Protocol/Protocol14x.h
@@ -55,6 +55,7 @@ public:
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
virtual void SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ, Byte a_Yaw, Byte a_Pitch) override;
+ virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType) override;
} ;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp
index 4ab163783..0d26cdbd3 100644
--- a/source/Protocol/ProtocolRecognizer.cpp
+++ b/source/Protocol/ProtocolRecognizer.cpp
@@ -436,6 +436,16 @@ void cProtocolRecognizer::SendSpawnObject(const cEntity & a_Entity, char a_Objec
+void cProtocolRecognizer::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType)
+{
+ ASSERT(m_Protocol != NULL);
+ m_Protocol->SendSpawnVehicle(a_Vehicle, a_VehicleType);
+}
+
+
+
+
+
void cProtocolRecognizer::SendTeleportEntity(const cEntity & a_Entity)
{
ASSERT(m_Protocol != NULL);
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h
index 53c8fa6e4..f638b08d8 100644
--- a/source/Protocol/ProtocolRecognizer.h
+++ b/source/Protocol/ProtocolRecognizer.h
@@ -86,6 +86,7 @@ public:
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnMob (const cMonster & a_Mob) override;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ, Byte a_Yaw, Byte a_Pitch) override;
+ virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType) override;
virtual void SendTeleportEntity (const cEntity & a_Entity) override;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;