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/server.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/server.h')
-rw-r--r-- | src/server.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server.h b/src/server.h index eeb134a5c..ab1660bf2 100644 --- a/src/server.h +++ b/src/server.h @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once -#include "network/connection.h" #include "irr_v3d.h" #include "map.h" #include "hud.h" @@ -29,6 +28,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "inventorymanager.h" #include "subgame.h" #include "tileanimation.h" // struct TileAnimationParams +#include "network/peerhandler.h" +#include "network/address.h" #include "util/numeric.h" #include "util/thread.h" #include "util/basic_macros.h" @@ -291,8 +292,7 @@ public: void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name); const std::string &hudGetHotbarSelectedImage(RemotePlayer *player) const; - inline Address getPeerAddress(u16 peer_id) - { return m_con.GetPeerAddress(peer_id); } + Address getPeerAddress(u16 peer_id); bool setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4], f32 frame_speed); @@ -320,7 +320,7 @@ public: void DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason=""); void acceptAuth(u16 peer_id, bool forSudoMode); void DenyAccess_Legacy(u16 peer_id, const std::wstring &reason); - bool getClientConInfo(u16 peer_id, con::rtt_stat_type type,float* retval); + bool getClientConInfo(u16 peer_id, con::rtt_stat_type type, float* retval); bool getClientInfo(u16 peer_id,ClientState* state, u32* uptime, u8* ser_vers, u16* prot_vers, u8* major, u8* minor, u8* patch, std::string* vers_string); @@ -506,7 +506,7 @@ private: ServerEnvironment *m_env = nullptr; // server connection - con::Connection m_con; + std::shared_ptr<con::Connection> m_con; // Ban checking BanManager *m_banmanager = nullptr; |