本文整理汇总了C++中IRegistry::WriteInt方法的典型用法代码示例。如果您正苦于以下问题:C++ IRegistry::WriteInt方法的具体用法?C++ IRegistry::WriteInt怎么用?C++ IRegistry::WriteInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRegistry
的用法示例。
在下文中一共展示了IRegistry::WriteInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UploadStatsFileNOW
bool CBaseGameStats::UploadStatsFileNOW( void )
{
if( !StatsTrackingIsFullyEnabled() )
return false;
if ( !filesystem->FileExists( gamestats->GetStatSaveFileName(), GAMESTATS_PATHID ) )
{
return false;
}
time_t curtime;
VCRHook_Time( reinterpret_cast<long*>(&curtime) );
// For now always send updates after every time they run the engine!!
#if 0
#if !defined( _DEBUG )
int elapsed = curtime - m_tLastUpload;
if ( elapsed < ONE_DAY_IN_SECONDS )
return;
#endif
#endif
CBGSDriver.m_tLastUpload = curtime;
// Update the registry
#ifndef SWDS
IRegistry *reg = InstanceRegistry( "Steam" );
Assert( reg );
reg->WriteInt( GetStatUploadRegistryKeyName(), CBGSDriver.m_tLastUpload );
ReleaseInstancedRegistry( reg );
#endif
CUtlBuffer buf;
filesystem->ReadFile( GetStatSaveFileName(), GAMESTATS_PATHID, buf );
unsigned int uBlobSize = buf.TellPut();
if ( uBlobSize == 0 )
{
return false;
}
const void *pvBlobData = ( const void * )buf.Base();
if( gamestatsuploader )
{
return gamestatsuploader->UploadGameStats( "",
1,
uBlobSize,
pvBlobData );
}
return false;
}
示例2: UploadStatsFileNOW
bool CBaseGameStats::UploadStatsFileNOW( void )
{
if( !StatsTrackingIsFullyEnabled() || !HaveValidData() || !gamestats->UseOldFormat() )
return false;
if ( !filesystem->FileExists( gamestats->GetStatSaveFileName(), GAMESTATS_PATHID ) )
{
return false;
}
int curtime = Plat_FloatTime();
CBGSDriver.m_tLastUpload = curtime;
// Update the registry
#ifndef SWDS
IRegistry *reg = InstanceRegistry( "Steam" );
Assert( reg );
reg->WriteInt( GetStatUploadRegistryKeyName(), CBGSDriver.m_tLastUpload );
ReleaseInstancedRegistry( reg );
#endif
CUtlBuffer buf;
filesystem->ReadFile( GetStatSaveFileName(), GAMESTATS_PATHID, buf );
unsigned int uBlobSize = buf.TellPut();
if ( uBlobSize == 0 )
{
return false;
}
const void *pvBlobData = ( const void * )buf.Base();
if( gamestatsuploader )
{
return gamestatsuploader->UploadGameStats( "",
1,
uBlobSize,
pvBlobData );
}
return false;
}