Don't expose CellArrays in ISourceMod to extensions

Don't let extensions have access to the internal implementation of cell
arrays.
This commit is contained in:
Peace-Maker 2016-08-26 15:09:18 -07:00
parent 5b9ae5917b
commit ecbedb7b11
4 changed files with 14 additions and 31 deletions

View File

@ -50,11 +50,24 @@ public:
free(m_Data); free(m_Data);
} }
/**
* @brief Creates a cell array object.
*
* @param blocksize The number of cells each member of the array can
* hold. For example, 32 cells is equivalent to:
* new Array[X][32]
* @return A new ICellArray object.
*/
static ICellArray *New(size_t blocksize) static ICellArray *New(size_t blocksize)
{ {
return new CellArray(blocksize); return new CellArray(blocksize);
} }
/**
* @brief Releases a cell array's resources.
*
* @param pack An ICellArray object to release.
*/
static void Free(ICellArray *arr) static void Free(ICellArray *arr)
{ {
delete arr; delete arr;

View File

@ -745,16 +745,6 @@ bool SourceModBase::IsMapRunning()
return g_OnMapStarted; return g_OnMapStarted;
} }
ICellArray *SourceModBase::CreateCellArray(size_t blocksize)
{
return logicore.CreateCellArray(blocksize);
}
void SourceModBase::FreeCellArray(ICellArray *arr)
{
logicore.FreeCellArray(arr);
}
class ConVarRegistrar : class ConVarRegistrar :
public IConCommandBaseAccessor, public IConCommandBaseAccessor,
public SMGlobalClass public SMGlobalClass

View File

@ -135,8 +135,6 @@ public: // ISourceMod
int GetPluginId(); int GetPluginId();
int GetShApiVersion(); int GetShApiVersion();
bool IsMapRunning(); bool IsMapRunning();
ICellArray *CreateCellArray(size_t blocksize);
void FreeCellArray(ICellArray *arr);
private: private:
void ShutdownServices(); void ShutdownServices();
private: private:

View File

@ -40,11 +40,10 @@
#include <IHandleSys.h> #include <IHandleSys.h>
#include <sp_vm_api.h> #include <sp_vm_api.h>
#include <IDataPack.h> #include <IDataPack.h>
#include <ICellArray.h>
#include <time.h> #include <time.h>
#define SMINTERFACE_SOURCEMOD_NAME "ISourceMod" #define SMINTERFACE_SOURCEMOD_NAME "ISourceMod"
#define SMINTERFACE_SOURCEMOD_VERSION 14 #define SMINTERFACE_SOURCEMOD_VERSION 13
/** /**
* @brief Forward declaration of the KeyValues class. * @brief Forward declaration of the KeyValues class.
@ -319,23 +318,6 @@ namespace SourceMod
* @return True if a map is currently running, otherwise false. * @return True if a map is currently running, otherwise false.
*/ */
virtual bool IsMapRunning() = 0; virtual bool IsMapRunning() = 0;
/**
* @brief Creates a cell array object.
*
* @param blocksize The number of cells each member of the array can
* hold. For example, 32 cells is equivalent to:
* new Array[X][32]
* @return A new ICellArray object.
*/
virtual ICellArray *CreateCellArray(size_t blocksize) = 0;
/**
* @brief Releases a cell array's resources so it can be re-used.
*
* @param pack An ICellArray object to release.
*/
virtual void FreeCellArray(ICellArray *arr) = 0;
}; };
} }