summaryrefslogtreecommitdiff
path: root/modules/chanserv/main
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-12-01 09:25:53 -0500
committerAdam <Adam@anope.org>2016-12-01 09:25:53 -0500
commitca28f9cfcbff0fbdb2afe96f1427245f83db7c47 (patch)
treeac5de801a4db01a7cb689ec670537ad74c7c53e6 /modules/chanserv/main
parent2f512281029fbf4f7ef9832e05804831ad2d9ba2 (diff)
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
Diffstat (limited to 'modules/chanserv/main')
-rw-r--r--modules/chanserv/main/channel.h51
-rw-r--r--modules/chanserv/main/level.h9
-rw-r--r--modules/chanserv/main/mode.h7
3 files changed, 32 insertions, 35 deletions
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<NickServ::Account *> founder, successor;
+ Serialize::Storage<Anope::string> name, desc;
+ Serialize::Storage<time_t> time_registered, last_used;
+ Serialize::Storage<Anope::string> last_topic, last_topic_setter;
+ Serialize::Storage<time_t> last_topic_time;
+ Serialize::Storage<int16_t> bantype;
+ Serialize::Storage<time_t> banexpire;
+ Serialize::Storage<BotInfo *> bi;
+ Serialize::Storage<bool> greet;
+ Serialize::Storage<bool> fantasy;
+ Serialize::Storage<bool> noautoop;
+ Serialize::Storage<bool> peace;
+ Serialize::Storage<bool> securefounder;
+ Serialize::Storage<bool> restricted;
+ Serialize::Storage<bool> secure;
+ Serialize::Storage<bool> secureops;
+ Serialize::Storage<bool> signkick;
+ Serialize::Storage<bool> signkicklevel;
+ Serialize::Storage<bool> noexpire;
+ Serialize::Storage<bool> keepmodes;
+ Serialize::Storage<bool> persist;
+ Serialize::Storage<bool> topiclock;
+ Serialize::Storage<bool> keeptopic;
+ Serialize::Storage<bool> _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<ChanServ::Channel *> channel;
+ Serialize::Storage<Anope::string> name;
+ Serialize::Storage<int> 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<ChanServ::Channel *> channel;
+ Serialize::Storage<Anope::string> 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;