the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 49 lines 1.3 kB view raw
1#pragma once 2 3#include "Packet.h" 4 5class Abilities; 6 7class PlayerAbilitiesPacket : public Packet, public enable_shared_from_this<PlayerAbilitiesPacket> 8{ 9private: 10 static const int FLAG_INVULNERABLE = 1 << 0; 11 static const int FLAG_FLYING = 1 << 1; 12 static const int FLAG_CAN_FLY = 1 << 2; 13 static const int FLAG_INSTABUILD = 1 << 3; 14 15 bool invulnerable; 16 bool _isFlying; 17 bool _canFly; 18 bool instabuild; 19 float flyingSpeed; 20 float walkingSpeed; 21 22public: 23 PlayerAbilitiesPacket(); 24 PlayerAbilitiesPacket(Abilities *abilities); 25 26 void read(DataInputStream *dis); 27 void write(DataOutputStream *dos); 28 void handle(PacketListener *listener); 29 int getEstimatedSize(); 30 //wstring getDebugInfo(); 31 bool isInvulnerable(); 32 void setInvulnerable(bool invulnerable); 33 bool isFlying(); 34 void setFlying(bool flying); 35 bool canFly(); 36 void setCanFly(bool canFly); 37 bool canInstabuild(); 38 void setInstabuild(bool instabuild); 39 float getFlyingSpeed(); 40 void setFlyingSpeed(float flySpeed); 41 float getWalkingSpeed(); 42 void setWalkingSpeed(float walkingSpeed); 43 bool canBeInvalidated(); 44 bool isInvalidatedBy(shared_ptr<Packet> packet); 45 46public: 47 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new PlayerAbilitiesPacket()); } 48 virtual int getId() { return 202; } 49};