Added MaxClients public var to replace GetMaxClients (bug 3283, r=pred).
This is a hard bump of the plugin version number. 1.1 plugins compiled against this include set will not run against earlier versions of SourceMod.
This commit is contained in:
@@ -45,9 +45,19 @@ enum NetFlow
|
||||
NetFlow_Both, /**< Both values added together */
|
||||
};
|
||||
|
||||
#define MAXPLAYERS 64 /**< Maximum number of players that can be in server */
|
||||
/**
|
||||
* MAXPLAYERS is not the same as MaxClients.
|
||||
* MAXPLAYERS is a hardcoded value as an upper limit. MaxClients changes based on the server.
|
||||
*
|
||||
* Both GetMaxClients() and MaxClients are only available once the map is loaded, and should
|
||||
* not be used in OnPluginStart().
|
||||
*/
|
||||
|
||||
#define MAXPLAYERS 64 /**< Maximum number of players SourceMod supports */
|
||||
#define MAX_NAME_LENGTH 32 /**< Maximum buffer required to store a client name */
|
||||
|
||||
public const MaxClients; /**< Maximum number of players the server supports (dynamic) */
|
||||
|
||||
/**
|
||||
* Called on client connection.
|
||||
*
|
||||
@@ -169,10 +179,16 @@ forward OnClientPostAdminFilter(client);
|
||||
forward OnClientPostAdminCheck(client);
|
||||
|
||||
/**
|
||||
* This function will be deprecated in a future release. Use the MaxClients variable instead.
|
||||
*
|
||||
* Returns the maximum number of clients allowed on the server. This may
|
||||
* return 0 if called before OnMapStart(), and thus should not be called
|
||||
* in OnPluginStart().
|
||||
*
|
||||
* You should not globally cache the value to GetMaxClients() because it can change from
|
||||
* SourceTV or TF2's arena mode. Use the "MaxClients" dynamic variable documented at the
|
||||
* top of this file.
|
||||
*
|
||||
* @return Maximum number of clients allowed.
|
||||
*/
|
||||
native GetMaxClients();
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
|
||||
#include <version>
|
||||
|
||||
#define SOURCEMOD_PLUGINAPI_VERSION 3
|
||||
/** If this gets changed, you need to update Core's check. */
|
||||
#define SOURCEMOD_PLUGINAPI_VERSION 4
|
||||
|
||||
struct PlVers
|
||||
{
|
||||
version,
|
||||
@@ -136,6 +138,25 @@ struct SharedPlugin
|
||||
public Float:NULL_VECTOR[3]; /**< Pass this into certain functions to act as a C++ NULL */
|
||||
public const String:NULL_STRING[1]; /**< pass this into certain functions to act as a C++ NULL */
|
||||
|
||||
/**
|
||||
* Horrible compatibility shim.
|
||||
*/
|
||||
public Extension:__ext_core =
|
||||
{
|
||||
name = "Core",
|
||||
file = "core",
|
||||
autoload = 0,
|
||||
required = 0,
|
||||
};
|
||||
|
||||
native VerifyCoreVersion();
|
||||
|
||||
public __ext_core_SetNTVOptional()
|
||||
{
|
||||
VerifyCoreVersion();
|
||||
}
|
||||
|
||||
|
||||
#define AUTOLOAD_EXTENSIONS
|
||||
#define REQUIRE_EXTENSIONS
|
||||
#define REQUIRE_PLUGIN
|
||||
|
||||
Reference in New Issue
Block a user