Server Help

ASSS Custom Projects - module loading process

Helicon - Mon Apr 07, 2003 4:18 pm
Post subject: module loading process
Gremlinar, could you describe the process of loading a module, in your own words? Also, could someone describe the process of adding arena.conf sections and values... are there side effects if these values are set in .conf but not utilised? I notice strange things happen with Powerball shipsettings when the ball module is not loaded
Grelminar - Tue Apr 08, 2003 2:31 am
Post subject:
Loading a module is pretty trivial (look at LoadMod in module.c). The file containing the module is identified and loaded with dlopen/LoadLibrary, then the MM_<modulename> symbol is located with dlsym/GetProcAddress, then it's called, with action equal to MM_LOAD, a pointer to the modman interface, and a null arena pointer (the arena ptr is used only when attaching).

The module entry point should do a few things, none of which is actually required: stash the modman pointer somewhere to get to later, get some other interface pointers, register some callbacks, register its own interface or two, call some functions in other interfaces (creating timers, packet handlers, etc.).
Grelminar - Tue Apr 08, 2003 2:34 am
Post subject:
Values in config files are only used when requested (via cfg->GetStr or cfg->GetInt). You can add anything you want there, but it won't make a difference unless someone requests it. It'll be read in and stored in memory, though, so don't put lots of extra crap in there.
Helicon - Thu Apr 10, 2003 4:53 pm
Post subject:
also, i notice that #include isnt as flexible as it could be. This is just a suggestion, or maybe i am doing this wrong


/conf/gunofDEATH.conf wrote:

InitialBombs = 2
MaxBombs = 3
;etc... for ultimate destructions


and then use it like this

Arena.conf wrote:


[Warbird]
#include /conf/gunofDEATH.conf
;etc...
[Javelin]
#include /conf/gunofDEATH.conf
;etc etc etc


am i doing this wrong? is this possible... if so it would really make those settings modular.
Grelminar - Fri Apr 11, 2003 8:11 pm
Post subject:
That should work now (it didn't work in my first version of config). You should use "conf/whatever.conf" as the include parameter. The inital slash is telling it to use that as an absolute pathname starting from /, and that won't work.
Helicon - Fri Apr 11, 2003 9:50 pm
Post subject:
< the subject of this post has been dealt with, Moderators, please feel free to delete this post >
Dr Brain - Fri Apr 11, 2003 11:23 pm
Post subject:
Nevar! (posts dont get deleted except with good reson)
Mine GO BOOM - Sat Apr 12, 2003 1:32 pm
Post subject:
Why not delete/close threads?

Simple. See that little "Search" button on the top of every page? If someone needs assistance, they can do a search before posting, and may find their answer.

As for not closing threads: What if someone else has a question that relates directly to this question? They can post a reply in it asking for some more info about it, even if the thread is 6 months old. Better they bump an old post with part of the info that they need than for them to post a new question with less information that we may not be able to understand their problem.
Helicon - Sat Apr 12, 2003 6:35 pm
Post subject:
i did not intend for you to close this entire thread....i made one stupid post whose error i dealth with within 5 minutes of posting, and i realised it was not worth keeping... no one should waste their time on me, especially when i've already fixed the problem. I edited it to keep Gremlinar from wasting time (and thinking i am a complete moron). The message you see above requests that that post itself be deleted, nothing more
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group