diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-30 20:56:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-30 20:56:20 +0000 |
commit | 81722ff786becb636b5f5d5d92fe51bdaab65589 (patch) | |
tree | 43af1426cc60af17d50a4dd4556a0c53769ed6cf /src/inspircd.cpp | |
parent | d190f6e7c22d0b246a90f60dbadb7f8f44f0d813 (diff) |
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
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 41 |
1 files changed, 36 insertions, 5 deletions
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<userrec*>::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; } |