diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-31 14:44:33 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-31 14:44:33 +0000 |
commit | 8a01e21a489d8d2515679eaf6de9da20431953e9 (patch) | |
tree | 747eb5fe469d41e5110bf3cd3cb4fe42b540f004 | |
parent | ab9c1e46513ffd2b44fb30fbc0845e7474d1c5fa (diff) |
Send snotice after connecting to the network. Also change OnServerConnect to take Server*, not a name.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2227 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/modules.h | 4 | ||||
-rw-r--r-- | src/core/ss_main.c | 3 | ||||
-rw-r--r-- | src/servers.c | 13 |
3 files changed, 12 insertions, 8 deletions
diff --git a/include/modules.h b/include/modules.h index f0da30255..8b0144d85 100644 --- a/include/modules.h +++ b/include/modules.h @@ -506,9 +506,9 @@ class CoreExport Module virtual void OnUserConnect(User *u) { } /** Called when a new server connects to the network. - * @param sname The server name that is connecting + * @param s The server that has connected to the network */ - virtual void OnServerConnect(const std::string &sname) { } + virtual void OnServerConnect(Server *s) { } /** Called when anope saves databases. * NOTE: This event is deprecated pending new database handling. diff --git a/src/core/ss_main.c b/src/core/ss_main.c index c92ce5211..e4fb1df15 100644 --- a/src/core/ss_main.c +++ b/src/core/ss_main.c @@ -72,7 +72,8 @@ class SSMain : public Module } } - void OnServerConnect(const std::string &sname) + /** This hack is necessary to replace delayed loading, for now */ + void OnServerConnect(Server *) { statserv = findbot("StatServ"); if (!statserv) diff --git a/src/servers.c b/src/servers.c index e66c5be98..073891fad 100644 --- a/src/servers.c +++ b/src/servers.c @@ -161,10 +161,6 @@ Server *new_server(Server * server_uplink, const char *name, const char *desc, if ((server_uplink == me_server) && !(flags & SERVER_JUPED)) serv_uplink = serv; - /* Write the StartGlobal (to non-juped servers) */ - if (GlobalOnCycle && GlobalOnCycleUP && !(flags & SERVER_JUPED)) - notice_server(s_GlobalNoticer, serv, "%s", GlobalOnCycleUP); - return serv; } @@ -402,8 +398,15 @@ void do_server(const char *source, const char *servername, const char *hops, if (s == NULL) throw CoreException("Recieved a server from a nonexistant uplink?"); + /* Create a server structure. */ new_server(s, servername, descript, 0, numeric); - FOREACH_MOD(I_OnServerConnect, OnServerConnect(servername)); + + /* Announce services being online. */ + if (GlobalOnCycle && GlobalOnCycleUP) + notice_server(s_GlobalNoticer, serv, "%s", GlobalOnCycleUP); + + /* Let modules know about the connection */ + FOREACH_MOD(I_OnServerConnect, OnServerConnect(s)); } /*************************************************************************/ |