From 6d57bbe05c31c79eaad02fe81cfb9c1ed6b79c58 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 13 Sep 2009 20:30:25 +0000 Subject: Change Extensible to use strongly typed entries git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11696 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 63de155b7..4940df24e 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -25,14 +25,18 @@ unsigned long uniq_id = 1; static unsigned long* already_sent = NULL; +LocalIntExt User::NICKForced("NICKForced", NULL); +LocalStringExt User::OperQuit("OperQuit", NULL); + +static bool dummy_init = Extensible::Register(&User::NICKForced) ^ Extensible::Register(&User::OperQuit); void InitializeAlreadySent(SocketEngine* SE) { + (void)dummy_init; already_sent = new unsigned long[SE->GetMaxFds()]; memset(already_sent, 0, SE->GetMaxFds() * sizeof(unsigned long)); } - std::string User::ProcessNoticeMasks(const char *sm) { bool adding = true, oldadding = false; @@ -1028,11 +1032,9 @@ bool User::ForceNickChange(const char* newnick) this->InvalidateCache(); - this->Extend("NICKForced"); - + NICKForced.set(this, 1); FIRST_MOD_RESULT(ServerInstance, OnUserPreNick, MOD_RESULT, (this, newnick)); - - this->Shrink("NICKForced"); + NICKForced.set(this, 0); if (MOD_RESULT == MOD_RES_DENY) { @@ -1046,9 +1048,9 @@ bool User::ForceNickChange(const char* newnick) { std::vector parameters; parameters.push_back(newnick); - this->Extend("NICKForced"); + NICKForced.set(this, 1); bool result = (ServerInstance->Parser->CallHandler("NICK", parameters, this) == CMD_SUCCESS); - this->Shrink("NICKForced"); + NICKForced.set(this, 0); return result; } -- cgit v1.2.3