#ifndef SHARED_NET_PACKET_HH_ #define SHARED_NET_PACKET_HH_ #include #include "shared/net/net.hh" #include "shared/net/proto.hh" #include "shared/shared.hh" namespace shared { namespace net { using packet_header_t = std::uint32_t; // A packet is a simple object which holds compressed protobuf data. // We split up upackets and rpackets as rpackets require a header on the // (due to using the reliable stream) which is not the case for the unreliable // stream. class packet { public: std::string data; public: //virtual ~packet() = 0; }; class upacket : public packet { public: upacket(const proto::packet& proto); virtual ~upacket() {}; }; class rpacket : public packet { public: rpacket(const proto::packet& proto); virtual ~rpacket() {}; }; } // namespace net } // namespace shared #endif