1 #ifndef BLANK_NET_CONNECTIONHANDLER_HPP_
2 #define BLANK_NET_CONNECTIONHANDLER_HPP_
11 class ConnectionHandler {
14 void Handle(const UDPpacket &);
16 // called as soon as the remote end ack'd given packet
17 virtual void OnPacketReceived(std::uint16_t) { }
18 // called if the remote end probably didn't get given packet
19 virtual void OnPacketLost(std::uint16_t) { }
21 virtual void OnTimeout() { }
24 virtual void On(const Packet::Ping &) { }
25 virtual void On(const Packet::Login &) { }
26 virtual void On(const Packet::Join &) { }
27 virtual void On(const Packet::Part &) { }
28 virtual void On(const Packet::PlayerUpdate &) { }
29 virtual void On(const Packet::SpawnEntity &) { }
30 virtual void On(const Packet::DespawnEntity &) { }
31 virtual void On(const Packet::EntityUpdate &) { }
32 virtual void On(const Packet::PlayerCorrection &) { }
33 virtual void On(const Packet::ChunkBegin &) { }
34 virtual void On(const Packet::ChunkData &) { }