//============================================================================ // NCommandLine::GetFlagFloat64 : Get a float64_t flag value. //---------------------------------------------------------------------------- float64_t NCommandLine::GetFlagFloat64(const NString &theArgument) const { float64_t theResult; NString theFlag; // Get the value theFlag = GetFlagString(theArgument); theResult = NNumber(theFlag).GetFloat64(); return(theResult); }
//============================================================================ // NCommandLine::GetFlagFile : Get a file flag value. //---------------------------------------------------------------------------- NFile NCommandLine::GetFlagFile(const NString &theArgument) const { NFile theResult; NString theValue; // Get the value // // Relative paths are relative to the current working directory. theValue = GetFlagString(theArgument); if (!theValue.IsEmpty()) { if (!theValue.StartsWith("/")) theValue = NFileUtilities::GetCWD().GetPath() + "/" + theValue; theResult = NFile(theValue); } return(theResult); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CGameServer::DumpPrecacheStats( INetworkStringTable *table ) { if ( table == NULL ) { ConMsg( "Can only dump stats when active in a level\n" ); return; } CPrecacheItem *items = NULL; if ( table == m_pModelPrecacheTable ) { items = model_precache; } else if ( table == m_pGenericPrecacheTable ) { items = generic_precache; } else if ( table == m_pSoundPrecacheTable ) { items = sound_precache; } else if ( table == m_pDecalPrecacheTable ) { items = decal_precache; } if ( !items ) return; int count = table->GetNumStrings(); int maxcount = table->GetMaxStrings(); ConMsg( "\n" ); ConMsg( "Precache table %s: %i of %i slots used\n", table->GetTableName(), count, maxcount ); for ( int i = 0; i < count; i++ ) { char const *name = table->GetString( i ); CPrecacheItem *slot = &items[ i ]; int testLength; const CPrecacheUserData *p = ( const CPrecacheUserData * )table->GetStringUserData( i, &testLength ); ErrorIfNot( testLength == sizeof( *p ), ("CGameServer::DumpPrecacheStats: invalid CPrecacheUserData length (%d)", testLength) ); if ( !name || !slot || !p ) continue; ConMsg( "%03i: %s (%s): ", i, name, GetFlagString( p->flags ) ); if ( slot->GetReferenceCount() == 0 ) { ConMsg( " never used\n" ); } else { ConMsg( " %i refs, first %.2f mru %.2f\n", slot->GetReferenceCount(), slot->GetFirstReference(), slot->GetMostRecentReference() ); } } ConMsg( "\n" ); }