plugins/include/core.inc
author David Anderson <dvander@alliedmods.net>
Tue Sep 02 03:58:34 2008 +0000 (2008-09-02)
changeset 2245 d8518466c06c
parent 2105 ad190b9bb5af
child 2289 44045ead61cd
permissions -rw-r--r--
Fixed amb1927 - client command case sensitivity did not match the server's logic.
ds@1952
     1
/**
ds@1952
     2
 * vim: set ts=4 :
ds@1952
     3
 * =============================================================================
ds@1952
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
ds@1952
     5
 * =============================================================================
ds@1952
     6
 *
ds@1952
     7
 * This file is part of the SourceMod/SourcePawn SDK.
ds@1952
     8
 *
ds@1952
     9
 * This program is free software; you can redistribute it and/or modify it under
ds@1952
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1952
    11
 * Free Software Foundation.
ds@1952
    12
 * 
ds@1952
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1952
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1952
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1952
    16
 * details.
ds@1952
    17
 *
ds@1952
    18
 * You should have received a copy of the GNU General Public License along with
ds@1952
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
ds@1952
    20
 *
ds@1952
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1952
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1952
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1952
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1952
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1952
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1952
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1952
    28
 * or <http://www.sourcemod.net/license.php>.
ds@1952
    29
 *
ds@1952
    30
 * Version: $Id$
ds@1952
    31
 */
ds@1952
    32
ds@1952
    33
#if defined _core_included
ds@1952
    34
 #endinput
ds@1952
    35
#endif
ds@1952
    36
#define _core_included
ds@1952
    37
ds@1952
    38
#include <version>
ds@1952
    39
dvander@2105
    40
#define SOURCEMOD_PLUGINAPI_VERSION		3
ds@1952
    41
struct PlVers
ds@1952
    42
{
ds@1952
    43
	version,
ds@1952
    44
	String:filevers[],
dvander@2105
    45
	String:date[],
dvander@2105
    46
	String:time[]
ds@1952
    47
};
ds@1952
    48
ds@1952
    49
/**
ds@1952
    50
 * Function helper values.
ds@1952
    51
 */
ds@1952
    52
enum Function
ds@1952
    53
{
ds@1952
    54
     INVALID_FUNCTION = -1,
ds@1952
    55
};
ds@1952
    56
ds@1952
    57
/**
ds@1952
    58
 * Specifies what to do after a hook completes.
ds@1952
    59
 */
ds@1952
    60
enum Action
ds@1952
    61
{
ds@1952
    62
	Plugin_Continue = 0,	/**< Continue with the original action */
ds@1952
    63
	Plugin_Changed = 1,		/**< Inputs or outputs have been overridden with new values */
ds@1952
    64
	Plugin_Handled = 3,		/**< Handle the action at the end (don't call it) */
ds@1952
    65
	Plugin_Stop = 4,		/**< Immediately stop the hook chain and handle the original */
ds@1952
    66
};
ds@1952
    67
ds@1952
    68
/**
ds@1952
    69
 * Specifies identity types.
ds@1952
    70
 */
ds@1952
    71
enum Identity
ds@1952
    72
{
ds@1952
    73
	Identity_Core = 0,
ds@1952
    74
	Identity_Extension = 1,
ds@1952
    75
	Identity_Plugin = 2
ds@1952
    76
};
ds@1952
    77
ds@1952
    78
public PlVers:__version = 
ds@1952
    79
{
ds@1952
    80
	version = SOURCEMOD_PLUGINAPI_VERSION,
dvander@2105
    81
	filevers = SOURCEMOD_VERSION,
dvander@2105
    82
	date = __DATE__,
dvander@2105
    83
	time = __TIME__
ds@1952
    84
};
ds@1952
    85
ds@1952
    86
/**
ds@1952
    87
 * Plugin status values.
ds@1952
    88
 */
ds@1952
    89
enum PluginStatus
ds@1952
    90
{
ds@1952
    91
	Plugin_Running=0,		/**< Plugin is running */
ds@1952
    92
	/* All states below are "temporarily" unexecutable */
ds@1952
    93
	Plugin_Paused,			/**< Plugin is loaded but paused */
ds@1952
    94
	Plugin_Error,			/**< Plugin is loaded but errored/locked */
ds@1952
    95
	/* All states below do not have all natives */
ds@1952
    96
	Plugin_Loaded,			/**< Plugin has passed loading and can be finalized */
ds@1952
    97
	Plugin_Failed,			/**< Plugin has a fatal failure */
ds@1952
    98
	Plugin_Created,			/**< Plugin is created but not initialized */
ds@1952
    99
	Plugin_Uncompiled,		/**< Plugin is not yet compiled by the JIT */
ds@1952
   100
	Plugin_BadLoad,			/**< Plugin failed to load */
ds@1952
   101
};
ds@1952
   102
ds@1952
   103
/**
ds@1952
   104
 * Plugin information properties.
ds@1952
   105
 */
ds@1952
   106
enum PluginInfo
ds@1952
   107
{
ds@1952
   108
	PlInfo_Name,			/**< Plugin name */
ds@1952
   109
	PlInfo_Author,			/**< Plugin author */
ds@1952
   110
	PlInfo_Description,		/**< Plugin description */
ds@1952
   111
	PlInfo_Version,			/**< Plugin verison */
ds@1952
   112
	PlInfo_URL,				/**< Plugin URL */
ds@1952
   113
};
ds@1952
   114
ds@1952
   115
/**
ds@1952
   116
 * Defines how an extension must expose itself for autoloading.
ds@1952
   117
 */
ds@1952
   118
struct Extension
ds@1952
   119
{
ds@1952
   120
	const String:name[],	/**< Short name */
ds@1952
   121
	const String:file[],	/**< Default file name */
ds@1952
   122
	bool:autoload,			/**< Whether or not to auto-load */
ds@1952
   123
	bool:required,			/**< Whether or not to require */
ds@1952
   124
};
ds@1952
   125
ds@1952
   126
/**
ds@1952
   127
 * Defines how a plugin must expose itself for native requiring.
ds@1952
   128
 */
ds@1952
   129
struct SharedPlugin
ds@1952
   130
{
ds@1952
   131
	const String:name[],	/**< Short name */
ds@1952
   132
	const String:file[],	/**< File name */
ds@1952
   133
	bool:required,			/**< Whether or not to require */
ds@1952
   134
};
ds@1952
   135
ds@1952
   136
public Float:NULL_VECTOR[3];		/**< Pass this into certain functions to act as a C++ NULL */
ds@1952
   137
public const String:NULL_STRING[1];	/**< pass this into certain functions to act as a C++ NULL */
ds@1952
   138
ds@1952
   139
#define AUTOLOAD_EXTENSIONS
ds@1952
   140
#define REQUIRE_EXTENSIONS
ds@1952
   141
#define REQUIRE_PLUGIN