Re: [hlcoders] Server Plug-in Loading Order

2005-02-20 Thread Lance Vorgin
Michael:

I'm doing that exact same thing right now, for a module for a plugin
manager that shall remain nameless :P

Your plugin is loaded before any ents are created, obviously, but
after all the factories are initialized and the class maps prettied up
and whatnot - a very good time for loading. Hooking CreateEdict is
nice, but it won't tell you what type of entity is being created.

So I went on to hooking EntityFactoryDictionary, which I've become
quite fond of :D A windows only way of getting the EFD ptr is in my
sigscanner thread on the forums of that place (nasty, I know, but hey
it works - haven't had to update it since I made it) - the linux way
is a ton easier. Using my vfunc hook thing again from those forums
heres a way to hook the creation of any ent, and do with it what you
will (too lazy to make my vtbl hook work on lin atm, but I'll be
forced to soon - again it's a ton easier)

class CEntityFactoryDictionary  : public IEntityFactoryDictionary {
public:
CEntityFactoryDictionary();

void InstallFactory( IEntityFactory *pFactory, const char *pClassName );
IServerNetworkable *Create( const char *pClassName );
void Destroy( const char *pClassName, IServerNetworkable *pNetworkable 
);

public:
IEntityFactory *FindFactory( const char *pClassName );

CUtlDict IEntityFactory *, unsigned short  m_Factories;
};

CEntityFactoryDictionary* pEntityFactoryDictionary = NULL;

CSigScanner SigEntityFactoryDictionary(SigEntityFactoryDictionary,
SIGRANGESERVERDLL, pEntityFactoryDictionary,
xxxxxxxxxxx,
\x8A\x0D\x58\x16\x5A\x22\xB0\x01\x84\xC8\x75\x21\x8A\xD1\x0A\xD0\xB9\x08\x16\x5A\x22\x88\x15\x58\x16\x5A\x22\xE8\x60\x00\x00\x00\x68\x30\xD9\x3A\x22\xE8\x2F\x99\x01\x00\x83\xC4\x04\xB8\x08\x16\x5A\x22\xC3,
17, false, 2); //lol

DEFVFUNC(EntityFactoryDictionary_Create, CBaseEntity*,
(CEntityFactoryDictionary*, const char* lpcClassName));

CBaseEntity* VFUNC myEFD_Create(CEntityFactoryDictionary* pEFD, const
char* lpcClassName){
CBaseEntity* pEntity = EntityFactoryDictionary_Create(pEFD, 
lpcClassName);

LOG(Made ent: [%s] %x, lpcClassName, pEntity);

return pEntity;
}

 init 

HOOKVFUNC(pEntityFactoryDictionary, 1,
EntityFactoryDictionary_Create, myEFD_Create);

Regarding modifying those entities, hook their vtbls - you can do
anything you want ot them. If you want a single instance only hook
then swap out the ent's vtable ptr (which I've had no luck with,
honestly), or hook all ents of that type by just modifying it's vtable
directly (which I've had luck with).

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



RE: [hlcoders] Server Plug-in Loading Order

2005-02-19 Thread Alfred Reynolds
They are loaded just after the DllInit() call to the game server dll.
What are you doing that requires a particular ordering of load?

- Alfred

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael A.
Hobson
Sent: Saturday, February 19, 2005 1:21 AM
To: HLCoders
Subject: [hlcoders] Server Plug-in Loading Order

Jay, Yahn or Alfred:

Does the engine load server plug-ins *before* or *after*  a mod's game
DLL and is this order guaranteed (even on Linux ) ?


Michael A. Hobson
email: [EMAIL PROTECTED]
(310) 344-3585 (cell)


___
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



RE: [hlcoders] Server Plug-in Loading Order

2005-02-19 Thread Michael Hobson
Alfred,
Thank you for the quick reply.
At 05:40 PM 2/19/2005, you wrote:
They are loaded just after the DllInit() call to the game server dll.
What are you doing that requires a particular ordering of load?
So the Game DLL's - DLLInit()  is called, passing in the engine interfaces
and what have you.
Then any server plug-ins  specified in the mods '/addon' folder get their
 DLLInit() calls.
Then the map begins loading and we start spawning game entities ?
The reason I asked is because I am considering some really evil low-level
[EMAIL PROTECTED] in order to provide some of the the API hooking functionality
that Metamod provided which the server plugin interface does not.
Particularly with regard to tracking the game DLL's entity creation
and possibly modifying those entities as can be done with Metamod,
but there are other ideas I have that are not very concrete yet.
Mostly, I'm scoping out capabilities at the moment.
- Alfred
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael A.
Hobson
Sent: Saturday, February 19, 2005 1:21 AM
To: HLCoders
Subject: [hlcoders] Server Plug-in Loading Order
Jay, Yahn or Alfred:
Does the engine load server plug-ins *before* or *after*  a mod's game
DLL and is this order guaranteed (even on Linux ) ?
Michael A. Hobson
yahoo: warrior_mike2001
icq: #2186709
mike (at) crusader (dash) services (dot) com

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


Re: [hlcoders] Server Plug-in Loading Order

2005-02-19 Thread David Anderson
What sort of low level hacks are you considering?
You may want to look into what Pavol Marko did for SourceMod, a general
manager for creating iterated lists of hooks to members in virtual
interfaces: http://www.sourcemod.net/devlog/index.php?p=17 (this gives
metamod style functionality for things like IVEngineServer and the
GameDLL interface).
Entities are a bit different, of course, because you need to hook
non-virtual things (so far)... Lance can probably tell you more about
this if you ask him nicely, he's done it :)
   ---David BAILOPAN Anderson
   http://www.sourcemod.net/
Michael Hobson wrote:
Alfred,
Thank you for the quick reply.
At 05:40 PM 2/19/2005, you wrote:
They are loaded just after the DllInit() call to the game server dll.
What are you doing that requires a particular ordering of load?

So the Game DLL's - DLLInit()  is called, passing in the engine interfaces
and what have you.
Then any server plug-ins  specified in the mods '/addon' folder get their
 DLLInit() calls.
Then the map begins loading and we start spawning game entities ?
The reason I asked is because I am considering some really evil low-level
[EMAIL PROTECTED] in order to provide some of the the API hooking functionality
that Metamod provided which the server plugin interface does not.
Particularly with regard to tracking the game DLL's entity creation
and possibly modifying those entities as can be done with Metamod,
but there are other ideas I have that are not very concrete yet.
Mostly, I'm scoping out capabilities at the moment.
- Alfred
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael A.
Hobson
Sent: Saturday, February 19, 2005 1:21 AM
To: HLCoders
Subject: [hlcoders] Server Plug-in Loading Order
Jay, Yahn or Alfred:
Does the engine load server plug-ins *before* or *after*  a mod's game
DLL and is this order guaranteed (even on Linux ) ?

Michael A. Hobson
yahoo: warrior_mike2001
icq: #2186709
mike (at) crusader (dash) services (dot) com

___
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


Re: [hlcoders] Server Plug-in Loading Order

2005-02-19 Thread Michael Hobson
Dave,
Make your own damned threads to plug *your* mod on, please.
Trying to hijack *my* thread is just plain rude.
At 07:49 PM 2/19/2005, you wrote:
What sort of low level hacks are you considering?
You may want to look into what Pavol Marko did for SourceMod, a general
manager for creating iterated lists of hooks to members in virtual
interfaces: http://www.sourcemod.net/devlog/index.php?p=17 (this gives
metamod style functionality for things like IVEngineServer and the
GameDLL interface).
Entities are a bit different, of course, because you need to hook
non-virtual things (so far)... Lance can probably tell you more about
this if you ask him nicely, he's done it :)
   ---David BAILOPAN Anderson
   http://www.sourcemod.net/
Michael A. Hobson
yahoo: warrior_mike2001
icq: #2186709
mike (at) crusader (dash) services (dot) com
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders