summaryrefslogtreecommitdiffstats
path: root/NetworkClient.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-18 16:03:05 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-18 16:03:05 +0200
commit4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79 (patch)
tree548911d4e341fd5717acff3b5bc752c7b5650bf4 /NetworkClient.hpp
parent2017-05-13 (diff)
downloadAltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.gz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.bz2
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.lz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.xz
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.tar.zst
AltCraft-4d7b1da29e0957ac798ee8e6da8288cbd4ae5c79.zip
Diffstat (limited to 'NetworkClient.hpp')
-rw-r--r--NetworkClient.hpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/NetworkClient.hpp b/NetworkClient.hpp
deleted file mode 100644
index a41b5f4..0000000
--- a/NetworkClient.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-
-#include <queue>
-#include <thread>
-#include <mutex>
-#include "Network.hpp"
-
-struct ServerInfo{
- std::string version;
- int protocol = 0;
- int players_max = 0;
- int players_online = 0;
- std::vector<std::pair<std::string, std::string>> players;
- std::string description;
- double ping = 0;
- std::string favicon;
- std::string json;
-};
-class NetworkClient {
-public:
- NetworkClient(std::string address, unsigned short port, std::string username);
- ~NetworkClient();
-
- void Update();
-
- 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;
- std::queue <Packet> m_received;
- std::queue <Packet> m_toSend;
-};
-