engine: client: limit ticket generator choices to revemu2013 only

This commit is contained in:
Alibek Omarov 2025-03-06 12:34:27 +03:00
parent 3e6b434733
commit 34322f025b
2 changed files with 3 additions and 21 deletions

@ -1 +1 @@
Subproject commit 7e989e670e516094c4d26f891d33e329f84d52c9 Subproject commit 11ff077ca58b9394a0eff0e89dd8980c2c252956

View file

@ -98,7 +98,6 @@ CVAR_DEFINE_AUTO( rate, "25000", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE,
static CVAR_DEFINE_AUTO( cl_ticket_generator, "revemu2013", FCVAR_ARCHIVE, "you wouldn't steal a car" ); static CVAR_DEFINE_AUTO( cl_ticket_generator, "revemu2013", FCVAR_ARCHIVE, "you wouldn't steal a car" );
client_t cl; client_t cl;
client_static_t cls; client_static_t cls;
clgame_static_t clgame; clgame_static_t clgame;
@ -1009,7 +1008,7 @@ static void CL_WriteSteamTicket( sizebuf_t *send )
const char *s; const char *s;
uint32_t crc; uint32_t crc;
char buf[768] = { 0 }; // setti and steamemu return 768 char buf[768] = { 0 }; // setti and steamemu return 768
size_t i = sizeof( buf ); int i = sizeof( buf );
if( !Q_strcmp( cl_ticket_generator.string, "null" )) if( !Q_strcmp( cl_ticket_generator.string, "null" ))
{ {
@ -1028,24 +1027,7 @@ static void CL_WriteSteamTicket( sizebuf_t *send )
CRC32_Init( &crc ); CRC32_Init( &crc );
CRC32_ProcessBuffer( &crc, s, Q_strlen( s )); CRC32_ProcessBuffer( &crc, s, Q_strlen( s ));
crc = CRC32_Final( crc ); crc = CRC32_Final( crc );
i = GenerateRevEmu2013( buf, s, crc );
if( !Q_stricmp( cl_ticket_generator.string, "revemu2013" ))
i = GenerateRevEmu2013( buf, crc );
else if( !Q_stricmp( cl_ticket_generator.string, "sc2009" ))
i = GenerateSC2009( buf, crc );
else if( !Q_stricmp( cl_ticket_generator.string, "oldrevemu" ))
i = GenerateOldRevEmu( buf, crc );
else if( !Q_stricmp( cl_ticket_generator.string, "steamemu" ))
i = GenerateSteamEmu( buf, crc );
else if( !Q_stricmp( cl_ticket_generator.string, "revemu" ))
i = GenerateRevEmu( buf, crc );
else if( !Q_stricmp( cl_ticket_generator.string, "setti" ))
i = GenerateSetti( buf );
else if( !Q_stricmp( cl_ticket_generator.string, "avsmp" ))
i = GenerateAVSMP( buf, crc, true );
else
Con_Printf( "%s: unknown generator %s, supported are: null, revemu2003, sc2009, oldrevemu, steamemu, revemu, setti, avsmp\n", __func__, cl_ticket_generator.string );
MSG_WriteBytes( send, buf, i ); MSG_WriteBytes( send, buf, i );
} }