the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 78 lines 2.0 kB view raw
1#pragma once 2using namespace std; 3 4#include "Packet.h" 5 6class MovePlayerPacket : public Packet, public enable_shared_from_this<MovePlayerPacket> 7{ 8public: 9 class PosRot; 10 class Pos; 11 class Rot; 12 13 double x, y, z, yView; 14 float yRot, xRot; 15 bool onGround; 16 bool hasPos, hasRot; 17 bool isFlying; // 4J Added 18 19 MovePlayerPacket(); 20 MovePlayerPacket(bool onGround, bool isFlying); 21 22 virtual void handle(PacketListener *listener); 23 virtual void read(DataInputStream *dis); 24 virtual void write(DataOutputStream *dos); 25 virtual int getEstimatedSize(); 26 virtual bool canBeInvalidated(); 27 virtual bool isInvalidatedBy(shared_ptr<Packet> packet); 28 29public: 30 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new MovePlayerPacket()); } 31 virtual int getId() { return 10; } 32}; 33 34class MovePlayerPacket::PosRot : public MovePlayerPacket 35{ 36public: 37 PosRot(); 38 PosRot(double x, double y, double yView, double z, float yRot, float xRot, bool onGround, bool isFlying); 39 40 virtual void read(DataInputStream *dis); 41 virtual void write(DataOutputStream *dos); 42 virtual int getEstimatedSize(); 43 44public: 45 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new MovePlayerPacket::PosRot()); } 46 virtual int getId() { return 13; } 47}; 48 49class MovePlayerPacket::Pos : public MovePlayerPacket 50{ 51public: 52 Pos(); 53 Pos(double x, double y, double yView, double z, bool onGround, bool isFlying); 54 55 virtual void read(DataInputStream *dis); 56 virtual void write(DataOutputStream *dos); 57 virtual int getEstimatedSize(); 58 59public: 60 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new MovePlayerPacket::Pos()); } 61 virtual int getId() { return 11; } 62 63}; 64 65class MovePlayerPacket::Rot : public MovePlayerPacket 66{ 67public: 68 Rot(); 69 Rot(float yRot, float xRot, bool onGround, bool isFlying); 70 71 virtual void read(DataInputStream *dis); 72 virtual void write(DataOutputStream *dos); 73 virtual int getEstimatedSize(); 74public: 75 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new MovePlayerPacket::Rot()); } 76 virtual int getId() { return 12; } 77 78};