Load of modules vs rest of profile

Post Reply
DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Load of modules vs rest of profile

Post by DevArrah » Wed Mar 05, 2014 2:06 am

So i have a bunch of mudlet modules that serve as the foundation for the rest of the profile, think a common trigger base and library functions.

however, every time i fire up mudlet, the functions and triggers that call into the function library (module) fails to load because those library functions haven;'t loaded yet. It appears as though the load order is profile -> modules.

Is there someway to jigger the load order so it loads all my modules first then the rest of the profile?

User avatar
Vadi
Posts: 4703
Joined: Sat Mar 14, 2009 3:13 pm

Re: Load of modules vs rest of profile

Post by Vadi » Wed Mar 05, 2014 7:05 am

What I do is have my modules raise an event when they are loaded, and make anything that uses them load off that event.

fetaera
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm

Re: Load of modules vs rest of profile

Post by fetaera » Wed Mar 05, 2014 11:42 am

Yeah, pretty much what Vadi said. I posted a method on one of the other threads that you're welcome to use. In short, though, I hook onto sysLoadEvent and run a lfs.attributes() check against the system core file. If it does not exist, I raise an event, 'Serenity Installer' in this instance. If it does, then I raise 'Serenity Loader' instead.

User avatar
keneanung
Site Admin
Posts: 94
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

Re: Load of modules vs rest of profile

Post by keneanung » Tue Mar 11, 2014 11:59 am

Vadi wrote:What I do is have my modules raise an event when they are loaded, and make anything that uses them load off that event.
Question to this approach: What happens if the module that is used finishes loading, before the using part gets a chance to register the callback?

User avatar
Vadi
Posts: 4703
Joined: Sat Mar 14, 2009 3:13 pm

Re: Load of modules vs rest of profile

Post by Vadi » Tue Mar 11, 2014 7:47 pm

The callbacks are registered via the Mudlet interface, not the function. Haven't seen any issues with this setup wherever the module is.

Also technically speaking, 'modules' are pretty much always loaded last after all the profile stuff. It is packages that get moved about.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests