Item serialization: Write description & text

This commit is contained in:
Ahmed Samy 2013-12-27 12:59:50 +02:00
parent a6f998d406
commit 9adab5f9bf
1 changed files with 11 additions and 0 deletions

View File

@ -221,6 +221,17 @@ void Item::serializeItem(const OutputBinaryTreePtr& out)
out->addU16(uid);
}
std::string text = getText();
if(g_things.getItemType(m_serverId)->isWritable() && !text.empty()) {
out->addU8(ATTR_TEXT);
out->addString(text);
}
std::string desc = getDescription();
if(!desc.empty()) {
out->addU8(ATTR_DESC);
out->addString(desc);
}
out->endNode();
for(auto i : m_containerItems)
i->serializeItem(out);