diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-24 08:28:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 08:28:54 +0200 |
commit | c7160cb629086df2a32c7dcf4faed4761ec4393e (patch) | |
tree | 63670a536ce95f6a3a1ce09bf2f2f65d1bec5214 /src/client.h | |
parent | 928609c8bd9d4e6129ab244214bd5c54d000b737 (diff) | |
download | minetest-c7160cb629086df2a32c7dcf4faed4761ec4393e.tar.gz minetest-c7160cb629086df2a32c7dcf4faed4761ec4393e.tar.bz2 minetest-c7160cb629086df2a32c7dcf4faed4761ec4393e.zip |
Network cleanup (#6302)
* Cleanup network headers
* Move peerhandler to a specific header to reduce compilation times
* Move socket.cpp/h to network folder
* More work
* Network code cleanups
* Move socket.{cpp,h} to network folder
* Move Address object to network/address.{cpp,h}
* Move network exceptions to network/networkexceptions.h
* Client: use unique_ptr for Connection
* Server/ClientIface: use shared_ptr for Connection
* Format fixes
* Remove socket.cpp socket.h from clang-format whitelist
* Also fix NetworkPacket code style & make it under clang-format
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client.h b/src/client.h index 80f4cee40..2ee81ea09 100644 --- a/src/client.h +++ b/src/client.h @@ -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 @@ public: u8 getProtoVersion() { return m_proto_ver; } - bool connectedToServer() - { return m_con.Connected(); } + bool connectedToServer(); float mediaReceiveProgress(); @@ -539,10 +542,7 @@ public: 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 @@ private: 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; |