32 #ifndef _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
33 #define _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
40 #include "smsdk_config.h"
43 #include <sp_vm_api.h>
46 #if defined SMEXT_ENABLE_FORWARDSYS
48 #endif //SMEXT_ENABLE_FORWARDSYS
49 #if defined SMEXT_ENABLE_PLAYERHELPERS
51 #endif //SMEXT_ENABLE_PlAYERHELPERS
52 #if defined SMEXT_ENABLE_DBMANAGER
54 #endif //SMEXT_ENABLE_DBMANAGER
55 #if defined SMEXT_ENABLE_GAMECONF
58 #if defined SMEXT_ENABLE_MEMUTILS
61 #if defined SMEXT_ENABLE_GAMEHELPERS
64 #if defined SMEXT_ENABLE_TIMERSYS
67 #if defined SMEXT_ENABLE_ADTFACTORY
70 #if defined SMEXT_ENABLE_THREADER
73 #if defined SMEXT_ENABLE_LIBSYS
76 #if defined SMEXT_ENABLE_PLUGINSYS
79 #if defined SMEXT_ENABLE_MENUS
82 #if defined SMEXT_ENABLE_ADMINSYS
85 #if defined SMEXT_ENABLE_TEXTPARSERS
88 #if defined SMEXT_ENABLE_USERMSGS
91 #if defined SMEXT_ENABLE_TRANSLATOR
94 #if defined SMEXT_ENABLE_NINVOKE
97 #if defined SMEXT_ENABLE_ROOTCONSOLEMENU
101 #if defined SMEXT_CONF_METAMOD
102 #include <ISmmPlugin.h>
106 #if !defined METAMOD_PLAPI_VERSION
107 #include <metamod_wrappers.h>
114 #if defined SMEXT_CONF_METAMOD
131 virtual bool SDK_OnLoad(
char *error,
size_t maxlength,
bool late);
136 virtual void SDK_OnUnload();
141 virtual void SDK_OnAllLoaded();
146 virtual void SDK_OnPauseChange(
bool paused);
152 virtual void SDK_OnDependenciesDropped();
154 #if defined SMEXT_CONF_METAMOD
163 virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm,
char *error,
size_t maxlength,
bool late);
173 virtual bool SDK_OnMetamodUnload(
char *error,
size_t maxlength);
184 virtual bool SDK_OnMetamodPauseChange(
bool paused,
char *error,
size_t maxlength);
188 virtual bool OnExtensionLoad(
IExtension *me,
IShareSys *sys,
char *error,
size_t maxlength,
bool late);
189 virtual void OnExtensionUnload();
190 virtual void OnExtensionsAllLoaded();
193 virtual bool IsMetamodExtension();
200 virtual void OnExtensionPauseChange(
bool state);
203 virtual const char *GetExtensionName();
205 virtual const char *GetExtensionURL();
207 virtual const char *GetExtensionTag();
209 virtual const char *GetExtensionAuthor();
211 virtual const char *GetExtensionVerString();
213 virtual const char *GetExtensionDescription();
215 virtual const char *GetExtensionDateString();
218 virtual void OnDependenciesDropped();
219 #if defined SMEXT_CONF_METAMOD
222 virtual bool Load(PluginId
id, ISmmAPI *ismm,
char *error,
size_t maxlength,
bool late);
224 virtual const char *GetAuthor();
226 virtual const char *GetName();
228 virtual const char *GetDescription();
230 virtual const char *GetURL();
232 virtual const char *GetLicense();
234 virtual const char *GetVersion();
236 virtual const char *GetDate();
238 virtual const char *GetLogTag();
240 virtual bool Unload(
char *error,
size_t maxlength);
242 virtual bool Pause(
char *error,
size_t maxlength);
244 virtual bool Unpause(
char *error,
size_t maxlength);
246 bool m_SourceMMLoaded;
247 bool m_WeAreUnloaded;
248 bool m_WeGotPauseChange;
261 #if defined SMEXT_ENABLE_FORWARDSYS
264 #endif //SMEXT_ENABLE_FORWARDSYS
265 #if defined SMEXT_ENABLE_HANDLESYS
268 #endif //SMEXT_ENABLE_HANDLESYS
269 #if defined SMEXT_ENABLE_PLAYERHELPERS
271 #endif //SMEXT_ENABLE_PLAYERHELPERS
272 #if defined SMEXT_ENABLE_DBMANAGER
274 #endif //SMEXT_ENABLE_DBMANAGER
275 #if defined SMEXT_ENABLE_GAMECONF
277 #endif //SMEXT_ENABLE_DBMANAGER
278 #if defined SMEXT_ENABLE_MEMUTILS
281 #if defined SMEXT_ENABLE_GAMEHELPERS
284 #if defined SMEXT_ENABLE_TIMERSYS
287 #if defined SMEXT_ENABLE_ADTFACTORY
290 #if defined SMEXT_ENABLE_THREADER
293 #if defined SMEXT_ENABLE_LIBSYS
296 #if defined SMEXT_ENABLE_PLUGINSYS
299 #if defined SMEXT_ENABLE_MENUS
302 #if defined SMEXT_ENABLE_ADMINSYS
305 #if defined SMEXT_ENABLE_USERMSGS
308 #if defined SMEXT_ENABLE_TRANSLATOR
311 #if defined SMEXT_ENABLE_NINVOKE
314 #if defined SMEXT_ENABLE_ROOTCONSOLEMENU
318 #if defined SMEXT_CONF_METAMOD
320 extern IVEngineServer *
engine;
321 extern IServerGameDLL *
gamedll;
325 #define SM_MKIFACE(name) SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION
327 #define SM_GET_IFACE(prefix, addr) \
328 if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
330 if (error != NULL && maxlength) \
332 size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
333 if (len >= maxlength) \
335 error[maxlength - 1] = '\0'; \
341 #define SM_GET_LATE_IFACE(prefix, addr) \
342 g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)
344 #define SM_CHECK_IFACE(prefix, addr) \
347 if (error != NULL && maxlength) \
349 size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
350 if (len >= maxlength) \
352 error[maxlength - 1] = '\0'; \
358 #endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
Provides Source helper functions.
IShareSys * g_pShareSys
Definition: smsdk_ext.cpp:42
Defines the interface for managing collections ("forwards") of plugin calls.
The interface an extension must expose.
Definition: IExtensionSys.h:145
IVEngineServer * engine
Definition: smsdk_ext.cpp:310
Defines the interface for creating, reading, and removing Handles.
Contains functions for advanced usermessage hooking.
Manages the root console menu - the "sm" command for servers.
Definition: IRootConsoleMenu.h:97
Interface for invoking natives.
Factory for dealing with native invocations.
Definition: INativeInvoker.h:84
IShareSys * sharesys
Definition: smsdk_ext.cpp:43
Defines basic helper functions for Half-Life 2 clients.
Provides functions for managing Handles.
Definition: IHandleSys.h:222
Tracks dependencies and fires dependency listeners.
Definition: IShareSys.h:126
Defines the interface for the Plugin System, which manages loaded plugins.
Abstracts game private data configuration.
Definition: IPlayerHelpers.h:489
Interface for finding patterns in memory.
Definition: IMemoryUtils.h:45
Provides functions for manipulating the admin options cache.
Definition: IAdminSystem.h:220
Contains functions for hooking user messages.
Definition: IUserMessages.h:178
Contains miscellaneous helper functions.
Definition: ISourceMod.h:83
Definition: ITimerSystem.h:111
ISourceMod * g_pSM
Definition: smsdk_ext.cpp:44
Definition: smsdk_ext.h:113
ISourceMod * smutils
Definition: smsdk_ext.cpp:45
Provides functions for translation.
Definition: ITranslator.h:229
Manages the runtime loading and unloading of plugins.
Definition: IPluginSys.h:299
Describes a threading system.
Definition: IThreader.h:414
Definition: IADTFactory.h:101
IServerGameDLL * gamedll
Definition: smsdk_ext.cpp:311
Contains various operating system specific code.
Definition: ILibrarySys.h:123
Manages game config files.
Definition: IGameConfigs.h:106
Defines interfaces for interacting with relational databases.
Provides functions for creating/destroying managed and unmanaged forwards.
Definition: IForwardSys.h:247
Describes the DBI manager.
Definition: IDBDriver.h:797
Defines various text/file parsing functions, as well as UTF-8 support code.
Defines the interface for loading/unloading/managing extensions.
Contains functions for creating and managing timers.
Definition: IAdminSystem.h:63
Defines the interface to manage the Admin Users/Groups and Override caches.
Creates abstract data types.
Encapsulates an IExtensionInterface and its dependencies.
Definition: IExtensionSys.h:53
Defines interfaces related to translation files.
Defines miscellaneous helper functions useful to extensions.
Contains platform independent routines for threading. These tools should be considered deprecated...
Definition: IGameHelpers.h:76
Defines platform-dependent operations, such as opening libraries and files.
IExtension * myself
Definition: smsdk_ext.cpp:41