summaryrefslogtreecommitdiffstats
path: root/src/packet/PacketBuilder.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-17 16:23:53 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-17 16:23:53 +0200
commit789f70b6f1a9067843dfc1ff73d86b645efe1da9 (patch)
treef3db085f2ac1ec5fd6ad0869a63e77a7f0fb1a17 /src/packet/PacketBuilder.cpp
parent2017-06-14 (diff)
downloadAltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar.gz
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar.bz2
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar.lz
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar.xz
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.tar.zst
AltCraft-789f70b6f1a9067843dfc1ff73d86b645efe1da9.zip
Diffstat (limited to 'src/packet/PacketBuilder.cpp')
-rw-r--r--src/packet/PacketBuilder.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/packet/PacketBuilder.cpp b/src/packet/PacketBuilder.cpp
deleted file mode 100644
index 4083ea3..0000000
--- a/src/packet/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;
-}