Index: src/game/g_admin.c =================================================================== --- src/game/g_admin.c (revision 1744) +++ src/game/g_admin.c (working copy) @@ -263,12 +263,32 @@ qboolean G_admin_name_check( gentity_t *ent, char gclient_t *client; char testName[ MAX_NAME_LENGTH ] = {""}; char name2[ MAX_NAME_LENGTH ] = {""}; + int alphaCount = 0; G_SanitiseString( name, name2, sizeof( name2 ) ); if( !strcmp( name2, "unnamedplayer" ) ) return qtrue; + G_DecolorString( name, testName, sizeof( testName ) ); + if( isdigit( testName[ 0 ] ) ) + { + Q_strncpyz( err, "Names cannot begin with numbers", len ); + return qfalse; + } + + for( i = 0; testName[ i ]; i++) + { + if( isalpha( testName[ i ] ) ) + alphaCount++; + } + + if( alphaCount == 0 ) + { + Q_strncpyz( err, "Names must contain letters", len ); + return qfalse; + } + for( i = 0; i < level.maxclients; i++ ) { client = &level.clients[ i ]; Index: src/game/g_cmds.c =================================================================== --- src/game/g_cmds.c (revision 1744) +++ src/game/g_cmds.c (working copy) @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Bos ================== G_SanitiseString -Remove case and control characters from a string +Remove color codes and non-alphanumeric characters from a string ================== */ void G_SanitiseString( char *in, char *out, int len ) @@ -61,14 +61,12 @@ void G_SanitiseString( char *in, char *out, int le continue; } - if( *in < 32 ) + if( isalnum( *in ) ) { - in++; - continue; + *out++ = tolower( *in ); + len--; } - - *out++ = tolower( *in++ ); - len--; + in++; } out -= spaces; *out = 0;