mirror of
https://github.com/moparisthebest/minetest
synced 2024-12-24 08:28:49 -05:00
Disallow the name 'singleplayer' in a multiplayer server
This commit is contained in:
parent
6027c8d259
commit
320a00e7c6
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user