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/botserv/badwords.cpp | 9 +++--- modules/botserv/kick.cpp | 67 ++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 39 deletions(-) (limited to 'modules/botserv') diff --git a/modules/botserv/badwords.cpp b/modules/botserv/badwords.cpp index 914e89ea9..754e202a7 100644 --- a/modules/botserv/badwords.cpp +++ b/modules/botserv/badwords.cpp @@ -24,13 +24,12 @@ class BadWordImpl : public BadWord { friend class BadWordsType; - ChanServ::Channel *channel = nullptr; - Anope::string word; - BadWordType type; + Serialize::Storage channel; + Serialize::Storage word; + Serialize::Storage type; public: - BadWordImpl(Serialize::TypeBase *type) : BadWord(type) { } - BadWordImpl(Serialize::TypeBase *type, Serialize::ID id) : BadWord(type, id) { } + using BadWord::BadWord; ChanServ::Channel *GetChannel() override; void SetChannel(ChanServ::Channel *c) override; diff --git a/modules/botserv/kick.cpp b/modules/botserv/kick.cpp index 4411ee4ed..20af77d1c 100644 --- a/modules/botserv/kick.cpp +++ b/modules/botserv/kick.cpp @@ -43,42 +43,41 @@ class KickerDataImpl : public KickerData { friend class KickerDataType; - ChanServ::Channel *channel = nullptr; - - bool amsgs = false, - badwords = false, - bolds = false, - caps = false, - colors = false, - flood = false, - italics = false, - repeat = false, - reverses = false, - underlines = false; - - int16_t ttb_bolds = 0, - ttb_colors = 0, - ttb_reverses = 0, - ttb_underlines = 0, - ttb_badwords = 0, - ttb_caps = 0, - ttb_flood = 0, - ttb_repeat = 0, - ttb_italics = 0, - ttb_amsgs = 0; - - int16_t capsmin = 0, - capspercent = 0, - floodlines = 0, - floodsecs = 0, - repeattimes = 0; - - bool dontkickops = false, - dontkickvoices = false; + Serialize::Storage channel; + + Serialize::Storage amsgs, + badwords, + bolds, + caps, + colors, + flood, + italics, + repeat, + reverses, + underlines; + + Serialize::Storage ttb_bolds, + ttb_colors, + ttb_reverses, + ttb_underlines, + ttb_badwords, + ttb_caps, + ttb_flood, + ttb_repeat, + ttb_italics, + ttb_amsgs; + + Serialize::Storage capsmin, + capspercent, + floodlines, + floodsecs, + repeattimes; + + Serialize::Storage dontkickops, + dontkickvoices; public: - KickerDataImpl(Serialize::TypeBase *type) : KickerData(type) { } - KickerDataImpl(Serialize::TypeBase *type, Serialize::ID id) : KickerData(type, id) { } + using KickerData::KickerData; ChanServ::Channel *GetChannel() override; void SetChannel(ChanServ::Channel *) override; -- cgit