summaryrefslogtreecommitdiffstats
path: root/src/Network.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 13:01:35 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 15:06:36 +0100
commita2345d1f45870eb00a2a3d5d6fd21a386efcade3 (patch)
tree895dbf8f78d5b0117fb0daaab43423775ac4c304 /src/Network.hpp
parentMerge pull request #31 from uis246/pluginSystem (diff)
downloadAltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar.gz
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar.bz2
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar.lz
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar.xz
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.tar.zst
AltCraft-a2345d1f45870eb00a2a3d5d6fd21a386efcade3.zip
Diffstat (limited to 'src/Network.hpp')
-rw-r--r--src/Network.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network.hpp b/src/Network.hpp
index 5d7fc38..29a090f 100644
--- a/src/Network.hpp
+++ b/src/Network.hpp
@@ -11,12 +11,13 @@ enum ConnectionState : unsigned char {
};
class Network {
- Socket *socket = nullptr;
- StreamSocket *stream = nullptr;
+ std::unique_ptr<Socket> socket;
+ std::unique_ptr<StreamSocket> stream;
std::shared_ptr<Packet> ReceivePacketByPacketId(int packetId, ConnectionState state, StreamInput &stream);
public:
Network(std::string address, unsigned short port);
+
~Network();
std::shared_ptr<Packet> ReceivePacket(ConnectionState state = Play, bool useCompression = false);