diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-31 16:17:09 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-31 16:17:09 +0200 |
commit | f721ed0e3c6be33670fe330c029a2d4c3353f635 (patch) | |
tree | 5afad5a292171d546d9ded16de6151a014883d84 /src/network | |
parent | 2017-05-28 (diff) | |
download | AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar.gz AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar.bz2 AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar.lz AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar.xz AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.tar.zst AltCraft-f721ed0e3c6be33670fe330c029a2d4c3353f635.zip |
Diffstat (limited to '')
-rw-r--r-- | src/network/Network.cpp | 3 | ||||
-rw-r--r-- | src/network/Network.hpp | 1 | ||||
-rw-r--r-- | src/network/NetworkClient.cpp | 1 | ||||
-rw-r--r-- | src/network/NetworkClient.hpp | 1 |
4 files changed, 4 insertions, 2 deletions
diff --git a/src/network/Network.cpp b/src/network/Network.cpp index b3b1e4b..7757be9 100644 --- a/src/network/Network.cpp +++ b/src/network/Network.cpp @@ -1,5 +1,4 @@ #include "Network.hpp" -#include "../packet/PacketBuilder.hpp" Network::Network(std::string address, unsigned short port) : m_address(address), m_port(port) { LOG(INFO) << "Connecting to server " << m_address << ":" << m_port; @@ -55,7 +54,7 @@ Packet Network::ReceivePacket() { break; } } - Field fLen = FieldParser::Parse(VarInt, bufLen); + Field fLen = FieldParser::Parse(VarIntType, bufLen); size_t packetLen = fLen.GetVarInt() + fLen.GetLength(); if (packetLen > 1024 * 1024 * 15) LOG(WARNING)<<"OMG SIZEOF PACKAGE IS "<<packetLen; diff --git a/src/network/Network.hpp b/src/network/Network.hpp index 7d8cfeb..84f2e7f 100644 --- a/src/network/Network.hpp +++ b/src/network/Network.hpp @@ -4,6 +4,7 @@ #include <easylogging++.h> #include <SFML/Network.hpp> #include "../packet/Packet.hpp" +#include "../packet/PacketBuilder.hpp" class Network { diff --git a/src/network/NetworkClient.cpp b/src/network/NetworkClient.cpp index 9916b10..fd957a5 100644 --- a/src/network/NetworkClient.cpp +++ b/src/network/NetworkClient.cpp @@ -95,6 +95,7 @@ void NetworkClient::Update() { } void NetworkClient::MainLoop() { + el::Helpers::setThreadName("Network"); try { while (isContinue) { Update(); diff --git a/src/network/NetworkClient.hpp b/src/network/NetworkClient.hpp index 9f68e37..14745a5 100644 --- a/src/network/NetworkClient.hpp +++ b/src/network/NetworkClient.hpp @@ -3,6 +3,7 @@ #include <queue> #include <thread> #include <mutex> +#include <nlohmann/json.hpp> #include "Network.hpp" #include "../packet/PacketParser.hpp" #include "../packet/PacketBuilder.hpp" |