summaryrefslogtreecommitdiffstats
path: root/code/Network.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--code/Network.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/code/Network.hpp b/code/Network.hpp
new file mode 100644
index 0000000..74df92c
--- /dev/null
+++ b/code/Network.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <string>
+#include <SFML/Network.hpp>
+#include "Packet.hpp"
+
+
+class Network {
+public:
+ Network(std::string address, unsigned short port);
+
+ ~Network();
+
+ void SendHandshake(std::string username);
+
+ void SendPacket(Packet &packet);
+
+ Packet ReceivePacket();
+
+private:
+ std::string m_address;
+ unsigned short m_port;
+ sf::TcpSocket m_socket;
+ bool m_isCommpress=false;
+};
+