fixed cryptic default player name on Android; instead using "anonymous" now 4.0.1.4
authorHolger Schemel <info@artsoft.org>
Fri, 16 Mar 2018 16:17:47 +0000 (17:17 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 16 Mar 2018 16:31:28 +0000 (17:31 +0100)
- on first start, the player name is taken from the system's user name
- on Android systems, this is usually something cryptic like "ud_a123"
- this was changed to use the default player name "anonymous" instead

src/libgame/misc.c

index bddd38d9a933ce858a53ee3d5c4706192107d35f..3e7719e1da6a32292a6a1339784f5ed27024150e 100644 (file)
@@ -571,7 +571,7 @@ char *getLoginName()
     if (GetUserName(login_name, &buffer_size) == 0)
       strcpy(login_name, ANONYMOUS_NAME);
   }
-#else
+#elif defined(PLATFORM_UNIX) && !defined(PLATFORM_ANDROID)
   if (login_name == NULL)
   {
     struct passwd *pwd;
@@ -581,6 +581,8 @@ char *getLoginName()
     else
       login_name = getStringCopy(pwd->pw_name);
   }
+#else
+  login_name = ANONYMOUS_NAME;
 #endif
 
   return login_name;