diff options
Diffstat (limited to 'messages.h')
-rw-r--r-- | messages.h | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1,6 +1,8 @@ #ifndef MESSAGES_H #define MESSAGES_H +#include "vector.h" + #include <boost/asio.hpp> namespace message { @@ -10,7 +12,8 @@ enum MessageType { MSG_TYPE_HELLO, MSG_TYPE_POS, MSG_TYPE_CHUNK, - MSG_TYPE_MSG + MSG_TYPE_MSG, + MSG_TYPE_PLAYER }; class MessageBase { @@ -75,6 +78,23 @@ class Message : public MessageBase { std::string get_str(); }; +class Player : public MessageBase { + protected: + uint32_t id; + uint16_t str_len; + bool got_len; + + public: + Player(); + Player(uint32_t id, Vector3 pos, std::string name); + + virtual std::size_t payload_size(); + uint32_t get_id(); + Vector3 get_pos(); + uint16_t get_len(); + std::string get_str(); +}; + } #endif |