diff --git a/extensions/bintools/msvc8/bintools.vcproj b/extensions/bintools/msvc8/bintools.vcproj index 2b2f73ab..fea8072f 100644 --- a/extensions/bintools/msvc8/bintools.vcproj +++ b/extensions/bintools/msvc8/bintools.vcproj @@ -200,6 +200,10 @@ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{C06F7BFF-18EE-4994-8572-D6383011354B}" > + + #include #include +#if defined SMEXT_ENABLE_FORWARDSYS #include +#endif //SMEXT_ENABLE_FORWARDSYS +#if defined SMEXT_ENABLE_PLAYERHELPERS +#include +#endif //SMEXT_ENABLE_PlAYERHELPERS +#if defined SMEXT_ENABLE_DBMANAGER +#include +#endif //SMEXT_ENABLE_DBMANAGER +#if defined SMEXT_ENABLE_GAMECONF +#include +#endif #if defined SMEXT_CONF_METAMOD #include @@ -108,7 +119,7 @@ public: virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength); #endif -public: // IExtensionInterface +public: //IExtensionInterface virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late); virtual void OnExtensionUnload(); virtual void OnExtensionsAllLoaded(); @@ -138,9 +149,9 @@ public: // IExtensionInterface /** Returns date string */ virtual const char *GetExtensionDateString(); #if defined SMEXT_CONF_METAMOD -public: // ISmmPlugin +public: //ISmmPlugin /** Called when the extension is attached to Metamod. */ - virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late); + virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late); /** Returns the author to MM */ virtual const char *GetAuthor(); /** Returns the name to MM */ @@ -158,11 +169,11 @@ public: // ISmmPlugin /** Returns the logtag to MM */ virtual const char *GetLogTag(); /** Called on unload */ - virtual bool Unload(char *error, size_t maxlen); + virtual bool Unload(char *error, size_t maxlength); /** Called on pause */ - virtual bool Pause(char *error, size_t maxlen); + virtual bool Pause(char *error, size_t maxlength); /** Called on unpause */ - virtual bool Unpause(char *error, size_t maxlen); + virtual bool Unpause(char *error, size_t maxlength); private: bool m_SourceMMLoaded; bool m_WeAreUnloaded; @@ -171,12 +182,31 @@ private: }; extern SDKExtension *g_pExtensionIface; +extern IExtension *myself; extern IShareSys *g_pShareSys; -extern IExtension *myself; -extern IHandleSys *g_pHandleSys; +extern IShareSys *sharesys; /* Note: Newer name */ extern ISourceMod *g_pSM; +extern ISourceMod *smutils; /* Note: Newer name */ + +/* Optional interfaces are below */ +#if defined SMEXT_ENABLE_FORWARDSYS extern IForwardManager *g_pForwards; +extern IForwardManager *forwards; /* Note: Newer name */ +#endif //SMEXT_ENABLE_FORWARDSYS +#if defined SMEXT_ENABLE_HANDLESYS +extern IHandleSys *g_pHandleSys; +extern IHandleSys *handlesys; /* Note: Newer name */ +#endif //SMEXT_ENABLE_HANDLESYS +#if defined SMEXT_ENABLE_PLAYERHELPERS +extern IPlayerManager *playerhelpers; +#endif //SMEXT_ENABLE_PLAYERHELPERS +#if defined SMEXT_ENABLE_DBMANAGER +extern IDBManager *dbi; +#endif //SMEXT_ENABLE_DBMANAGER +#if defined SMEXT_ENABLE_GAMECONF +extern IGameConfigManager *gameconfs; +#endif //SMEXT_ENABLE_DBMANAGER #if defined SMEXT_CONF_METAMOD PLUGIN_GLOBALVARS(); @@ -192,7 +222,7 @@ extern IServerGameDLL *gamedll; { \ if (error) \ { \ - snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \ + snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \ return false; \ } \ } diff --git a/extensions/bintools/svn_version.h b/extensions/bintools/svn_version.h new file mode 100644 index 00000000..fec0fe3a --- /dev/null +++ b/extensions/bintools/svn_version.h @@ -0,0 +1,12 @@ +/** + * Autogenerated by build scripts + */ + +#ifndef _INCLUDE_BINTOOLS_VERSION_H_ +#define _INCLUDE_BINTOOLS_VERSION_H_ + + +#define SVN_FULL_VERSION "1.0.0.431" +#define SVN_FILE_VERSION 1,0,0,431 + +#endif //_INCLUDE_BINTOOLS_VERSION_H_ diff --git a/extensions/bintools/svn_version.tpl b/extensions/bintools/svn_version.tpl new file mode 100644 index 00000000..c33bbc77 --- /dev/null +++ b/extensions/bintools/svn_version.tpl @@ -0,0 +1,12 @@ +/** + * Autogenerated by build scripts + */ + +#ifndef _INCLUDE_BINTOOLS_VERSION_H_ +#define _INCLUDE_BINTOOLS_VERSION_H_ + + +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$" +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$ + +#endif //_INCLUDE_BINTOOLS_VERSION_H_ diff --git a/extensions/bintools/version.rc b/extensions/bintools/version.rc new file mode 100644 index 00000000..8a357fe5 --- /dev/null +++ b/extensions/bintools/version.rc @@ -0,0 +1,104 @@ +// Microsoft Visual C++ generated resource script. +// +//#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +#include "svn_version.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION SVN_FILE_VERSION + PRODUCTVERSION SVN_FILE_VERSION + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "Comments", "BinTools Extension" + VALUE "FileDescription", "SourceMod BinTools Extension" + VALUE "FileVersion", SVN_FULL_VERSION + VALUE "InternalName", "SourceMod BinTools Extension" + VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC" + VALUE "OriginalFilename", "bintools.ext.dll" + VALUE "ProductName", "SourceMod BinTools Extension" + VALUE "ProductVersion", SVN_FULL_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/extensions/geoip/sdk/smsdk_config.h b/extensions/geoip/sdk/smsdk_config.h index 09025e28..1941ea0d 100644 --- a/extensions/geoip/sdk/smsdk_config.h +++ b/extensions/geoip/sdk/smsdk_config.h @@ -27,7 +27,7 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "GeoIP" -#define SMEXT_CONF_DESCRIPTION "NO IDEA WHAT THIS MODULE DOES" //:TODO: +#define SMEXT_CONF_DESCRIPTION "Geographical IP information" #define SMEXT_CONF_VERSION SVN_FULL_VERSION #define SMEXT_CONF_AUTHOR "AlliedModders" #define SMEXT_CONF_URL "http://www.sourcemod.net/" @@ -46,4 +46,11 @@ */ //#define SMEXT_CONF_METAMOD +/** Enable interfaces you want to use here by uncommenting lines */ +//#define SMEXT_ENABLE_FORWARDSYS +//#define SMEXT_ENABLE_HANDLESYS +//#define SMEXT_ENABLE_PLAYERHELPERS +//#define SMEXT_ENABLE_DBMANAGER +//#define SMEXT_ENABLE_GAMECONF + #endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ diff --git a/extensions/geoip/sdk/smsdk_ext.cpp b/extensions/geoip/sdk/smsdk_ext.cpp index 02eb27ee..7b4ed0f3 100644 --- a/extensions/geoip/sdk/smsdk_ext.cpp +++ b/extensions/geoip/sdk/smsdk_ext.cpp @@ -25,11 +25,29 @@ * @brief Contains wrappers for making Extensions easier to write. */ -IShareSys *g_pShareSys = NULL; /**< Share system */ IExtension *myself = NULL; /**< Ourself */ -IHandleSys *g_pHandleSys = NULL; /**< Handle system */ +IShareSys *g_pShareSys = NULL; /**< Share system */ +IShareSys *sharesys = NULL; /**< Share system */ ISourceMod *g_pSM = NULL; /**< SourceMod helpers */ +ISourceMod *smutils = NULL; /**< SourceMod helpers */ + +#if defined SMEXT_ENABLE_FORWARDSYS IForwardManager *g_pForwards = NULL; /**< Forward system */ +IForwardManager *forwards = NULL; /**< Forward system */ +#endif +#if defined SMEXT_ENABLE_HANDLESYS +IHandleSys *g_pHandleSys = NULL; /**< Handle system */ +IHandleSys *handlesys = NULL; /**< Handle system */ +#endif +#if defined SMEXT_ENABLE_PLAYERHELPERS +IPlayerManager *playerhelpers = NULL; /**< Player helpers */ +#endif //SMEXT_ENABLE_PLAYERHELPERS +#if defined SMEXT_ENABLE_DBMANAGER +IDBManager *dbi = NULL; /**< DB Manager */ +#endif //SMEXT_ENABLE_DBMANAGER +#if defined SMEXT_ENABLE_GAMECONF +IGameConfigManager *gameconfs = NULL; /**< Game config manager */ +#endif //SMEXT_ENABLE_DBMANAGER /** Exports the main interface */ PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI() @@ -48,7 +66,7 @@ SDKExtension::SDKExtension() bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late) { - g_pShareSys = sys; + g_pShareSys = sharesys = sys; myself = me; #if defined SMEXT_CONF_METAMOD @@ -63,10 +81,25 @@ bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, return false; } #endif - - SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys); SM_GET_IFACE(SOURCEMOD, g_pSM); + smutils = g_pSM; +#if defined SMEXT_ENABLE_HANDLESYS + SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys); + handlesys = g_pHandleSys; +#endif +#if defined SMEXT_ENABLE_FORWARDSYS SM_GET_IFACE(FORWARDMANAGER, g_pForwards); + forwards = g_pForwards; +#endif +#if defined SMEXT_ENABLE_PLAYERHELPERS + SM_GET_IFACE(PLAYERMANAGER, playerhelpers); +#endif +#if defined SMEXT_ENABLE_DBMANAGER + SM_GET_IFACE(DBI, dbi); +#endif +#if defined SMEXT_ENABLE_GAMECONF + SM_GET_IFACE(GAMECONFIG, gameconfs); +#endif if (SDK_OnLoad(error, maxlength, late)) { @@ -217,7 +250,7 @@ bool SDKExtension::Unload(char *error, size_t maxlen) return SDK_OnMetamodUnload(error, maxlen); } -bool SDKExtension::Pause(char *error, size_t maxlength) +bool SDKExtension::Pause(char *error, size_t maxlen) { if (!m_WeGotPauseChange) { diff --git a/extensions/geoip/sdk/smsdk_ext.h b/extensions/geoip/sdk/smsdk_ext.h index 808e9759..b6309d68 100644 --- a/extensions/geoip/sdk/smsdk_ext.h +++ b/extensions/geoip/sdk/smsdk_ext.h @@ -30,7 +30,18 @@ #include #include #include +#if defined SMEXT_ENABLE_FORWARDSYS #include +#endif //SMEXT_ENABLE_FORWARDSYS +#if defined SMEXT_ENABLE_PLAYERHELPERS +#include +#endif //SMEXT_ENABLE_PlAYERHELPERS +#if defined SMEXT_ENABLE_DBMANAGER +#include +#endif //SMEXT_ENABLE_DBMANAGER +#if defined SMEXT_ENABLE_GAMECONF +#include +#endif #if defined SMEXT_CONF_METAMOD #include @@ -108,7 +119,7 @@ public: virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength); #endif -public: // IExtensionInterface +public: //IExtensionInterface virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late); virtual void OnExtensionUnload(); virtual void OnExtensionsAllLoaded(); @@ -138,9 +149,9 @@ public: // IExtensionInterface /** Returns date string */ virtual const char *GetExtensionDateString(); #if defined SMEXT_CONF_METAMOD -public: // ISmmPlugin +public: //ISmmPlugin /** Called when the extension is attached to Metamod. */ - virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late); + virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late); /** Returns the author to MM */ virtual const char *GetAuthor(); /** Returns the name to MM */ @@ -158,11 +169,11 @@ public: // ISmmPlugin /** Returns the logtag to MM */ virtual const char *GetLogTag(); /** Called on unload */ - virtual bool Unload(char *error, size_t maxlen); + virtual bool Unload(char *error, size_t maxlength); /** Called on pause */ - virtual bool Pause(char *error, size_t maxlen); + virtual bool Pause(char *error, size_t maxlength); /** Called on unpause */ - virtual bool Unpause(char *error, size_t maxlen); + virtual bool Unpause(char *error, size_t maxlength); private: bool m_SourceMMLoaded; bool m_WeAreUnloaded; @@ -171,12 +182,31 @@ private: }; extern SDKExtension *g_pExtensionIface; +extern IExtension *myself; extern IShareSys *g_pShareSys; -extern IExtension *myself; -extern IHandleSys *g_pHandleSys; +extern IShareSys *sharesys; /* Note: Newer name */ extern ISourceMod *g_pSM; +extern ISourceMod *smutils; /* Note: Newer name */ + +/* Optional interfaces are below */ +#if defined SMEXT_ENABLE_FORWARDSYS extern IForwardManager *g_pForwards; +extern IForwardManager *forwards; /* Note: Newer name */ +#endif //SMEXT_ENABLE_FORWARDSYS +#if defined SMEXT_ENABLE_HANDLESYS +extern IHandleSys *g_pHandleSys; +extern IHandleSys *handlesys; /* Note: Newer name */ +#endif //SMEXT_ENABLE_HANDLESYS +#if defined SMEXT_ENABLE_PLAYERHELPERS +extern IPlayerManager *playerhelpers; +#endif //SMEXT_ENABLE_PLAYERHELPERS +#if defined SMEXT_ENABLE_DBMANAGER +extern IDBManager *dbi; +#endif //SMEXT_ENABLE_DBMANAGER +#if defined SMEXT_ENABLE_GAMECONF +extern IGameConfigManager *gameconfs; +#endif //SMEXT_ENABLE_DBMANAGER #if defined SMEXT_CONF_METAMOD PLUGIN_GLOBALVARS(); @@ -192,7 +222,7 @@ extern IServerGameDLL *gamedll; { \ if (error) \ { \ - snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \ + snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \ return false; \ } \ }