diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index fab4b3e3..a4a41f50 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -2791,7 +2791,7 @@ static void GAME_EXPORT PlayerInfo_SetValueForKey( const char *key, const char * else if( Info_SetValueForStarKey( cls.userinfo, key, value, MAX_INFO_STRING )) { // time to update server copy of userinfo - CL_ServerCommand( true, "setinfo \"%s\" \"%s\"\n", key, value ); + CL_UpdateInfo( key, value ); } } diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 57163d48..7df6ea31 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2722,6 +2722,29 @@ void CL_ServerCommand( qboolean reliable, const char *fmt, ... ) } } +/* +=============== +CL_UpdateInfo + +tell server about changed userinfo +=============== +*/ +void CL_UpdateInfo( const char *key, const char *value ) +{ + if( !cls.legacymode ) + { + CL_ServerCommand( true, "setinfo \"%s\" \"%s\"\n", key, value ); + } + else + { + if( cls.state != ca_active ) + return; + + MSG_BeginClientCmd( &cls.netchan.message, clc_legacy_userinfo ); + MSG_WriteString( &cls.netchan.message, cls.userinfo ); + } +} + //============================================================================= /* ============== diff --git a/engine/client/cl_parse_48.c b/engine/client/cl_parse_48.c index d18928d7..24c7eea5 100644 --- a/engine/client/cl_parse_48.c +++ b/engine/client/cl_parse_48.c @@ -657,18 +657,6 @@ void CL_LegacyPrecache_f( void ) cls.signon = SIGNONS; } -void CL_LegacyUpdateInfo( void ) -{ - if( !cls.legacymode ) - return; - - if( cls.state != ca_active ) - return; - - MSG_BeginClientCmd( &cls.netchan.message, clc_legacy_userinfo ); - MSG_WriteString( &cls.netchan.message, cls.userinfo ); -} - qboolean CL_LegacyMode( void ) { return cls.legacymode == PROTO_LEGACY; diff --git a/engine/common/common.h b/engine/common/common.h index c64f200e..b2c743b1 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -671,6 +671,7 @@ void SV_BroadcastPrintf( struct sv_client_s *ignore, const char *fmt, ... ) _for void CL_ClearStaticEntities( void ); qboolean S_StreamGetCurrentState( char *currentTrack, size_t currentTrackSize, char *loopTrack, size_t loopTrackSize, int *position ); void CL_ServerCommand( qboolean reliable, const char *fmt, ... ) _format( 2 ); +void CL_UpdateInfo( const char *key, const char *value ); void CL_HudMessage( const char *pMessage ); const char *CL_MsgInfo( int cmd ); void SV_DrawDebugTriangles( void ); diff --git a/engine/common/cvar.c b/engine/common/cvar.c index 54d69016..1bdda06b 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -164,8 +164,7 @@ static qboolean Cvar_UpdateInfo( convar_t *var, const char *value, qboolean noti return false; // failed to change value // time to update server copy of userinfo - CL_ServerCommand( true, "setinfo \"%s\" \"%s\"\n", var->name, value ); - CL_LegacyUpdateInfo(); + CL_UpdateInfo( var->name, value ); } #endif }