mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
backing up at OTBM loading, if someone can continue working on it until I'm available again, I would appreciate it much, here is current progress: http://pastebin.com/qEfC9ftv
This commit is contained in:
@@ -93,3 +93,14 @@ uint64 BinaryTree::getU64()
|
||||
m_pos += 8;
|
||||
return v;
|
||||
}
|
||||
|
||||
std::string BinaryTree::getString()
|
||||
{
|
||||
uint16 len = getU16();
|
||||
if (len == 0 || len > 8192)
|
||||
stdext::throw_exception("failed to get string from binary tree - invalid size read.");
|
||||
|
||||
std::string ret((char *)&m_buffer[m_pos], len);
|
||||
m_pos += len;
|
||||
return ret;
|
||||
}
|
||||
|
@@ -254,7 +254,7 @@ BinaryTreePtr FileStream::getBinaryTree()
|
||||
if(byte == BINARYTREE_NODE_START)
|
||||
root->unserialize(asFileStream());
|
||||
else
|
||||
stdext::throw_exception(stdext::format("failed to read node start (getFirstNode): %d", byte));
|
||||
stdext::throw_exception(stdext::format("failed to read node start (getBinaryTree): %d", byte));
|
||||
return root;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user