Raised This Month: $ Target: $400
 0% 

The Future of Zombie Plugins


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 01-20-2014 , 02:12   Re: The Future of Zombie Plugins
Reply With Quote #6

Late Loading

To support lade loading, modules will need to replay essential events that were fired before they were loaded. SourceMod already handles the basic stuff like OnMapStart, OnConfigsExecuted, OnClientConnected and others, but some custom zombie events must be replayed too.

This is not a responsibility for the event manager, but individual feature modules. The event manager don't know which events to forward.

I'm thinking of creating a new event in the module manager for notifying modules that a module was late loaded. The module manager itself can't detect it either (or maybe shouldn't), so it should provide a native where late loaded modules can notify the module manager themselves that they were late loaded. The module manager will then send the event so feature modules can replay events.

The tricky part is to replay essential events only for late loaded modules. This might imply that the event manager must support filtered events, so it can send an event to certain modules only. Forwards won't work for this, since they're global. We have to use callbacks and let feature modules fire individual events to a specific module. The module ID is passed as a parameter in the late load event.

Edit: Forwards may still work, since I didn't know about private forwards. The code will run a lot more efficient if we delegate most of the work to SourceMod.

Essential events to replay in the Zombie API (so far):
  • OnGameModeActivated - Lets the module initialize according to a certain game mode. More about game modes some other time.
  • OnPlayerTeam
  • OnRoundStart, OnRoundFreezeEnd - If it has started.
  • OnPlayerSpawn, OnPlayerSpawnPost
  • OnClientZombie, OnClientHuman - Tricky, some players may be dead or haven't spawned yet. Actual conditions for when these are fired are not completely defined yet.

Note that the event names are just examples.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 01-25-2014 at 08:56.
rhelgeby is offline
Send a message via MSN to rhelgeby
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode