the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 56 lines 1.1 kB view raw
1#include "stdafx.h" 2#include <iostream> 3#include "ArrayWithLength.h" 4#include "InputOutputStream.h" 5#include "PacketListener.h" 6#include "RemoveEntitiesPacket.h" 7 8RemoveEntitiesPacket::RemoveEntitiesPacket() 9{ 10} 11 12RemoveEntitiesPacket::RemoveEntitiesPacket(intArray ids) 13{ 14 this->ids = ids; 15} 16 17RemoveEntitiesPacket::~RemoveEntitiesPacket() 18{ 19 delete ids.data; 20} 21 22void RemoveEntitiesPacket::read(DataInputStream *dis) //throws IOException 23{ 24 ids = intArray(dis->readByte()); 25 for(unsigned int i = 0; i < ids.length; ++i) 26 { 27 ids[i] = dis->readInt(); 28 } 29} 30 31void RemoveEntitiesPacket::write(DataOutputStream *dos) //throws IOException 32{ 33 dos->writeByte(ids.length); 34 for(unsigned int i = 0; i < ids.length; ++i) 35 { 36 dos->writeInt(ids[i]); 37 } 38} 39 40void RemoveEntitiesPacket::handle(PacketListener *listener) 41{ 42 listener->handleRemoveEntity(shared_from_this()); 43} 44 45int RemoveEntitiesPacket::getEstimatedSize() 46{ 47 return 1 + (ids.length * 4); 48} 49 50/* 51 4J: These are necesary on the PS3. 52 (and 4). 53*/ 54#if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__) 55const int RemoveEntitiesPacket::MAX_PER_PACKET; 56#endif