mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Disallow the name 'singleplayer' in a multiplayer server
This commit is contained in:
@@ -1922,6 +1922,15 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isSingleplayer() && strcasecmp(playername, "singleplayer") == 0)
|
||||
{
|
||||
actionstream<<"Server: Player with an invalid name "
|
||||
<<"tried to connect from "<<addr_s<<std::endl;
|
||||
SendAccessDenied(m_con, peer_id,
|
||||
L"Name is not allowed");
|
||||
return;
|
||||
}
|
||||
|
||||
infostream<<"Server: New connection: \""<<playername<<"\" from "
|
||||
<<m_con.GetPeerAddress(peer_id).serializeString()<<std::endl;
|
||||
|
||||
|
Reference in New Issue
Block a user