mirror of
https://github.com/edubart/otclient.git
synced 2026-01-09 07:41:29 +01:00
rework log function and protocol
* remove some protocol ifdefs, replace with game features system
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user