mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Send Position packet on event, don't check it at each AsyncRunStep.
* This permit to cleanup the player checking loop
This commit is contained in:
@@ -581,32 +581,6 @@ void Server::AsyncRunStep(bool initial_step)
|
||||
Do background stuff
|
||||
*/
|
||||
|
||||
/*
|
||||
Handle players
|
||||
*/
|
||||
{
|
||||
JMutexAutoLock lock(m_env_mutex);
|
||||
|
||||
std::list<u16> clientids = m_clients.getClientIDs();
|
||||
|
||||
ScopeProfiler sp(g_profiler, "Server: handle players");
|
||||
|
||||
for(std::list<u16>::iterator
|
||||
i = clientids.begin();
|
||||
i != clientids.end(); ++i)
|
||||
{
|
||||
PlayerSAO *playersao = getPlayerSAO(*i);
|
||||
if(playersao == NULL)
|
||||
continue;
|
||||
|
||||
|
||||
if(playersao->m_moved) {
|
||||
SendMovePlayer(*i);
|
||||
playersao->m_moved = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Transform liquids */
|
||||
m_liquid_transform_timer += dtime;
|
||||
if(m_liquid_transform_timer >= m_liquid_transform_every)
|
||||
@@ -2590,6 +2564,7 @@ void Server::RespawnPlayer(u16 peer_id)
|
||||
bool repositioned = m_script->on_respawnplayer(playersao);
|
||||
if(!repositioned){
|
||||
v3f pos = findSpawnPos(m_env->getServerMap());
|
||||
// setPos will send the new position to client
|
||||
playersao->setPos(pos);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user