本文整理汇总了C++中IRegistry::ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C++ IRegistry::ReadInt方法的具体用法?C++ IRegistry::ReadInt怎么用?C++ IRegistry::ReadInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRegistry
的用法示例。
在下文中一共展示了IRegistry::ReadInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
bool CBaseGameStats_Driver::Init()
{
const char *pGameDir = CommandLine()->ParmValue( "-game", "hl2" );
//standardizing is a good thing
char szLoweredGameDir[256];
Q_strncpy( szLoweredGameDir, pGameDir, sizeof( szLoweredGameDir ) );
Q_strlower( szLoweredGameDir );
gamestats = gamestats->OnInit( gamestats, szLoweredGameDir );
//determine constant strings needed for saving and uploading
Q_strncpy( s_szSaveFileName, szLoweredGameDir, sizeof( s_szSaveFileName ) );
Q_strncat( s_szSaveFileName, "_gamestats.dat", sizeof( s_szSaveFileName ) );
Q_strncpy( s_szStatUploadRegistryKeyName, "GameStatsUpload_", sizeof( s_szStatUploadRegistryKeyName ) );
Q_strncat( s_szStatUploadRegistryKeyName, szLoweredGameDir, sizeof( s_szStatUploadRegistryKeyName ) );
gamestats->m_bLoggingToFile = CommandLine()->FindParm( "-gamestatsloggingtofile" ) ? true : false;
gamestats->m_bLogging = CommandLine()->FindParm( "-gamestatslogging" ) ? true : false;
if ( gamestatsuploader )
{
m_bEnabled = gamestatsuploader->IsGameStatsLoggingEnabled();
if ( m_bEnabled )
{
gamestatsuploader->GetPseudoUniqueId( s_szPseudoUniqueID, sizeof( s_szPseudoUniqueID ) );
}
}
ResetData();
#ifdef GAME_DLL
if ( StatsTrackingIsFullyEnabled() )
{
// FIXME: Load m_tLastUpload from registry and save it back out, too
#ifndef SWDS
IRegistry *reg = InstanceRegistry( "Steam" );
Assert( reg );
m_tLastUpload = reg->ReadInt( gamestats->GetStatUploadRegistryKeyName(), 0 );
ReleaseInstancedRegistry( reg );
#endif
//load existing stats
gamestats->LoadFromFile();
}
#endif // GAME_DLL
if ( s_szPseudoUniqueID[ 0 ] != 0 )
{
gamestats->Event_Init();
#ifdef GAME_DLL
if ( gamestats->UseOldFormat() )
{
if( gamestats->AutoSave_OnInit() )
gamestats->SaveToFileNOW();
if( gamestats->AutoUpload_OnInit() )
gamestats->UploadStatsFileNOW();
}
#endif
}
else
{
m_bEnabled = false; //unable to generate a pseudo-unique ID, disable tracking
}
return true;
}