Item serialization: Write description & text
This commit is contained in:
parent
a6f998d406
commit
9adab5f9bf
|
@ -221,6 +221,17 @@ void Item::serializeItem(const OutputBinaryTreePtr& out)
|
||||||
out->addU16(uid);
|
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();
|
out->endNode();
|
||||||
for(auto i : m_containerItems)
|
for(auto i : m_containerItems)
|
||||||
i->serializeItem(out);
|
i->serializeItem(out);
|
||||||
|
|
Loading…
Reference in New Issue