mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Add minetest.is_valid_player_name
utility
This commit is contained in:
@@ -30,6 +30,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "porting.h" // strlcpy
|
||||
|
||||
|
||||
bool is_valid_player_name(std::string_view name) {
|
||||
return !name.empty() && name.size() <= PLAYERNAME_SIZE && string_allowed(name, PLAYERNAME_ALLOWED_CHARS);
|
||||
}
|
||||
|
||||
Player::Player(const std::string &name, IItemDefManager *idef):
|
||||
inventory(idef)
|
||||
{
|
||||
|
Reference in New Issue
Block a user