parent
1a71f4fbde
commit
8a5d0a58e4
@ -41,7 +41,7 @@ ConVarManager g_ConVarManager;
|
|||||||
|
|
||||||
const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String};
|
const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String};
|
||||||
typedef List<const ConVar *> ConVarList;
|
typedef List<const ConVar *> ConVarList;
|
||||||
NameHashSet<ConVarInfo *> convar_cache;
|
NameHashSet<ConVarInfo *, ConVarInfo::ConVarPolicy> convar_cache;
|
||||||
|
|
||||||
class ConVarReentrancyGuard
|
class ConVarReentrancyGuard
|
||||||
{
|
{
|
||||||
|
@ -64,15 +64,27 @@ struct ConVarInfo
|
|||||||
ConVar *pVar; /**< The actual convar */
|
ConVar *pVar; /**< The actual convar */
|
||||||
List<IConVarChangeListener *> changeListeners;
|
List<IConVarChangeListener *> changeListeners;
|
||||||
|
|
||||||
static inline bool matches(const char *name, const ConVarInfo *info)
|
struct ConVarPolicy
|
||||||
{
|
{
|
||||||
return strcmp(name, info->pVar->GetName()) == 0;
|
static inline bool matches(const char *name, ConVarInfo *info)
|
||||||
|
{
|
||||||
|
const char *conVarChars = info->pVar->GetName();
|
||||||
|
|
||||||
|
ke::AString convarName = ke::AString(conVarChars).lowercase();
|
||||||
|
ke::AString input = ke::AString(name).lowercase();
|
||||||
|
|
||||||
|
return convarName == input;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t hash(const detail::CharsAndLength &key)
|
static inline uint32_t hash(const detail::CharsAndLength &key)
|
||||||
{
|
{
|
||||||
return key.hash();
|
ke::AString original(key.chars());
|
||||||
|
ke::AString lower = original.lowercase();
|
||||||
|
|
||||||
|
return detail::CharsAndLength(lower.chars()).hash();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds information about a client convar query
|
* Holds information about a client convar query
|
||||||
|
Loading…
Reference in New Issue
Block a user