mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add player name length checks
This commit is contained in:
parent
8e9d896f2d
commit
d7d8aa1039
2 changed files with 21 additions and 6 deletions
|
@ -79,6 +79,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "httpfetch.h"
|
||||
#include "guiEngine.h"
|
||||
#include "mapsector.h"
|
||||
#include "player.h"
|
||||
|
||||
#include "database-sqlite3.h"
|
||||
#ifdef USE_LEVELDB
|
||||
|
@ -1843,6 +1844,13 @@ int main(int argc, char *argv[])
|
|||
break;
|
||||
}
|
||||
|
||||
if (current_playername.length() > PLAYERNAME_SIZE-1) {
|
||||
error_message = wgettext("Player name to long.");
|
||||
playername = current_playername.substr(0,PLAYERNAME_SIZE-1);
|
||||
g_settings->set("name", playername);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
Run game
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue