u32 Gdl_setSfx(u8* sfxSong,u32 size) { if(!sfxSong || !size) return 0; #ifdef useModSfx mymod = loadMod(sfxSong); if(!mymod) return 0; #endif #ifdef useS3mSfx #endif return 1; }
void Mind::loadModules(std::string &modules) { std::string tmp = "."; int i; if (modules == "") return; for (i = 1; tmp != "";) { tmp = Utils::getToken(modules, " ", i++); if (tmp == "") break; loadMod(tmp); } *_logger << "Modules loaded."; }
void CContentHandler::load(CModInfo & mod) { bool validate = (mod.validation != CModInfo::PASSED); if (!loadMod(mod.identifier, validate)) mod.validation = CModInfo::FAILED; if (validate) { if (mod.validation != CModInfo::FAILED) logGlobal->infoStream() << "\t\t[DONE] " << mod.name; else logGlobal->errorStream() << "\t\t[FAIL] " << mod.name; } else logGlobal->infoStream() << "\t\t[SKIP] " << mod.name; }
void loadNextFile() { int res; char *dotPointer; do { res=f_readdir(&dir, &fileInfo); if (res) { die(4,res); } if(fileInfo.fname[0] == 0) break; dotPointer = strrchr(fileInfo.fname, '.'); } while(dotPointer == NULL || strcasecmp(dotPointer, ".mod")); f_chdir (MOD_PATH); if(fileInfo.fname[0] != 0) { f_open(&file, fileInfo.fname, FA_READ); message("Opened File: %s ",fileInfo.fname); loadMod(); message("Song name: [%s]\n",Mod.name); } }
void Mind::execAdmin(ircEvent event, std::string &data) { moduleMap::iterator it; std::string msg, cmd, tmp; std::string target; User u; if (event == PRIVMSG) { msg = data.substr(msg.find(":") + 2); msg = msg.substr(msg.find(":") + 1); Utils::eraseCRLF(msg); Utils::trim(msg); cmd = Utils::getToken(msg, " ", 1); if (cmd == "") cmd = msg; target = Utils::getToken(data, " ", 3); if (target[0] != '#' && target[0] != '&') { u = irc::makeUser(data); target = u.getNick(); } if (cmd == ".load") { tmp = Utils::getToken(msg, " ", 2); if (loadMod(tmp)) _irc->privmsg(target, "Module successfully loaded."); else _irc->privmsg(target, "Unable to load module. Please check log file for further information."); try { initMod(tmp); } catch (Exception &e) { _irc->privmsg(target, "Error: Cannot init module. Unloading..."); unloadMod(tmp); } } else if (cmd == ".unload") { tmp = Utils::getToken(msg, " ", 2); if (unloadMod(tmp)) _irc->privmsg(target, "Module successfully unloaded."); else _irc->privmsg(target, "Unable to unload module. Please check log file for further information."); } else if (cmd == ".reload") { tmp = Utils::getToken(msg, " ", 2); if (!unloadMod(tmp)) _irc->privmsg(target, "Unable to reload module. Please check log file for further information."); if (loadMod(tmp)) { try { initMod(tmp); } catch (Exception &e) { _irc->privmsg(target, "Error: Cannot init module. Unloading..."); unloadMod(tmp); } _irc->privmsg(target, "Module successfully reloaded."); } else _irc->privmsg(target, "Unable to reload module. Please check log file for further information."); } else if (cmd == ".rehash") { rehash(); } else if (cmd == ".die") { std::string msg = "Ciao!"; _irc->quit(msg); exit(0); } } }