dvander@373: /** ds@757: * vim: set ts=4 : ds@757: * =============================================================== ds@757: * SourceMod GeoIP Extension ds@757: * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved. ds@757: * =============================================================== dvander@373: * dvander@373: * This program is free software; you can redistribute it and/or dvander@373: * modify it under the terms of the GNU General Public License dvander@373: * as published by the Free Software Foundation; either version 2 dvander@373: * of the License, or (at your option) any later version. dvander@373: * This program is distributed in the hope that it will be useful, dvander@373: * but WITHOUT ANY WARRANTY; without even the implied warranty of dvander@373: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dvander@373: * GNU General Public License for more details. dvander@373: * dvander@373: * You should have received a copy of the GNU General Public License dvander@373: * along with this program; if not, write to the Free Software dvander@373: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. dvander@373: * dvander@373: * Version: $Id$ dvander@373: */ dvander@373: faluco@316: #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ faluco@316: #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ faluco@316: ds@757: /** ds@757: * @file extension.h ds@757: * @brief GeoIP extension code header. ds@757: */ ds@757: faluco@316: #include "smsdk_ext.h" faluco@316: faluco@316: faluco@316: /** ds@757: * @brief Implementation of the GeoIP extension. faluco@316: * Note: Uncomment one of the pre-defined virtual functions in order to use it. faluco@316: */ faluco@316: class GeoIP_Extension : public SDKExtension faluco@316: { faluco@316: public: faluco@316: /** faluco@316: * @brief This is called after the initial loading sequence has been processed. faluco@316: * faluco@316: * @param error Error message buffer. ds@757: * @param maxlength Size of error message buffer. faluco@316: * @param late Whether or not the module was loaded after map load. faluco@316: * @return True to succeed loading, false to fail. faluco@316: */ ds@757: virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late); faluco@316: faluco@316: /** faluco@316: * @brief This is called right before the extension is unloaded. faluco@316: */ faluco@316: virtual void SDK_OnUnload(); faluco@316: faluco@316: /** faluco@316: * @brief This is called once all known extensions have been loaded. faluco@316: * Note: It is is a good idea to add natives here, if any are provided. faluco@316: */ faluco@316: //virtual void SDK_OnAllLoaded(); faluco@316: faluco@316: /** faluco@316: * @brief Called when the pause state is changed. faluco@316: */ faluco@316: //virtual void SDK_OnPauseChange(bool paused); faluco@316: faluco@316: /** faluco@316: * @brief this is called when Core wants to know if your extension is working. faluco@316: * faluco@316: * @param error Error message buffer. ds@757: * @param maxlength Size of error message buffer. faluco@316: * @return True if working, false otherwise. faluco@316: */ ds@757: //virtual bool QueryRunning(char *error, size_t maxlength); faluco@316: public: faluco@316: #if defined SMEXT_CONF_METAMOD faluco@316: /** ds@757: * @brief Called when Metamod is attached, before the extension version is called. ds@757: * ds@757: * @param error Error buffer. ds@757: * @param maxlength Maximum size of error buffer. ds@757: * @param late Whether or not Metamod considers this a late load. ds@757: * @return True to succeed, false to fail. faluco@316: */ ds@757: //virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late); faluco@316: ds@757: /** ds@757: * @brief Called when Metamod is detaching, after the extension version is called. ds@757: * NOTE: By default this is blocked unless sent from SourceMod. ds@757: * ds@757: * @param error Error buffer. ds@757: * @param maxlength Maximum size of error buffer. ds@757: * @return True to succeed, false to fail. ds@757: */ ds@757: //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength); ds@757: ds@757: /** ds@757: * @brief Called when Metamod's pause state is changing. ds@757: * NOTE: By default this is blocked unless sent from SourceMod. ds@757: * ds@757: * @param paused Pause state being set. ds@757: * @param error Error buffer. ds@757: * @param maxlength Maximum size of error buffer. ds@757: * @return True to succeed, false to fail. ds@757: */ ds@757: //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength); faluco@316: #endif faluco@316: }; faluco@316: faluco@321: extern const sp_nativeinfo_t geoip_natives[]; faluco@321: ds@757: #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_