Try to load the nonworking interfaces with gameServerFactory
instead of interfaceFactory. Especially IServerGameDLL needs
gameServerFactory.

Greets
Ronny

I've been trying to determine which interface factories are supported by
Source Engine plugins.  Here's some code I added to the empty plugin
Load()
function...

// IClientEntityList *cliententitylist =
(IClientEntityList*)interfaceFactory(VCLIENTENTITYLIST_INTERFACE_VERSION,
NULL);
// if ( !cliententitylist )
//  Msg("PLUGIN: Unable to load cliententitylist, ignoring\n");
// else
//  Msg("PLUGIN: Loaded cliententitylist\n");

IEngineTrace *enginetrace =
(IEngineTrace*)interfaceFactory(INTERFACEVERSION_ENGINETRACE_SERVER,
NULL);
if ( !enginetrace )
 Msg("PLUGIN: Unable to load enginetrace, ignoring\n");
else
 Msg("PLUGIN: Loaded enginetrace\n");

// IServerGameDLL *gamedll =
(IServerGameDLL*)interfaceFactory(INTERFACEVERSION_SERVERGAMEDLL, NULL);
// if ( !gamedll )
//  Msg("PLUGIN: Unable to load gamedll, ignoring\n");
// else
//  Msg("PLUGIN: Loaded gamedll\n");

// IServerGameEnts *gameents =
(IServerGameEnts*)interfaceFactory(INTERFACEVERSION_SERVERGAMEENTS, NULL);
// if ( !gameents )
//  Msg("PLUGIN: Unable to load gameents, ignoring\n");
// else
//  Msg("PLUGIN: Loaded gameents\n");

// IServerGameClients *gameclients =
(IServerGameClients*)interfaceFactory(INTERFACEVERSION_SERVERGAMECLIENTS,
NULL);
// if ( !gameclients )
//  Msg("PLUGIN: Unable to load gameclients, ignoring\n");
// else
//  Msg("PLUGIN: Loaded gameclients\n");

ISpatialPartition *spatialpartition =
(ISpatialPartition*)interfaceFactory(INTERFACEVERSION_SPATIALPARTITION,
NULL);
if ( !spatialpartition )
 Msg("PLUGIN: Unable to load spatialpartition, ignoring\n");
else
 Msg("PLUGIN: Loaded spatialpartition\n");

IVoiceServer *voiceserver =
(IVoiceServer*)interfaceFactory(INTERFACEVERSION_VOICESERVER, NULL);
if ( !voiceserver )
 Msg("PLUGIN: Unable to load voiceserver, ignoring\n");
else
 Msg("PLUGIN: Loaded voiceserver\n");

IStaticPropMgr *staticprops =
(IStaticPropMgr*)interfaceFactory(INTERFACEVERSION_STATICPROPMGR_SERVER,
NULL);
if ( !staticprops )
 Msg("PLUGIN: Unable to load staticprops, ignoring\n");
else
 Msg("PLUGIN: Loaded staticprops\n");

// IMapData *mapdata =
(IMapData*)interfaceFactory(INTERFACEVERSION_MAPDATA,
NULL);
// if ( !mapdata )
//  Msg("PLUGIN: Unable to load mapdata, ignoring\n");
// else
//  Msg("PLUGIN: Loaded mapdata\n");

// IPhysics *physics =
(IPhysics*)interfaceFactory(VPHYSICS_INTERFACE_VERSION, NULL);
// if ( !physics )
//  Msg("PLUGIN: Unable to load physics, ignoring\n");
// else
//  Msg("PLUGIN: Loaded physics\n");

// IPhysicsCollision *physicscol =
(IPhysicsCollision*)interfaceFactory(VPHYSICS_COLLISION_INTERFACE_VERSION,
NULL);
// if ( !physicscol )
//  Msg("PLUGIN: Unable to load physicscol, ignoring\n");
// else
//  Msg("PLUGIN: Loaded physicscol\n");

// IPhysicsSurfaceProps *physicssurfprop =
(IPhysicsSurfaceProps*)interfaceFactory(VPHYSICS_SURFACEPROPS_INTERFACE_VERS
ION, NULL);
// if ( !physicssurfprop )
//  Msg("PLUGIN: Unable to load physicssurfprop, ignoring\n");
// else
//  Msg("PLUGIN: Loaded physicssurfprop\n");

IEngineSound *enginesound =
(IEngineSound*)interfaceFactory(IENGINESOUND_SERVER_INTERFACE_VERSION,
NULL);
if ( !enginesound )
 Msg("PLUGIN: Unable to load enginesound, ignoring\n");
else
 Msg("PLUGIN: Loaded enginesound\n");

IVEngineCache *enginecache =
(IVEngineCache*)interfaceFactory(VENGINE_CACHE_INTERFACE_VERSION, NULL);
if ( !enginecache )
 Msg("PLUGIN: Unable to load enginecache, ignoring\n");
else
 Msg("PLUGIN: Loaded enginecache\n");

IVModelInfo *modelinfo =
(IVModelInfo*)interfaceFactory(VMODELINFO_SERVER_INTERFACE_VERSION, NULL);
if ( !modelinfo )
 Msg("PLUGIN: Unable to load modelinfo, ignoring\n");
else
 Msg("PLUGIN: Loaded modelinfo\n");

...and I obviously included the proper .h files to resolve these at
compile
time (Alfred: public/engine is not in the list of default include
directories in the empty plugin project, you might want to add it for
later
updates).

When I start HL2DM up, the plugin loads fine, but many of the interface
factories return NULL (they don't get resolved).  I'm assuming that
plugins
only have access to certain interface factories.  I didn't even try most
of
the ones that I knew were client side only (like anything with "render",
"shadow" or "client" in it).  The ones that are commented out above,
returned NULL for the interface.

Hopefully this will help some people along who are writting plugins for
Source.

v----- HELP!!!! -----v

I STILL haven't determined a method to get each player's "origin" and
"angles" in a plugin.  The best I have found so far is to use the
ICollideable::GetCollisionOrigin() and ICollideable::GetCollisionAngles()
for each client (ICollideable is available through the edict_t structure
using GetCollideable() function).

^----- HELP!!!! -----^

P.S. I *LOVE* the interface factory stuff!  It REALLY helps you figure out
exactly which functions are valid on different types of entities.  I think
that people who complained about how "messy" the Source SDK is, just isn't
used to the interface factory stuff.  Once you get the hang of it, it
ROCKS!!!  But you DEFINITELY have to use grep a lot to find stuff.  You
also
need to "unlearn" all the old Half-Life/Quake engine crap.  Dump all that
you know about Half-Life, free up some brain cells, and begin learning how
Source works.  Embrace the new technology.  Open your arms up WIDE and
give
the Source SDK a BIG HUG.  :)

Jeffrey "botman" Broome



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to