]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added '@' (WALLOPS) link token
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Apr 2004 11:49:14 +0000 (11:49 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Apr 2004 11:49:14 +0000 (11:49 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@561 e03df62e-2008-0410-955e-edbf42e46eb7

include/globals.h
include/inspircd.h
src/InspIRCd.layout
src/inspircd.cpp
src/modules.cpp

index 4f5e035e2e956cbc6e45b298a6e01b42e41af4a6..4087ab00cb5aace5b710b76bcca9fabb3221820a 100644 (file)
@@ -29,7 +29,7 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...);
 int common_channels(userrec *u, userrec *u2);
 void WriteCommon(userrec *u, char* text, ...);
 void WriteCommonExcept(userrec *u, char* text, ...);
-void WriteWallOps(userrec *source, char* text, ...);
+void WriteWallOps(userrec *source, bool local_only, char* text, ...);
 int isnick(const char *n);
 userrec* Find(std::string nick);
 chanrec* FindChan(const char* chan);
index 6da27ce3f12754eebeac26b8230dfedba10a157c..c81efb9927be8e5a9e47b5201d9d00384835f766 100644 (file)
@@ -91,7 +91,7 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...);
 int common_channels(userrec *u, userrec *u2);
 void WriteCommon(userrec *u, char* text, ...);
 void WriteCommonExcept(userrec *u, char* text, ...);
-void WriteWallOps(userrec *source, char* text, ...);
+void WriteWallOps(userrec *source, bool local_only, char* text, ...);
 int isnick(const char *n);
 userrec* Find(std::string nick);
 chanrec* FindChan(const char* chan);
index b2fd8089ad61374123e7af44f72a8d941f0a7011..d4d4bbaeca77da3e2c46f4d9d2a339f8990b06a2 100644 (file)
@@ -1,5 +1,5 @@
 [Editors]
-Focused=24
+Focused=-1
 Order=1,2,-1,4,6,3,7,25,5,24
 
 [Editor_0]
@@ -13,9 +13,9 @@ LeftChar=1
 [Editor_1]
 Open=1
 Top=0
-CursorCol=17
-CursorRow=6600
-TopLine=6573
+CursorCol=6
+CursorRow=952
+TopLine=952
 LeftChar=1
 
 [Editor_2]
@@ -37,9 +37,9 @@ LeftChar=1
 [Editor_4]
 Open=1
 Top=0
-CursorCol=57
-CursorRow=180
-TopLine=145
+CursorCol=26
+CursorRow=258
+TopLine=204
 LeftChar=1
 
 [Editor_5]
@@ -132,17 +132,17 @@ LeftChar=1
 
 [Editor_16]
 Open=1
-Top=0
-CursorCol=34
-CursorRow=29
+Top=1
+CursorCol=6
+CursorRow=32
 TopLine=1
 LeftChar=1
 
 [Editor_17]
 Open=1
 Top=0
-CursorCol=25
-CursorRow=115
+CursorCol=6
+CursorRow=94
 TopLine=62
 LeftChar=1
 
@@ -196,10 +196,10 @@ LeftChar=1
 
 [Editor_24]
 Open=1
-Top=1
-CursorCol=1
-CursorRow=220
-TopLine=212
+Top=0
+CursorCol=13
+CursorRow=83
+TopLine=56
 LeftChar=1
 [Editor_25]
 Open=1
index 607c79b83acee95641a53318d7936770bc4a6000..bd0198e5f30e647a10beea52900f4f6dd618f524 100644 (file)
@@ -949,7 +949,7 @@ void WriteMode(const char* modes, int flags, const char* text, ...)
        }
 }
 
