summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-28 13:20:11 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-28 13:20:11 +0000
commit5ee7322040d501fe55853453caa230f4550313c3 (patch)
tree6dd434c71f58dd03b2b912fa733aada4fb760f8d
parent95a8c258e2bc051e8605ee14d1643f3310221271 (diff)
Add a global fake client to class InspIRCd used instead of instantiating a fake client every time a mode needs to be forced through, etc
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7938 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/inspircd.h4
-rw-r--r--src/inspircd.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index aaa597acf..6d5f35eb2 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -342,6 +342,10 @@ class CoreExport InspIRCd : public classbase
*/
interfacelist Interfaces;
+ /** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1
+ */
+ userrec *FakeClient;
+
/** The current time, updated in the mainloop
*/
time_t TIME;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index bc968e87e..f39ba03bc 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -425,6 +425,10 @@ InspIRCd::InspIRCd(int argc, char** argv)
Exit(EXIT_STATUS_LOG);
}
+ /* set up fake client */
+ this->FakeClient = new userrec(this);
+ this->FakeClient->SetFd(FD_MAGIC_NUMBER);
+
this->stats = new serverstats();
this->Timers = new TimerManager(this);
this->Parser = new CommandParser(this);