diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-21 16:26:25 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-21 16:26:25 +0200 |
commit | f5aa7827af55342a1ec714d366944b3e3f3129b2 (patch) | |
tree | 4f4885d2ae0f46004a22e7d4dc34f80c11ecee0c /src/network | |
parent | 2017-06-20 (diff) | |
download | AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.gz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.bz2 AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.lz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.xz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.zst AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.zip |
Diffstat (limited to '')
-rw-r--r-- | include/network/Network.hpp (renamed from src/network/Network.hpp) | 0 | ||||
-rw-r--r-- | include/network/NetworkClient.hpp (renamed from src/network/NetworkClient.hpp) | 3 | ||||
-rw-r--r-- | include/network/Packet.hpp (renamed from src/network/Packet.hpp) | 3 | ||||
-rw-r--r-- | include/network/Socket.hpp (renamed from src/network/Socket.hpp) | 1 | ||||
-rw-r--r-- | include/network/Stream.hpp (renamed from src/network/Stream.hpp) | 18 | ||||
-rw-r--r-- | src/network/Network.cpp | 3 | ||||
-rw-r--r-- | src/network/NetworkClient.cpp | 3 | ||||
-rw-r--r-- | src/network/Socket.cpp | 2 | ||||
-rw-r--r-- | src/network/Stream.cpp | 2 |
9 files changed, 14 insertions, 21 deletions
diff --git a/src/network/Network.hpp b/include/network/Network.hpp index 1281289..1281289 100644 --- a/src/network/Network.hpp +++ b/include/network/Network.hpp diff --git a/src/network/NetworkClient.hpp b/include/network/NetworkClient.hpp index bf7aa4e..22b1b22 100644 --- a/src/network/NetworkClient.hpp +++ b/include/network/NetworkClient.hpp @@ -3,7 +3,8 @@ #include <thread> #include <queue> #include <mutex> -#include "Network.hpp" + +#include <network/Network.hpp> class NetworkClient { Network network; diff --git a/src/network/Packet.hpp b/include/network/Packet.hpp index 3cf4d26..685e3da 100644 --- a/src/network/Packet.hpp +++ b/include/network/Packet.hpp @@ -1,7 +1,8 @@ #pragma once #include <easylogging++.h> -#include "Stream.hpp" + +#include <network/Stream.hpp> enum PacketNameLoginSB { LoginStart = 0x00, diff --git a/src/network/Socket.hpp b/include/network/Socket.hpp index ee449b3..48bcad9 100644 --- a/src/network/Socket.hpp +++ b/include/network/Socket.hpp @@ -1,6 +1,7 @@ #pragma once #include <string> + #include <SFML/Network.hpp> /** diff --git a/src/network/Stream.hpp b/include/network/Stream.hpp index 5babb08..a24dfbe 100644 --- a/src/network/Stream.hpp +++ b/include/network/Stream.hpp @@ -5,23 +5,15 @@ #include <stdexcept> #include <vector> #include <cstring> + #include <nlohmann/json.hpp> #include <easylogging++.h> -#include "Socket.hpp" -#include "../utility/Vector.hpp" - -class Stream { -protected: - template<class T> - void endswap(T &obj) { - unsigned char *raw = reinterpret_cast<unsigned char *>(&obj); - std::reverse(raw, raw + sizeof(T)); - } - void endswap(unsigned char *arr, size_t arrLen) { - std::reverse(arr, arr + arrLen); - } +#include <network/Socket.hpp> +#include <Vector.hpp> +#include <Utility.hpp> +class Stream { public: virtual ~Stream() {}; }; diff --git a/src/network/Network.cpp b/src/network/Network.cpp index 68df158..91cb481 100644 --- a/src/network/Network.cpp +++ b/src/network/Network.cpp @@ -1,5 +1,4 @@ -#include "Network.hpp" -#include <iostream> +#include <network/Network.hpp> Network::Network(std::string address, unsigned short port) { socket = new Socket(address, port); diff --git a/src/network/NetworkClient.cpp b/src/network/NetworkClient.cpp index b8d880d..73880cf 100644 --- a/src/network/NetworkClient.cpp +++ b/src/network/NetworkClient.cpp @@ -1,5 +1,4 @@ -#include "NetworkClient.hpp" -#include "Packet.hpp" +#include <network/NetworkClient.hpp> NetworkClient::NetworkClient(std::string address, unsigned short port, std::string username, bool &quit) : network(address, port), isRunning(quit) { diff --git a/src/network/Socket.cpp b/src/network/Socket.cpp index 2bbf49a..f4e6787 100644 --- a/src/network/Socket.cpp +++ b/src/network/Socket.cpp @@ -1,4 +1,4 @@ -#include "Socket.hpp" +#include <network/Socket.hpp> Socket::Socket(std::string address, unsigned short port) { sf::Socket::Status connectionStatus = socket.connect(sf::IpAddress(address), port); diff --git a/src/network/Stream.cpp b/src/network/Stream.cpp index d492428..447b13f 100644 --- a/src/network/Stream.cpp +++ b/src/network/Stream.cpp @@ -1,4 +1,4 @@ -#include "Stream.hpp" +#include <network/Stream.hpp> const int MAX_VARINT_LENGTH = 5; |