Packet.h 364 B

1234567891011121314151617181920212223
  1. #ifndef PACKET_H
  2. #define PACKET_H
  3. #include "network/ENet.h"
  4. #include "utils/Types.h"
  5. class InPacket {
  6. ENetPacket* packet;
  7. unsigned int readIndex;
  8. friend class Server;
  9. InPacket(ENetPacket* packet);
  10. bool read(void* buffer, unsigned int length);
  11. public:
  12. bool read(uint8& u);
  13. bool read(uint16& u);
  14. bool read(uint32& u);
  15. };
  16. #endif