diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-04-21 15:31:43 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-04-21 15:31:43 +0200 |
commit | 71760514fc044f273914c17b1510fa3cf10419b3 (patch) | |
tree | 72f822efde300d8e1e9de1cc578d431ff72e0e03 /NetworkClient.hpp | |
parent | 2017-04-15 (diff) | |
download | AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.gz AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.bz2 AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.lz AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.xz AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.zst AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.zip |
Diffstat (limited to '')
-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; |