extensions/bintools/extension.h
author David Anderson <dvander@alliedmods.net>
Sun Nov 25 18:50:13 2007 +0000 (2007-11-25)
changeset 1725 ea875bcbc286
parent 1330 ab94316bb52b
child 1947 e73a1e51833b
permissions -rw-r--r--
small clarification to param2 in MenuAction_End
faluco@739
     1
/**
faluco@739
     2
 * vim: set ts=4 :
ds@1330
     3
 * =============================================================================
ds@757
     4
 * SourceMod BinTools Extension
dvander@1226
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
ds@1330
     6
 * =============================================================================
faluco@739
     7
 *
ds@1330
     8
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    10
 * Free Software Foundation.
dvander@1226
    11
 * 
ds@1330
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    15
 * details.
dvander@1226
    16
 *
ds@1330
    17
 * You should have received a copy of the GNU General Public License along with
ds@1330
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1226
    19
 *
ds@1330
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    27
 * or <http://www.sourcemod.net/license.php>.
faluco@739
    28
 *
faluco@739
    29
 * Version: $Id$
faluco@739
    30
 */
faluco@739
    31
faluco@739
    32
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@739
    33
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@739
    34
faluco@739
    35
/**
faluco@739
    36
 * @file extension.h
faluco@739
    37
 * @brief Sample extension code header.
faluco@739
    38
 */
faluco@739
    39
faluco@739
    40
#include "smsdk_ext.h"
faluco@739
    41
faluco@739
    42
faluco@739
    43
/**
ds@757
    44
 * @brief Implementation of the BinTools extension.
faluco@739
    45
 * Note: Uncomment one of the pre-defined virtual functions in order to use it.
faluco@739
    46
 */
faluco@739
    47
class BinTools : public SDKExtension
faluco@739
    48
{
faluco@739
    49
public:
faluco@739
    50
	/**
faluco@739
    51
	 * @brief This is called after the initial loading sequence has been processed.
faluco@739
    52
	 *
faluco@739
    53
	 * @param error		Error message buffer.
ds@757
    54
	 * @param maxlength	Size of error message buffer.
faluco@739
    55
	 * @param late		Whether or not the module was loaded after map load.
faluco@739
    56
	 * @return			True to succeed loading, false to fail.
faluco@739
    57
	 */
ds@757
    58
	virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
faluco@739
    59
	
faluco@739
    60
	/**
faluco@739
    61
	 * @brief This is called right before the extension is unloaded.
faluco@739
    62
	 */
faluco@739
    63
	//virtual void SDK_OnUnload();
faluco@739
    64
faluco@739
    65
	/**
faluco@739
    66
	 * @brief This is called once all known extensions have been loaded.
faluco@739
    67
	 * Note: It is is a good idea to add natives here, if any are provided.
faluco@739
    68
	 */
faluco@739
    69
	//virtual void SDK_OnAllLoaded();
faluco@739
    70
faluco@739
    71
	/**
faluco@739
    72
	 * @brief Called when the pause state is changed.
faluco@739
    73
	 */
faluco@739
    74
	//virtual void SDK_OnPauseChange(bool paused);
faluco@739
    75
faluco@739
    76
	/**
faluco@739
    77
	 * @brief this is called when Core wants to know if your extension is working.
faluco@739
    78
	 *
faluco@739
    79
	 * @param error		Error message buffer.
ds@757
    80
	 * @param maxlength	Size of error message buffer.
faluco@739
    81
	 * @return			True if working, false otherwise.
faluco@739
    82
	 */
ds@757
    83
	//virtual bool QueryRunning(char *error, size_t maxlength);
faluco@739
    84
public:
faluco@739
    85
#if defined SMEXT_CONF_METAMOD
faluco@739
    86
	/**
ds@757
    87
	 * @brief Called when Metamod is attached, before the extension version is called.
ds@757
    88
	 *
ds@757
    89
	 * @param error			Error buffer.
ds@757
    90
	 * @param maxlength		Maximum size of error buffer.
ds@757
    91
	 * @param late			Whether or not Metamod considers this a late load.
ds@757
    92
	 * @return				True to succeed, false to fail.
faluco@739
    93
	 */
ds@757
    94
	//virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
faluco@739
    95
ds@757
    96
	/**
ds@757
    97
	 * @brief Called when Metamod is detaching, after the extension version is called.
ds@757
    98
	 * NOTE: By default this is blocked unless sent from SourceMod.
ds@757
    99
	 *
ds@757
   100
	 * @param error			Error buffer.
ds@757
   101
	 * @param maxlength		Maximum size of error buffer.
ds@757
   102
	 * @return				True to succeed, false to fail.
ds@757
   103
	 */
ds@757
   104
	//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
ds@757
   105
ds@757
   106
	/**
ds@757
   107
	 * @brief Called when Metamod's pause state is changing.
ds@757
   108
	 * NOTE: By default this is blocked unless sent from SourceMod.
ds@757
   109
	 *
ds@757
   110
	 * @param paused		Pause state being set.
ds@757
   111
	 * @param error			Error buffer.
ds@757
   112
	 * @param maxlength		Maximum size of error buffer.
ds@757
   113
	 * @return				True to succeed, false to fail.
ds@757
   114
	 */
ds@757
   115
	//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
faluco@739
   116
#endif
faluco@739
   117
};
faluco@739
   118
faluco@739
   119
extern ISourcePawnEngine *g_SPEngine;
faluco@739
   120
ds@757
   121
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_