Skip to content

Commit

Permalink
engine: client: use xash id to generate fake steam id
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Oct 11, 2024
1 parent f8babab commit 6329ffe
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,33 +1055,38 @@ static void CL_GetCDKey( char *protinfo, size_t protinfosize )

#include "multi_emulator.h"
static CVAR_DEFINE_AUTO( cl_ticket_generator, "revemu2013", FCVAR_ARCHIVE, "you wouldn't steal a car" );
static CVAR_DEFINE_AUTO( cl_ticket_id, "76123847", FCVAR_ARCHIVE, "random number" );

static size_t CL_GenerateSteamTicket( byte *buf, size_t size )
{
const char *s = ID_GetMD5();
uint32_t crc;

CRC32_Init( &crc );
CRC32_ProcessBuffer( &crc, s, Q_strlen( s ));
crc = CRC32_Final( crc );

if( !Q_stricmp( cl_ticket_generator.string, "revemu2013" ))
return GenerateRevEmu2013( buf, cl_ticket_id.value );
return GenerateRevEmu2013( buf, crc );

if( !Q_stricmp( cl_ticket_generator.string, "sc2009" ))
return GenerateSC2009( buf, cl_ticket_id.value );
return GenerateSC2009( buf, crc );

if( !Q_stricmp( cl_ticket_generator.string, "oldrevemu" ))
return GenerateOldRevEmu( buf, cl_ticket_id.value );
return GenerateOldRevEmu( buf, crc );

if( !Q_stricmp( cl_ticket_generator.string, "steamemu" ))
return GenerateSteamEmu( buf, cl_ticket_id.value );
return GenerateSteamEmu( buf, crc );

if( !Q_stricmp( cl_ticket_generator.string, "revemu" ))
return GenerateRevEmu( buf, cl_ticket_id.value );
return GenerateRevEmu( buf, crc );

if( !Q_stricmp( cl_ticket_generator.string, "setti" ))
return GenerateSetti( buf );

if( !Q_stricmp( cl_ticket_generator.string, "avsmp" ))
return GenerateAVSMP( buf, cl_ticket_id.value, true );
return GenerateAVSMP( buf, crc, true );

Con_Printf( "%s: unknown generator %s, supported are: revemu2003, sc2009, oldrevemu, steamemu, revemu, setti, avsmp\n", __func__, cl_ticket_generator.string );

memset( buf, 0, size );
return size;
}
Expand Down Expand Up @@ -3203,7 +3208,6 @@ static void CL_InitLocal( void )
cl.resourcesonhand.pNext = cl.resourcesonhand.pPrev = &cl.resourcesonhand;

Cvar_RegisterVariable( &cl_ticket_generator );
Cvar_RegisterVariable( &cl_ticket_id );

Cvar_RegisterVariable( &showpause );
Cvar_RegisterVariable( &mp_decals );
Expand Down

0 comments on commit 6329ffe

Please sign in to comment.