| 509 | } |
| 510 | |
| 511 | void ConfigObject::RestoreObject(const String& message, int attributeTypes) |
| 512 | { |
| 513 | Dictionary::Ptr persistentObject = JsonDecode(message, std::numeric_limits<size_t>::max()); |
| 514 | |
| 515 | String type = persistentObject->Get("type"); |
| 516 | String name = persistentObject->Get("name"); |
| 517 | |
| 518 | ConfigObject::Ptr object = GetObject(type, name); |
| 519 | |
| 520 | if (!object) |
| 521 | return; |
| 522 | |
| 523 | #ifdef I2_DEBUG |
| 524 | Log(LogDebug, "ConfigObject") |
| 525 | << "Restoring object '" << name << "' of type '" << type << "'."; |
| 526 | #endif /* I2_DEBUG */ |
| 527 | Dictionary::Ptr update = persistentObject->Get("update"); |
| 528 | Deserialize(object, update, false, attributeTypes); |
| 529 | object->OnStateLoaded(); |
| 530 | object->SetStateLoaded(true); |
| 531 | } |
| 532 | |
| 533 | void ConfigObject::RestoreObjects(const String& filename, int attributeTypes) |
| 534 | { |
nothing calls this directly
no test coverage detected