From ca28f9cfcbff0fbdb2afe96f1427245f83db7c47 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 1 Dec 2016 09:25:53 -0500 Subject: Allow objects to opt out of gc, don't gc accounts with users logged in Also store cached state with the field by using Serialize::Storage for field storage --- modules/chanserv/main/channel.h | 51 ++++++++++++++++++++--------------------- modules/chanserv/main/level.h | 9 ++++---- modules/chanserv/main/mode.h | 7 +++--- 3 files changed, 32 insertions(+), 35 deletions(-) (limited to 'modules/chanserv/main') diff --git a/modules/chanserv/main/channel.h b/modules/chanserv/main/channel.h index fd9a357eb..bb79df3c5 100644 --- a/modules/chanserv/main/channel.h +++ b/modules/chanserv/main/channel.h @@ -21,34 +21,33 @@ class ChannelImpl : public ChanServ::Channel { friend class ChannelType; - NickServ::Account *founder = nullptr, *successor = nullptr; - Anope::string name, desc; - time_t time_registered = 0, last_used = 0; - Anope::string last_topic, last_topic_setter; - time_t last_topic_time = 0; - int16_t bantype = 0; - time_t banexpire = 0; - BotInfo *bi = nullptr; - bool greet = false; - bool fantasy = false; - bool noautoop = false; - bool peace = false; - bool securefounder = false; - bool restricted = false; - bool secure = false; - bool secureops = false; - bool signkick = false; - bool signkicklevel = false; - bool noexpire = false; - bool keepmodes = false; - bool persist = false; - bool topiclock = false; - bool keeptopic = false; - bool _private = false; + Serialize::Storage founder, successor; + Serialize::Storage name, desc; + Serialize::Storage time_registered, last_used; + Serialize::Storage last_topic, last_topic_setter; + Serialize::Storage last_topic_time; + Serialize::Storage bantype; + Serialize::Storage banexpire; + Serialize::Storage bi; + Serialize::Storage greet; + Serialize::Storage fantasy; + Serialize::Storage noautoop; + Serialize::Storage peace; + Serialize::Storage securefounder; + Serialize::Storage restricted; + Serialize::Storage secure; + Serialize::Storage secureops; + Serialize::Storage signkick; + Serialize::Storage signkicklevel; + Serialize::Storage noexpire; + Serialize::Storage keepmodes; + Serialize::Storage persist; + Serialize::Storage topiclock; + Serialize::Storage keeptopic; + Serialize::Storage _private; public: - ChannelImpl(Serialize::TypeBase *type) : ChanServ::Channel(type) { } - ChannelImpl(Serialize::TypeBase *type, Serialize::ID id) : ChanServ::Channel(type, id) { } + using ChanServ::Channel::Channel; ~ChannelImpl(); void Delete() override; diff --git a/modules/chanserv/main/level.h b/modules/chanserv/main/level.h index d22dc2831..1da1b26b5 100644 --- a/modules/chanserv/main/level.h +++ b/modules/chanserv/main/level.h @@ -21,13 +21,12 @@ class LevelImpl : public ChanServ::Level { friend class LevelType; - ChanServ::Channel *channel = nullptr; - Anope::string name; - int level = 0; + Serialize::Storage channel; + Serialize::Storage name; + Serialize::Storage level; public: - LevelImpl(Serialize::TypeBase *type) : ChanServ::Level(type) { } - LevelImpl(Serialize::TypeBase *type, Serialize::ID id) : ChanServ::Level(type, id) { } + using ChanServ::Level::Level; ChanServ::Channel *GetChannel() override; void SetChannel(ChanServ::Channel *) override; diff --git a/modules/chanserv/main/mode.h b/modules/chanserv/main/mode.h index b56360a22..de3a0315d 100644 --- a/modules/chanserv/main/mode.h +++ b/modules/chanserv/main/mode.h @@ -21,12 +21,11 @@ class ModeImpl : public ChanServ::Mode { friend class CSModeType; - ChanServ::Channel *channel = nullptr; - Anope::string mode, param; + Serialize::Storage channel; + Serialize::Storage mode, param; public: - ModeImpl(Serialize::TypeBase *type) : ChanServ::Mode(type) { } - ModeImpl(Serialize::TypeBase *type, Serialize::ID id) : ChanServ::Mode(type, id) { } + using ChanServ::Mode::Mode; ChanServ::Channel *GetChannel() override; void SetChannel(ChanServ::Channel *) override; -- cgit