Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef UNTITLED_DATAGRAM_H
- #define UNTITLED_DATAGRAM_H
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <netinet/in.h>
- #include <endian.h>
- class Datagram {
- public:
- Datagram();
- void clear_datagram();
- void pack_next_int8_bit_value_buffer(int8_t v);
- void pack_next_uint32_bit_value_buffer(uint32_t v);
- void pack_next_uint64_bit_value_buffer(uint64_t v);
- void get_int8_bit_value_fbuffer(int8_t& v, int start_in_datagram);
- void get_int32_bit_value_fbuffer(uint32_t& v, int start_in_datagram);
- void get_int64_bit_value_fbuffer(uint64_t& v, int start_in_datagram);
- };
- /*
- class Client_datagram: public Datagram {
- public:
- void create_datagram(const uint64_t& session_id, const int8_t& turn_direction,
- const uint32_t& next_expected_event_no, string p);
- bool read_datagram_from_client(uint64_t& session_id, int8_t& turn_direction,
- uint32_t& next_expected_event_no, string& player_name);
- void test(string t);
- };
- class Server_datagram: public Datagram {
- public:
- bool read_datagram_from_client(uint64_t& session_id, int8_t& turn_direction,
- uint32_t& next_expected_event_no, string& player_name);
- };
- class TESTOWA {
- public:
- char datagram_buffer[512 + 1];// \0
- int next_free_byte;
- int recv_length;
- public:
- TESTOWA();
- void clear_datagram();
- void s(string t);
- };
- */
- #endif //UNTITLED_DATAGRAM_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement