Unify Maximum supported clients, raised SDKTools limit (bug 5964, r=psychonic).
This commit is contained in:
parent
6f47b1a89d
commit
b1901da79f
@ -285,11 +285,11 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
|
||||
/* Initialize all players */
|
||||
|
||||
m_PlayerCount = 0;
|
||||
m_Players = new CPlayer[ABSOLUTE_PLAYER_LIMIT + 1];
|
||||
m_AuthQueue = new unsigned int[ABSOLUTE_PLAYER_LIMIT + 1];
|
||||
m_Players = new CPlayer[SM_MAXPLAYERS + 1];
|
||||
m_AuthQueue = new unsigned int[SM_MAXPLAYERS + 1];
|
||||
m_FirstPass = true;
|
||||
|
||||
memset(m_AuthQueue, 0, sizeof(unsigned int) * (ABSOLUTE_PLAYER_LIMIT + 1));
|
||||
memset(m_AuthQueue, 0, sizeof(unsigned int) * (SM_MAXPLAYERS + 1));
|
||||
|
||||
g_NumPlayersToAuth = &m_AuthQueue[0];
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ Handle_t g_ReadBufHandle;
|
||||
bf_read g_ReadBitBuf;
|
||||
#endif
|
||||
|
||||
int g_MsgPlayers[256];
|
||||
int g_MsgPlayers[SM_MAXPLAYERS+1];
|
||||
bool g_IsMsgInExec = false;
|
||||
|
||||
typedef List<MsgListenerWrapper *> MsgWrapperList;
|
||||
|
@ -37,7 +37,7 @@ CookieManager g_CookieManager;
|
||||
|
||||
CookieManager::CookieManager()
|
||||
{
|
||||
for (int i=0; i<=MAXCLIENTS; i++)
|
||||
for (int i=0; i<=SM_MAXPLAYERS; i++)
|
||||
{
|
||||
connected[i] = false;
|
||||
statsLoaded[i] = false;
|
||||
|
@ -73,13 +73,13 @@ struct Cookie
|
||||
|
||||
dbid = -1;
|
||||
|
||||
for (int i=0; i<=MAXCLIENTS; i++)
|
||||
for (int i=0; i<=SM_MAXPLAYERS; i++)
|
||||
data[i] = NULL;
|
||||
}
|
||||
|
||||
~Cookie()
|
||||
{
|
||||
for (int i=0; i<=MAXCLIENTS; i++)
|
||||
for (int i=0; i<=SM_MAXPLAYERS; i++)
|
||||
{
|
||||
if (data[i] != NULL)
|
||||
delete data[i];
|
||||
@ -89,7 +89,7 @@ struct Cookie
|
||||
char name[MAX_NAME_LENGTH+1];
|
||||
char description[MAX_DESC_LENGTH+1];
|
||||
int dbid;
|
||||
CookieData *data[MAXCLIENTS+1];
|
||||
CookieData *data[SM_MAXPLAYERS+1];
|
||||
CookieAccess access;
|
||||
|
||||
static inline bool matches(const char *name, const Cookie *cookie)
|
||||
@ -133,11 +133,11 @@ public:
|
||||
|
||||
private:
|
||||
NameHashSet<Cookie *> cookieFinder;
|
||||
SourceHook::List<CookieData *> clientData[MAXCLIENTS+1];
|
||||
SourceHook::List<CookieData *> clientData[SM_MAXPLAYERS+1];
|
||||
|
||||
bool connected[MAXCLIENTS+1];
|
||||
bool statsLoaded[MAXCLIENTS+1];
|
||||
bool statsPending[MAXCLIENTS+1];
|
||||
bool connected[SM_MAXPLAYERS+1];
|
||||
bool statsLoaded[SM_MAXPLAYERS+1];
|
||||
bool statsPending[SM_MAXPLAYERS+1];
|
||||
};
|
||||
|
||||
extern CookieManager g_CookieManager;
|
||||
|
@ -32,8 +32,6 @@
|
||||
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
||||
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
||||
|
||||
#define MAXCLIENTS 65
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include "smsdk_ext.h"
|
||||
|
@ -37,7 +37,7 @@ SH_DECL_HOOK5_void(IVEngineServer, PlaybackTempEntity, SH_NOATTRIB, 0, IRecipien
|
||||
|
||||
CellRecipientFilter g_TERecFilter;
|
||||
TempEntityInfo *g_CurrentTE = NULL;
|
||||
int g_TEPlayers[256];
|
||||
int g_TEPlayers[SM_MAXPLAYERS+1];
|
||||
bool tenatives_initialized = false;
|
||||
|
||||
/*************************
|
||||
|
@ -576,7 +576,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char name[48];
|
||||
const char *sound_name;
|
||||
cell_t player_list[256], total_players = 0;
|
||||
cell_t player_list[SM_MAXPLAYERS], total_players = 0;
|
||||
int maxClients = playerhelpers->GetMaxClients();
|
||||
|
||||
int r = (rand() % s_sound_count) + 1;
|
||||
|
@ -51,10 +51,10 @@ enum ListenOverride
|
||||
Listen_Yes, /**< Can hear */
|
||||
};
|
||||
|
||||
size_t g_VoiceFlags[65];
|
||||
size_t g_VoiceFlags[SM_MAXPLAYERS+1];
|
||||
size_t g_VoiceHookCount = 0;
|
||||
ListenOverride g_VoiceMap[65][65];
|
||||
bool g_ClientMutes[65][65];
|
||||
ListenOverride g_VoiceMap[SM_MAXPLAYERS+1][SM_MAXPLAYERS+1];
|
||||
bool g_ClientMutes[SM_MAXPLAYERS+1][SM_MAXPLAYERS+1];
|
||||
|
||||
SH_DECL_HOOK3(IVoiceServer, SetClientListening, SH_NOATTRIB, 0, bool, int, int, bool);
|
||||
|
||||
|
@ -308,11 +308,11 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
|
||||
|
||||
for (iter=m_NormalFuncs.begin(); iter!=m_NormalFuncs.end(); iter++)
|
||||
{
|
||||
int players[64], size;
|
||||
int players[SM_MAXPLAYERS], size;
|
||||
size = _FillInPlayers(players, &filter);
|
||||
pFunc = (*iter);
|
||||
|
||||
pFunc->PushArray(players, 64, SM_PARAM_COPYBACK);
|
||||
pFunc->PushArray(players, SM_ARRAYSIZE(players), SM_PARAM_COPYBACK);
|
||||
pFunc->PushCellByRef(&size);
|
||||
pFunc->PushStringEx(buffer, sizeof(buffer), SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
||||
pFunc->PushCellByRef(&iEntIndex);
|
||||
@ -423,11 +423,11 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
|
||||
|
||||
for (iter=m_NormalFuncs.begin(); iter!=m_NormalFuncs.end(); iter++)
|
||||
{
|
||||
int players[64], size;
|
||||
int players[SM_MAXPLAYERS], size;
|
||||
size = _FillInPlayers(players, &filter);
|
||||
pFunc = (*iter);
|
||||
|
||||
pFunc->PushArray(players, 64, SM_PARAM_COPYBACK);
|
||||
pFunc->PushArray(players, SM_ARRAYSIZE(players), SM_PARAM_COPYBACK);
|
||||
pFunc->PushCellByRef(&size);
|
||||
pFunc->PushStringEx(buffer, sizeof(buffer), SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
||||
pFunc->PushCellByRef(&iEntIndex);
|
||||
|
@ -42,8 +42,6 @@
|
||||
#include <server_class.h>
|
||||
#include <igameevents.h>
|
||||
|
||||
#define MAXPLAYERS 65
|
||||
|
||||
/**
|
||||
* @brief Sample implementation of the SDK Extension.
|
||||
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
|
||||
|
@ -93,7 +93,7 @@ unsigned int TopMenu::CalcMemUsage()
|
||||
|
||||
size += m_Config.strings.GetMemTable()->GetMemUsage();
|
||||
size += (m_Config.cats.size() * sizeof(int));
|
||||
size += (sizeof(topmenu_player_t) * (ABSOLUTE_PLAYER_LIMIT + 1));
|
||||
size += (sizeof(topmenu_player_t) * (SM_MAXPLAYERS + 1));
|
||||
size += (m_SortedCats.size() * sizeof(unsigned int));
|
||||
size += (m_UnsortedCats.size() * sizeof(unsigned int));
|
||||
size += (m_Categories.size() * (sizeof(topmenu_category_t *) + sizeof(topmenu_category_t)));
|
||||
@ -938,8 +938,8 @@ void TopMenu::SortCategoriesIfNeeded()
|
||||
void TopMenu::CreatePlayers(int max_clients)
|
||||
{
|
||||
m_max_clients = max_clients;
|
||||
m_clients = (topmenu_player_t *)malloc(sizeof(topmenu_player_t) * (ABSOLUTE_PLAYER_LIMIT + 1));
|
||||
memset(m_clients, 0, sizeof(topmenu_player_t) * (ABSOLUTE_PLAYER_LIMIT + 1));
|
||||
m_clients = (topmenu_player_t *)malloc(sizeof(topmenu_player_t) * (SM_MAXPLAYERS + 1));
|
||||
memset(m_clients, 0, sizeof(topmenu_player_t) * (SM_MAXPLAYERS + 1));
|
||||
}
|
||||
|
||||
void TopMenu::TearDownClient(topmenu_player_t *player)
|
||||
|
@ -42,8 +42,6 @@
|
||||
using namespace SourceHook;
|
||||
using namespace SourceMod;
|
||||
|
||||
#define ABSOLUTE_PLAYER_LIMIT 255 // not 256, so we can send the limit as a byte
|
||||
|
||||
struct config_category_t
|
||||
{
|
||||
int name;
|
||||
|
@ -49,6 +49,8 @@ class IPlayerInfo;
|
||||
#define SM_REPLY_CONSOLE 0 /**< Reply to console. */
|
||||
#define SM_REPLY_CHAT 1 /**< Reply to chat. */
|
||||
|
||||
#define SM_MAXPLAYERS 65 /**< Maxplayer Count */
|
||||
|
||||
namespace SourceMod
|
||||
{
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user