exposed DataPack Handle type

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401197
This commit is contained in:
David Anderson 2007-07-27 15:45:15 +00:00
parent 995f0231a8
commit fa07c9d8a2
2 changed files with 13 additions and 9 deletions

View File

@ -25,7 +25,16 @@ class DataPackNatives :
public: public:
void OnSourceModAllInitialized() void OnSourceModAllInitialized()
{ {
g_DataPackType = g_HandleSys.CreateType("DataPack", this, 0, NULL, NULL, g_pCoreIdent, NULL); HandleAccess hacc;
TypeAccess tacc;
g_HandleSys.InitAccessDefaults(&tacc, &hacc);
tacc.access[HTypeAccess_Create] = true;
tacc.access[HTypeAccess_Inherit] = true;
tacc.ident = g_pCoreIdent;
hacc.access[HandleAccess_Read] = HANDLE_RESTRICT_OWNER;
g_DataPackType = g_HandleSys.CreateType("DataPack", this, 0, &tacc, &hacc, g_pCoreIdent, NULL);
} }
void OnSourceModShutdown() void OnSourceModShutdown()
{ {

View File

@ -139,15 +139,10 @@ namespace SourceMod
virtual void FreeDataPack(IDataPack *pack) =0; virtual void FreeDataPack(IDataPack *pack) =0;
/** /**
* @brief Returns the automated data pack handle type. * @brief Not implemented, do not use.
* *
* The read-only data type is the parent of the writable type. * @param readonly Ignored
* Note that calling CloseHandle() on either type will release the data pack. * @return 0
* The read-only type is inheritable, but due to limitations of the Handle System,
* the writable type is not.
*
* @param readonly If true, the read-only type will be returned.
* @return The Handle type for storing generic data packs.
*/ */
virtual HandleType_t GetDataPackHandleType(bool readonly=false) =0; virtual HandleType_t GetDataPackHandleType(bool readonly=false) =0;