1.1 --- a/core/AdminCache.h Wed Jan 24 21:51:49 2007 +0000
1.2 +++ b/core/AdminCache.h Wed Jan 24 23:43:31 2007 +0000
1.3 @@ -3,8 +3,12 @@
1.4
1.5 #include "sm_memtable.h"
1.6 #include <sm_trie.h>
1.7 +#include <sh_list.h>
1.8 #include <IAdminSystem.h>
1.9 #include "sm_globals.h"
1.10 +#include <IForwardSys.h>
1.11 +
1.12 +using namespace SourceHook;
1.13
1.14 #define GRP_MAGIC_SET 0xDEADFADE
1.15 #define GRP_MAGIC_UNSET 0xFACEFACE
1.16 @@ -36,27 +40,29 @@
1.17 ~AdminCache();
1.18 public: //SMGlobalClass
1.19 void OnSourceModAllInitialized();
1.20 + void OnSourceModShutdown();
1.21 public: //IAdminSystem
1.22 /** Command cache stuff */
1.23 void AddCommandOverride(const char *cmd, OverrideType type, AdminFlag flag);
1.24 bool GetCommandOverride(const char *cmd, OverrideType type, AdminFlag *pFlag);
1.25 void UnsetCommandOverride(const char *cmd, OverrideType type);
1.26 - void DumpCommandOverrideCache(OverrideType type);
1.27 /** Group cache stuff */
1.28 GroupId AddGroup(const char *group_name);
1.29 GroupId FindGroupByName(const char *group_name);
1.30 void SetGroupAddFlag(GroupId id, AdminFlag flag, bool enabled);
1.31 bool GetGroupAddFlag(GroupId id, AdminFlag flag);
1.32 - unsigned int GetGroupAddFlags(GroupId Id, AdminFlag flags[], unsigned int total);
1.33 + unsigned int GetGroupAddFlagBits(GroupId id, bool flags[], unsigned int total);
1.34 void SetGroupGenericImmunity(GroupId id, ImmunityType type, bool enabled);
1.35 bool GetGroupGenericImmunity(GroupId id, ImmunityType type);
1.36 void InvalidateGroup(GroupId id);
1.37 - void InvalidateGroupCache();
1.38 void AddGroupImmunity(GroupId id, GroupId other_id);
1.39 unsigned int GetGroupImmunityCount(GroupId id);
1.40 GroupId GetGroupImmunity(GroupId id, unsigned int number);
1.41 void AddGroupCommandOverride(GroupId id, const char *name, OverrideType type, OverrideRule rule);
1.42 bool GetGroupCommandOverride(GroupId id, const char *name, OverrideType type, OverrideRule *pRule);
1.43 + void DumpAdminCache(int cache_flags, bool rebuild);
1.44 + void AddAdminListener(IAdminListener *pListener);
1.45 + void RemoveAdminListener(IAdminListener *pListener);
1.46 private:
1.47 void _AddCommandOverride(const char *cmd, AdminFlag flag);
1.48 void _AddCommandGroupOverride(const char *group, AdminFlag flag);
1.49 @@ -64,6 +70,8 @@
1.50 bool _GetCommandGroupOverride(const char *group, AdminFlag *pFlag);
1.51 void _UnsetCommandOverride(const char *cmd);
1.52 void _UnsetCommandGroupOverride(const char *group);
1.53 + void InvalidateGroupCache();
1.54 + void DumpCommandOverrideCache(OverrideType type);
1.55 public:
1.56 BaseStringTable *m_pStrings;
1.57 BaseMemTable *m_pMemory;
1.58 @@ -73,6 +81,8 @@
1.59 int m_LastGroup;
1.60 int m_FreeGroupList;
1.61 Trie *m_pGroups;
1.62 + List<IAdminListener *> m_hooks;
1.63 + IForward *m_pCacheFwd;
1.64 };
1.65
1.66 extern AdminCache g_Admins;