]> git.lizzy.rs Git - minetest.git/blobdiff - src/client.h
Overlays for wield and inventory images (#6107)
[minetest.git] / src / client.h
index 80f4cee406457e3ebf929bed9b93f2099e0b558b..2ee81ea09b68ffff7cd3d95de1154cc5735e80c7 100644 (file)
@@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #pragma once
 
-#include "network/connection.h"
 #include "clientenvironment.h"
 #include "irrlichttypes_extrabloated.h"
 #include <ostream>
@@ -36,6 +35,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mapnode.h"
 #include "tileanimation.h"
 #include "mesh_generator_thread.h"
+#include "network/address.h"
+#include "network/peerhandler.h"
 #include <fstream>
 
 #define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
@@ -57,6 +58,9 @@ class Minimap;
 struct MinimapMapblock;
 class Camera;
 class NetworkPacket;
+namespace con {
+class Connection;
+}
 
 enum LocalClientState {
        LC_Created,
@@ -472,8 +476,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        u8 getProtoVersion()
        { return m_proto_ver; }
 
-       bool connectedToServer()
-       { return m_con.Connected(); }
+       bool connectedToServer();
 
        float mediaReceiveProgress();
 
@@ -539,10 +542,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        void showGameFog(bool show = true);
        void showGameDebug(bool show = true);
 
-       const Address getServerAddress()
-       {
-               return m_con.GetPeerAddress(PEER_ID_SERVER);
-       }
+       const Address getServerAddress();
 
        const std::string &getAddressName() const
        {
@@ -611,7 +611,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        MeshUpdateThread m_mesh_update_thread;
        ClientEnvironment m_env;
        ParticleManager m_particle_manager;
-       con::Connection m_con;
+       std::unique_ptr<con::Connection> m_con;
        std::string m_address_name;
        Camera *m_camera = nullptr;
        Minimap *m_minimap = nullptr;