summaryrefslogtreecommitdiffstats
path: root/src/game-server/statusmanager.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr>2010-05-28 16:58:26 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr>2010-05-28 16:58:26 +0200
commit32018c0b78bd5408ec5032ac5960a2b640ed89f9 (patch)
treec1eee55d5f6582db4cab94670d70e2bd69ae75dd /src/game-server/statusmanager.cpp
parent39b00578c249a3396bb03faa92bc9cccdcb1c68a (diff)
downloadmanaserv-32018c0b78bd5408ec5032ac5960a2b640ed89f9.tar.gz
manaserv-32018c0b78bd5408ec5032ac5960a2b640ed89f9.tar.xz
manaserv-32018c0b78bd5408ec5032ac5960a2b640ed89f9.zip
Added some more log infos, and made small cleanups.
Reviewed-by: Thorbjorn, Jaxad0127
Diffstat (limited to 'src/game-server/statusmanager.cpp')
-rw-r--r--src/game-server/statusmanager.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/game-server/statusmanager.cpp b/src/game-server/statusmanager.cpp
index 173996d..8962180 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;
}