From 81722ff786becb636b5f5d5d92fe51bdaab65589 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 30 Apr 2005 20:56:20 +0000 Subject: Tried a new way of doing remote versions commented some users and connections code added remote @* notice git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1269 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 2671de21b..2a15f265c 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -197,10 +197,6 @@ int portCount = 0, UDPportCount = 0, ports[MAXSOCKS]; int defaultRoute = 0; char ModPath[MAXBUF]; -connection C; - -long MyKey = C.GenKey(); - /* prototypes */ int has_channel(userrec *u, chanrec *c); @@ -947,6 +943,41 @@ void WriteOpers(char* text, ...) } } +void NoticeAllOpers(userrec *source, bool local_only, char* text, ...) +{ + if ((!text) || (!source)) + { + log(DEFAULT,"*** BUG *** NoticeAllOpers was given an invalid parameter"); + return; + } + + char textbuffer[MAXBUF]; + va_list argsPtr; + va_start (argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + for (std::vector::iterator i = all_opers.begin(); i != all_opers.end(); i++) + { + userrec* a = *i; + if ((a) && (a->fd != FD_MAGIC_NUMBER)) + { + if (strchr(a->modes,'s')) + { + // send server notices to all with +s + WriteServ(a->fd,"NOTICE %s :*** Notice From %s: %s",a->nick,source->nick,textbuffer); + } + } + } + + if (!local_only) + { + char buffer[MAXBUF]; + snprintf(buffer,MAXBUF,"V %s @* :%s",source->nick,textbuffer); + NetSendToAll(buffer); + } +} + // returns TRUE of any users on channel C occupy server 'servername'. bool ChanAnyOnThisServer(chanrec *c,char* servername) @@ -1181,7 +1212,7 @@ void NoticeAll(userrec *source, bool local_only, char* text, ...) { if ((!text) || (!source)) { - log(DEFAULT,"*** BUG *** WriteOpers was given an invalid parameter"); + log(DEFAULT,"*** BUG *** NoticeAll was given an invalid parameter"); return; } -- cgit v1.2.3