TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_packet_handler_interface.hpp
1 
9 #ifndef TurtleBrains_PacketHandlerInterface_hpp
10 #define TurtleBrains_PacketHandlerInterface_hpp
11 
12 #include <turtle_brains/core/tb_configuration.hpp>
13 #if defined(tb_with_networking)
14 
15 #include <turtle_brains/core/tb_types.hpp>
16 
17 namespace tbImplementation { class SocketConnectionImplementation; };
18 
19 namespace TurtleBrains
20 {
21  namespace Network
22  {
23 
24  class PacketHandlerInterface
25  {
26  public:
27  PacketHandlerInterface(void);
28  virtual ~PacketHandlerInterface(void);
29 
30  protected:
31  virtual void OnConnect(void);
32  virtual void OnDisconnect(void);
33 
34  virtual void OnConnectClient(tbCore::byte clientID);
35  virtual void OnDisconnectClient(tbCore::byte clientID);
36 
37  virtual bool OnHandlePacket(const tbCore::byte* packetData, size_t packetSize, tbCore::byte from) = 0;
38 
39  private:
40  friend class tbImplementation::SocketConnectionImplementation;
41  };
42 
43  }; /* namespace Network */
44 }; /* namespace TurtleBrains */
45 
46 namespace tbNetwork = TurtleBrains::Network;
47 
48 #endif /* tb_with_networking */
49 #endif /* TurtleBrains_PacketHandlerInterface_hpp */
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:21
uint8 byte
Unsigned integer with 8 bits (1 byte). Supports 256 values from 0 to 255.
Definition: tb_types.hpp:24
Definition: tb_application_dialog.hpp:19