summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-14 16:38:44 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:07 +0100
commit5508f21d2b040e2e25e0352e221d19c2a45a0deb (patch)
tree9efe3a94d636c2a9858f7a8e012e3765620c1e59
parentd7077bdad052a64f1e57ba137a5461b670d52787 (diff)
stop accessing the hostname, the current username and the architecture/platform/OS information
use "UnnamedPlayer" as the default player name
-rw-r--r--src/client/cl_main.c2
-rw-r--r--src/qcommon/net_ip.c2
-rw-r--r--src/qcommon/qcommon.h2
-rw-r--r--src/sys/sys_main.c2
-rw-r--r--src/sys/sys_unix.c15
-rw-r--r--src/sys/sys_win32.c21
6 files changed, 1 insertions, 43 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index ac7d6356..a4e6301f 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3676,7 +3676,7 @@ void CL_Init( void ) {
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE);
// userinfo
- Cvar_Get ("name", Sys_GetCurrentUser( ), CVAR_USERINFO | CVAR_ARCHIVE );
+ Cvar_Get ("name", "UnnamedPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("color1", "4", CVAR_USERINFO | CVAR_ARCHIVE );
diff --git a/src/qcommon/net_ip.c b/src/qcommon/net_ip.c
index 651fd4d3..882562e9 100644
--- a/src/qcommon/net_ip.c
+++ b/src/qcommon/net_ip.c
@@ -1303,8 +1303,6 @@ static void NET_GetLocalAddress( void ) {
if(gethostname( hostname, 256 ) == SOCKET_ERROR)
return;
- Com_Printf( "Hostname: %s\n", hostname );
-
memset(&hint, 0, sizeof(hint));
hint.ai_family = AF_UNSPEC;
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index c896ccbe..567abe5f 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -1040,8 +1040,6 @@ void * QDECL Sys_LoadGameDll( const char *name, intptr_t (QDECL **entryPoint)(in
intptr_t (QDECL *systemcalls)(intptr_t, ...) );
void Sys_UnloadDll( void *dllHandle );
-char *Sys_GetCurrentUser( void );
-
void QDECL Sys_Error( const char *error, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
void Sys_Quit (void) __attribute__ ((noreturn));
char *Sys_GetClipboardData( void ); // note that this isn't journaled...
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 24d501f1..8c28252e 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -210,8 +210,6 @@ Sys_Init
void Sys_Init(void)
{
Cmd_AddCommand( "in_restart", Sys_In_Restart_f );
- Cvar_Set( "arch", OS_STRING " " ARCH_STRING );
- Cvar_Set( "username", Sys_GetCurrentUser( ) );
}
/*
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index bc3cacf5..fa1efe0c 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -128,21 +128,6 @@ qboolean Sys_RandomBytes( byte *string, int len )
return qtrue;
}
-/*
-==================
-Sys_GetCurrentUser
-==================
-*/
-char *Sys_GetCurrentUser( void )
-{
- struct passwd *p;
-
- if ( (p = getpwuid( getuid() )) == NULL ) {
- return "player";
- }
- return p->pw_name;
-}
-
#define MEM_THRESHOLD 96*1024*1024
/*
diff --git a/src/sys/sys_win32.c b/src/sys/sys_win32.c
index 6f251299..1a2da73d 100644
--- a/src/sys/sys_win32.c
+++ b/src/sys/sys_win32.c
@@ -171,27 +171,6 @@ qboolean Sys_RandomBytes( byte *string, int len )
return qtrue;
}
-/*
-================
-Sys_GetCurrentUser
-================
-*/
-char *Sys_GetCurrentUser( void )
-{
- static char s_userName[1024];
- unsigned long size = sizeof( s_userName );
-
- if( !GetUserName( s_userName, &size ) )
- strcpy( s_userName, "player" );
-
- if( !s_userName[0] )
- {
- strcpy( s_userName, "player" );
- }
-
- return s_userName;
-}
-
#define MEM_THRESHOLD 96*1024*1024
/*