- // Read id
- u8 buf[2];
- is.read((char*)buf, 2);
- s16 id = readS16(buf);
-
- // Read data
- std::string data = deSerializeString(is);
-
- // Find factory function
- core::map<u16, Factory>::Node *n;
- n = m_types.find(id);
- if(n == NULL)
- {
- // If factory is not found, just return.
- infostream<<"WARNING: NodeMetadata: No factory for typeId="
- <<id<<std::endl;
- return NULL;
- }
-
- // Try to load the metadata. If it fails, just return.
- try
- {
- std::istringstream iss(data, std::ios_base::binary);
-
- Factory f = n->getValue();
- NodeMetadata *meta = (*f)(iss, gamedef);
- return meta;
- }
- catch(SerializationError &e)
- {
- infostream<<"WARNING: NodeMetadata: ignoring SerializationError"<<std::endl;
- return NULL;
+ m_stringvars.clear();
+ int num_vars = readU32(is);
+ for(int i=0; i<num_vars; i++){
+ std::string name = deSerializeString(is);
+ std::string var = deSerializeLongString(is);
+ m_stringvars[name] = var;