mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Optional reconnect functionality
Enable the server to request the client to reconnect. This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
This commit is contained in:
@@ -426,13 +426,15 @@ bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize, v3s16
|
||||
return true;
|
||||
}
|
||||
|
||||
void ServerEnvironment::kickAllPlayers(const std::string &reason)
|
||||
void ServerEnvironment::kickAllPlayers(AccessDeniedCode reason,
|
||||
const std::string &str_reason, bool reconnect)
|
||||
{
|
||||
std::wstring wreason = utf8_to_wide(reason);
|
||||
for (std::vector<Player*>::iterator it = m_players.begin();
|
||||
it != m_players.end();
|
||||
++it) {
|
||||
((Server*)m_gamedef)->DenyAccess_Legacy((*it)->peer_id, wreason);
|
||||
((Server*)m_gamedef)->DenyAccessVerCompliant((*it)->peer_id,
|
||||
(*it)->protocol_version, (AccessDeniedCode)reason,
|
||||
str_reason, reconnect);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user