mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Add minetest.is_valid_player_name
utility
This commit is contained in:
parent
44db47e64a
commit
d3ca269c79
7 changed files with 32 additions and 15 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue