mirror of
https://github.com/anope/anope.git
synced 2026-07-04 07:23:13 +02:00
Store flags for objects, also fixes bug #1333
This commit is contained in:
@@ -74,6 +74,7 @@ SerializableBase::serialized_data BotInfo::serialize()
|
||||
data["realname"] << this->realname;
|
||||
data["created"] << this->created;
|
||||
data["chancount"] << this->chancount;
|
||||
data["flags"] << this->ToString();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -85,6 +86,7 @@ void BotInfo::unserialize(SerializableBase::serialized_data &data)
|
||||
bi = new BotInfo(data["nick"].astr(), data["user"].astr(), data["host"].astr(), data["realname"].astr());
|
||||
data["created"] >> bi->created;
|
||||
data["chancount"] >> bi->chancount;
|
||||
bi->FromString(data["flags"].astr());
|
||||
}
|
||||
|
||||
void BotInfo::GenerateUID()
|
||||
|
||||
@@ -115,6 +115,7 @@ SerializableBase::serialized_data NickAlias::serialize()
|
||||
data["time_registered"].setType(Serialize::DT_INT) << this->time_registered;
|
||||
data["last_seen"].setType(Serialize::DT_INT) << this->last_seen;
|
||||
data["nc"] << this->nc->display;
|
||||
data["flags"] << this->ToString();
|
||||
|
||||
if (this->hostinfo.HasVhost())
|
||||
{
|
||||
@@ -140,6 +141,7 @@ void NickAlias::unserialize(SerializableBase::serialized_data &data)
|
||||
data["last_realhost"] >> na->last_realhost;
|
||||
data["time_registered"] >> na->time_registered;
|
||||
data["last_seen"] >> na->last_seen;
|
||||
na->FromString(data["flags"].astr());
|
||||
|
||||
time_t vhost_time;
|
||||
data["vhost_time"] >> vhost_time;
|
||||
|
||||
@@ -54,6 +54,7 @@ SerializableBase::serialized_data NickCore::serialize()
|
||||
data["email"] << this->email;
|
||||
data["greet"] << this->greet;
|
||||
data["language"] << this->language;
|
||||
data["flags"] << this->ToString();
|
||||
for (unsigned i = 0; i < this->access.size(); ++i)
|
||||
data["access"] << this->access[i] << " ";
|
||||
for (unsigned i = 0; i < this->cert.size(); ++i)
|
||||
@@ -72,6 +73,7 @@ void NickCore::unserialize(serialized_data &data)
|
||||
data["email"] >> nc->email;
|
||||
data["greet"] >> nc->greet;
|
||||
data["language"] >> nc->language;
|
||||
nc->FromString(data["flags"].astr());
|
||||
{
|
||||
Anope::string buf;
|
||||
data["access"] >> buf;
|
||||
|
||||
@@ -43,6 +43,7 @@ SerializableBase::serialized_data AutoKick::serialize()
|
||||
data["creator"] << this->creator;
|
||||
data["addtime"].setType(Serialize::DT_INT) << this->addtime;
|
||||
data["last_used"].setType(Serialize::DT_INT) << this->last_used;
|
||||
data["flags"] << this->ToString();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -57,6 +58,7 @@ void AutoKick::unserialize(SerializableBase::serialized_data &data)
|
||||
data["creator"] >> ak->creator;
|
||||
data["addtime"] >> ak->addtime;
|
||||
data["last_used"] >> ak->last_used;
|
||||
ak->FromString(data["flags"].astr());
|
||||
}
|
||||
|
||||
SerializableBase::serialized_data ModeLock::serialize()
|
||||
@@ -276,6 +278,7 @@ SerializableBase::serialized_data ChannelInfo::serialize()
|
||||
data["last_topic_setter"] << this->last_topic_setter;
|
||||
data["last_topic_time"].setType(Serialize::DT_INT) << this->last_topic_time;
|
||||
data["bantype"].setType(Serialize::DT_INT) << this->bantype;
|
||||
data["flags"] << this->ToString();
|
||||
data["botflags"] << this->botflags.ToString();
|
||||
{
|
||||
Anope::string levels_buffer;
|
||||
@@ -313,6 +316,7 @@ void ChannelInfo::unserialize(SerializableBase::serialized_data &data)
|
||||
data["last_topic_setter"] >> ci->last_topic_setter;
|
||||
data["last_topic_time"] >> ci->last_topic_time;
|
||||
data["bantype"] >> ci->bantype;
|
||||
ci->FromString(data["flags"].astr());
|
||||
ci->botflags.FromString(data["botflags"].astr());
|
||||
{
|
||||
std::vector<Anope::string> v = BuildStringVector(data["levels"].astr());
|
||||
|
||||
Reference in New Issue
Block a user