aboutsummaryrefslogtreecommitdiff
path: root/src/clientiface.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
committerest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
commit81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (patch)
tree1e9ef1be1b3295a8673d6e4f0bdeb4c2d3a6015f /src/clientiface.h
parent8077612dcb48221281e726a60eb97bf73fde462b (diff)
parent231ac33d34dfaaddf292c5f31b1eae43eeefba2d (diff)
downloadminetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.gz
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.bz2
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.zip
Merge 0.4.15 changes into stable-0.4
0.4.15 release!
Diffstat (limited to 'src/clientiface.h')
-rw-r--r--src/clientiface.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/clientiface.h b/src/clientiface.h
index c09942909..551d71bbe 100644
--- a/src/clientiface.h
+++ b/src/clientiface.h
@@ -25,10 +25,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "serialization.h" // for SER_FMT_VER_INVALID
#include "threading/mutex.h"
#include "network/networkpacket.h"
+#include "util/cpp11_container.h"
#include <list>
#include <vector>
-#include <map>
#include <set>
class MapBlock;
@@ -453,7 +453,7 @@ public:
std::vector<u16> getClientIDs(ClientState min_state=CS_Active);
/* get list of client player names */
- std::vector<std::string> getPlayerNames();
+ const std::vector<std::string> &getPlayerNames() const { return m_clients_names; }
/* send message to client */
void send(u16 peer_id, u8 channelnum, NetworkPacket* pkt, bool reliable);
@@ -502,8 +502,7 @@ protected:
void lock() { m_clients_mutex.lock(); }
void unlock() { m_clients_mutex.unlock(); }
- std::map<u16, RemoteClient*>& getClientList()
- { return m_clients; }
+ UNORDERED_MAP<u16, RemoteClient*>& getClientList() { return m_clients; }
private:
/* update internal player list */
@@ -513,7 +512,7 @@ private:
con::Connection* m_con;
Mutex m_clients_mutex;
// Connected clients (behind the con mutex)
- std::map<u16, RemoteClient*> m_clients;
+ UNORDERED_MAP<u16, RemoteClient*> m_clients;
std::vector<std::string> m_clients_names; //for announcing masterserver
// Environment