Guest User

Untitled

a guest
Sep 18th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. //
  2. // Created by armegon on 17.09.20 г..
  3. //
  4.  
  5. #ifndef VIBRANIUM_CORE_PACKET_H
  6. #define VIBRANIUM_CORE_PACKET_H
  7.  
  8.  
  9. #include <cstdio>
  10. #include <cstdlib>
  11. #include <cstring>
  12. #include "string"
  13. #include "Protocol/ServerOpcode.h"
  14.  
  15. class Packet {
  16. public:
  17.     Packet() : body_length_(0)
  18.     {
  19.     }
  20.     enum { body_length = 1024 };
  21.     enum { header_length = 8 };
  22.     char header_[header_length];
  23.     char body_[body_length];
  24.     char data_[header_length + body_length];
  25.     void PreparePacket(ServerOpcode serverOpcode, std::string message);
  26. private:
  27.     void decode_header();
  28.     size_t body_length_;
  29. };
  30.  
  31.  
  32. #endif //VIBRANIUM_CORE_PACKET_H
  33.  
Advertisement
Add Comment
Please, Sign In to add comment