I have several problems when trying to make my plugins work in HL2DM.
1. Returning "false" in the plugin's Load() virtual method, which would normally tell Source to skip this plugin and not attempt to load it, makes the server crash.
2. I am unable to load the IPlayerInfoManager and IBotManager interfaces through gameServerFactory (which noteworthy, are not interfaces from the engine but from the game DLL, hence the need to load them from gameServerFactory() and not interfaceFactory()). The same code works fine in CS:Source, where I can load all the interfaces I want.
Here's my Load() function:
Code:
virtual bool Load (CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory)
{
// get the interfaces we want to use
if (!(playerinfomanager = (IPlayerInfoManager *) gameServerFactory (INTERFACEVERSION_PLAYERINFOMANAGER,NULL))
|| !(gameclients = (IServerGameClients *) gameServerFactory (INTERFACEVERSION_SERVERGAMECLIENTS, NULL))
|| !(debugoverlay = (IVDebugOverlay *) interfaceFactory (VDEBUG_OVERLAY_INTERFACE_VERSION, NULL))
|| !(engine = (IVEngineServer *) interfaceFactory (INTERFACEVERSION_VENGINESERVER, NULL))
|| !(gameeventmanager = (IGameEventManager *) interfaceFactory (INTERFACEVERSION_GAMEEVENTSMANAGER,NULL))
|| !(filesystem = (IFileSystem *) interfaceFactory (FILESYSTEM_INTERFACE_VERSION, NULL))
|| !(helpers = (IServerPluginHelpers *) interfaceFactory (INTERFACEVERSION_ISERVERPLUGINHELPERS, NULL))
|| !(enginetrace = (IEngineTrace *) interfaceFactory (INTERFACEVERSION_ENGINETRACE_SERVER,NULL))
|| !(serverconsole = (ICvar *) interfaceFactory (VENGINE_CVAR_INTERFACE_VERSION, NULL)))
return (false); // we require all these interface to function
gpGlobals = playerinfomanager->GetGlobalVars (); // get a pointer to the engine's globalvars
ConCommandBaseMgr::OneTimeInit (&g_ConVarAccessor); // register any cvars and server commands
return (true); // return true so as to enable the engine to load this plugin
}
I precise that I don't try to get gpGlobals when I don't load playerinfomanager, so the crash does not come from here.
Is it me or is it that HL2DM is buggy ?