extensions/geoip/extension.h
author David Anderson <dvander@alliedmods.net>
Fri Feb 16 03:47:10 2007 +0000 (2007-02-16)
changeset 501 e209a7296936
parent 373 bf3335acefdd
child 757 b799caa9a190
permissions -rw-r--r--
removed this potential feature, not useful enough
dvander@373
     1
/**
dvander@373
     2
 * GeoIP SourceMod Extension, (C)2007 AlliedModders LLC.  All rights reserved.
dvander@373
     3
 *
dvander@373
     4
 * This program is free software; you can redistribute it and/or
dvander@373
     5
 * modify it under the terms of the GNU General Public License
dvander@373
     6
 * as published by the Free Software Foundation; either version 2
dvander@373
     7
 * of the License, or (at your option) any later version.
dvander@373
     8
 * This program is distributed in the hope that it will be useful,
dvander@373
     9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dvander@373
    10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dvander@373
    11
 * GNU General Public License for more details.
dvander@373
    12
 * 
dvander@373
    13
 * You should have received a copy of the GNU General Public License
dvander@373
    14
 * along with this program; if not, write to the Free Software
dvander@373
    15
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
dvander@373
    16
 *
dvander@373
    17
 * Version: $Id$
dvander@373
    18
 */
dvander@373
    19
faluco@316
    20
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@316
    21
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@316
    22
faluco@316
    23
#include "smsdk_ext.h"
faluco@316
    24
faluco@316
    25
#define GEOIPDATADIR ""
faluco@316
    26
faluco@316
    27
/**
faluco@316
    28
 * @brief GeoIP implementation of the SDK Extension.
faluco@316
    29
 * Note: Uncomment one of the pre-defined virtual functions in order to use it.
faluco@316
    30
 */
faluco@316
    31
class GeoIP_Extension : public SDKExtension
faluco@316
    32
{
faluco@316
    33
public:
faluco@316
    34
	/**
faluco@316
    35
	 * @brief This is called after the initial loading sequence has been processed.
faluco@316
    36
	 *
faluco@316
    37
	 * @param error		Error message buffer.
faluco@316
    38
	 * @param err_max	Size of error message buffer.
faluco@316
    39
	 * @param late		Whether or not the module was loaded after map load.
faluco@316
    40
	 * @return			True to succeed loading, false to fail.
faluco@316
    41
	 */
faluco@316
    42
	virtual bool SDK_OnLoad(char *error, size_t err_max, bool late);
faluco@316
    43
	
faluco@316
    44
	/**
faluco@316
    45
	 * @brief This is called right before the extension is unloaded.
faluco@316
    46
	 */
faluco@316
    47
	virtual void SDK_OnUnload();
faluco@316
    48
faluco@316
    49
	/**
faluco@316
    50
	 * @brief This is called once all known extensions have been loaded.
faluco@316
    51
	 * Note: It is is a good idea to add natives here, if any are provided.
faluco@316
    52
	 */
faluco@316
    53
	//virtual void SDK_OnAllLoaded();
faluco@316
    54
faluco@316
    55
	/**
faluco@316
    56
	 * @brief Called when the pause state is changed.
faluco@316
    57
	 */
faluco@316
    58
	//virtual void SDK_OnPauseChange(bool paused);
faluco@316
    59
faluco@316
    60
	/**
faluco@316
    61
	 * @brief this is called when Core wants to know if your extension is working.
faluco@316
    62
	 *
faluco@316
    63
	 * @param error		Error message buffer.
faluco@316
    64
	 * @param err_max	Size of error message buffer.
faluco@316
    65
	 * @return			True if working, false otherwise.
faluco@316
    66
	 */
faluco@316
    67
	//virtual void QueryRunning(char *error, size_t maxlength);
faluco@316
    68
public:
faluco@316
    69
#if defined SMEXT_CONF_METAMOD
faluco@316
    70
	/**
faluco@316
    71
	 * Read smext_base.h for documentation on these.
faluco@316
    72
	 */
faluco@316
    73
faluco@316
    74
	//virtual bool SDK_OnMetamodLoad(char *error, size_t err_max, bool late);
faluco@316
    75
	//virtual bool SDK_OnMetamodUnload(char *error, size_t err_max);
faluco@316
    76
	//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t err_max);
faluco@316
    77
#endif
faluco@316
    78
};
faluco@316
    79
faluco@321
    80
extern const sp_nativeinfo_t geoip_natives[];
faluco@321
    81
faluco@316
    82
#endif //_INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_