1.1 --- a/plugins/include/clients.inc Sun Oct 05 04:19:39 2008 -0700
1.2 +++ b/plugins/include/clients.inc Sun Oct 05 15:20:17 2008 -0700
1.3 @@ -45,9 +45,19 @@
1.4 NetFlow_Both, /**< Both values added together */
1.5 };
1.6
1.7 -#define MAXPLAYERS 64 /**< Maximum number of players that can be in server */
1.8 +/**
1.9 + * MAXPLAYERS is not the same as MaxClients.
1.10 + * MAXPLAYERS is a hardcoded value as an upper limit. MaxClients changes based on the server.
1.11 + *
1.12 + * Both GetMaxClients() and MaxClients are only available once the map is loaded, and should
1.13 + * not be used in OnPluginStart().
1.14 + */
1.15 +
1.16 +#define MAXPLAYERS 64 /**< Maximum number of players SourceMod supports */
1.17 #define MAX_NAME_LENGTH 32 /**< Maximum buffer required to store a client name */
1.18
1.19 +public const MaxClients; /**< Maximum number of players the server supports (dynamic) */
1.20 +
1.21 /**
1.22 * Called on client connection.
1.23 *
1.24 @@ -169,10 +179,16 @@
1.25 forward OnClientPostAdminCheck(client);
1.26
1.27 /**
1.28 + * This function will be deprecated in a future release. Use the MaxClients variable instead.
1.29 + *
1.30 * Returns the maximum number of clients allowed on the server. This may
1.31 * return 0 if called before OnMapStart(), and thus should not be called
1.32 * in OnPluginStart().
1.33 *
1.34 + * You should not globally cache the value to GetMaxClients() because it can change from
1.35 + * SourceTV or TF2's arena mode. Use the "MaxClients" dynamic variable documented at the
1.36 + * top of this file.
1.37 + *
1.38 * @return Maximum number of clients allowed.
1.39 */
1.40 native GetMaxClients();