//************************************* //* NWN-MySQL 4.0 (c) 2004 FastFrench * //************************************* // This file is licensed under the terms of the // GNU GENERAL PUBLIC LICENSE (GPL) Version 2 // ************************ // ** ff_on_mod_load.nss ** // ************************ // ** put this file on your module OnLoad event, // ** or add the instruction: // ** ExecuteScript("ff_on_mod_load", OBJECT_SELF); // ** at the beginning of your main function in your existing script #include "ff_include" #include "ff_initcolors" #include "ff_initwp" #include "ff_modhb_inc" void main() { SetLocalInt(GetModule(),"ModuleInit",1); InitWP(); int DelayStart = 20; // Default 20 seconds before players are accepted if (FF_USE_EXTERNAL_DATABASE) { SQLInit(); ExecuteScript("ff_buildtable", OBJECT_SELF); // Creation de toutes les tables necessaires DelayStart = ff_GetPersistentInt("GDelayStart", "global", DelayStart); ff_SetPersistentInt("GDelayStart", DelayStart); if (ff_GetPersistentString("GDelayStart")=="") { WriteTimestampedLogEntry("MySQL Database is not available. Check if MySQL server is running and configuration file properly set."); return; } } ff_InitColors(); int LastRestart = 0; if (FF_USE_EXTERNAL_DATABASE) { if (FF_USING_NWN_SPEECH) InitSpeech(); int bDebug = ff_GetPersistentInt("GDebug"); if (bDebug) SpawnScriptDebugger(); // GDebug LastRestart = ff_GetPersistentInt("GModeRestart"); ff_SetPersistentInt("GModeRestart",0); if (FF_SYNCHRONIZE_TIME) SQLSetIGDate(); if (FF_USING_LOG_ACTIONS) ExecuteScript("ff_processaction", OBJECT_SELF); } SetLocalInt(GetModule(),"LastRestart",LastRestart); SetLocalString(GetModule(), "PWId", "0"); if (FF_PROTECT_SERVER_INITIALIZATION) DelayCommand(IntToFloat(DelayStart), SetLocalInt(GetModule(),"ModuleInit",0)); else SetLocalInt(GetModule(),"ModuleInit",0); }