summaryrefslogtreecommitdiff
path: root/src/game/g_client.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2010-03-29 16:33:13 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:32 +0000
commit55004fcab9cc37836ef376f2277de73b553bb982 (patch)
tree4908964fba38bf4d79c9edc802ef18efe50f6ac4 /src/game/g_client.c
parent31922eb1d2b923221401e5b7d06775f2899f5055 (diff)
* Fix handling of invalid userinfo
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r--src/game/g_client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 3bbdb754..0cdd7d0b 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -971,7 +971,7 @@ The game can override any of the settings and call trap_SetUserinfo
if desired.
============
*/
-void ClientUserinfoChanged( int clientNum )
+char *ClientUserinfoChanged( int clientNum )
{
gentity_t *ent;
char *s;
@@ -997,6 +997,7 @@ void ClientUserinfoChanged( int clientNum )
"disconnect \"illegal or malformed userinfo\n\"" );
trap_DropClient( ent - g_entities,
"dropped: illegal or malformed userinfo");
+ return "Illegal or malformed userinfo";
}
// stickyspec toggle
@@ -1160,6 +1161,8 @@ void ClientUserinfoChanged( int clientNum )
trap_SetConfigstring( CS_PLAYERS + clientNum, userinfo );
/*G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, userinfo );*/
+
+ return NULL;
}
@@ -1186,6 +1189,7 @@ restarts.
char *ClientConnect( int clientNum, qboolean firstTime )
{
char *value;
+ char *userInfoError;
gclient_t *client;
char userinfo[ MAX_INFO_STRING ];
gentity_t *ent;
@@ -1256,7 +1260,10 @@ char *ClientConnect( int clientNum, qboolean firstTime )
// get and distribute relevent paramters
G_namelog_connect( client );
- ClientUserinfoChanged( clientNum );
+ userInfoError = ClientUserinfoChanged( clientNum );
+ if( userInfoError != NULL )
+ return userInfoError;
+
G_LogPrintf( "ClientConnect: %i [%s] (%s) \"%s^7\" \"%c%s%c^7\"\n",
clientNum, client->pers.ip.str, client->pers.guid,
client->pers.netname,