rework log function and protocol

* remove some protocol ifdefs, replace with game features system
This commit is contained in:
Eduardo Bart
2012-05-28 19:04:44 -03:00
parent 4c80d783d6
commit c01b32b032
51 changed files with 391 additions and 280 deletions

View File

@@ -77,14 +77,14 @@ OTMLNodePtr OTMLNode::at(const std::string& childTag)
}
}
if(!res)
throw OTMLException(shared_from_this(), stdext::mkstr("child node with tag '", childTag, "' not found"));
throw OTMLException(shared_from_this(), stdext::format("child node with tag '%s' not found", childTag));
return res;
}
OTMLNodePtr OTMLNode::atIndex(int childIndex)
{
if(childIndex >= size() || childIndex < 0)
throw OTMLException(shared_from_this(), stdext::mkstr("child node with index '", childIndex, "' not found"));
throw OTMLException(shared_from_this(), stdext::mkstr("child node with index '%d' not found", childIndex));
return m_children[childIndex];
}

View File

@@ -108,7 +108,7 @@ template<typename T>
T OTMLNode::value() {
T ret;
if(!stdext::cast(m_value, ret))
throw OTMLException(shared_from_this(), stdext::mkstr("failed to cast node value to type '", stdext::demangle_type<T>(), "'"));
throw OTMLException(shared_from_this(), stdext::mkstr("failed to cast node value to type '%s'", stdext::demangle_type<T>()));
return ret;
}