-void WriteWallOps(userrec *source, char* text, ...)  
+void WriteWallOps(userrec *source, bool local_only, char* text, ...)  
 {  
        if ((!text) || (!source))
        {
@@ -969,11 +969,28 @@ void WriteWallOps(userrec *source, char* text, ...)
                if (i->second)
                {
                        if (strchr(i->second->modes,'w'))
-                       {  
+                       {
                                WriteTo(source,i->second,"WALLOPS %s",textbuffer);
                        }
                 }
        }
+
+       if (!local_only)
+       {
+               char buffer[MAXBUF];
+               snprintf(buffer,MAXBUF,"@ %s :%s",source->nick,textbuffer);
+               for (int j = 0; j < 255; j++)
+               {
+                       if (servers[j] != NULL)
+                       {
+                               if (strcmp(servers[j]->name,ServerName))
+                               {
+                                       me[defaultRoute]->SendPacket(buffer,servers[j]->internal_addr,servers[j]->internal_port,MyKey);
+                                       log(DEBUG,"Sent @ token");
+                               }
+                       }
+               }
+       }
 }  
 
 /* convert a string to lowercase. Note following special circumstances
@@ -3914,7 +3931,7 @@ void handle_kill(char **parameters, int pcnt, userrec *user)
                if (strcmp(ServerName,u->server))
                {
                        // remote kill
-                       WriteOpers("*** Remote kill: %s!%s@%s (%s)",user->nick,u->nick,u->ident,u->host,parameters[1]);
+                       WriteOpers("*** Remote kill by %s: %s!%s@%s (%s)",user->nick,u->nick,u->ident,u->host,parameters[1]);
                        sprintf(killreason,"[%s] Killed (%s (%s))",ServerName,user->nick,parameters[1]);
                        WriteCommonExcept(u,"QUIT :%s",killreason);
                        // K token must go to ALL servers!!!
@@ -4869,7 +4886,7 @@ void handle_who(char **parameters, int pcnt, userrec *user)
 
 void handle_wallops(char **parameters, int pcnt, userrec *user)
 {
-       WriteWallOps(user,"%s",parameters[0]);
+       WriteWallOps(user,false,"%s",parameters[0]);
 }
 
 void handle_list(char **parameters, int pcnt, userrec *user)
@@ -6280,9 +6297,9 @@ void handle_K(char token,char* params,serverrec* source,serverrec* reply, char*
        
        if ((user) && (u))
        {
-               WriteTo(user, u, "KILL %s :%s!%s!%s!%s (%s)", u->nick, ServerName, reply->name, user->dhost,user->nick,reason);
+               WriteTo(user, u, "KILL %s :%s!%s!%s!%s (%s)", u->nick, source->name, ServerName, user->dhost,user->nick,reason);
                WriteOpers("*** Remote kill from %s by %s: %s!%s@%s (%s)",source->name,user->nick,u->nick,u->ident,u->host,reason);
-               snprintf(kreason,MAXBUF,"[%s] Killed (%s (%s))",reply->name,user->nick,reason);
+               snprintf(kreason,MAXBUF,"[%s] Killed (%s (%s))",source->name,user->nick,reason);
                kill_link(u,kreason);
        }
 }
@@ -6355,6 +6372,19 @@ void handle_k(char token,char* params,serverrec* source,serverrec* reply, char*
        }
 }
 
+void handle_AT(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
+{
+       char* who = strtok(params," :");
+       char* text = strtok(NULL,"\r\n");
+       text++;
+       userrec* s = Find(who);
+       if (s)
+       {
+               WriteWallOps(s,true,text);
+       }
+}
+
+
 void handle_N(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
 {
        char* tm = strtok(params," ");
@@ -6555,11 +6585,16 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
                case 'Q':
                        handle_Q(token,params,source,reply,udp_host,udp_port);
                break;
-               // K <SOURCE> :<REASON>
+               // K <SOURCE> <DEST> :<REASON>
                // remote kill
                case 'K':
                        handle_K(token,params,source,reply,udp_host,udp_port);
                break;
+               // @ <SOURCE> :<TEXT>
+               // wallops
+               case '@':
+                       handle_AT(token,params,source,reply,udp_host,udp_port);
+               break;
                // F <TS>
                // end netburst
                case 'F':
index 548f6fdcb9841a7e234e493796a95b073ae44ce8..1ff2f3f9d572ebdea1b48cd403dc48f1ac85fdbd 100644 (file)
@@ -255,7 +255,7 @@ void Server::SendCommon(userrec* User, std::string text,bool IncludeSender)
 
 void Server::SendWallops(userrec* User, std::string text)
 {
-       WriteWallOps(User,"%s",text.c_str());
+       WriteWallOps(User,false,"%s",text.c_str());
 }
 
 bool Server::IsNick(std::string nick)