From fa07c9d8a22625811e5ccbd27212509158113e7f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 27 Jul 2007 15:45:15 +0000 Subject: [PATCH] exposed DataPack Handle type --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401197 --- core/smn_datapacks.cpp | 11 ++++++++++- public/ISourceMod.h | 11 +++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/smn_datapacks.cpp b/core/smn_datapacks.cpp index a73dd251..51e8bd1b 100644 --- a/core/smn_datapacks.cpp +++ b/core/smn_datapacks.cpp @@ -25,7 +25,16 @@ class DataPackNatives : public: 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() { diff --git a/public/ISourceMod.h b/public/ISourceMod.h index 69c1596c..2d951b04 100644 --- a/public/ISourceMod.h +++ b/public/ISourceMod.h @@ -139,15 +139,10 @@ namespace SourceMod 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. - * Note that calling CloseHandle() on either type will release the data pack. - * 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. + * @param readonly Ignored + * @return 0 */ virtual HandleType_t GetDataPackHandleType(bool readonly=false) =0;