aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ClientCommandPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/ClientCommandPacket.cpp')
-rw-r--r--Minecraft.World/ClientCommandPacket.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/Minecraft.World/ClientCommandPacket.cpp b/Minecraft.World/ClientCommandPacket.cpp
new file mode 100644
index 00000000..4245fc3f
--- /dev/null
+++ b/Minecraft.World/ClientCommandPacket.cpp
@@ -0,0 +1,33 @@
+#include "stdafx.h"
+#include "PacketListener.h"
+#include "ClientCommandPacket.h"
+
+ClientCommandPacket::ClientCommandPacket()
+{
+ action = 0;
+}
+
+ClientCommandPacket::ClientCommandPacket(int action)
+{
+ this->action = action;
+}
+
+void ClientCommandPacket::read(DataInputStream *dis)
+{
+ action = dis->readByte();
+}
+
+void ClientCommandPacket::write(DataOutputStream *dos)
+{
+ dos->writeByte(action & 0xff);
+}
+
+void ClientCommandPacket::handle(PacketListener *listener)
+{
+ listener->handleClientCommand(dynamic_pointer_cast<ClientCommandPacket>(shared_from_this()));
+}
+
+int ClientCommandPacket::getEstimatedSize()
+{
+ return 1;
+} \ No newline at end of file