Please bear with me as I haven't programmed in years... Yes... Years (~10).
Anyway. I find it quite annoying to have to rename my MaNGOSScript.dll each and every time I build a new version of SD2 etc, so I made a little mod that will look up a new entry in the mangosd.conf called AltLib and will try to load the .dll/.so attached to that tag.
I'm thinking this could be very useful for other mods/DBs/scripting used with MaNGOS.
It's actually very simple... Feel free to bash my head in if you feel like it or see an easier way to do it!
@@ -1131,13 +1131,29 @@ void World::SetInitialWorldSettings()
objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sLog.outString( "Initializing Scripts..." );
- if(!LoadScriptingModule())
- exit(1);
-
+ // Alternate script engine library loading
+ std::string AltLib = sConfig.GetStringDefault("AltLib", "");
+ char const* sAltName = AltLib.c_str();
+
+ if(strlen(sAltName))
+ {
+ // Load alternate library
+ sLog.outString( "Loading script engine library: %s", sAltName );
+ if(!LoadScriptingModule(sAltName))
+ exit(1);
+ }
+ else
+ {
+ // bailout w/ default lib
+ sLog.outString( "Loading default MaNGOS script engine.");
+ if(!LoadScriptingModule())
+ exit(1);
+ }
+
///- Initialize game time and timers
sLog.outString( "DEBUG:: Initialize game time and timers" );
m_gameTime = time(NULL);
m_startTime=m_gameTime;
PS: Before it is to be committed we should talk to SD2's people and kindly ask them to change their library name output to something like: scriptdev2.dll/.so instead of MaNGOSScript...
Anyway, that's that.
Thank you for your time! LoL