]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Adjusted N token stuff
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 9 Apr 2004 16:56:28 +0000 (16:56 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 9 Apr 2004 16:56:28 +0000 (16:56 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@472 e03df62e-2008-0410-955e-edbf42e46eb7

src/InspIRCd.layout
src/inspircd.cpp

index 77ece5f58ed62faa2a3fc9f170100c47fa33ece8..0bc46b2c67e383d3365292db60ffe67fb558ffa8 100644 (file)
@@ -13,9 +13,9 @@ LeftChar=1
 [Editor_1]
 Open=1
 Top=1
-CursorCol=1
-CursorRow=4021
-TopLine=3955
+CursorCol=12
+CursorRow=5139
+TopLine=5093
 LeftChar=1
 
 [Editor_2]
index 02414ad07449ddad40c73ee7e14ad63a96d6cbac..60ae88f614e0ae644083d3aa6dfa09fbaf7bef74 100644 (file)
@@ -5096,6 +5096,50 @@ void DoSync(serverrec* serv, char* udp_host,int udp_port, long MyKey)
        serv->SendPacket(data,udp_host,udp_port,MyKey);
 }
 
+
+void handle_N(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
+{
+       log(DEBUG,"Sync: Received an 'N' packet, processing");
+       char* tm = strtok(params," ");
+       char* nick = strtok(params," ");
+       char* host = strtok(params," ");
+       char* dhost = strtok(params," ");
+       char* ident = strtok(params," ");
+       char* modes = strtok(params," ");
+       char* server = strtok(params," ");
+       char* gecos = strchr(params,':') + 1;
+       time_t TS = atoi(tm);
+       user_hash::iterator iter = clientlist.find(nick);
+       if (iter != clientlist.end())
+       {
+               // nick collision
+               // TODO: make this work!
+               WriteOpers("Nickname collision: %s@%s != %s@%s",nick,server,iter->second->nick,iter->second->server);
+               return;
+       }
+       clientlist[nick] = new userrec();
+       // remote users have an fd of -1. This is so that our Write abstraction
+       // routines know to route any messages to this record away to whatever server
+       // theyre on.
+       clientlist[nick]->fd = -1;
+       strncpy(clientlist[nick]->nick, nick,NICKMAX);
+       strncpy(clientlist[nick]->host, host,160);
+       strncpy(clientlist[nick]->dhost, dhost,160);
+       strncpy(clientlist[nick]->server, server,256);
+       strncpy(clientlist[nick]->ident, ident,10); // +1 char to compensate for '~'
+       clientlist[nick]->signon = TS;
+       clientlist[nick]->nping = 0; // this is ignored for a remote user anyway.
+       clientlist[nick]->lastping = 1;
+       clientlist[nick]->port = 0; // so is this...
+       clientlist[nick]->registered = 7; // this however we need to set for them to receive messages and appear online
+       clientlist[nick]->idle_lastmsg = time(NULL); // this will have to update as they pm us,
+                                        // so a user wont need /WHOIS <nick> <server> to find it
+                                        // but it may be slightly different over the net
+                                        // (a couple of seconds at most)
+       log(DEBUG,"Sync: Added %s",nick);
+}
+
+
 void process_restricted_commands(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
 {
        switch(token)
@@ -5107,82 +5151,31 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
                // N <TS> <NICK> <HOST> <DHOST> <IDENT> <MODES> <SERVER> :<GECOS>
                // introduce remote client
                case 'N':
-               {
-                       printf("Sync: Received an 'N' packet, processing");
-                       char* tm = strtok(params," ");
-                       char* nick = strtok(params," ");
-                       char* host = strtok(params," ");
-                       char* dhost = strtok(params," ");
-                       char* ident = strtok(params," ");
-                       char* modes = strtok(params," ");
-                       char* server = strtok(params," ");
-                       char* gecos = strchr(params,':') + 1;
-                       time_t TS = atoi(tm);
-                       user_hash::iterator iter = clientlist.find(nick);
-                       if (iter != clientlist.end())
-                       {
-                               // nick collision
-                               // TODO: make this work!
-                               WriteOpers("Nickname collision: %s@%s != %s@%s",nick,server,iter->second->nick,iter->second->server);
-                               return;
-                       }
-                       clientlist[nick] = new userrec();
-                       // remote users have an fd of -1. This is so that our Write abstraction
-                       // routines know to route any messages to this record away to whatever server
-                       // theyre on.
-                       clientlist[nick]->fd = -1;
-                       strncpy(clientlist[nick]->nick, nick,NICKMAX);
-                       strncpy(clientlist[nick]->host, host,160);
-                       strncpy(clientlist[nick]->dhost, dhost,160);
-                       strncpy(clientlist[nick]->server, server,256);
-                       strncpy(clientlist[nick]->ident, ident,10); // +1 char to compensate for '~'
-                       clientlist[nick]->signon = TS;
-                       clientlist[nick]->nping = 0; // this is ignored for a remote user anyway.
-                       clientlist[nick]->lastping = 1;
-                       clientlist[nick]->port = 0; // so is this...
-                       clientlist[nick]->registered = 7; // this however we need to set for them to receive messages and appear online
-                       clientlist[nick]->idle_lastmsg = time(NULL); // this will have to update as they pm us,
-                                                        // so a user wont need /WHOIS <nick> <server> to find it
-                                                        // but it may be slightly different over the net
-                                                        // (a couple of seconds at most)
-                       printf("Sync: Added %s",nick);
-               }
+                       process_N(token,params,source,reply,udp_host,udp_port);
                break;
                // J <NICK> :<CHANLIST>
                // Join user to channel list, merge channel permissions
                case 'J':
-               {
-               }
                break;
                // C <CHANNEL> <TS> <TOPICSETTER> :<MODES>
                // initialise channel (netburst only)
                case 'C':
-               {
-               }
                break;
                // T <TS> <CHANNEL> :<TOPIC>
                // change channel topic (netburst only)
                case 'T':
-               {
-               }
                break;
                // M <TS> <TARGET> <MODES> [MODE-PARAMETERS]
                // Set modes on an object
                case 'M':
-               {
-               }
                break;
                // F <TS>
                // end netburst
                case 'F':
-               {
-               }
                break;
                // anything else
                default:
-               {
                        WriteOpers("WARNING! Unknown datagram type '%c'",token);
-               }
                break;
        }
 }