summaryrefslogtreecommitdiffstats
path: root/code/PacketBuilder.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-18 16:03:05 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-18 16:03:05 +0200
commit4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79 (patch)
tree548911d4e341fd5717acff3b5bc752c7b5650bf4 /code/PacketBuilder.cpp
parent2017-05-13 (diff)
downloadAltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.gz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.bz2
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.lz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.xz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.zst
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.zip
Diffstat (limited to 'code/PacketBuilder.cpp')
-rw-r--r--code/PacketBuilder.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/code/PacketBuilder.cpp b/code/PacketBuilder.cpp
deleted file mode 100644
index 4083ea3..0000000
--- a/code/PacketBuilder.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "PacketBuilder.hpp"
-
-Packet PacketBuilder::CHandshaking0x00(int protocolVerison, std::string address, unsigned short port, int nextState) {
- Packet handshakePacket(0);
- Field fProtocol;
- fProtocol.SetVarInt(protocolVerison);
- Field fAddress;
- fAddress.SetString(address);
- Field fPort;
- fPort.SetUShort(port);
- Field fNextState;
- fNextState.SetVarInt(nextState);
- handshakePacket.AddField(fProtocol);
- handshakePacket.AddField(fAddress);
- handshakePacket.AddField(fPort);
- handshakePacket.AddField(fNextState);
- return handshakePacket;
-}
-
-Packet PacketBuilder::CPlay0x0B(int keepAliveId) {
- Packet keepAlivePacket(0x0B);
- Field fKeepAlive;
- fKeepAlive.SetVarInt(keepAliveId);
- keepAlivePacket.AddField(fKeepAlive);
- return keepAlivePacket;
-}
-
-Packet PacketBuilder::CPlay0x03(int actionId) {
- Packet clientStatusPacket(0x03);
- Field fActionId;
- fActionId.SetVarInt(actionId);
- clientStatusPacket.AddField(fActionId);
- return clientStatusPacket;
-}
-
-Packet PacketBuilder::CPlay0x00(int teleportId) {
- Packet teleportConfirmPacket(0x00);
- Field fTeleportId;
- fTeleportId.SetVarInt(teleportId);
- teleportConfirmPacket.AddField(fTeleportId);
- return teleportConfirmPacket;
-}
-
-Packet PacketBuilder::CPlay0x0D(double x, double y, double z, float yaw, float pitch, bool onGround) {
- Packet playerPositionAndLookPacket(0x0D);
- Field fX;
- Field fY;
- Field fZ;
- Field fYaw;
- Field fPitch;
- Field fOnGround;
- fX.SetDouble(x);
- fY.SetDouble(y);
- fZ.SetDouble(z);
- fYaw.SetFloat(yaw);
- fPitch.SetFloat(pitch);
- fOnGround.SetBool(onGround);
- playerPositionAndLookPacket.AddField(fX);
- playerPositionAndLookPacket.AddField(fY);
- playerPositionAndLookPacket.AddField(fZ);
- playerPositionAndLookPacket.AddField(fYaw);
- playerPositionAndLookPacket.AddField(fPitch);
- playerPositionAndLookPacket.AddField(fOnGround);
- return playerPositionAndLookPacket;
-}