mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Add player name length checks
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user