Created
March 15, 2013 19:17
-
-
Save 0xa/5172326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Opcodes { | |
OP_PING = 0x1337 | |
} | |
class Packet { | |
public: | |
Packet(int32_t opcode); | |
virtual bool encode(std::string& buffer) = 0; | |
virtual bool decode(const std::string& buffer) = 0; | |
private: | |
int32_t m_opcode; | |
}; | |
class PingPacket : public Packet { | |
public: | |
PingPacket() | |
: Packet(OP_PING) | |
{} | |
virtual bool encode(std::string& buffer) {} | |
virtual bool decode(const std::string& buffer) {} | |
int64_t pingId; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment