本文整理汇总了C++中IRegistry类的典型用法代码示例。如果您正苦于以下问题:C++ IRegistry类的具体用法?C++ IRegistry怎么用?C++ IRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dataMgr
//-----------------------------------------------------------------------------
/// Switch to object directory (=Parent directory)
TDirectory* RootHistCnv::RConverter::changeDirectory(DataObject* pObject)
//-----------------------------------------------------------------------------
{
if ( pObject ) {
IRegistry* pReg = pObject->registry();
if ( pReg ) {
SmartIF<IDataManagerSvc> dataMgr(dataProvider());
if ( dataMgr.isValid() ) {
IRegistry* pParentReg = 0;
StatusCode status = dataMgr->objectParent(pReg, pParentReg);
if ( status.isSuccess() ) {
IOpaqueAddress* pParAddr = pParentReg->address();
if ( pParAddr ) {
TDirectory* pParentDir = (TDirectory*)pParAddr->ipar()[0];
if ( pParentDir ) {
gDirectory->cd(pParentDir->GetPath());
return pParentDir;
}
}
}
}
}
}
return 0;
}
示例2: VCRHook_Time
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;
}
示例3: top
//-----------------------------------------------------------------------------
StatusCode RootHistCnv::PersSvc::createRep(DataObject* pObject,
IOpaqueAddress*& refpAddress)
//-----------------------------------------------------------------------------
{
// There are objects in the HDS to be stored
if( m_outputEnabled && undefFileName != m_defFileName ) {
SmartDataPtr<DataObject> top(dataProvider(), stat_dir);
if ( 0 != top ) {
IRegistry* pReg = top->registry();
if ( pReg ) {
if ( top.ptr() == pObject ) {
TDirectory* pDir = m_hfile;
refpAddress = new RootObjAddress( repSvcType(),
CLID_DataObject,
stat_dir,
m_defFileName,
long(pDir),
long(0));
return StatusCode::SUCCESS;
}
else {
StatusCode sc = ConversionSvc::createRep(pObject, refpAddress);
if( sc.isFailure() ) {
MsgStream log( msgSvc(), name() );
log << MSG::ERROR
<< "Error while creating persistent Histogram:"
<< pReg->identifier()
<< endmsg;
}
return sc;
}
}
}
MsgStream err( msgSvc(), name() );
err << MSG::ERROR
<< "Internal error while creating Histogram persistent representations"
<< endmsg;
return StatusCode::FAILURE;
} else {
if (m_outputEnabled && !m_prtWar) {
m_prtWar = true;
MsgStream log( msgSvc(), name() );
log << MSG::WARNING
<< "no ROOT output file name, "
<< "Histograms cannot be persistified" << endmsg;
}
}
return StatusCode::SUCCESS;
}
示例4: ReadErrorEmulatorSection
void SNS_Parameters::ReadErrorEmulatorSection(const IRegistry & reg)
{
debug_fd_count.ReadInt(reg, "error_emulator", "fd_report");
if (!debug_fd_count.value.empty() && debug_fd_count.as_int < -1)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected value of the [error_emulator]/fd_report "
" parameter. It must be >= 0");
debug_mem_count.ReadInt(reg, "error_emulator", "mem_report");
if (!debug_mem_count.value.empty() && debug_mem_count.as_int < -1)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected value of the [error_emulator]/mem_report "
" parameter. It must be >= 0");
debug_write_delay.ReadDouble(reg, "error_emulator", "delay");
if (!debug_write_delay.value.empty() && debug_write_delay.as_double < 0.0)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected value of the [error_emulator]/delay "
" parameter. It must be >= 0");
debug_conn_drop_before_write.ReadBool(reg, "error_emulator",
"drop_before_reply");
debug_conn_drop_after_write.ReadBool(reg, "error_emulator",
"drop_after_reply");
debug_reply_with_garbage.ReadBool(reg, "error_emulator",
"reply_with_garbage");
debug_garbage = reg.GetString("error_emulator", "garbage_data",
"please define [error_emulator]/garbage_data "
"parameter value");
}
示例5: Read
void SQueueParameters::Read(const IRegistry& reg, const string& sname)
{
qclass = reg.GetString(sname, "class", kEmptyStr);
timeout = ReadTimeout(reg, sname);
notif_hifreq_interval = ReadNotifHifreqInterval(reg, sname);
notif_hifreq_period = ReadNotifHifreqPeriod(reg, sname);
notif_lofreq_mult = ReadNotifLofreqMult(reg, sname);
notif_handicap = ReadNotifHandicap(reg, sname);
dump_buffer_size = ReadDumpBufferSize(reg, sname);
run_timeout = ReadRunTimeout(reg, sname);
program_name = ReadProgram(reg, sname);
failed_retries = ReadFailedRetries(reg, sname);
blacklist_time = ReadBlacklistTime(reg, sname);
max_input_size = ReadMaxInputSize(reg, sname);
max_output_size = ReadMaxOutputSize(reg, sname);
subm_hosts = ReadSubmHosts(reg, sname);
wnode_hosts = ReadWnodeHosts(reg, sname);
wnode_timeout = ReadWnodeTimeout(reg, sname);
pending_timeout = ReadPendingTimeout(reg, sname);
max_pending_wait_timeout = ReadMaxPendingWaitTimeout(reg, sname);
description = ReadDescription(reg, sname);
run_timeout_precision = ReadRunTimeoutPrecision(reg, sname);
return;
}
示例6: Plat_FloatTime
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;
}
示例7: x_ReadCommon
void SErrorEmulatorParameter::x_ReadCommon(const IRegistry & reg,
const string & section,
const string & param_name)
{
string reg_value = reg.GetString(section, param_name, "");
reg_value = NStr::TruncateSpaces(reg_value);
if (reg_value.empty())
return;
list<string> parts;
NStr::Split(reg_value, " ", parts,
NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
size_t parts_count = parts.size();
if (parts_count != 1 && parts_count != 2)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected format of the [" + section + "]/" +
param_name + " parameter. Expected: F:Ff [Fb-Fe]");
if (parts_count == 2) {
// Need to read the range
list<string> range_parts;
NStr::Split(parts.back(), "-", range_parts,
NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
if (range_parts.size() != 2)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected range format of the [" + section + "]/" +
param_name + " parameter. Expected: Fb-Fe");
range_begin = NStr::StringToULong(range_parts.front());
range_end = NStr::StringToULong(range_parts.back());
if (range_end < range_begin)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Incorrect range specification for [" + section + "]/" +
param_name + " parameter. "
"End value must be >= begin value.");
}
// Read frequency
list<string> val_freq_parts;
NStr::Split(parts.front(), ":", val_freq_parts,
NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
if (val_freq_parts.size() != 1 && val_freq_parts.size() != 2)
NCBI_THROW(CNetScheduleException, eInvalidParameter,
"Unexpected value and frequence format of the [" +
section + "]/" + param_name + " parameter. Expected: F:Ff");
else if (val_freq_parts.size() == 1)
frequency = 1; // default
else
frequency = NStr::StringToUInt(val_freq_parts.back());
value = val_freq_parts.front();
}
示例8: RootObjAddress
//-----------------------------------------------------------------------------
StatusCode RootHistCnv::RConverter::createAddress(DataObject* pObj,
TDirectory* pDir,
TObject* pTObj,
IOpaqueAddress*& refpAddr)
//-----------------------------------------------------------------------------
{
// Get address again....it does not change
IRegistry* pReg = pObj->registry();
if ( 0 != pReg ) {
refpAddr = pReg->address();
if ( 0 == refpAddr ) {
refpAddr = new RootObjAddress(repSvcType(),
objType(),
pReg->name(),
"",
(unsigned long)(pDir),
(unsigned long)(pTObj),
pTObj);
return StatusCode::SUCCESS;
}
}
return StatusCode::FAILURE;
}
示例9: catch
unsigned int
SQueueParameters::ReadMaxOutputSize(const IRegistry & reg,
const string & sname)
{
string s = reg.GetString(sname, "max_output_size", kEmptyStr);
unsigned int val = kNetScheduleMaxDBDataSize;
try {
val = (unsigned) NStr::StringToUInt8_DataSize(s);
}
catch (CStringException&)
{}
val = min(kNetScheduleMaxOverflowSize, val);
return val;
}
示例10: log
//--------------------------------------------------------------------------------------------
// implementation of IAppMgrUI::finalize
//--------------------------------------------------------------------------------------------
StatusCode MTEventLoopMgr::finalize() {
StatusCode sc;
MsgStream log(msgSvc(), name());
log << MSG::INFO << " Number of events processed : " << m_total_nevt << endmsg;
// Finalize base class
MinimalEventLoopMgr::finalize();
// Save Histograms Now
if ( 0 != m_histoPersSvc ) {
HistogramAgent agent;
sc = m_histoDataMgrSvc->traverseTree( &agent );
if( sc.isSuccess() ) {
IDataSelector* objects = agent.selectedObjects();
// skip /stat entry!
if ( objects->size() > 0 ) {
IDataSelector::iterator i;
for ( i = objects->begin(); i != objects->end(); i++ ) {
IOpaqueAddress* pAddr = 0;
StatusCode iret = m_histoPersSvc->createRep(*i, pAddr);
if ( iret.isSuccess() ) {
(*i)->registry()->setAddress(pAddr);
}
else {
sc = iret;
}
}
for ( i = objects->begin(); i != objects->end(); i++ ) {
IRegistry* reg = (*i)->registry();
StatusCode iret = m_histoPersSvc->fillRepRefs(reg->address(), *i);
if ( !iret.isSuccess() ) {
sc = iret;
}
}
}
if ( sc.isSuccess() ) {
log << MSG::INFO << "Histograms converted successfully according to request." << endmsg;
}
else {
log << MSG::ERROR << "Error while saving Histograms." << endmsg;
}
}
else {
log << MSG::ERROR << "Error while traversing Histogram data store" << endmsg;
}
}
if ( 0 != m_evtCtxt && 0 != m_evtSelector ) {
m_evtSelector->releaseContext(m_evtCtxt);
m_evtCtxt = 0;
}
// Release all interfaces...
m_histoDataMgrSvc = releaseInterface(m_histoDataMgrSvc);
m_histoPersSvc = releaseInterface(m_histoPersSvc);
m_evtSelector = releaseInterface(m_evtSelector);
m_incidentSvc = releaseInterface(m_incidentSvc);
m_evtDataSvc = releaseInterface(m_evtDataSvc);
m_evtDataMgrSvc = releaseInterface(m_evtDataMgrSvc);
return StatusCode::SUCCESS;
}
示例11: s_ReadSpecificParams
static void
s_ReadSpecificParams(const IRegistry& reg,
const string& section,
SNCSpecificParams* params)
{
if (reg.HasEntry(section, kNCReg_DisableClient, IRegistry::fCountCleared)) {
params->disable = reg.GetBool(section, kNCReg_DisableClient, false);
}
if (reg.HasEntry(section, kNCReg_BlobTTL, IRegistry::fCountCleared)) {
params->blob_ttl = reg.GetInt(section, kNCReg_BlobTTL, 3600);
}
if (reg.HasEntry(section, kNCReg_VerTTL, IRegistry::fCountCleared)) {
params->ver_ttl = reg.GetInt(section, kNCReg_VerTTL, 3600);
}
if (reg.HasEntry(section, kNCReg_TTLUnit, IRegistry::fCountCleared)) {
params->ttl_unit = reg.GetInt(section, kNCReg_TTLUnit, 300);
}
if (reg.HasEntry(section, kNCReg_ProlongOnRead, IRegistry::fCountCleared)) {
params->prolong_on_read = reg.GetBool(section, kNCReg_ProlongOnRead, true);
}
if (reg.HasEntry(section, kNCReg_SearchOnRead, IRegistry::fCountCleared)) {
params->srch_on_read = reg.GetBool(section, kNCReg_SearchOnRead, true);
}
if (reg.HasEntry(section, kNCReg_Quorum, IRegistry::fCountCleared)) {
params->quorum = reg.GetInt(section, kNCReg_Quorum, 2);
}
if (reg.HasEntry(section, kNCReg_FastOnMain, IRegistry::fCountCleared)) {
params->fast_on_main = reg.GetBool(section, kNCReg_FastOnMain, true);
}
if (reg.HasEntry(section, kNCReg_PassPolicy, IRegistry::fCountCleared)) {
string pass_policy = reg.GetString(section, kNCReg_PassPolicy, "any");
if (pass_policy == "no_password") {
params->pass_policy = eNCOnlyWithoutPass;
}
else if (pass_policy == "with_password") {
params->pass_policy = eNCOnlyWithPass;
}
else {
if (pass_policy != "any") {
SRV_LOG(Error, "Incorrect value of '" << kNCReg_PassPolicy
<< "' parameter: '" << pass_policy
<< "', assuming 'any'");
}
params->pass_policy = eNCBlobPassAny;
}
}
}
示例12: Read
void SNS_Parameters::Read(const IRegistry& reg, const string& sname)
{
reinit = GetBoolNoErr("reinit", false);
max_connections = GetIntNoErr("max_connections", default_max_connections);
max_threads = GetIntNoErr("max_threads", default_max_threads);
init_threads = GetIntNoErr("init_threads", default_init_threads);
if (init_threads > max_threads) {
LOG_POST(Message << Warning <<
"INI file sets init_threads > max_threads. "
"Assume init_threads = max_threads(" << max_threads <<
") instead of given " << init_threads);
init_threads = max_threads;
}
port = (unsigned short) GetIntNoErr("port", default_port);
use_hostname = GetBoolNoErr("use_hostname", default_use_hostname);
network_timeout = GetIntNoErr("network_timeout", default_network_timeout);
if (network_timeout == 0) {
LOG_POST(Message << Warning <<
"INI file sets 0 sec. network timeout. Assume " <<
default_network_timeout << " seconds.");
network_timeout = default_network_timeout;
}
// Logging parameters
is_log = GetBoolNoErr("log",
default_is_log);
log_batch_each_job = GetBoolNoErr("log_batch_each_job",
default_log_batch_each_job);
log_notification_thread = GetBoolNoErr("log_notification_thread",
default_log_notification_thread);
log_cleaning_thread = GetBoolNoErr("log_cleaning_thread",
default_log_cleaning_thread);
log_execution_watcher_thread = GetBoolNoErr("log_execution_watcher_thread",
default_log_execution_watcher_thread);
log_statistics_thread = GetBoolNoErr("log_statistics_thread",
default_log_statistics_thread);
// Job deleting parameters
del_batch_size = GetIntNoErr("del_batch_size", default_del_batch_size);
markdel_batch_size = GetIntNoErr("markdel_batch_size", default_markdel_batch_size);
scan_batch_size = GetIntNoErr("scan_batch_size", default_scan_batch_size);
purge_timeout = GetDoubleNoErr("purge_timeout", default_purge_timeout);
CheckGarbageCollectorSettings();
// Affinity GC settings
affinity_high_mark_percentage = GetIntNoErr("affinity_high_mark_percentage",
default_affinity_high_mark_percentage);
affinity_low_mark_percentage = GetIntNoErr("affinity_low_mark_percentage",
default_affinity_low_mark_percentage);
affinity_high_removal = GetIntNoErr("affinity_high_removal",
default_affinity_high_removal);
affinity_low_removal = GetIntNoErr("affinity_low_removal",
default_affinity_low_removal);
affinity_dirt_percentage = GetIntNoErr("affinity_dirt_percentage",
default_affinity_dirt_percentage);
CheckAffinityGarbageCollectorSettings();
// Max affinities
max_affinities = GetIntNoErr("max_affinities", default_max_affinities);
if (max_affinities <= 0) {
LOG_POST(Message << Warning <<
"INI file sets the max number of preferred affinities <= 0."
" Assume " << default_max_affinities << " instead.");
max_affinities = default_max_affinities;
}
admin_hosts = reg.GetString(sname, "admin_host", kEmptyStr);
admin_client_names = reg.GetString(sname, "admin_client_name", kEmptyStr);
return;
}
示例13: GetIntNoErr
// A configuration file is always already validated so the reading
// must not produce any log output etc.
// See ns_util.cpp NS_ValidateConfigFile(...)
void SNS_Parameters::Read(const IRegistry & reg)
{
const string sname = "server";
max_connections = GetIntNoErr("max_connections", default_max_connections);
if (max_connections < max_connections_low_limit)
max_connections = (max_connections_low_limit +
max_connections_high_limit) / 2;
else if (max_connections > max_connections_high_limit)
max_connections = max_connections_high_limit;
max_threads = GetIntNoErr("max_threads", default_max_threads);
init_threads = GetIntNoErr("init_threads", default_init_threads);
if (init_threads > max_threads)
init_threads = max_threads;
port = (unsigned short) GetIntNoErr("port", 0);
use_hostname = GetBoolNoErr("use_hostname", default_use_hostname);
network_timeout = GetIntNoErr("network_timeout", default_network_timeout);
if (network_timeout == 0)
network_timeout = default_network_timeout;
// Logging parameters
is_log = GetBoolNoErr("log", default_is_log);
log_batch_each_job = GetBoolNoErr("log_batch_each_job",
default_log_batch_each_job);
log_notification_thread = GetBoolNoErr("log_notification_thread",
default_log_notification_thread);
log_cleaning_thread = GetBoolNoErr("log_cleaning_thread",
default_log_cleaning_thread);
log_execution_watcher_thread = GetBoolNoErr("log_execution_watcher_thread",
default_log_execution_watcher_thread);
log_statistics_thread = GetBoolNoErr("log_statistics_thread",
default_log_statistics_thread);
// Job deleting parameters
del_batch_size = GetIntNoErr("del_batch_size", default_del_batch_size);
markdel_batch_size = GetIntNoErr("markdel_batch_size",
default_markdel_batch_size);
scan_batch_size = GetIntNoErr("scan_batch_size", default_scan_batch_size);
purge_timeout = GetDoubleNoErr("purge_timeout", default_purge_timeout);
x_CheckJobGarbageCollectorSettings();
stat_interval = GetIntNoErr("stat_interval", default_stat_interval);
if (stat_interval < 1)
stat_interval = 1;
int val = GetIntNoErr("job_counters_interval",
default_job_counters_interval);
if (val < 0)
job_counters_interval = 0;
else
job_counters_interval = val;
affinity_reg.Read(reg, sname, "affinity",
default_max_affinities,
default_affinity_high_mark_percentage,
default_affinity_low_mark_percentage,
default_affinity_high_removal,
default_affinity_low_removal,
default_affinity_dirt_percentage);
group_reg.Read(reg, sname, "group",
default_max_groups,
default_group_high_mark_percentage,
default_group_low_mark_percentage,
default_group_high_removal,
default_group_low_removal,
default_group_dirt_percentage);
scope_reg.Read(reg, sname, "scope",
default_max_scopes,
default_scope_high_mark_percentage,
default_scope_low_mark_percentage,
default_scope_high_removal,
default_scope_low_removal,
default_scope_dirt_percentage);
reserve_dump_space = NS_GetDataSize(reg, "server", "reserve_dump_space",
default_reserve_dump_space);
wst_cache_size = GetIntNoErr("wst_cache_size",
default_wst_cache_size);
if (wst_cache_size < 0)
wst_cache_size = default_wst_cache_size;
max_client_data = GetIntNoErr("max_client_data", default_max_client_data);
if (max_client_data <= 0)
max_client_data = default_max_client_data;
admin_hosts = reg.GetString(sname, "admin_host", kEmptyStr);
try {
admin_client_names = reg.GetEncryptedString(sname, "admin_client_name",
IRegistry::fPlaintextAllowed);
} catch (...) {
// All the warnings are collected at the time of validating the
// configuration file, so here a problem is simply suppressed
//.........这里部分代码省略.........
示例14:
string
SQueueParameters::ReadDescription(const IRegistry & reg,
const string & sname)
{
return reg.GetString(sname, "description", kEmptyStr);
}
示例15: CommandLine
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;
}