Browse Source

legacymode: implement clc_userinfo

pull/2/head
mittorn 6 years ago
parent
commit
bbd4c1315e
  1. 12
      engine/client/cl_parse.c
  2. 1
      engine/common/common.h
  3. 1
      engine/common/cvar.c
  4. 2
      engine/common/protocol.h

12
engine/client/cl_parse.c

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

1
engine/common/common.h

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

1
engine/common/cvar.c

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

2
engine/common/protocol.h

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

Loading…
Cancel
Save