legacymode: implement clc_userinfo

This commit is contained in:
mittorn 2019-01-29 02:32:54 +07:00
parent ed049ea539
commit bbd4c1315e
4 changed files with 16 additions and 0 deletions

View File

@ -3095,3 +3095,15 @@ void CL_LegacyPrecache_f( void )
MSG_WriteString( &cls.netchan.message, va( "begin %i", spawncount ));
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 );
}

View File

@ -975,6 +975,7 @@ qboolean CL_IsThirdPerson( void );
qboolean CL_IsIntermission( void );
qboolean CL_Initialized( void );
char *CL_Userinfo( void );
void CL_LegacyUpdateInfo( void );
void CL_CharEvent( int key );
qboolean CL_DisableVisibility( void );
int CL_PointContents( const vec3_t point );

View File

@ -121,6 +121,7 @@ static qboolean Cvar_UpdateInfo( convar_t *var, const char *value, qboolean noti
// time to update server copy of userinfo
CL_ServerCommand( true, "setinfo \"%s\" \"%s\"\n", var->name, value );
CL_LegacyUpdateInfo();
}
#endif
}

View File

@ -253,6 +253,8 @@ extern const char *clc_strings[clc_lastmsg+1];
#define svc_legacy_event 27 // playback event queue
#define svc_legacy_changing 3 // changelevel by server request
#define clc_legacy_userinfo 6 // [[userinfo string]
#define SND_LEGACY_LARGE_INDEX (1<<2) // a send sound as short
#define MAX_LEGACY_ENTITY_BITS 12
#define MAX_LEGACY_WEAPON_BITS 5