diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-09 16:56:28 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-09 16:56:28 +0000 |
commit | 79b501744ab65ef6894fe5c187d7411f29019871 (patch) | |
tree | 35ca6de5ec7d53b45240b3b822bdc79f9fa66c09 /src | |
parent | d70c0c393f4109e2ab571f204a7dcba2ce37c305 (diff) |
Adjusted N token stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@472 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/InspIRCd.layout | 6 | ||||
-rw-r--r-- | src/inspircd.cpp | 97 |
2 files changed, 48 insertions, 55 deletions
diff --git a/src/InspIRCd.layout b/src/InspIRCd.layout index 77ece5f58..0bc46b2c6 100644 --- a/src/InspIRCd.layout +++ b/src/InspIRCd.layout @@ -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] diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 02414ad07..60ae88f61 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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; } } |