mmsplugin.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * vim: set ts=4 sw=4 tw=99 noet :
  3. * ======================================================
  4. * Metamod:Source Stub Plugin
  5. * Written by AlliedModders LLC.
  6. * ======================================================
  7. *
  8. * This software is provided 'as-is', without any express or implied warranty.
  9. * In no event will the authors be held liable for any damages arising from
  10. * the use of this software.
  11. *
  12. * This stub plugin is public domain.
  13. */
  14. #ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
  15. #define _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
  16. #include <ISmmPlugin.h>
  17. #include <smsdk_config.h>
  18. #if defined WIN32 && !defined snprintf
  19. #define snprintf _snprintf
  20. #endif
  21. using SourceMod::IExtension;
  22. using SourceMod::IShareSys;
  23. using SourceMod::IExtensionManager;
  24. class DynSchema : public ISmmPlugin, public SourceMod::IExtensionInterface, public IMetamodListener
  25. {
  26. public:
  27. bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
  28. bool Unload(char *error, size_t maxlen);
  29. bool Pause(char *error, size_t maxlen);
  30. bool Unpause(char *error, size_t maxlen);
  31. void AllPluginsLoaded();
  32. bool Hook_LevelInitPost(const char *pMapName, char const *pMapEntities, char const *pOldLevel,
  33. char const *pLandmarkName, bool loadGame, bool background);
  34. void *OnMetamodQuery(const char* iface, int *ret);
  35. public:
  36. const char *GetAuthor();
  37. const char *GetName();
  38. const char *GetDescription();
  39. const char *GetURL();
  40. const char *GetLicense();
  41. const char *GetVersion();
  42. const char *GetDate();
  43. const char *GetLogTag();
  44. public:
  45. virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char* error, size_t maxlength, bool late);
  46. virtual void OnExtensionUnload();
  47. virtual void OnExtensionsAllLoaded();
  48. virtual void OnExtensionPauseChange(bool pause);
  49. virtual bool QueryRunning(char *error, size_t maxlength);
  50. virtual bool IsMetamodExtension();
  51. virtual const char *GetExtensionName();
  52. virtual const char *GetExtensionURL();
  53. virtual const char *GetExtensionTag();
  54. virtual const char *GetExtensionAuthor();
  55. virtual const char *GetExtensionVerString();
  56. virtual const char *GetExtensionDescription();
  57. virtual const char *GetExtensionDateString();
  58. };
  59. extern DynSchema g_Plugin;
  60. extern SourceMod::IExtensionManager *smexts;
  61. extern SourceMod::IShareSys *sharesys;
  62. extern SourceMod::IExtension *myself;
  63. PLUGIN_GLOBALVARS();
  64. #endif //_INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_