Changeset 2:10c3bca620af

Show
Ignore:
Timestamp:
11/06/07 14:51:04 (3 years ago)
Author:
kang
Branch:
default
convert_revision:
svn:7c786126-522e-0410-a822-d6d8feae56ca/trunk@51
Message:

Guid is now checked, a non-valid GUID will be listed as XXX ...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/game/g_client.c

    r1 r2  
    7878void SP_info_human_intermission( gentity_t *ent ) 
    7979{ 
     80} 
     81 
     82/* 
     83=============== 
     84G_CheckGUID 
     85=============== 
     86*/ 
     87qboolean G_ValidGUID(char *in) 
     88{ 
     89  int count = 0; 
     90  while( *in ) 
     91  { 
     92    count ++; 
     93    //check that the char is an alphanumeric one (with uppercased letter) 
     94    if( !((*in >= '0' && *in <= '9') || (*in >= 'A' && *in <= 'F')) ) 
     95      return qfalse; 
     96 
     97    in++; 
     98  } 
     99 
     100  if( count != 32 ) 
     101    return qfalse; 
     102 
     103  return qtrue; 
    80104} 
    81105 
     
    12521276 
    12531277  // add guid to session so we don't have to keep parsing userinfo everywhere 
    1254   if( !guid[0] ) 
     1278  if( !G_ValidGUID(guid) ) 
    12551279  { 
    12561280    Q_strncpyz( client->pers.guid, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",