diff options
author | Adam <Adam@anope.org> | 2013-02-24 05:45:20 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-02-24 20:14:15 -0500 |
commit | 501503b7a5b80343c78354e3e4045528198edf80 (patch) | |
tree | 97f90091657d020148cca1483d03e740b9df9a80 | |
parent | a980e32581cc559b6ebe45f212a355e787eff2e7 (diff) |
On startup check all object types
-rw-r--r-- | include/serialize.h | 1 | ||||
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/serialize.cpp | 9 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/serialize.h b/include/serialize.h index 23c865688..a43046b1e 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -40,6 +40,7 @@ namespace Serialize }; extern void RegisterTypes(); + extern void CheckTypes(); class Type; template<typename T> class Checker; diff --git a/src/init.cpp b/src/init.cpp index 445995b46..a419c9f8d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -460,6 +460,8 @@ void Anope::Init(int ac, char **av) EventReturn MOD_RESULT; FOREACH_RESULT(I_OnLoadDatabase, OnLoadDatabase()); Log() << "Databases loaded"; + + Serialize::CheckTypes(); } /*************************************************************************/ diff --git a/src/serialize.cpp b/src/serialize.cpp index ee300a441..444cf79da 100644 --- a/src/serialize.cpp +++ b/src/serialize.cpp @@ -35,6 +35,15 @@ void Serialize::RegisterTypes() memo("Memo", Memo::Unserialize), xline("XLine", XLine::Unserialize); } +void Serialize::CheckTypes() +{ + for (std::map<Anope::string, Serialize::Type *>::const_iterator it = Serialize::Type::GetTypes().begin(), it_end = Serialize::Type::GetTypes().end(); it != it_end; ++it) + { + Serialize::Type *t = it->second; + t->Check(); + } +} + Serializable::Serializable(const Anope::string &serialize_type) : last_commit(0), last_commit_time(0), id(0) { if (SerializableItems == NULL) |