SourceMod SDK  1.7
IGameConfigs.h
Go to the documentation of this file.
1 
32 #ifndef _INCLUDE_SOURCEMOD_GAMECONFIG_SYSTEM_H_
33 #define _INCLUDE_SOURCEMOD_GAMECONFIG_SYSTEM_H_
34 
35 #include <IShareSys.h>
36 #include <IHandleSys.h>
37 #include <ITextParsers.h>
38 
44 #define SMINTERFACE_GAMECONFIG_NAME "IGameConfigManager"
45 #define SMINTERFACE_GAMECONFIG_VERSION 6
46 
47 class SendProp;
48 
49 namespace SourceMod
50 {
55  {
56  public:
64  virtual bool GetOffset(const char *key, int *value) =0;
65 
72  virtual SendProp *GetSendProp(const char *key) =0;
73 
80  virtual const char *GetKeyValue(const char *key) =0;
81 
91  virtual bool GetMemSig(const char *key, void **addr) =0;
92 
100  virtual bool GetAddress(const char *key, void **addr) =0;
101  };
102 
107  {
108  public:
109  const char *GetInterfaceName()
110  {
111  return SMINTERFACE_GAMECONFIG_NAME;
112  }
113  unsigned int GetInterfaceVersion()
114  {
115  return SMINTERFACE_GAMECONFIG_VERSION;
116  }
117  public:
130  virtual bool LoadGameConfigFile(const char *file,
131  IGameConfig **pConfig,
132  char *error,
133  size_t maxlength) =0;
134 
142  virtual void CloseGameConfigFile(IGameConfig *cfg) =0;
143 
152  virtual IGameConfig *ReadHandle(Handle_t hndl,
153  IdentityToken_t *ident,
154  HandleError *err) =0;
155 
163  virtual void AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener) =0;
164 
172  virtual void RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener) =0;
173 
177  virtual void AcquireLock() = 0;
178 
182  virtual void ReleaseLock() = 0;
183  };
184 }
185 
186 #endif //_INCLUDE_SOURCEMOD_GAMECONFIG_SYSTEM_H_
Describes the events available for reading an SMC stream.
Definition: ITextParsers.h:236
virtual void ReleaseLock()=0
Does nothing.
Defines the interface for creating, reading, and removing Handles.
virtual IGameConfig * ReadHandle(Handle_t hndl, IdentityToken_t *ident, HandleError *err)=0
Reads an GameConfig Handle.
virtual void RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener)=0
Removes a custom gamedata section hook.
Describes a game private data config file.
Definition: IGameConfigs.h:54
virtual bool GetOffset(const char *key, int *value)=0
Returns an offset value.
const char * GetInterfaceName()
Must return a string defining the interface's unique name.
Definition: IGameConfigs.h:109
Defines the Share System, responsible for shared resources and dependencies.
virtual SendProp * GetSendProp(const char *key)=0
Returns information about a dynamic offset.
virtual const char * GetKeyValue(const char *key)=0
Returns the value of a key from the "Keys" section.
virtual bool GetMemSig(const char *key, void **addr)=0
Retrieves a cached memory signature.
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
unsigned int GetInterfaceVersion()
Must return an integer defining the interface's version.
Definition: IGameConfigs.h:113
Manages game config files.
Definition: IGameConfigs.h:106
Defines various text/file parsing functions, as well as UTF-8 support code.
virtual bool GetAddress(const char *key, void **addr)=0
Retrieves the value of an address from the "Address" section.
Definition: IAdminSystem.h:63
virtual void CloseGameConfigFile(IGameConfig *cfg)=0
Closes an IGameConfig pointer. Since a file can be loaded more than once, the file will not actually ...
virtual void AcquireLock()=0
Does nothing.
virtual bool LoadGameConfigFile(const char *file, IGameConfig **pConfig, char *error, size_t maxlength)=0
Loads or finds an already loaded game config file.
virtual void AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener)=0
Adds a custom gamedata section hook.