1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Reduced the CPU usage of the sent block selector algorithm

This commit is contained in:
Perttu Ahola 2011-05-31 00:15:43 +03:00
parent 16fdb42590
commit 223b379348
11 changed files with 355 additions and 55 deletions

View file

@ -500,6 +500,15 @@ private:
// When called, connection mutex should be locked
RemoteClient* getClient(u16 peer_id);
// When called, environment mutex should be locked
std::string getPlayerName(u16 peer_id)
{
Player *player = m_env.getPlayer(peer_id);
if(player == NULL)
return "[id="+itos(peer_id);
return player->getName();
}
/*
Get a player from memory or creates one.
If player is already connected, return NULL
@ -627,6 +636,8 @@ private:
*/
u16 m_ignore_map_edit_events_peer_id;
Profiler *m_profiler;
friend class EmergeThread;
friend class RemoteClient;
};