summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-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"