summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-31 16:17:09 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-31 16:17:09 +0200
commitf721ed0e3c6be33670fe330c029a2d4c3353f635 (patch)
tree5afad5a292171d546d9ded16de6151a014883d84 /src/network
parent2017-05-28 (diff)
downloadAltCraft-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.cpp3
-rw-r--r--src/network/Network.hpp1
-rw-r--r--src/network/NetworkClient.cpp1
-rw-r--r--src/network/NetworkClient.hpp1
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"