diff options
Diffstat (limited to 'NetworkClient.hpp')
-rw-r--r-- | NetworkClient.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/NetworkClient.hpp b/NetworkClient.hpp index df2f616..a41b5f4 100644 --- a/NetworkClient.hpp +++ b/NetworkClient.hpp @@ -1,6 +1,8 @@ #pragma once #include <queue> +#include <thread> +#include <mutex> #include "Network.hpp" struct ServerInfo{ @@ -21,11 +23,16 @@ public: void Update(); - Packet GetPacket(); + void MainLoop(); + + Packet * GetPacket(); void AddPacketToQueue(Packet packet); static ServerInfo ServerPing(std::string address,unsigned short port); private: + std::mutex m_updateMutex; + std::thread m_networkThread; + bool isContinue=true; NetworkClient (const NetworkClient&); NetworkClient&operator=(const NetworkClient&); Network m_network; |