dvander@373: /** ds@757: * vim: set ts=4 : ds@1330: * ============================================================================= ds@757: * SourceMod GeoIP Extension ds@1947: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. ds@1330: * ============================================================================= dvander@373: * ds@1330: * This program is free software; you can redistribute it and/or modify it under ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the ds@1330: * Free Software Foundation. dvander@1226: * ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ds@1330: * details. dvander@1226: * ds@1330: * You should have received a copy of the GNU General Public License along with ds@1330: * this program. If not, see . dvander@1226: * ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants ds@1330: * this exception to all derivative works. AlliedModders LLC defines further ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), ds@1330: * or . 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_