summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-08-22 14:03:04 +0200
committersapier <Sapier at GMX dot net>2014-08-22 21:18:43 +0200
commitd7d8aa1039e898dd37fcd8fa01d7f13c5452b43d (patch)
treece9b4cb93136d20937d0b47c04b4529a03fb4887 /src/main.cpp
parent8e9d896f2d4bd3c9579170d01e14f1dd5e514362 (diff)
downloadminetest-d7d8aa1039e898dd37fcd8fa01d7f13c5452b43d.tar.gz
minetest-d7d8aa1039e898dd37fcd8fa01d7f13c5452b43d.tar.bz2
minetest-d7d8aa1039e898dd37fcd8fa01d7f13c5452b43d.zip
Add player name length checks
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index bb2ac5faf..a44a2e611 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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
*/