]> git.localhorst.tv Git - blank.git/blobdiff - src/net/ConnectionHandler.hpp
fixed transmission control
[blank.git] / src / net / ConnectionHandler.hpp
diff --git a/src/net/ConnectionHandler.hpp b/src/net/ConnectionHandler.hpp
new file mode 100644 (file)
index 0000000..3eb8f55
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef BLANK_NET_CONNECTIONHANDLER_HPP_
+#define BLANK_NET_CONNECTIONHANDLER_HPP_
+
+#include "Packet.hpp"
+
+#include <SDL_net.h>
+
+
+namespace blank {
+
+class ConnectionHandler {
+
+public:
+       void Handle(const UDPpacket &);
+
+       virtual void OnPacketLost(std::uint16_t) { }
+
+       virtual void OnTimeout() { }
+
+private:
+       virtual void On(const Packet::Ping &) { }
+       virtual void On(const Packet::Login &) { }
+       virtual void On(const Packet::Join &) { }
+       virtual void On(const Packet::Part &) { }
+
+};
+
+}
+
+#endif