diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/main-account.cpp | 5 | ||||
-rw-r--r-- | src/game-server/itemmanager.cpp | 8 | ||||
-rw-r--r-- | src/game-server/main-game.cpp | 8 | ||||
-rw-r--r-- | src/game-server/mapmanager.cpp | 8 | ||||
-rw-r--r-- | src/game-server/monstermanager.cpp | 40 | ||||
-rw-r--r-- | src/game-server/skillmanager.cpp | 10 | ||||
-rw-r--r-- | src/game-server/statusmanager.cpp | 14 |
7 files changed, 59 insertions, 34 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index 460a5f1b..39c111aa 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -249,6 +249,11 @@ static void printHelp() << "Options: " << std::endl << " -h --help : Display this help" << std::endl << " --verbosity <n> : Set the verbosity level" << std::endl + << " - 0. Fatal Errors only." << std::endl + << " - 1. All Errors." << std::endl + << " - 2. Plus warnings." << std::endl + << " - 3. Plus standard information." << std::endl + << " - 4. Plus debugging information." << std::endl << " --port <n> : Set the default port to listen on" << std::endl; exit(0); } diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp index 96f9c210..275f24b0 100644 --- a/src/game-server/itemmanager.cpp +++ b/src/game-server/itemmanager.cpp @@ -49,6 +49,8 @@ void ItemManager::reload() // Note: The file is checked for UTF-8 BOM. char *data = ResourceManager::loadFile(itemReferenceFile, size, true); + std::string absPathFile = ResourceManager::resolve(itemReferenceFile); + if (!data) { LOG_ERROR("Item Manager: Could not find " << itemReferenceFile << "!"); free(data); @@ -61,20 +63,20 @@ void ItemManager::reload() if (!doc) { LOG_ERROR("Item Manager: Error while parsing item database (" - << itemReferenceFile << ")!"); + << absPathFile << ")!"); return; } xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "items")) { - LOG_ERROR("Item Manager: " << itemReferenceFile + LOG_ERROR("Item Manager: " << absPathFile << " is not a valid database file!"); xmlFreeDoc(doc); return; } - LOG_INFO("Loading item reference..."); + LOG_INFO("Loading item reference: " << absPathFile); unsigned nbItems = 0; for (node = node->xmlChildrenNode; node != NULL; node = node->next) { diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index 1e01bcb5..19ffa937 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -242,7 +242,13 @@ void printHelp() << "Options: " << std::endl << " -h --help : Display this help" << std::endl << " --verbosity <n> : Set the verbosity level" << std::endl - << " --port <n> : Set the default port to listen on" << std::endl; + << " - 0. Fatal Errors only." << std::endl + << " - 1. All Errors." << std::endl + << " - 2. Plus warnings." << std::endl + << " - 3. Plus standard information." << std::endl + << " - 4. Plus debugging information." << std::endl + << " --port <n> : Set the default port to listen on." + << std::endl; exit(0); } diff --git a/src/game-server/mapmanager.cpp b/src/game-server/mapmanager.cpp index ced6b582..562abb0d 100644 --- a/src/game-server/mapmanager.cpp +++ b/src/game-server/mapmanager.cpp @@ -48,6 +48,8 @@ unsigned int MapManager::initialize(const std::string &mapReferenceFile) // Note: The file is checked for UTF-8 BOM. char *data = ResourceManager::loadFile(mapReferenceFile, size, true); + std::string absPathFile = ResourceManager::resolve(mapReferenceFile); + if (!data) { LOG_ERROR("Map Manager: Could not find " << mapReferenceFile << "!"); free(data); @@ -60,20 +62,20 @@ unsigned int MapManager::initialize(const std::string &mapReferenceFile) if (!doc) { LOG_ERROR("Map Manager: Error while parsing map database (" - << mapReferenceFile << ")!"); + << absPathFile << ")!"); return loadedMaps; } xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "maps")) { - LOG_ERROR("Map Manager: " << mapReferenceFile + LOG_ERROR("Map Manager: " << absPathFile << " is not a valid database file!"); xmlFreeDoc(doc); return loadedMaps; } - LOG_INFO("Loading map reference..."); + LOG_INFO("Loading map reference: " << absPathFile); for (node = node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlStrEqual(node->name, BAD_CAST "map")) { diff --git a/src/game-server/monstermanager.cpp b/src/game-server/monstermanager.cpp index af6f3a20..7396744d 100644 --- a/src/game-server/monstermanager.cpp +++ b/src/game-server/monstermanager.cpp @@ -66,6 +66,8 @@ void MonsterManager::reload() // Note: The file is checked for UTF-8 BOM. char *data = ResourceManager::loadFile(monsterReferenceFile, size, true); + std::string absPathFile = ResourceManager::resolve(monsterReferenceFile); + if (!data) { LOG_ERROR("Monster Manager: Could not find " << monsterReferenceFile << "!"); @@ -79,20 +81,20 @@ void MonsterManager::reload() if (!doc) { LOG_ERROR("Monster Manager: Error while parsing monster database (" - << monsterReferenceFile << ")!"); + << absPathFile << ")!"); return; } xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "monsters")) { - LOG_ERROR("Monster Manager: " << monsterReferenceFile + LOG_ERROR("Monster Manager: " << absPathFile << " is not a valid database file!"); xmlFreeDoc(doc); return; } - LOG_INFO("Loading monster reference..."); + LOG_INFO("Loading monster reference: " << absPathFile); int nbMonsters = 0; for (node = node->xmlChildrenNode; node != NULL; node = node->next) { @@ -106,8 +108,9 @@ void MonsterManager::reload() if (id == -1) { - LOG_WARN("Monster Manager: There is a monster ("<<name<<") without ID in " - << monsterReferenceFile << "! It has been ignored."); + LOG_WARN("Monster Manager: There is a monster (" + << name << ") without ID in " + << monsterReferenceFile << "! It has been ignored."); continue; } @@ -193,7 +196,7 @@ void MonsterManager::reload() } if (!attributesComplete) LOG_WARN(monsterReferenceFile - <<": Attributes incomplete for monster #"<<id); + << ": Attributes incomplete for monster #" << id); //The speed is set in tiles per second in the monsters.xml monster->setSpeed(speed); @@ -237,20 +240,21 @@ void MonsterManager::reload() if (att->id == 0) { LOG_WARN(monsterReferenceFile - <<": Attack without ID for monster #" - <<id<<" ("<<name<<") - attack ignored"); + << ": Attack without ID for monster #" + << id << " (" << name << ") - attack ignored"); } else if (att->element == ELEMENT_ILLEGAL) { LOG_WARN(monsterReferenceFile - <<": Attack with unknown element \""<<sElement<<"\" " - <<"for monster #"<<id<<" ("<<name<<") - attack ignored"); + << ": Attack with unknown element \"" + << sElement << "\" for monster #" << id + << " (" << name << ") - attack ignored"); } else if (att->type == -1) { LOG_WARN(monsterReferenceFile - <<": Attack with unknown type \""<<sType<<"\" " - <<"for monster #"<<id<<" ("<<name<<")"); + << ": Attack with unknown type \"" << sType << "\"" + << " for monster #" << id << " (" << name << ")"); } else { @@ -268,16 +272,16 @@ void MonsterManager::reload() monster->setDrops(drops); if (!attributesSet) LOG_WARN(monsterReferenceFile - <<": No attributes defined for monster #" - <<id<<" ("<<name<<")"); + << ": No attributes defined for monster #" + << id << " (" << name << ")"); if (!behaviorSet) LOG_WARN(monsterReferenceFile - <<": No behavior defined for monster #" - <<id<<" ("<<name<<")"); + << ": No behavior defined for monster #" + << id << " (" << name << ")"); if (monster->getExp() == -1) { LOG_WARN(monsterReferenceFile - <<": No experience defined for monster #" - <<id<<" ("<<name<<")"); + << ": No experience defined for monster #" + << id << " (" << name << ")"); monster->setExp(0); } ++nbMonsters; diff --git a/src/game-server/skillmanager.cpp b/src/game-server/skillmanager.cpp index ea29e585..48319198 100644 --- a/src/game-server/skillmanager.cpp +++ b/src/game-server/skillmanager.cpp @@ -48,6 +48,8 @@ void SkillManager::reload() // Note: The file is checked for UTF-8 BOM. char *data = ResourceManager::loadFile(skillReferenceFile, size, true); + std::string absPathFile = ResourceManager::resolve(skillReferenceFile); + if (!data) { LOG_ERROR("Item Manager: Could not find " << skillReferenceFile << "!"); free(data); @@ -60,20 +62,20 @@ void SkillManager::reload() if (!doc) { LOG_ERROR("Skill Manager: Error while parsing skill database (" - << skillReferenceFile << ")!"); + << absPathFile << ")!"); return; } xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "skills")) { - LOG_ERROR("Skill Manager: " << skillReferenceFile + LOG_ERROR("Skill Manager: " << absPathFile << " is not a valid database file!"); xmlFreeDoc(doc); return; } - LOG_INFO("Loading skill reference..."); + LOG_INFO("Loading skill reference: " << absPathFile); for_each_xml_child_node(setnode, node) { @@ -97,7 +99,7 @@ void SkillManager::reload() LOG_DEBUG("skill map:"); for (SkillMap::iterator i = skillMap.begin(); i != skillMap.end(); i++) { - LOG_DEBUG(" "<<i->first<<" : "<<i->second); + LOG_DEBUG(" " << i->first << " : " << i->second); } } diff --git a/src/game-server/statusmanager.cpp b/src/game-server/statusmanager.cpp index 173996dd..89621806 100644 --- a/src/game-server/statusmanager.cpp +++ b/src/game-server/statusmanager.cpp @@ -46,6 +46,8 @@ void StatusManager::reload() // Note: The file is checked for UTF-8 BOM. char *data = ResourceManager::loadFile(statusReferenceFile, size, true); + std::string absPathFile = ResourceManager::resolve(statusReferenceFile); + if (!data) { LOG_ERROR("Status Manager: Could not find " << statusReferenceFile << "!"); free(data); @@ -58,20 +60,20 @@ void StatusManager::reload() if (!doc) { LOG_ERROR("Status Manager: Error while parsing status database (" - << statusReferenceFile << ")!"); + << absPathFile << ")!"); return; } xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "status-effects")) { - LOG_ERROR("Status Manager: " << statusReferenceFile + LOG_ERROR("Status Manager: " << absPathFile << " is not a valid database file!"); xmlFreeDoc(doc); return; } - LOG_INFO("Loading status reference..."); + LOG_INFO("Loading status reference: " << absPathFile); for (node = node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlStrEqual(node->name, BAD_CAST "status-effect")) @@ -113,7 +115,8 @@ void StatusManager::reload() s->loadFile(filename.str()); statusEffect->setScript(s); } else { - LOG_WARN("Could not find script file \"" << filename.str() << "\" for status #"<<id); + LOG_WARN("Could not find script file \"" << filename.str() + << "\" for status #"<<id); } } statusEffects[id] = statusEffect; @@ -124,7 +127,8 @@ void StatusManager::reload() void StatusManager::deinitialize() { - for (StatusEffects::iterator i = statusEffects.begin(), i_end = statusEffects.end(); i != i_end; ++i) + for (StatusEffects::iterator i = statusEffects.begin(), + i_end = statusEffects.end(); i != i_end; ++i) { delete i->second; } |