added handle reading to GameConfigManager

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40955
This commit is contained in:
David Anderson
2007-06-16 08:35:26 +00:00
parent 15a7be0e3e
commit c133002c14
3 changed files with 49 additions and 10 deletions
+17
View File
@@ -24,6 +24,7 @@
#include "ShareSys.h"
#include "MemoryUtils.h"
#include "LibrarySys.h"
#include "HandleSys.h"
#if defined PLATFORM_LINUX
#include <dlfcn.h>
@@ -560,3 +561,19 @@ void GameConfigManager::CloseGameConfigFile(IGameConfig *cfg)
delete pConfig;
}
}
extern HandleType_t g_GameConfigsType;
IGameConfig *GameConfigManager::ReadHandle(Handle_t hndl, IdentityToken_t *ident, HandleError *err)
{
HandleSecurity sec(ident, g_pCoreIdent);
IGameConfig *conf = NULL;
HandleError _err = g_HandleSys.ReadHandle(hndl, g_GameConfigsType, &sec, (void **)&conf);
if (err)
{
*err = _err;
}
return conf;
}
+3
View File
@@ -76,6 +76,9 @@ public:
public: //IGameConfigManager
bool LoadGameConfigFile(const char *file, IGameConfig **pConfig, char *error, size_t maxlength);
void CloseGameConfigFile(IGameConfig *cfg);
IGameConfig *ReadHandle(Handle_t hndl,
IdentityToken_t *ident,
HandleError *err);
public: //SMGlobalClass
void OnSourceModStartup(bool late);
void OnSourceModAllInitialized();