Checkupdatingsteamresources

12-Jan-2016 06:31 by 10 Comments

Checkupdatingsteamresources - big beautiful dating

Q_strcasecmp( table Name, sz Decal Precache Tablename ) ) { // Cache the id m_p Decal Precache Table = table; return true; } if ( !Q_strcasecmp( table Name, INSTANCE_BASELINE_TABLENAME ) ) { // Cache the id m_p Instance Baseline Table = table; return true; } if ( !

//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.

============// // // Purpose: // // $No Keywords: $ //=============================================================================// #include "client_pch.h" #include "networkstringtabledefs.h" #include #include "pure_server.h" #include "netmessages.h" #include "cl_demo.h" #include "host_state.h" #include "host.h" #include "gl_matsysiface.h" #include "vgui_baseui_interface.h" #include "tier0/icommandline.h" #include #include "checksum_engine.h" #include "filesystem_engine.h" #include "logofile_shared.h" #include "sound.h" #include "decal.h" #include "networkstringtableclient.h" #include "dt_send_eng.h" #include "ents_shared.h" #include "cl_ents_parse.h" #include "cl_entityreport.h" #include "Map Reslist Generator.h" #include "Download List Generator.h" #include "Game Event Manager.h" #include "host_phonehome.h" #include "vgui_baseui_interface.h" #include "clockdriftmgr.h" #include "snd_audio_source.h" #include "vgui_controls/Controls.h" #include "vgui/ILocalize.h" #include "download.h" #include "checksum_engine.h" #include "Model Info.h" #include "materialsystem/imaterial.h" #include "materialsystem/materialsystem_config.h" #include "tier1/fmtstr.h" #include "steam/steam_api.h" #include "matchmaking.h" #include "tier0/platform.h" #include "tier0/systeminformation.h" // memdbgon must be the last include file in a file!!!

#include "tier0/memdbgon.h" static Con Var cl_timeout( "cl_timeout", "30", FCVAR_ARCHIVE, "After this many seconds without receiving a packet from the server, the client will disconnect itself" ); static Con Var cl_logofile( "cl_logofile", "materials/decals/spraylogo.vtf", FCVAR_ARCHIVE, "Spraypoint logo decal." ); // TODO must be more generic static Con Var cl_soundfile( "cl_soundfile", "sound/player/jingle.wav", FCVAR_ARCHIVE, "Jingle sound file." ); static Con Var cl_forcepreload( "cl_forcepreload", "0", FCVAR_ARCHIVE, "Whether we should force preloading."); static Con Var cl_allowdownload ( "cl_allowdownload", "1", FCVAR_ARCHIVE, "Client downloads customization files" ); static Con Var cl_downloadfilter( "cl_downloadfilter", "all", FCVAR_ARCHIVE, "Determines which files can be downloaded from the server (all, none, nosounds)" ); extern Con Var sv_downloadurl; extern Con Var sv_consistency; extern bool g_b Server Game DLLGreater Than V5; ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CClient State:: CClient State() { m_b Marked CRCs Unverified = false; demonum = -1; m_tick Remainder = 0; m_frame Time = 0; m_p Area Bits = NULL; m_h Wait For Resources Handle = NULL; m_b Update Steam Resources = false; m_b Shown Steam Resource Update Progress = false; m_p Pure Server Whitelist = NULL; m_b Check CRCs With Server = false; m_fl Last CRCBatch Time = 0; m_n Friends ID = 0; m_Friends Name[0] = 0; } CClient State::~CClient State() { if ( m_p Pure Server Whitelist ) m_p Pure Server Whitelist-Release(); } // HL1 CD Key #define GUID_LEN 13 /* ======================= CL_Get CDKey Hash() Connections will now use a hashed cd key value A LAN server will know not to allows more then xxx users with the same CD Key ======================= */ const char *CClient State:: Get CDKey Hash( void ) { if ( Is PC() ) { char sz Key Buffer[256]; // Keys are about 13 chars long.

static char sz Hashed Key Buffer[64]; int n Key Length; bool b Dedicated = false; MD5Context_t ctx; unsigned char digest[16]; // The MD5 Hash n Key Length = Q_snprintf( sz Key Buffer, sizeof( sz Key Buffer ), "%s", registry-Read String( "key", "" ) ); if (b Dedicated) { Con Msg("Key has no meaning on dedicated server...\n"); return ""; } if ( n Key Length == 0 ) { n Key Length = 13; Q_strncpy( sz Key Buffer, "1234567890123", sizeof( sz Key Buffer ) ); Assert( Q_strlen( sz Key Buffer ) == n Key Length ); Dev Msg( "Missing CD Key from registry, inserting blank key\n" ); registry-= 256 ) { Con Msg("Bogus key length on CD Key...\n"); return ""; } // Now get the md5 hash of the key memset( &ctx, 0, sizeof( ctx ) ); memset( digest, 0, sizeof( digest ) ); MD5Init(&ctx); MD5Update(&ctx, (unsigned char*)sz Key Buffer, n Key Length); MD5Final(digest, &ctx); Q_strncpy ( sz Hashed Key Buffer, MD5_Print ( digest, sizeof( digest ) ), sizeof( sz Hashed Key Buffer ) ); return sz Hashed Key Buffer; } return "12345678901234567890123456789012"; } void CClient State:: Send Client Info( void ) { CLC_Client Info info; info.m_n Send Table CRC = Send Table_Get CRC(); info.m_n Server Count = m_n Server Count; info.m_b Is HLTV = false; #if !

if ( 0 ) { Q_snprintf( sz Downloadable File Tablename, 255, ":%s", DOWNLOADABLE_FILE_TABLENAME ); Q_snprintf( sz Model Precache Tablename, 255, ":%s", MODEL_PRECACHE_TABLENAME ); Q_snprintf( sz Generic Precache Tablename, 255, ":%s", GENERIC_PRECACHE_TABLENAME ); Q_snprintf( sz Sound Precache Tablename, 255, ":%s", SOUND_PRECACHE_TABLENAME ); Q_snprintf( sz Decal Precache Tablename, 255, ":%s", DECAL_PRECACHE_TABLENAME ); } // Hook Model Precache table if ( !

Q_strcasecmp( table Name, sz Model Precache Tablename ) ) { m_p Model Precache Table = table; return true; } if ( !

Q_strcasecmp( table Name, sz Generic Precache Tablename ) ) { m_p Generic Precache Table = table; return true; } if ( !Q_strcasecmp( table Name, sz Sound Precache Tablename ) ) { m_p Sound Precache Table = table; return true; } if ( !defined( NO_STEAM ) info.m_n Friends ID = Steam User() ? Get Account ID() : 0; #else info.m_n Friends ID = 0; #endif Q_strncpy( info.m_Friends Name, m_Friends Name, sizeof(info.m_Friends Name) ); Check Own Custom Files(); // load & verfiy custom player files for ( int i=0; i Send Net Msg( info ); } extern IVEngine Client *engine Client; //----------------------------------------------------------------------------- // Purpose: A svc_signonnum has been received, perform a client side setup // Output : void CL_Signon Reply //----------------------------------------------------------------------------- bool CClient State:: Set Signon State ( int state, int count ) { if ( !CBase Client State:: Set Signon State( state, count ) ) { CL_Retry(); return false; } // Con DMsg ("Signon state: %i\n", state ); COM_Timestamped Log( "CClient State:: Set Signon State: start %i", state ); switch ( m_n Signon State ) { case SIGNONSTATE_CHALLENGE : m_b Marked CRCs Unverified = false; // Remember that we just connected to a new server so it'll // reverify any necessary file CRCs on this server.Engine VGui()-Is Playing Back() ) { // start making sure we have all the specified resources Start Updating Steam Resources(); } else { // during demo playback dont try to download resource Finish Signon State_New(); } // don't tell the server yet that we've entered this state return true; } break; case SIGNONSTATE_PRESPAWN : m_n Sound Sequence = 1; // reset sound sequence number after receiving signon sounds break; case SIGNONSTATE_SPAWN : { Assert( g_Client DLL ); Engine VGui()-Send Net Msg( NET_Signon State( state, count) ); } return true; } bool CClient State:: Hook Client String Table( char const *table Name ) { INetwork String Table *table = Get String Table( table Name ); if ( !table ) { // If engine takes a pass, allow client dll to hook in its callbacks if ( g_Client DLL ) { g_Client DLL-Install String Table Callback( table Name ); } return false; } char sz Downloadable File Tablename[255] = DOWNLOADABLE_FILE_TABLENAME; char sz Model Precache Tablename[255] = MODEL_PRECACHE_TABLENAME; char sz Generic Precache Tablename[255] = GENERIC_PRECACHE_TABLENAME; char sz Sound Precache Tablename[255] = SOUND_PRECACHE_TABLENAME; char sz Decal Precache Tablename[255] = DECAL_PRECACHE_TABLENAME; // This was added into staging at some point and is not enabled in main or rel.