mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Added Mapbase's enhanced save/restore to new response system + moved aound rr_dumphashinfo code so that it has access to default response system
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
using namespace ResponseRules;
|
||||
static void CC_RR_Debug_ResponseConcept_Exclude( const CCommand &args );
|
||||
static ConCommand rr_debug_responseconcept_exclude( "rr_debugresponseconcept_exclude", CC_RR_Debug_ResponseConcept_Exclude, "Set a list of concepts to exclude from rr_debugresponseconcept. Separate multiple concepts with spaces. Call with no arguments to see current list. Call 'rr_debug_responseconcept_exclude !' to reset.");
|
||||
static void CC_RR_DumpHashInfo( const CCommand &args );
|
||||
|
||||
namespace ResponseRules
|
||||
{
|
||||
@@ -2809,12 +2808,6 @@ static void CC_RR_Debug_ResponseConcept_Exclude( const CCommand &args )
|
||||
}
|
||||
}
|
||||
#if RR_DUMPHASHINFO_ENABLED
|
||||
static void CC_RR_DumpHashInfo( const CCommand &args )
|
||||
{
|
||||
defaultresponsesytem.m_InstancedSystems[0]->m_RulePartitions.PrintBucketInfo( defaultresponsesytem.m_InstancedSystems[0] );
|
||||
}
|
||||
static ConCommand rr_dumphashinfo( "rr_dumphashinfo", CC_RR_DumpHashInfo, "Statistics on primary hash bucketing of response rule partitions");
|
||||
|
||||
void ResponseRulePartition::PrintBucketInfo( CResponseSystem *pSys )
|
||||
{
|
||||
struct bucktuple_t
|
||||
|
||||
@@ -47,6 +47,24 @@ char const *ResponseRulePartition::GetElementName( const tIndex &i ) const
|
||||
}
|
||||
|
||||
|
||||
Rule *ResponseRulePartition::FindByName( char const *name ) const
|
||||
{
|
||||
int count;
|
||||
|
||||
for ( int bukkit = 0 ; bukkit < N_RESPONSE_PARTITIONS ; ++bukkit )
|
||||
{
|
||||
count = m_RuleParts[bukkit].Count();
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
if (V_strncmp( m_RuleParts[bukkit].GetElementName(i), name, CRR_Response::MAX_RULE_NAME ) == 0)
|
||||
return m_RuleParts[bukkit][i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int ResponseRulePartition::Count( void )
|
||||
{
|
||||
int count = 0 ;
|
||||
|
||||
@@ -436,6 +436,7 @@ namespace ResponseRules
|
||||
inline Rule &operator[]( tIndex idx );
|
||||
int Count( void ); // number of elements inside, but you can't iterate from 0 to this
|
||||
char const *GetElementName( const tIndex &i ) const;
|
||||
Rule *FindByName( char const *name ) const;
|
||||
|
||||
/// given a dictionary and an element number inside that dict,
|
||||
/// return a tIndex
|
||||
|
||||
Reference in New Issue
Block a user