mirror of
https://github.com/minetest/minetest.git
synced 2025-07-06 01:40:21 +02:00
Move network protocol implementation behind an interface
This commit is contained in:
@ -648,13 +648,14 @@ void RemoteClient::setLangCode(const std::string &code)
|
||||
m_lang_code = string_sanitize_ascii(code, 12);
|
||||
}
|
||||
|
||||
ClientInterface::ClientInterface(const std::shared_ptr<con::Connection> & con)
|
||||
ClientInterface::ClientInterface(const std::shared_ptr<con::IConnection> &con)
|
||||
:
|
||||
m_con(con),
|
||||
m_env(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ClientInterface::~ClientInterface()
|
||||
{
|
||||
/*
|
||||
|
@ -168,7 +168,7 @@ class EmergeManager;
|
||||
|
||||
*/
|
||||
namespace con {
|
||||
class Connection;
|
||||
class IConnection;
|
||||
}
|
||||
|
||||
|
||||
@ -464,7 +464,7 @@ public:
|
||||
|
||||
friend class Server;
|
||||
|
||||
ClientInterface(const std::shared_ptr<con::Connection> &con);
|
||||
ClientInterface(const std::shared_ptr<con::IConnection> &con);
|
||||
~ClientInterface();
|
||||
|
||||
/* run sync step */
|
||||
@ -543,7 +543,7 @@ private:
|
||||
void UpdatePlayerList();
|
||||
|
||||
// Connection
|
||||
std::shared_ptr<con::Connection> m_con;
|
||||
std::shared_ptr<con::IConnection> m_con;
|
||||
std::recursive_mutex m_clients_mutex;
|
||||
// Connected clients (behind the con mutex)
|
||||
RemoteClientMap m_clients;
|
||||
|
Reference in New Issue
Block a user