Thread: [X2serv-cvs] [CVS] Module x2: Change committed
Brought to you by:
sirvulcan
From: Reed L. <r3...@us...> - 2003-06-13 03:04:06
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-13 03:04:02 UTC Modified files: source/chan.c source/parse.c source/parse.h source/send.c Log message: Started to work on getting X2 to work with u2.10.11+ on the new AfterNET IRCd. ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.85 x2/source/chan.c:1.86 --- x2/source/chan.c:1.85 Sat May 17 20:43:45 2003 +++ x2/source/chan.c Thu Jun 12 20:03:49 2003 @@ -976,7 +976,7 @@ if(hptr && !strcmp(crypt("*",hptr->Pass), hptr->Pass)) { send_to_user(UserNode, "This version of X2 requires that all users have passwords set."); - send_to_user(UserNode, "Please set your password. T ype: /msg %s %s PASS * yournewpass", IrcNick, ChanNode->Name); + send_to_user(UserNode, "Please set your password. Type: /msg %s %s PASS * yournewpass", IrcNick, ChanNode->Name); } /* If they are (co)owner, mark that one has joined. */ Index: x2/source/parse.c diff -u x2/source/parse.c:1.77 x2/source/parse.c:1.78 --- x2/source/parse.c:1.77 Sat May 17 20:43:45 2003 +++ x2/source/parse.c Thu Jun 12 20:03:50 2003 @@ -48,47 +48,47 @@ int usercmd; } server_commands[] = { -/* Command function servers users .. */ - { "END_OF_BURST", m_eob, TRUE, FALSE }, - { "EOB_ACK", m_noop, TRUE, FALSE }, - { "DESYNCH", m_desynch, TRUE, FALSE }, - { "PING", m_ping, TRUE, FALSE }, - { "PONG", m_pong, TRUE, TRUE }, - { "PRIVMSG", m_privmsg, FALSE, TRUE }, - { "WC", m_noop, TRUE, TRUE }, - { "SERVER", m_server, TRUE, FALSE }, - { "BURST", m_burst, TRUE, FALSE }, +/* Command function servers users .. */ + { "EB", m_eob, TRUE, FALSE }, + { "EA", m_noop, TRUE, FALSE }, + { "DS", m_desynch, TRUE, FALSE }, + { "G", m_ping, TRUE, FALSE }, + { "Z", m_pong, TRUE, TRUE }, + { "P", m_privmsg, FALSE, TRUE }, + { "WC", m_noop, TRUE, TRUE }, + { "S", m_server, TRUE, FALSE }, + { "B", m_burst, TRUE, FALSE }, // wtf?? -// { "NOTICE", m_ping, TRUE, TRUE }, - { "NICK", m_nick, TRUE, TRUE }, - { "CREATE", m_create, FALSE, TRUE }, - { "JOIN", m_join, FALSE, TRUE }, - { "PART", m_part, FALSE, TRUE }, - { "MODE", m_mode, TRUE, TRUE }, - { "INVITE", m_noop, TRUE, TRUE }, - { "AWAY", m_away, FALSE, TRUE }, - { "WHOIS", m_whois, FALSE, TRUE }, - { "GLINE", m_gline, TRUE, TRUE }, - { "KICK", m_kick, TRUE, TRUE }, - { "QUIT", m_quit, FALSE, TRUE }, - { "KILL", m_kill, TRUE, TRUE }, - { "SQUIT", m_squit, TRUE, TRUE }, - { "TOPIC", m_noop , TRUE, TRUE }, - { "NOTICE", m_notice, TRUE, TRUE }, - { "INFO", m_noop, TRUE, TRUE }, - { "ADMIN", m_noop, TRUE, TRUE }, - { "CONNECT", m_noop, TRUE, TRUE }, - { "TIME", m_noop, TRUE, TRUE }, - { "TRACE", m_noop, TRUE, TRUE }, - { "MOTD", m_noop, TRUE, TRUE }, - { "RPING", m_noop, TRUE, TRUE }, - { "SILENCE", m_noop, TRUE, TRUE }, - { "UPING", m_noop, TRUE, TRUE }, - { "VERSION", m_noop, TRUE, TRUE }, - { "WALLOPS", m_noop, TRUE, TRUE }, - { "STATS", m_noop, TRUE, TRUE }, - { "SETTIME", m_settime, TRUE, FALSE }, - { NULL, NULL, FALSE, FALSE } +// { "O", m_ping, TRUE, TRUE }, + { "N", m_nick, TRUE, TRUE }, + { "C", m_create, FALSE, TRUE }, + { "J", m_join, FALSE, TRUE }, + { "L", m_part, FALSE, TRUE }, + { "M", m_mode, TRUE, TRUE }, + { "I", m_noop, TRUE, TRUE }, + { "A", m_away, FALSE, TRUE }, + { "W", m_whois, FALSE, TRUE }, + { "GL", m_gline, TRUE, TRUE }, + { "K", m_kick, TRUE, TRUE }, + { "Q", m_quit, FALSE, TRUE }, + { "D", m_kill, TRUE, TRUE }, + { "SQ", m_squit, TRUE, TRUE }, + { "T", m_noop, TRUE, TRUE }, + { "O", m_notice, TRUE, TRUE }, + { "F", m_noop, TRUE, TRUE }, + { "AD", m_noop, TRUE, TRUE }, + { "CO", m_noop, TRUE, TRUE }, + { "TI", m_noop, TRUE, TRUE }, + { "TR", m_noop, TRUE, TRUE }, + { "MO", m_noop, TRUE, TRUE }, + { "RI", m_noop, TRUE, TRUE }, + { "U", m_noop, TRUE, TRUE }, + { "UP", m_noop, TRUE, TRUE }, + { "V", m_noop, TRUE, TRUE }, + { "WA", m_noop, TRUE, TRUE }, + { "R", m_noop, TRUE, TRUE }, + { "SE", m_settime, TRUE, FALSE }, + { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ Index: x2/source/parse.h diff -u x2/source/parse.h:1.10 x2/source/parse.h:1.11 --- x2/source/parse.h:1.10 Tue Apr 24 23:05:40 2001 +++ x2/source/parse.h Thu Jun 12 20:03:51 2003 @@ -1,7 +1,7 @@ int ProcessCommand(UserListType from, char *to, char *rest); int ProcessCTCP(UserListType from, char *to, char *rest); int ReadSocket(int TheSocket, char *Buffer); -/* m_fuctions */ +/* m_functions */ #define M_PARAMS ServerListType sptr, UserListType uptr, char* rest #define M_PARAMS_CALL sptr, uptr, rest Index: x2/source/send.c diff -u x2/source/send.c:1.34 x2/source/send.c:1.35 --- x2/source/send.c:1.34 Wed Feb 27 03:54:46 2002 +++ x2/source/send.c Thu Jun 12 20:03:51 2003 @@ -59,7 +59,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("PRIVMSG %s :%s", to, buff); + send_command_from_nick("P %s :%s", to, buff); } void send_notice(char *to, char *rest, ...) @@ -70,7 +70,7 @@ va_start(args, rest); vsprintf(buff, rest, args); va_end(args); - send_command_from_nick("NOTICE %s :%s", to, buff); + send_command_from_nick("O %s :%s", to, buff); } void send_to_channel(ChannelListType cptr, char *sendtext,...) @@ -119,7 +119,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("WALLOPS :%s", buff); + send_command_from_nick("WA :%s", buff); } void send_kick(ChannelListType cptr, UserListType uptr, char *format, ...) @@ -131,7 +131,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("KICK %s %s :%s", cptr->Name, uptr->Numnick, buff); + send_command_from_nick("K %s %s :%s", cptr->Name, uptr->Numnick, buff); ProcessPart(cptr, uptr); } @@ -141,7 +141,7 @@ * returns the status, not our uplink. This is important * for getting good away status. */ - send_command_from_nick("WHOIS %c :%s", uptr->Numnick[0], uptr->Nick); + send_command_from_nick("W %c :%s", uptr->Numnick[0], uptr->Nick); } void send_chanmode(ChannelListType cptr, char *format, ...) @@ -153,28 +153,28 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("MODE %s %s", cptr->Name, buff); + send_command_from_nick("M %s %s", cptr->Name, buff); } /* A simpler mode for all the stuff in chan.c */ void send_op(ChannelListType cptr, UserListType uptr) { - send_command_from_nick("MODE %s +o %s", cptr->Name, uptr->Numnick); + send_command_from_nick("M %s +o %s", cptr->Name, uptr->Numnick); } void send_deop(ChannelListType cptr, UserListType uptr) { - send_command_from_nick("MODE %s -o %s", cptr->Name, uptr->Numnick); + send_command_from_nick("M %s -o %s", cptr->Name, uptr->Numnick); } void send_voice(ChannelListType cptr, UserListType uptr) { - send_command_from_nick("MODE %s +v %s", cptr->Name, uptr->Numnick); + send_command_from_nick("M %s +v %s", cptr->Name, uptr->Numnick); } void send_devoice(ChannelListType cptr, UserListType uptr) { - send_command_from_nick("MODE %s -v %s", cptr->Name, uptr->Numnick); + send_command_from_nick("M %s -v %s", cptr->Name, uptr->Numnick); } void send_usermode(char *format, ...) @@ -186,7 +186,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("MODE %s %s", NumNick, buff); + send_command_from_nick("M %s %s", NumNick, buff); } void send_wallchops(ChannelListType cptr, char *format, ...) @@ -198,7 +198,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("WALLCHOPS %s :%s", cptr->Name, buff); + send_command_from_nick("WC %s :%s", cptr->Name, buff); } void send_kill(UserListType uptr, char *format, ...) @@ -210,7 +210,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("KILL %s :%s", uptr->Numnick, buff); + send_command_from_nick("D %s :%s", uptr->Numnick, buff); } void send_gline(char *mask, time_t duration, char *format, ...) @@ -222,7 +222,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("GLINE * +%s %lu :%s", mask, duration, buff); + send_command_from_server("GL * +%s %lu :%s", mask, duration, buff); } void send_gline_to_server(char num, char *mask, time_t duration, char *format, ...) @@ -234,22 +234,22 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("GLINE %c +%s %lu :%s", num, mask, duration, buff); + send_command_from_server("GL %c +%s %lu :%s", num, mask, duration, buff); } void send_ungline(char *mask) { - send_command_from_server("GLINE * -%s", mask); + send_command_from_server("GL * -%s", mask); } void send_settime(time_t thetime) { - send_command_from_server("SETTIME %lu :%s", thetime, ServiceName); + send_command_from_server("SE %lu :%s", thetime, ServiceName); } void send_opchan(ChannelListType cptr) { - send_command_from_server("MODE %s +o %s 0", cptr->Name, NumNick); + send_command_from_server("M %s +o %s 0", cptr->Name, NumNick); } void send_hackmode(ChannelListType cptr, char *format, ...) @@ -261,7 +261,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("MODE %s %s %lu", cptr->Name, buff, 0); + send_command_from_server("M %s %s %lu", cptr->Name, buff, 0); } void send_join(ChannelListType cptr) @@ -271,7 +271,7 @@ else { /* Services CAN join +kibl channels without worry */ cptr->NumOfNicks++; - send_command_from_nick("JOIN %s", cptr->Name); + send_command_from_nick("J %s", cptr->Name); } } @@ -281,7 +281,7 @@ if (cptr->NumOfNicks == 0) cptr->CreationDate = Timestamp; cptr->NumOfNicks++; - send_command_from_nick("CREATE %s %lu", cptr->Name, Timestamp); + send_command_from_nick("C %s %lu", cptr->Name, Timestamp); } void send_part(ChannelListType cptr, char *format, ...) @@ -294,18 +294,18 @@ va_end(args); cptr->NumOfNicks--; - send_command_from_nick("PART %s :%s", cptr->Name, buff); + send_command_from_nick("L %s :%s", cptr->Name, buff); } void send_topic(ChannelListType cptr, char *topic) { /* Never really need %s formatting in topic */ - send_command_from_nick("TOPIC %s :%s", cptr->Name, topic); + send_command_from_nick("T %s :%s", cptr->Name, topic); } void send_invite(ChannelListType cptr, UserListType uptr) { - send_command_from_nick("INVITE %s :%s", uptr->Nick, cptr->Name); + send_command_from_nick("I %s :%s", uptr->Nick, cptr->Name); } void send_quit(char *format, ...) @@ -317,7 +317,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_nick("QUIT :%s", buff); + send_command_from_nick("Q :%s", buff); } void send_squit(char* who, char *format, ...) @@ -329,12 +329,12 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("SQUIT %s %s :%s", who, ServiceName, buff); + send_command_from_server("SQ %s %s :%s", who, ServiceName, buff); } void send_connect(char *servertoconnect, int port, ServerListType target) { - send_command_from_nick("CONNECT %s %d :%c", servertoconnect, port, target->numnick); + send_command_from_nick("CO %s %d :%c", servertoconnect, port, target->numnick); } void send_spoofserv(char *servname, int Numeric, char *format, ...) @@ -347,7 +347,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("SERVER %s 1 9999999999 9999999999 P10 %cD] 0 :%s", + send_command_from_server("S %s 1 9999999999 9999999999 P10 %cD] 0 :%s", servname, NumChar, buff); } @@ -365,12 +365,12 @@ void send_serverping(char *who) { - send_command_from_server("PING %s :%s", ServiceName, who); + send_command_from_server("G %s :%s", ServiceName, who); } void send_serverpong(char *who) { - send_command_from_server("PONG %s :%s", ServiceName, who); + send_command_from_server("Z %s :%s", ServiceName, who); } /* CTCPs */ @@ -427,12 +427,12 @@ void send_eob() { - send_command_from_server("END_OF_BURST"); + send_command_from_server("EB"); } void send_eob_ack() { - send_command_from_server("EOB_ACK"); + send_command_from_server("EA"); } void Authenticate(UpLinkList *UpLinkPtr) @@ -451,7 +451,7 @@ convert2y[ServiceNumeric], "X2 Channel Service"); /* <server> NICK <nick> <hops> <timestamp> <user> <host> <compressed ip> <3 letter numeric> :<username> */ - sendtosock(Sock, "%c NICK %s 1 %lu %s %s +%s %s %c%s :\002%c\002) /MSG %s Help (\002%c\002", + sendtosock(Sock, "%c N %s 1 %lu %s %s +%s %s %c%s :\002%c\002) /MSG %s Help (\002%c\002", convert2y[ServiceNumeric], IrcNick, LinkTimeStamp, IrcNick, /* user */ ServiceName, /* host */ @@ -471,7 +471,7 @@ */ void send_preauth_pong(char *arg) { - sendtosock(Sock, "PONG :%s", arg); /* Needs the : */ + sendtosock(Sock, "Z :%s", arg); /* Needs the : */ } void ModeChans() @@ -487,7 +487,7 @@ { if(TempChanPtr->settings[INCHAN]) { - sendtosock(Sock, ":%s MODE %s %s", IrcNick, TempChanPtr->Name, + sendtosock(Sock, ":%s M %s %s", IrcNick, TempChanPtr->Name, GetModeString(ModeString, TempChanPtr->PlusModes, TempChanPtr->MinModes, TempChanPtr->Key, TempChanPtr->Limit)); @@ -495,7 +495,7 @@ if(TempChanPtr->settings[INCHAN]) { if (strcmp(TempChanPtr->Topic, "*") && (TempChanPtr->settings[TOPICFREQ] > 0)) - sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, + sendtosock(Sock, ":%s T %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); } TempChanPtr = TempChanPtr->Next; @@ -519,7 +519,7 @@ if(TempChanPtr->settings[INCHAN]) { send_opchan(TempChanPtr); - sendtosock(Sock, ":%s MODE %s +o %s %lu", + sendtosock(Sock, ":%s M %s +o %s %lu", ServiceName, TempChanPtr->Name, IrcNick, BURSTCHANNELDATE); } @@ -541,7 +541,7 @@ if(TempChanPtr->settings[INCHAN]) { TempChanPtr->NumOfNicks++; /* Note that we joined the channel */ - sendtosock(Sock, "%c BURST %s %lu %s:o", + sendtosock(Sock, "%c B %s %lu %s:o", convert2y[ServiceNumeric], /* servers numnick */ TempChanPtr->Name, /* #channel */ TempChanPtr->CreationDate, /* Hopefully already set by other side BURST */ @@ -567,14 +567,10 @@ while (TempChanPtr) { if(TempChanPtr->settings[TOPICFREQ] && strcmp(TempChanPtr->Topic, "*")) - sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); + sendtosock(Sock, ":%s T %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); TempChanPtr = TempChanPtr->Next; } } } } - - - - ----------------------- End of diff ----------------------- |
From: Matthias C. <ul...@us...> - 2003-06-14 13:16:19
|
Committer : Matthias Crauwels <ul...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-14 13:16:18 UTC Modified files: source/config.h source/main.c source/misc.c source/parse.c source/send.c source/server.c source/server.h Log message: Author: Matthias Crauwels <ult...@wo...> Log message: * Added Extended-numerics support ( this service will now only link to ircu2.10.08 or above!! ) * Added 'Account' handler ---------------------- diff included ---------------------- Index: x2/source/config.h diff -u x2/source/config.h:1.72 x2/source/config.h:1.73 --- x2/source/config.h:1.72 Sat May 17 21:04:09 2003 +++ x2/source/config.h Sat Jun 14 06:16:05 2003 @@ -21,9 +21,11 @@ /* If there are problems and you want all X2 output to go to x2.debug, define * this. Note that it gets very big, very fast... + * * #define LOGALLDEBUG */ + /* This is the CTCP character. (^A) */ #define CTCP '\001' @@ -65,8 +67,9 @@ #define GATEURL "http://www.afternet.org/support/proxy.html" /* Uncomment the following for debugging. - #define debugon -*/ + * + * #define debugon + */ /* Older afternet ircu had a mode (+g) added that made * IRC Ops able to override X2 security (God mode) @@ -145,7 +148,7 @@ #define OPERSEGSIZE 401 #define SERVNAMESEGSIZE 21 #define NETCHANMAXSIZE 21 -#define MAXNUMNICKNUM 65 +#define MAXNUMNICKNUM 4096 #define MAXLOGINLEN 10 /* This is the max # of lines of accounting.log @@ -167,7 +170,9 @@ * The default is 9. AfterNET runs 30. */ #define MAXNICKLEN 31 #define MAXCIDLEN 10 /* TS4 Connection ID (no idea whats reasonable). */ -#define NUMNICKLEN 4 /* 1 char (server number) + 2 char (user number) + '\0' */ +#define SERVNUMLEN 3 /* 2 char (server number) + '\0' */ +#define NUMNICKLEN 6 /* 2 char (server number) + 3 char (user number) + '\0' */ +#define NUMNICKMASK 63 /* (NUMNICKBASE-1) */ #define PASSWORDLEN 16 /* we're now using md5 for encryption, so MUCH longer passwords can be used. */ /* I do believe that 16 should be long enough for everyone, though (: */ #define MAXPASS 200 /* No longer used for ban reason. Shrinking... */ @@ -552,7 +557,7 @@ char *Name; char *LinkName; char *Description; - char numnick; + char numnick[SERVNUMLEN]; int NumOfUsers; int Deleted; struct ServStruct *NextA; /* jump by nAme */ @@ -649,6 +654,7 @@ extern int ServiceNumeric; extern char NumNick[NUMNICKLEN]; +extern char ServNum[SERVNUMLEN]; extern u_short Port, SERVERPORT; extern int Sock, NewSock; Index: x2/source/main.c diff -u x2/source/main.c:1.59 x2/source/main.c:1.60 --- x2/source/main.c:1.59 Sat May 17 20:43:45 2003 +++ x2/source/main.c Sat Jun 14 06:16:05 2003 @@ -44,7 +44,8 @@ IrcNick[MAXNICKLEN] = "X2", CommandMark = '.', HomeDir[2048]="", AccessLog[2048]=""; int ServiceNumeric = 53; -char NumNick[NUMNICKLEN] = "1X2"; +char ServNum[SERVNUMLEN] = "A1"; +char NumNick[NUMNICKLEN] = "A1AAA"; u_short Port, SERVERPORT; int Sock, NewSock; @@ -189,13 +190,15 @@ fscanf(ConfFile, "%s", StrBuffr); - /* Numeric must be 0-63 */ - if ( (i = atol(StrBuffr)) & ~(64-1) ) { + /* Numeric must be 0-4095 */ + if ( (i = atol(StrBuffr)) & ~(4096-1) ) { printf("Invalid numeric (%d) in NUMERIC line. \n", i); exit(1); } - NumNick[0] = convert2y[i]; + inttobase64(ServNum, i, 2); + strcpy(NumNick, ServNum); + strcat(NumNick, "AAA"); ServiceNumeric = i; } else if (!strcmp(StrBuffr, "PASSWORD")) Index: x2/source/misc.c diff -u x2/source/misc.c:1.48 x2/source/misc.c:1.49 --- x2/source/misc.c:1.48 Sat May 17 20:43:45 2003 +++ x2/source/misc.c Sat Jun 14 06:16:05 2003 @@ -131,6 +131,17 @@ return i; } +/* taken from ircu2.10.05 */ +const char* inttobase64(char* buf, unsigned int v, unsigned int count) +{ + buf[count] = '\0'; + while (count > 0) { + buf[--count] = convert2y[(v & NUMNICKMASK)]; + v >>= NUMNICKLOG; + } + return buf; +} + char *NickToNum(char *nick) { Index: x2/source/parse.c diff -u x2/source/parse.c:1.78 x2/source/parse.c:1.79 --- x2/source/parse.c:1.78 Thu Jun 12 20:03:50 2003 +++ x2/source/parse.c Sat Jun 14 06:16:06 2003 @@ -88,6 +88,7 @@ { "WA", m_noop, TRUE, TRUE }, { "R", m_noop, TRUE, TRUE }, { "SE", m_settime, TRUE, FALSE }, + { "AC", m_noop, TRUE, FALSE }, /* this won't be used in this service */ { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ @@ -124,7 +125,7 @@ { return(0); /* Msg to channel */ } - else if(to[0] == convert2y[ServiceNumeric]) + else if(strcmp(to, NumNick) == 0) { Debug(DBGINFO, "m_privmsg() %s(%s) sent privmsg to %s [%s]", uptr->Nick, uptr->Numnick, to, rest); /* Check for CTCP */ @@ -186,10 +187,7 @@ sprintf(CSHOST, "%s@%s", IrcNick, ServiceName); if(!strcasecmp(to, CSHOST)) - { - strcpy(to, "?X2"); - to[0] = convert2y[ServiceNumeric]; - } + strcpy(to, NumNick); if(to[0] == '#') { if(rest[0] == CommandMark) @@ -197,7 +195,7 @@ ProcessCommand(uptr, to, rest); } } - else if(to[0] == convert2y[ServiceNumeric]) + else if(strcmp(to, NumNick) == 0) { Debug(DBGINFO, "m_privmsg() %s(%s) sent privmsg to %s [%s]", uptr->Nick, uptr->Numnick, to, rest); /* Check for CTCP */ @@ -224,6 +222,9 @@ int m_server(M_PARAMS) { char* Arg[8]; + char numnick[SERVNUMLEN]; + int i; + Arg[0] = (char *) strtok(rest, " "); /* Name */ Arg[1] = (char *) strtok(NULL, " "); /* hopes */ Arg[2] = (char *) strtok(NULL, " "); /* ts 1 */ @@ -238,7 +239,11 @@ Debug(DBGWARNING, "Incorrect syntax in SERVER line"); return(0); } - AddServer(Arg[0], sptr->Name, Arg[5][0]); + + for(i = 0; i < SERVNUMLEN - 1; i++) + numnick[i] = Arg[5][i]; + + AddServer(Arg[0], sptr->Name, numnick); return (0); } /* E.G.: @@ -370,7 +375,7 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes; + char* modes, *account; UserListType UserPtr; unsigned int IP; Arg[0] = (char *) strtok(rest, " "); /* nick */ @@ -393,8 +398,17 @@ modes = (char *) strtok(NULL, " "); /* modes */ if(modes[0] == '+') { - Arg[5] = modes; - Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ + if(strchr(modes, 'r')) + { + Arg[5] = modes; + account = (char *) strtok(NULL, " "); /* This user has an account set from another service */ + Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ + } + else + { + Arg[5] = modes; + Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ + } } else { @@ -1383,8 +1397,8 @@ char *Arg[MAXLEN]; static char RemotePass[MAXPASS]; /* should be this or just '10'? */ - Arg[0] = (char *) strtok(LineBuff, " "); - Arg[1] = (char *) strtok(NULL, " "); + Arg[0] = (char *) strtok(LineBuff, " "); /* sender numeric */ + Arg[1] = (char *) strtok(NULL, " "); if(!strcmp(Arg[0], "PING")) { /* Respond with a ping reply */ @@ -1410,8 +1424,9 @@ { /* Beginning of burst. validate password and name, authenticate and send our burst * if we were listning for the link */ UpLinkList *UpLinkPtr; - char Numnick[NUMNICKLEN]; - + char numnick[SERVNUMLEN]; + int i; + Debug(DBGNOTICE, "Got SERVER line from uplink. Processing."); Arg[2] = (char *) strtok(NULL, " "); /* Hops */ Arg[3] = (char *) strtok(NULL, " "); /* TS #1 */ @@ -1426,7 +1441,7 @@ return; } Debug(DBGINFO, "PROTOCOL: %s", Arg[5]); - if(strcmp(Arg[5], "J10")) /* If Arg[5] is not "J10" then.. */ + if(strcmp(Arg[5], "J10")) /* If Arg5] is not "J10" then.. */ { Debug(DBGWARNING, "UNKNOWN protocol. This is NOT a compatable irc daemon."); Debug(DBGWARNING, "Currently X2 works with the following irc servers:"); @@ -1452,8 +1467,11 @@ #endif return; } - Debug(DBGINFO, "Adding server %s %s %c", Arg[1], ServiceName, Arg[6][0]); - AddServer(Arg[1], ServiceName, Arg[6][0]); + + for(i = 0; i < SERVNUMLEN - 1; i++) + numnick[i] = Arg[6][i]; + Debug(DBGINFO, "Adding server %s %s %s", Arg[1], ServiceName, numnick); + AddServer(Arg[1], ServiceName, numnick); NETBURSTING = TRUE; /* Ignore incomming users for a while*/ REMOTE_AUTHENTICATED = TRUE; /* Stop parsing PASS/SERVER etc */ bantimer = time(NULL); /* Start ban timer over */ @@ -1470,9 +1488,7 @@ } } - strcpy(Numnick, "?X2"); - Numnick[0] = convert2y[ServiceNumeric]; /* Server numnick is first letter of user numnick */ - AddUser(Numnick, IrcNick, IrcNick, "X2", ServiceName, + AddUser(NumNick, IrcNick, IrcNick, "X2", ServiceName, LOCALIP, ServiceName, (UMODEk & UMODEo)); ProcessUserMode(FindNick(IrcNick, UsersN), "+kows"); @@ -1508,58 +1524,22 @@ UserListType UserPtr = NULL; ServerListType ServerPtr = NULL; int i; - /* prefix hack is because when sending numerics you have to parse the - * target differently, depending if its sent as <numnick> or :server. - * if prefix_hack is 1, it was sent as :server, and numeric target - * must be nick. Otherwise, prefix_hack is 0, and prefix was a proper - * prefix and target is a numnick. (ircu2.10.08 sends :server) - */ - int prefix_hack = 0; Sender = (char *) strtok(LineBuff, " "); - if(Sender[0] == ':') - { - prefix_hack++; /* See above comment */ - Sender++; - if(!(ServerPtr = GetServer(Sender))) - { - if(!(UserPtr = FindNick(Sender, UsersN))) - Debug(DBGINFO, "Sender %s not found", Sender); - } - } - else - { /* Find by numnicks */ - if(!((!Sender[1]) && (ServerPtr = GetServerByNumnick(Sender[0])))) - { - if(!(UserPtr = FindNumnick(Sender, UsersU))) - Debug(DBGINFO, "Sender %s not found", Sender); - } - } Command = (char *) strtok(NULL, " "); rest = (char *) strtok(NULL, "\r\n\0"); -/*** Check if maybe its a numeric ***/ - if(isdigit(Command[0]) && ServerPtr) /* If first letter is a number and a server sent it.. */ - { - int num = 0; - if((num = atoi(Command))) /* if num is non zero.. */ - { - char* target; - UserListType TmpUserPtr; - target = (char *) strtok(rest, " "); - rest = (char *) strtok(NULL, "\r\n"); - if(prefix_hack) - TmpUserPtr = FindNick(target, UsersN); - else - TmpUserPtr = FindNumnick(target, UsersU); - ProcessNumeric(ServerPtr, num, TmpUserPtr, rest); - return(0); - } - } + + if((strlen(Sender) < 5) && !(ServerPtr = GetServerByNumnick(Sender))) + Debug(DBGINFO, "Sender %s not found", Sender); + + if((strlen(Sender) > 2) && !(UserPtr = FindNumnick(Sender, UsersU))) + Debug(DBGINFO, "Sender %s not found", Sender); + for(i=0;server_commands[i].name;i++) { if(!strcasecmp(server_commands[i].name, Command)) { - if(UserPtr) + if(UserPtr) { if(server_commands[i].usercmd == FALSE) { @@ -1567,7 +1547,7 @@ return(0); } } - else if(ServerPtr) + else if(ServerPtr) { if(server_commands[i].servercmd == FALSE) { Index: x2/source/send.c diff -u x2/source/send.c:1.35 x2/source/send.c:1.36 --- x2/source/send.c:1.35 Thu Jun 12 20:03:51 2003 +++ x2/source/send.c Sat Jun 14 06:16:06 2003 @@ -30,14 +30,11 @@ { va_list args; char buff[LINEBUFFSIZE]; - char numnick[NUMNICKLEN]; va_start(args, format); vsprintf(buff, format, args); va_end(args); - strcpy(numnick, " "); - numnick[0] = convert2y[ServiceNumeric]; - send_command(numnick, "%s", buff); + send_command(ServNum, "%s", buff); } void send_command_from_nick(char *format, ...) @@ -437,7 +434,6 @@ void Authenticate(UpLinkList *UpLinkPtr) { - /* This is now done in parse.c * * AddServer(Uplink,ServiceName); * */ @@ -447,17 +443,16 @@ ConnectTime = ServerTimeStamp = time(NULL); sendtosock(Sock, "PASS :%s", UpLinkPtr->ServPass); LinkTimeStamp = NetTime()- 10000; - sendtosock(Sock, "SERVER %s 1 %lu %lu J10 %cD] 0 :%s", ServiceName, LinkTimeStamp, ServerTimeStamp, - convert2y[ServiceNumeric], - "X2 Channel Service"); + sendtosock(Sock, "SERVER %s 1 %lu %lu J10 %s]]] 0 :%s", ServiceName, LinkTimeStamp, ServerTimeStamp, + ServNum, "X2 Channel Service"); /* <server> NICK <nick> <hops> <timestamp> <user> <host> <compressed ip> <3 letter numeric> :<username> */ - sendtosock(Sock, "%c N %s 1 %lu %s %s +%s %s %c%s :\002%c\002) /MSG %s Help (\002%c\002", - convert2y[ServiceNumeric], IrcNick, LinkTimeStamp, + sendtosock(Sock, "%s N %s 1 %lu %s %s +%s %s %s%s :\002%c\002) /MSG %s Help (\002%c\002", + ServNum, IrcNick, LinkTimeStamp, IrcNick, /* user */ ServiceName, /* host */ "ko", /* Modes */ "B]AAAB", /* compressed ip (127.0.0.1) */ - convert2y[ServiceNumeric], "X2", /* ?X2 is our numnick where ? is server num */ + ServNum, "AAA", /* lets use the first available numeric :) */ CommandMark, IrcNick, CommandMark); #ifdef pinging PingStamp = time(NULL); Index: x2/source/server.c diff -u x2/source/server.c:1.19 x2/source/server.c:1.20 --- x2/source/server.c:1.19 Mon Feb 24 01:19:55 2003 +++ x2/source/server.c Sat Jun 14 06:16:06 2003 @@ -325,14 +325,14 @@ } } -ServerListType GetServerByNumnick(char numnick) +ServerListType GetServerByNumnick(char *numnick) { ServerListType TempPtr; - TempPtr = Servers->TableU[convert2n[(int)numnick]]; + TempPtr = Servers->TableU[base64toint(numnick)]; while (TempPtr) { - if (numnick == TempPtr->numnick) + if (strcmp(numnick, TempPtr->numnick) == 0) { return (TempPtr); } @@ -363,7 +363,7 @@ return (NULL); } -int AddServer(char *ServName, char *ServLink, char numnick) +int AddServer(char *ServName, char *ServLink, char *numnick) { static int ServerSegWarning = 1; ServerListType NewServ; @@ -395,7 +395,8 @@ strcpy(NewServ->Name, ServName); strcpy(NewServ->LinkName, ServLink); - NewServ->numnick = numnick; + numnick[2] = '\0'; /* make sure we only have 2 chars as servernum */ + strcpy(NewServ->numnick, numnick); NewServ->NumOfUsers = 0; NewServ->Deleted = FALSE; @@ -404,7 +405,7 @@ NewServ->NextA = Servers->Table[Pos]; Servers->Table[Pos] = NewServ; - Servers->TableU[convert2n[(int)numnick]] = NewServ; + Servers->TableU[base64toint(numnick)] = NewServ; ServerCount++; return (1); } Index: x2/source/server.h diff -u x2/source/server.h:1.8 x2/source/server.h:1.9 --- x2/source/server.h:1.8 Wed Feb 28 02:11:29 2001 +++ x2/source/server.h Sat Jun 14 06:16:06 2003 @@ -11,9 +11,9 @@ void ProcessRemoveGline(char *Address); void ProcessAddSGline(char *Address, time_t gtime, char *Reason); void ProcessRemoveSGline(char *Address); -int AddServer(char *ServName, char *ServLink, char numnick); +int AddServer(char *ServName, char *ServLink, char *numnick); ServerListType GetServer(char *Name); -ServerListType GetServerByNumnick(char numnick); +ServerListType GetServerByNumnick(char *numnick); void RemoveServer(char *Name); void RemoveDownLinks(char *Name); void KillServerList(); ----------------------- End of diff ----------------------- |
From: Matthias C. <ul...@us...> - 2003-06-14 13:23:50
|
Committer : Matthias Crauwels <ul...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-14 13:23:50 UTC Modified files: source/commands.c source/server.c Log message: Author: Matthias Crauwels <ult...@wo...> Log message: * forgot 2 updates which cored the bot ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.173 x2/source/commands.c:1.174 --- x2/source/commands.c:1.173 Mon Feb 17 00:58:48 2003 +++ x2/source/commands.c Sat Jun 14 06:23:39 2003 @@ -3277,7 +3277,8 @@ while (ServPtr) { if(!strstr(ServPtr->Name, ".Services") || (strstr(rest, "DEBUG") )) /* filter out Services */ - send_to_user(uptr, "\002 %s\002(%d) has %d user(s) <-> \002%s\002", ServPtr->Name, convert2n[(int)ServPtr->numnick], ServPtr->NumOfUsers, ServPtr->LinkName); + send_to_user(uptr, "\002 %s\002(%d) has %d user(s) <-> \002%s\002", ServPtr->Name, + base64toint(ServPtr->numnick), ServPtr->NumOfUsers, ServPtr->LinkName); ServPtr = ServPtr->NextA; } } Index: x2/source/server.c diff -u x2/source/server.c:1.20 x2/source/server.c:1.21 --- x2/source/server.c:1.20 Sat Jun 14 06:16:06 2003 +++ x2/source/server.c Sat Jun 14 06:23:40 2003 @@ -508,7 +508,7 @@ Servers->Table[Pos] = CurrPtr->NextA; else TailPtr->NextA = CurrPtr->NextA; - Servers->TableU[convert2n[(int)CurrPtr->numnick]] = NULL; + Servers->TableU[base64toint(CurrPtr->numnick)] = NULL; free(CurrPtr->Name); CurrPtr->Name = NULL; ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-06-14 20:24:29
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-14 20:24:28 UTC Modified files: INSTALL README configure configure.in HELP/ACCESS doc/config.txt source/commands.c source/config.h source/misc.c source/parse.c source/user.c Log message: Update documentation, remove +h mode and make it a virtual GODMODE, add new cmodes and umodes, and clean-up code. We're calling this X2 v5.2 now. ---------------------- diff included ---------------------- Index: x2/HELP/ACCESS diff -u x2/HELP/ACCESS:1.4 x2/HELP/ACCESS:1.5 --- x2/HELP/ACCESS:1.4 Fri Mar 2 04:22:25 2001 +++ x2/HELP/ACCESS Sat Jun 14 13:24:18 2003 @@ -10,9 +10,9 @@ * This tells you the TOGOP status for the given users host. Rubin is an AfterNet IRC Operator. * This line will show up if `nickname' is an IRCOP. -Rubin has security overrride (+h) enabled. +Rubin has security overrride (GOD) enabled. * This line will show up if `nickname' is an IRCOP who is using the override - mode (+h). + mode (GOD). The ACCESS command can by done by all users. Index: x2/INSTALL diff -u x2/INSTALL:1.6 x2/INSTALL:1.7 --- x2/INSTALL:1.6 Thu Nov 8 00:21:08 2001 +++ x2/INSTALL Sat Jun 14 13:24:17 2003 @@ -1,7 +1,4 @@ Ok, quick and dirty: -X2 WORKS ONLY WITH UNIVERSAL IRCD http://www.sourceforge.net/projects/ircu -it will NOT connect to Undernet ircu2.10.08 or higher without -serious modifications!!! (Undernet has changed the P10 protocol they use) Basic Install procedure: ------------------------- @@ -15,7 +12,7 @@ You can then execute the bot by changing to the directory you installed to and running: ./x2 -You will of course have to add C,N,H lines to the server you will be +You will of course have to add C and H lines to the server you will be connecting too, as well as U: lines on EVERY CONNECTED SERVER for X2 to work properly. Please submit bug reports and suggestions to the bug tracking system on Index: x2/README diff -u x2/README:1.7 x2/README:1.8 --- x2/README:1.7 Thu Nov 8 00:21:08 2001 +++ x2/README Sat Jun 14 13:24:18 2003 @@ -1,11 +1,9 @@ --------- X2 5.1 Channel and Oper Services ------- +-------- X2 5.2 Channel and Oper Services ------- Alright folks here it is. Complete channel and oper services -for universal ircd based IRC network. This version of x2 is compatable -with universal ircd ircu2.10.08.37 or above. The 2.10.09 release is -reccomended. -***X2 DOES NOT WORK WITH UNDERNET IRC DAEMON!*** -Undernet has made changes to the P10 protocol which X2 is NOT COMPATABLE with. +for undernet ircd (IRCu) based IRC network. This version of x2 is +compatable with undernet IRCu u2.10.11 or above. The u2.10.11.05 +release is recommended. I am hereby releasing the source to the channel services we at AfterNet have been using for several years to the general public, under the terms @@ -47,6 +45,20 @@ Add your net? Email me. ru...@af... -- Changes -- +------- Changes for 5.2 ------------------------ +AfterNET swapped to a new and better IRCd (UnderNet IRCu + +modifications) and is now not compatible with older IRCd's such as +universal. + +Some of the things changed: +* Fully support P10 tokens. +* Use extended numerics. +* Recognize the account (AC) token, but do nothing with it currently. + JinX will (maybe) be the new service to use accounts. +* Added new umodes and cmodes. +* Removed +h GODMODE and just left the /msg X2 GOD on/off thing. + + ------- Changes for 5.1 ------------------------ Note: This is a major upgrade. If you're upgrading from a 5.0.3 or earlier release, you should know that we've totally Index: x2/configure diff -u x2/configure:1.3 x2/configure:1.4 --- x2/configure:1.3 Sun Nov 11 03:37:11 2001 +++ x2/configure Sat Jun 14 13:24:18 2003 @@ -524,7 +524,7 @@ PACKAGE=x2serv -VERSION=5.1 +VERSION=5.2 Index: x2/configure.in diff -u x2/configure.in:1.3 x2/configure.in:1.4 --- x2/configure.in:1.3 Thu Nov 8 04:53:07 2001 +++ x2/configure.in Sat Jun 14 13:24:18 2003 @@ -2,7 +2,7 @@ AC_INIT(source/main.c) AC_CONFIG_HEADER(source/setup.h) PACKAGE=x2serv -VERSION=5.1 +VERSION=5.2 AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_PREFIX_DEFAULT(.) Index: x2/doc/config.txt diff -u x2/doc/config.txt:1.1 x2/doc/config.txt:1.2 --- x2/doc/config.txt:1.1 Wed Mar 21 01:17:29 2001 +++ x2/doc/config.txt Sat Jun 14 13:24:18 2003 @@ -17,7 +17,7 @@ NUMERIC - X2 is P10, and this is the server numeric the service x2 connects as should use. This would be the same as the number at the end of the M: line in an ircd.conf. Every server on the network - must have a different numeric (1-63). + must have a different numeric (1-4095). IRCNICK - This is the nickname of the user that is created to interface with your users. Index: x2/source/commands.c diff -u x2/source/commands.c:1.174 x2/source/commands.c:1.175 --- x2/source/commands.c:1.174 Sat Jun 14 06:23:39 2003 +++ x2/source/commands.c Sat Jun 14 13:24:18 2003 @@ -224,9 +224,7 @@ { "DUMP", c_raw, NONE, 0, 0, 0, T, T }, { "RAW", c_raw, NONE, 0, 0, 0, T, T }, #endif -#ifndef AFTERNET /* we have a mode in our ircd for this */ { "GOD", c_god, NONE, 0, 0, 0, T, T }, -#endif { "BACKUP", c_backup, NONE, 0, 0, 0, T, T }, /* ... */ { NULL, null(int(*)()), 0, 0, 0, 0, 0, 0 } @@ -818,7 +816,6 @@ return(TRUE); } -#ifndef AFTERNET int c_god(C_PARAM) { if(uptr != NULL) @@ -846,7 +843,6 @@ return(FALSE); } } -#endif int c_whoami(C_PARAM) { @@ -894,8 +890,14 @@ strcat(modetmp, "k"); if (target->Modes & UMODEg) strcat(modetmp, "g"); + if (target->Modes & UMODEh) + strcat(modetmp, "h"); if (target->Modes & UMODEx) strcat(modetmp, "x"); + if (target->Modes & UMODEB) + strcat(modetmp, "B"); + if (target->Modes & UMODER) + strcat(modetmp, "R"); if (target->Modes & UMODEgod) strcat(modetmp, "(GOD)"); send_to_user(uptr, "\002 Modes : +%s\002", modetmp); @@ -1884,7 +1886,7 @@ if (target && IsOper(target)) send_to_user(uptr, "%s is an \002IRC Operator\002.", target->Nick); if (target && IsGodOper(target)) - send_to_user(uptr, "%s has \002security override (+h)\002 enabled.", target->Nick); + send_to_user(uptr, "%s has \002security override (GOD)\002 enabled.", target->Nick); if (target && IsModeK(target)) send_to_user(uptr, "%s is a \002no-kick service (+k)\002.", target->Nick); return(TRUE); Index: x2/source/config.h diff -u x2/source/config.h:1.73 x2/source/config.h:1.74 --- x2/source/config.h:1.73 Sat Jun 14 06:16:05 2003 +++ x2/source/config.h Sat Jun 14 13:24:18 2003 @@ -35,16 +35,16 @@ /* * Please do not remove the name 'X2' and the version from this reply. If you - * make modifications please use the format: 5.1+<yournet>.<yourversion> + * make modifications please use the format: 5.2+<yournet>.<yourversion> * Or, use one of the replies provided. Obviously theres no way for me * to enforce this, but I have put many hundreds of hours into this program * and I'd like to be able to tell whos using it and what version it is based * on. * [alternate replies] - * #define VERSION "X2 v5.1 - Channel and Oper services" - * #define VERSION "<YourNet> Channel services powered by Rubin's X2 version 5.1" + * #define VERSION "X2 v5.2 - Channel and Oper services" + * #define VERSION "<YourNet> Channel services powered by Rubin's X2 version 5.2" */ -#define VERSION "X2 v5.1 - AfterNET Channel Services" +#define VERSION "X2 v5.2 - AfterNET Channel Services" /* This is used to refer to your network in various places. It should be one word, eg "AfterNET" */ #define NETWORK "AfterNET" @@ -71,20 +71,6 @@ * #define debugon */ -/* Older afternet ircu had a mode (+g) added that made - * IRC Ops able to override X2 security (God mode) - * Current afternet ircu (runs universal ircu) uses - * +h for this (we call it helper). - * If your ircu does not support this, be sure to #undef - * AFTERNET below and choose an unused mode for this: - */ -#define OVERRIDEMODE "h" - -/* If your ircd does not have an override mode for use with X2 - * please undefine this so you can /msg X2 GOD on/off - */ -#define AFTERNET - /* If you dont want the word warez in channel names, define this. * TODO : This is a hack, and would do better in a config file. Do it! */ @@ -104,12 +90,6 @@ #define GLINEFILENAME "gline.dat" #define SUPERGLINEFILENAME "supergline.dat" -/* This is part of the on-connect probes; x2 sends a - * command to crash "fizzer" worms, this text is included - * to explain the probe to the users - */ -#define FIZZER_TEXT "Please pardon this check, it is a probe for 'fizzer' worm drones. Thanks ( )" - /* These are for the Wingate check. */ #define MAXGATESOCKS 20 #define GATECHECKTIMEOUT 60 @@ -220,6 +200,10 @@ /* These are for channel mode parsing */ #define NOMODES 0 +#define CMODEu 8192 +#define CMODEC 4096 +#define CMODEc 2048 +#define CMODEr 1024 #define CMODEe 512 #define CMODER 256 #define CMODEn 128 @@ -232,6 +216,8 @@ #define CMODEm 1 /* These are for User mode parsing.. */ +#define UMODEh 8192 +#define UMODEB 4096 #define UMODEaway 2048 #define UMODEgod 1024 #define UMODER 512 Index: x2/source/misc.c diff -u x2/source/misc.c:1.49 x2/source/misc.c:1.50 --- x2/source/misc.c:1.49 Sat Jun 14 06:16:05 2003 +++ x2/source/misc.c Sat Jun 14 13:24:18 2003 @@ -347,7 +347,7 @@ char buff[MAXLEN*4]; int hidepass = 0; /* global nick!user@host command rest [time] */ -/* #channel nick!user@host +h command rest [time] */ +/* #channel nick!user@host GOD command rest [time] */ if( ! (strcasecmp(command, "LOGIN") && strcasecmp(command, "RESETPASS") && strcasecmp(command, "MLOGIN") ) ) @@ -1157,7 +1157,7 @@ if(IsGodOper(uptr)) { level = 600; - send_to_user(uptr, "\002WARNING:\002 You are using HELP mode (+h) to over-ride channel security!"); + send_to_user(uptr, "\002WARNING:\002 You are using GOD mode to override channel security!"); } } return (level); @@ -1457,6 +1457,18 @@ break; case 'm': ModeNum = ModeNum | CMODEm; + break; + case 'r': + ModeNum = ModeNum | CMODEr; + break; + case 'u': + ModeNum = ModeNum | CMODEu; + break; + case 'c': + ModeNum = ModeNum | CMODEc; + break; + case 'C': + ModeNum = ModeNum | CMODEC; break; default: return (-1); Index: x2/source/parse.c diff -u x2/source/parse.c:1.79 x2/source/parse.c:1.80 --- x2/source/parse.c:1.79 Sat Jun 14 06:16:06 2003 +++ x2/source/parse.c Sat Jun 14 13:24:18 2003 @@ -56,6 +56,7 @@ { "Z", m_pong, TRUE, TRUE }, { "P", m_privmsg, FALSE, TRUE }, { "WC", m_noop, TRUE, TRUE }, + { "WV", m_noop, TRUE, TRUE }, { "S", m_server, TRUE, FALSE }, { "B", m_burst, TRUE, FALSE }, // wtf?? @@ -88,7 +89,12 @@ { "WA", m_noop, TRUE, TRUE }, { "R", m_noop, TRUE, TRUE }, { "SE", m_settime, TRUE, FALSE }, - { "AC", m_noop, TRUE, FALSE }, /* this won't be used in this service */ + { "AC", m_noop, TRUE, FALSE }, /* not used in X2 */ + { "WU", m_noop, TRUE, TRUE }, + { "LL", m_noop, TRUE, FALSE }, + { "SH", m_noop, FALSE, TRUE }, + { "OM", m_noop, TRUE, TRUE }, + { "CM", m_noop, TRUE, TRUE }, { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ @@ -448,7 +454,6 @@ if(SUB7SCAN != 0) { send_ctcp(UserPtr, "CLIENTINFO"); send_ctcp(UserPtr, "VERSION"); - send_ctcp(UserPtr, "001PING %s", FIZZER_TEXT); } } } @@ -1398,7 +1403,7 @@ static char RemotePass[MAXPASS]; /* should be this or just '10'? */ Arg[0] = (char *) strtok(LineBuff, " "); /* sender numeric */ - Arg[1] = (char *) strtok(NULL, " "); + Arg[1] = (char *) strtok(NULL, " "); if(!strcmp(Arg[0], "PING")) { /* Respond with a ping reply */ @@ -1441,12 +1446,11 @@ return; } Debug(DBGINFO, "PROTOCOL: %s", Arg[5]); - if(strcmp(Arg[5], "J10")) /* If Arg5] is not "J10" then.. */ + if(strcmp(Arg[5], "J10")) /* If Arg[5] is not "J10" then.. */ { Debug(DBGWARNING, "UNKNOWN protocol. This is NOT a compatable irc daemon."); - Debug(DBGWARNING, "Currently X2 works with the following irc servers:"); - Debug(DBGWARNING, " Universal ircd - http://ircu.sourceforge.net"); - Debug(DBGWARNING, "OLD Undernet ircd - 2.10.07 and lower P10 versions."); + Debug(DBGWARNING, "Currently X2 works with the following IRC daemon(s):"); + Debug(DBGWARNING, "UnderNet IRCu - u2.10.11 and above - http://coder-com.undernet.org"); Debug(DBGWARNING, ""); Debug(DBGWARNING, "Making x2 work with other versions requires serious rewriting."); sleep(4); Index: x2/source/user.c diff -u x2/source/user.c:1.34 x2/source/user.c:1.35 --- x2/source/user.c:1.34 Thu Nov 8 00:21:08 2001 +++ x2/source/user.c Sat Jun 14 13:24:18 2003 @@ -1,4 +1,3 @@ - /* * X2 IRC Operator and Channel services * by Rubin (ru...@af...) @@ -549,11 +548,9 @@ case 'i': UserMode = UMODEi; break; -/* New afternet "GOD" mode +h (helper) */ case 'h': - UserMode = UMODEgod; + UserMode = UMODEh; break; -/* ircu hack2 notices +g */ case 'g': UserMode = UMODEg; break; @@ -565,6 +562,9 @@ break; case 'r': UserMode = UMODEr; + break; + case 'B': + UserMode = UMODEB; break; case 'R': UserMode = UMODER; ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-06-14 20:49:07
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-14 20:49:06 UTC Modified files: source/route.c Log message: Remove 'numnick' from test reroute output. ---------------------- diff included ---------------------- Index: x2/source/route.c diff -u x2/source/route.c:1.12 x2/source/route.c:1.13 --- x2/source/route.c:1.12 Tue May 29 13:51:06 2001 +++ x2/source/route.c Sat Jun 14 13:48:56 2003 @@ -399,7 +399,7 @@ if(directive != 'T') /* if not tetsing */ send_connect(rptr->server, rptr->port, suptr); else - send_to_user(uptr, "->connect %s %d numnick(%s)", + send_to_user(uptr, "->connect %s %d %s", rptr->server, rptr->port, suptr->Name); } } @@ -458,10 +458,3 @@ * complain in wallops */ } - - - - - - - ----------------------- End of diff ----------------------- |
From: Matthias C. <ul...@us...> - 2003-06-14 22:51:55
|
Committer : Matthias Crauwels <ul...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-06-14 22:51:54 UTC Modified files: source/parse.c Log message: Author: Matthias Crauwels <ult...@wo...> Log message: * added Asuka's freeform sethost support ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.80 x2/source/parse.c:1.81 --- x2/source/parse.c:1.80 Sat Jun 14 13:24:18 2003 +++ x2/source/parse.c Sat Jun 14 15:51:44 2003 @@ -381,9 +381,10 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes, *account; + char* modes, *account, *hiddenhost; UserListType UserPtr; unsigned int IP; + Arg[0] = (char *) strtok(rest, " "); /* nick */ Arg[1] = (char *) strtok(NULL, " "); /* 1 */ Arg[2] = (char *) strtok(NULL, " "); /* ts */ @@ -404,17 +405,16 @@ modes = (char *) strtok(NULL, " "); /* modes */ if(modes[0] == '+') { + Arg[5] = modes; if(strchr(modes, 'r')) { - Arg[5] = modes; account = (char *) strtok(NULL, " "); /* This user has an account set from another service */ - Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } - else + if(strchr(modes, 'h')) { - Arg[5] = modes; - Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ + hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ } + Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } else { ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-24 02:52:25
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-24 02:50:28 UTC Modified files: source/parse.c source/server.c Log message: Modified gline reasons to work with evilnet ircd. ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.81 x2/source/parse.c:1.82 --- x2/source/parse.c:1.81 Sat Jun 14 15:51:44 2003 +++ x2/source/parse.c Thu Oct 23 19:50:18 2003 @@ -1297,7 +1297,7 @@ return(0); case 2: sprintf(uh, "*@%s", unsigned32ToDotQuad(from->IP)); - send_gline(uh, 3600, "%s", "Sub7 trojan detected"); + send_gline(uh, 3600, "%s", "<X2> Sub7 trojan detected"); return(0); default: Debug(DBGINFO, "Unknown SUB7SCAN setting"); return(0); @@ -1312,7 +1312,7 @@ return(0); case 2: sprintf(uh, "*@%s", unsigned32ToDotQuad(from->IP)); - send_gline(uh, 3600, "%s", "Litmus trojan detected"); + send_gline(uh, 3600, "%s", "<X2> Litmus trojan detected"); return(0); default: Debug(DBGINFO, "Unknown LITMUS setting"); return(0); @@ -1327,7 +1327,7 @@ return(0); case 2: sprintf(uh, "*@%s", unsigned32ToDotQuad(from->IP)); - send_gline(uh, 3600, "%s", "SDBot trojan detected"); + send_gline(uh, 3600, "%s", "<X2> SDBot trojan detected"); return(0); default: Debug(DBGINFO, "Unknown SDBOT setting"); return(0); Index: x2/source/server.c diff -u x2/source/server.c:1.21 x2/source/server.c:1.22 --- x2/source/server.c:1.21 Sat Jun 14 06:23:40 2003 +++ x2/source/server.c Thu Oct 23 19:50:18 2003 @@ -160,7 +160,7 @@ if(!matches(urbuff, ur)) { sprintf(Address, "*@%s", IP); - sprintf(reason, "Added automatically from SuperGline(%s)", gptr->reason); + sprintf(reason, "<SuperGline> %s", gptr->reason); send_gline(Address, 3600, "%s", reason); ProcessAddGline(Address, 3600, reason); Debug(DBGINFO, "Supergline matched: %s", gptr->reason); @@ -173,7 +173,7 @@ if(!matches(gptr->address, uhr)) { sprintf(Address, "*@%s", IP); - sprintf(reason, "Added automatically from SuperGline(%s)", gptr->reason); + sprintf(reason, "<SuperGline> %s", gptr->reason); send_gline(Address, 3600, "%s", reason); ProcessAddGline(Address, 3600, reason); return(TRUE); ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-26 21:18:10
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-26 21:17:46 UTC Modified files: conf/x2.news source/commands.c Log message: Fix .Services stuff. ---------------------- diff included ---------------------- Index: x2/conf/x2.news diff -u x2/conf/x2.news:1.1 x2/conf/x2.news:1.2 --- x2/conf/x2.news:1.1 Sat Apr 29 18:41:34 2000 +++ x2/conf/x2.news Sun Oct 26 13:17:36 2003 @@ -1,7 +1,7 @@ A note from The X2 Author: -------------------------------- Your network has recently upgraded -to X2 version 5.0! Congratulations! +to X2 version 5.2! Congratulations! This news file is displayed once to every manager, owner, or coowner in every channel. It can be used to @@ -11,7 +11,7 @@ the NEWS command. Please let your X2 operator know they can change this news file by editing -x2.news in the main X2 5.0 directory. +x2.news in the main X2 5.2 directory. Thanks, -Rubin (ru...@af...) X2 author/maintainer Index: x2/source/commands.c diff -u x2/source/commands.c:1.175 x2/source/commands.c:1.176 --- x2/source/commands.c:1.175 Sat Jun 14 13:24:18 2003 +++ x2/source/commands.c Sun Oct 26 13:17:36 2003 @@ -2128,12 +2128,12 @@ buff = (char *) mysep(&rest, "\0"); if(!buff || !*buff) buff = ""; - sprintf(reason, "(added by %s) We do not allow advertizing on AfterNET! (%s)\002", uptr->Nick, target->Nick); + sprintf(reason, "<%s> We do not allow advertising on AfterNET! (%s)", uptr->Nick, target->Nick); if((target = FindNick(nick, UsersN))) { if (IsModeK(target)) { - send_to_user(uptr, "\002Cannot spamsassanate a service!\002"); + send_to_user(uptr, "\002Cannot spamassassinate a service!\002"); return(FALSE); } IP = unsigned32ToDotQuad(target->IP); @@ -3153,7 +3153,7 @@ if((ServPtr = GetServer(Name))) { - if (!strstr(ServPtr->Name, ".Services")) + if (0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) { if (ServPtr->NumOfUsers != 1) send_to_user(uptr, "%s%s-\002%s\002 [%d users]", pre, arrowchar, Name, ServPtr->NumOfUsers); @@ -3278,7 +3278,8 @@ ServPtr = Servers->Table[i]; while (ServPtr) { - if(!strstr(ServPtr->Name, ".Services") || (strstr(rest, "DEBUG") )) /* filter out Services */ + if((0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) + || (strstr(rest, "DEBUG") )) /* filter out Services */ send_to_user(uptr, "\002 %s\002(%d) has %d user(s) <-> \002%s\002", ServPtr->Name, base64toint(ServPtr->numnick), ServPtr->NumOfUsers, ServPtr->LinkName); ServPtr = ServPtr->NextA; @@ -4162,7 +4163,8 @@ ListPtr = UsersN->Table[i]; while (ListPtr) { - if ((!strstr(".Services", ListPtr->Serv)) && ((UMODEo & ListPtr->Modes) != 0)) + if ((0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) + && ((UMODEo & ListPtr->Modes) != 0)) { if(!(ListPtr->Modes & UMODEk)) { ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-26 21:47:57
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-26 21:46:03 UTC Modified files: source/commands.c source/send.c Log message: Make X2 tell its uplink that it is a service and fix some more .Services bugs. ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.176 x2/source/commands.c:1.177 --- x2/source/commands.c:1.176 Sun Oct 26 13:17:36 2003 +++ x2/source/commands.c Sun Oct 26 13:45:52 2003 @@ -4163,7 +4163,7 @@ ListPtr = UsersN->Table[i]; while (ListPtr) { - if ((0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) + if ((0 != strcmp(".Services", (ListPtr->Serv)+strlen(ListPtr->Serv)-1-strlen(".Services"))) && ((UMODEo & ListPtr->Modes) != 0)) { if(!(ListPtr->Modes & UMODEk)) Index: x2/source/send.c diff -u x2/source/send.c:1.36 x2/source/send.c:1.37 --- x2/source/send.c:1.36 Sat Jun 14 06:16:06 2003 +++ x2/source/send.c Sun Oct 26 13:45:53 2003 @@ -443,8 +443,9 @@ ConnectTime = ServerTimeStamp = time(NULL); sendtosock(Sock, "PASS :%s", UpLinkPtr->ServPass); LinkTimeStamp = NetTime()- 10000; - sendtosock(Sock, "SERVER %s 1 %lu %lu J10 %s]]] 0 :%s", ServiceName, LinkTimeStamp, ServerTimeStamp, - ServNum, "X2 Channel Service"); + sendtosock(Sock, "SERVER %s 1 %lu %lu J10 %s]]] +s :%s", + ServiceName, LinkTimeStamp, ServerTimeStamp, ServNum, + "X2 Channel Service"); /* <server> NICK <nick> <hops> <timestamp> <user> <host> <compressed ip> <3 letter numeric> :<username> */ sendtosock(Sock, "%s N %s 1 %lu %s %s +%s %s %s%s :\002%c\002) /MSG %s Help (\002%c\002", ServNum, IrcNick, LinkTimeStamp, ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-26 22:20:57
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-26 22:20:46 UTC Modified files: source/commands.c Log message: Show spammer glines as issuer 'Spammer' ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.177 x2/source/commands.c:1.178 --- x2/source/commands.c:1.177 Sun Oct 26 13:45:52 2003 +++ x2/source/commands.c Sun Oct 26 14:20:35 2003 @@ -2128,7 +2128,7 @@ buff = (char *) mysep(&rest, "\0"); if(!buff || !*buff) buff = ""; - sprintf(reason, "<%s> We do not allow advertising on AfterNET! (%s)", uptr->Nick, target->Nick); + sprintf(reason, "<Spammer> <%s> We do not allow advertising on AfterNET! (%s)", uptr->Nick, target->Nick); if((target = FindNick(nick, UsersN))) { if (IsModeK(target)) ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-26 22:26:46
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-26 22:24:17 UTC Modified files: source/commands.c Log message: All caps looks better. ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.178 x2/source/commands.c:1.179 --- x2/source/commands.c:1.178 Sun Oct 26 14:20:35 2003 +++ x2/source/commands.c Sun Oct 26 14:24:07 2003 @@ -2128,7 +2128,7 @@ buff = (char *) mysep(&rest, "\0"); if(!buff || !*buff) buff = ""; - sprintf(reason, "<Spammer> <%s> We do not allow advertising on AfterNET! (%s)", uptr->Nick, target->Nick); + sprintf(reason, "<SPAMMER> <%s> We do not allow advertising on AfterNET! (%s)", uptr->Nick, target->Nick); if((target = FindNick(nick, UsersN))) { if (IsModeK(target)) ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-27 01:56:01
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-27 01:52:19 UTC Modified files: source/parse.c Log message: Add support for privs and sajoin/sapart. ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.82 x2/source/parse.c:1.83 --- x2/source/parse.c:1.82 Thu Oct 23 19:50:18 2003 +++ x2/source/parse.c Sun Oct 26 17:52:08 2003 @@ -65,6 +65,8 @@ { "C", m_create, FALSE, TRUE }, { "J", m_join, FALSE, TRUE }, { "L", m_part, FALSE, TRUE }, + { "SJ", m_noop, TRUE, FALSE }, + { "SP", m_noop, TRUE, FALSE }, { "M", m_mode, TRUE, TRUE }, { "I", m_noop, TRUE, TRUE }, { "A", m_away, FALSE, TRUE }, @@ -90,6 +92,7 @@ { "R", m_noop, TRUE, TRUE }, { "SE", m_settime, TRUE, FALSE }, { "AC", m_noop, TRUE, FALSE }, /* not used in X2 */ + { "PRIVS", m_noop, TRUE, FALSE }, { "WU", m_noop, TRUE, TRUE }, { "LL", m_noop, TRUE, FALSE }, { "SH", m_noop, FALSE, TRUE }, ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2003-10-28 00:20:20
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2003-10-28 00:18:36 UTC Modified files: source/commands.c Log message: Second try at fixing .Services thing. ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.179 x2/source/commands.c:1.180 --- x2/source/commands.c:1.179 Sun Oct 26 14:24:07 2003 +++ x2/source/commands.c Mon Oct 27 16:18:26 2003 @@ -3153,7 +3153,7 @@ if((ServPtr = GetServer(Name))) { - if (0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) + if (strcmp((ServPtr->Name) + strlen(ServPtr->Name) - strlen(".Services"), ".Services")) { if (ServPtr->NumOfUsers != 1) send_to_user(uptr, "%s%s-\002%s\002 [%d users]", pre, arrowchar, Name, ServPtr->NumOfUsers); @@ -3278,7 +3278,7 @@ ServPtr = Servers->Table[i]; while (ServPtr) { - if((0 != strcmp(".Services", (ServPtr->Name)+strlen(ServPtr->Name)-1-strlen(".Services"))) + if((strcmp((ServPtr->Name) + strlen(ServPtr->Name) - strlen(".Services"), ".Services")) || (strstr(rest, "DEBUG") )) /* filter out Services */ send_to_user(uptr, "\002 %s\002(%d) has %d user(s) <-> \002%s\002", ServPtr->Name, base64toint(ServPtr->numnick), ServPtr->NumOfUsers, ServPtr->LinkName); @@ -4163,7 +4163,7 @@ ListPtr = UsersN->Table[i]; while (ListPtr) { - if ((0 != strcmp(".Services", (ListPtr->Serv)+strlen(ListPtr->Serv)-1-strlen(".Services"))) + if ((strcmp((ListPtr->Serv) + strlen(ListPtr->Serv) - strlen(".Services"), ".Services")) && ((UMODEo & ListPtr->Modes) != 0)) { if(!(ListPtr->Modes & UMODEk)) ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-03-02 05:32:55
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Branch tags: stable Commit time: 2004-03-02 05:21:23 UTC Modified files: Tag: stable source/chan.c source/commands.c source/config.h source/main.c Log message: Fixed PEON's able to voice others, Added 4 day new channel expiration Added warning topic set for expiring channels ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.85 x2/source/chan.c:1.85.2.1 --- x2/source/chan.c:1.85 Sat May 17 20:43:45 2003 +++ x2/source/chan.c Mon Mar 1 21:21:07 2004 @@ -1911,6 +1911,15 @@ return; } +/* This checks for channels that have not + * been logged into by a (co)owner for + * CHANEXPIREDAYS and removes them. + * + * Also sets topic warning at + * CHANWARNEXPIREDAYS days + * and brand new channels + * are removed in NEWCHANEXPIREDAYS + */ void ExpireChannels(UserListType uptr) { ChannelListType TempChanPtr, NextChanPtr; @@ -1929,6 +1938,7 @@ NextChanPtr = TempChanPtr->Next; if((TempChanPtr->Regged) && !(TempChanPtr->settings[NODELETE]) && (TempChanPtr->LastAccess > 0)) /* If its not marked nodelete */ { + /* CHANEXPIREDAYS */ if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANEXPIREDAYS) /* older than CHANEXPIREDAYS days */ { Debug(DBGNOTICE, "Channel %s not visited since %lu. Removing..", TempChanPtr->Name, @@ -1950,6 +1960,38 @@ send_to_user(uptr, "Removing %s", TempChanPtr->Name); UnregExpired(TempChanPtr); } + /* CHANWARNEXPIREDAYS */ + if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANWARNEXPIREDAYS) + { + Debug(DBGNOTICE, "Channel %s not visited since %lu. Setting a warning topic.", TempChanPtr->Name, TempChanPtr->LastAccess); + /* First, change the topic */ + free(TempChanPtr->Topic); + if((TempChanPtr->Topic = (char *) malloc(strlen(CHANWARNMESSAGE) + 1))) + strcpy(TempChanPtr->Topic, CHANWARNMESSAGE); + else + Debug(DBGWARNING, "Error allocating memery for chan expire topic warning!"); + /* Next, set topic refresh to maximum */ + TempChanPtr->settings[TOPICFREQ] = 4; + /* Save */ + WriteChanOpFile(TempChanPtr); + } + /* NEWCHANEXPIREDAYS */ + if( ((time(NULL) - TempChanPtr->LastAccess) > 86400 * NEWCHANEXPIREDAYS) && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + { + Debug(DBGINFO, "Channel %s never visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); + logfile = fopen(ExpiredChanLog, "a"); + if(logfile != 0) + { + ct = time(NULL); + strcpy(tmp, ctime(&ct)); + tmp[strlen(tmp) - 1] = '\0'; + strcpy(lvistime, ctime(&TempChanPtr->LastAccess)); + fprintf(logfile, ":%s: Channel %s removed, never visited since %s", tmp, + TempChanPtr->Name, lvistime); + fclose(logfile); + } + UnregExpired(TempChanPtr); + } } TempChanPtr = NextChanPtr; } Index: x2/source/commands.c diff -u x2/source/commands.c:1.173 x2/source/commands.c:1.173.2.1 --- x2/source/commands.c:1.173 Mon Feb 17 00:58:48 2003 +++ x2/source/commands.c Mon Mar 1 21:21:09 2004 @@ -153,8 +153,8 @@ { "SPOOFSERV", c_spoofserv, NONE, 0, 0, 0, T, T }, { "RESETPASS", c_resetpass, REGED, MA, T, T, F, F }, { "OP", c_op, REGED, OP, T, F, F, T }, - { "VOICE", c_voice, REGED, PE, T, F, F, T }, - { "V", c_voice, REGED, PE, T, F, F, T }, + { "VOICE", c_voice, REGED, OP, T, F, F, T }, + { "V", c_voice, REGED, OP, T, F, F, T }, { "DEVOICE", c_devoice, REGED, OP, T, F, F, T }, { "OPCHAN", c_opchan, REQED, 0, 0, 0, T, T }, { "DEOPCHAN", c_deopchan, REQED, 0, 0, 0, T, T }, Index: x2/source/config.h diff -u x2/source/config.h:1.72 x2/source/config.h:1.72.2.1 --- x2/source/config.h:1.72 Sat May 17 21:04:09 2003 +++ x2/source/config.h Mon Mar 1 21:21:12 2004 @@ -136,9 +136,9 @@ * and 900 users at peak time. The bot will notify you via wallops if * these need to be increased. Small values only hurt performance, every- * thing will remain functional. */ -#define CHANSEGSIZE 3001 -#define USERSEGSIZE 3001 -#define SERVERSEGSIZE 61 +#define CHANSEGSIZE 30001 +#define USERSEGSIZE 30001 +#define SERVERSEGSIZE 128 #define ROUTSEGSIZE SERVERSEGSIZE #define NETSEGSIZE 41 #define NETLINKSEGSIZE 21 @@ -200,6 +200,12 @@ * removed when they reach this many days old. */ #define CHANEXPIREDAYS 30 +/* unreg new never-logged-into channels in __ days */ +#define NEWCHANEXPIREDAYS 4 +/* Warn of impending expiration in __ days*/ +#define CHANWARNEXPIREDAYS 28 +/* Warning message */ +#define CHANWARNMESSAGE "ATTENTION: This channel is going to expire soon! An Owner or CoOwner needs to log in!" /* This time stamp is used as the date registered channels were created in X2. * It should be older then the oldest channel on the network, or X2 wont get Index: x2/source/main.c diff -u x2/source/main.c:1.59 x2/source/main.c:1.59.2.1 --- x2/source/main.c:1.59 Sat May 17 20:43:45 2003 +++ x2/source/main.c Mon Mar 1 21:21:12 2004 @@ -940,6 +940,7 @@ if (ServerConnected) { int Now = time(NULL); + /* Check for ping timeout */ if (((Now - PingStamp) > PINGTIMEOUT) && (!GotPong)) { Debug(DBGINFO, "No ping recieved. Killing link.."); @@ -947,16 +948,16 @@ SockConnected = false; continue; } + /* Check for bans */ if ((Now - bantimer) >= 120) - { /* Once every 120 seconds check for expired bans.. */ - bantimer = Now; + { + bantimer = Now; CheckBanTimeouts(); CheckGlineTimeouts(); CheckSuspendedTimeouts(); - /* Superglines nolonger time out. */ - /*CheckSuperGlineTimeouts(); */ NETBURSTING = FALSE; /* after 2 min start parsing on_join completely */ } + /* Set topics and expire channels once a day */ if ((Now - TopicTimer_1) >= 86400) { TopicTimer_1 = Now; ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2004-03-17 04:52:36
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-03-17 04:43:14 UTC Modified files: source/chan.c source/commands.c source/config.h source/main.c source/parse.c Log message: Forward port from stable branch plus addition of another numeric to ignore. ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.86 x2/source/chan.c:1.87 --- x2/source/chan.c:1.86 Thu Jun 12 20:03:49 2003 +++ x2/source/chan.c Tue Mar 16 20:43:03 2004 @@ -1911,6 +1911,15 @@ return; } +/* This checks for channels that have not + * been logged into by a (co)owner for + * CHANEXPIREDAYS and removes them. + * + * Also sets topic warning at + * CHANWARNEXPIREDAYS days + * and brand new channels + * are removed in NEWCHANEXPIREDAYS + */ void ExpireChannels(UserListType uptr) { ChannelListType TempChanPtr, NextChanPtr; @@ -1929,6 +1938,7 @@ NextChanPtr = TempChanPtr->Next; if((TempChanPtr->Regged) && !(TempChanPtr->settings[NODELETE]) && (TempChanPtr->LastAccess > 0)) /* If its not marked nodelete */ { + /* CHANEXPIREDAYS */ if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANEXPIREDAYS) /* older than CHANEXPIREDAYS days */ { Debug(DBGNOTICE, "Channel %s not visited since %lu. Removing..", TempChanPtr->Name, @@ -1950,6 +1960,38 @@ send_to_user(uptr, "Removing %s", TempChanPtr->Name); UnregExpired(TempChanPtr); } + /* CHANWARNEXPIREDAYS */ + if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANWARNEXPIREDAYS) + { + Debug(DBGNOTICE, "Channel %s not visited since %lu. Setting a warning topic.", TempChanPtr->Name, TempChanPtr->LastAccess); + /* First, change the topic */ + free(TempChanPtr->Topic); + if((TempChanPtr->Topic = (char *) malloc(strlen(CHANWARNMESSAGE) + 1))) + strcpy(TempChanPtr->Topic, CHANWARNMESSAGE); + else + Debug(DBGWARNING, "Error allocating memery for chan expire topic warning!"); + /* Next, set topic refresh to maximum */ + TempChanPtr->settings[TOPICFREQ] = 4; + /* Save */ + WriteChanOpFile(TempChanPtr); + } + /* NEWCHANEXPIREDAYS */ + if( ((time(NULL) - TempChanPtr->LastAccess) > 86400 * NEWCHANEXPIREDAYS) && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + { + Debug(DBGINFO, "Channel %s never visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); + logfile = fopen(ExpiredChanLog, "a"); + if(logfile != 0) + { + ct = time(NULL); + strcpy(tmp, ctime(&ct)); + tmp[strlen(tmp) - 1] = '\0'; + strcpy(lvistime, ctime(&TempChanPtr->LastAccess)); + fprintf(logfile, ":%s: Channel %s removed, never visited since %s", tmp, + TempChanPtr->Name, lvistime); + fclose(logfile); + } + UnregExpired(TempChanPtr); + } } TempChanPtr = NextChanPtr; } Index: x2/source/commands.c diff -u x2/source/commands.c:1.180 x2/source/commands.c:1.181 --- x2/source/commands.c:1.180 Mon Oct 27 16:18:26 2003 +++ x2/source/commands.c Tue Mar 16 20:43:03 2004 @@ -153,8 +153,8 @@ { "SPOOFSERV", c_spoofserv, NONE, 0, 0, 0, T, T }, { "RESETPASS", c_resetpass, REGED, MA, T, T, F, F }, { "OP", c_op, REGED, OP, T, F, F, T }, - { "VOICE", c_voice, REGED, PE, T, F, F, T }, - { "V", c_voice, REGED, PE, T, F, F, T }, + { "VOICE", c_voice, REGED, OP, T, F, F, T }, + { "V", c_voice, REGED, OP, T, F, F, T }, { "DEVOICE", c_devoice, REGED, OP, T, F, F, T }, { "OPCHAN", c_opchan, REQED, 0, 0, 0, T, T }, { "DEOPCHAN", c_deopchan, REQED, 0, 0, 0, T, T }, Index: x2/source/config.h diff -u x2/source/config.h:1.74 x2/source/config.h:1.75 --- x2/source/config.h:1.74 Sat Jun 14 13:24:18 2003 +++ x2/source/config.h Tue Mar 16 20:43:03 2004 @@ -119,9 +119,9 @@ * and 900 users at peak time. The bot will notify you via wallops if * these need to be increased. Small values only hurt performance, every- * thing will remain functional. */ -#define CHANSEGSIZE 3001 -#define USERSEGSIZE 3001 -#define SERVERSEGSIZE 61 +#define CHANSEGSIZE 30001 +#define USERSEGSIZE 30001 +#define SERVERSEGSIZE 128 #define ROUTSEGSIZE SERVERSEGSIZE #define NETSEGSIZE 41 #define NETLINKSEGSIZE 21 @@ -185,6 +185,12 @@ * removed when they reach this many days old. */ #define CHANEXPIREDAYS 30 +/* unreg new never-logged-into channels in __ days */ +#define NEWCHANEXPIREDAYS 4 +/* Warn of impending expiration in __ days*/ +#define CHANWARNEXPIREDAYS 28 +/* Warning message */ +#define CHANWARNMESSAGE "ATTENTION: This channel is going to expire soon! An Owner or CoOwner needs to log in!" /* This time stamp is used as the date registered channels were created in X2. * It should be older then the oldest channel on the network, or X2 wont get Index: x2/source/main.c diff -u x2/source/main.c:1.60 x2/source/main.c:1.61 --- x2/source/main.c:1.60 Sat Jun 14 06:16:05 2003 +++ x2/source/main.c Tue Mar 16 20:43:03 2004 @@ -943,6 +943,7 @@ if (ServerConnected) { int Now = time(NULL); + /* Check for ping timeout */ if (((Now - PingStamp) > PINGTIMEOUT) && (!GotPong)) { Debug(DBGINFO, "No ping recieved. Killing link.."); @@ -950,16 +951,16 @@ SockConnected = false; continue; } + /* Check for bans */ if ((Now - bantimer) >= 120) - { /* Once every 120 seconds check for expired bans.. */ - bantimer = Now; + { + bantimer = Now; CheckBanTimeouts(); CheckGlineTimeouts(); CheckSuspendedTimeouts(); - /* Superglines nolonger time out. */ - /*CheckSuperGlineTimeouts(); */ NETBURSTING = FALSE; /* after 2 min start parsing on_join completely */ } + /* Set topics and expire channels once a day */ if ((Now - TopicTimer_1) >= 86400) { TopicTimer_1 = Now; Index: x2/source/parse.c diff -u x2/source/parse.c:1.83 x2/source/parse.c:1.84 --- x2/source/parse.c:1.83 Sun Oct 26 17:52:08 2003 +++ x2/source/parse.c Tue Mar 16 20:43:03 2004 @@ -98,6 +98,7 @@ { "SH", m_noop, FALSE, TRUE }, { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, + { "402", m_noop, TRUE, TRUE ), { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-03-27 09:42:50
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Branch tags: stable Commit time: 2004-03-27 09:31:47 UTC Modified files: Tag: stable source/chan.c source/config.h source/server.c Log message: Fixed up the new expire stuff ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.85.2.1 x2/source/chan.c:1.85.2.2 --- x2/source/chan.c:1.85.2.1 Mon Mar 1 21:21:07 2004 +++ x2/source/chan.c Sat Mar 27 01:31:37 2004 @@ -1938,8 +1938,11 @@ NextChanPtr = TempChanPtr->Next; if((TempChanPtr->Regged) && !(TempChanPtr->settings[NODELETE]) && (TempChanPtr->LastAccess > 0)) /* If its not marked nodelete */ { - /* CHANEXPIREDAYS */ - if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANEXPIREDAYS) /* older than CHANEXPIREDAYS days */ + /* CHANEXPIRE */ + if ( ( (time(NULL) - TempChanPtr->LastAccess) > 3600 * CHANEXPIREHOURS ) /* older than CHANEXPIREhours hours */ + || ( ((time(NULL) - TempChanPtr->LastAccess) > 3600 * NEWCHANEXPIREHOURS) + && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + ) { Debug(DBGNOTICE, "Channel %s not visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); @@ -1960,8 +1963,11 @@ send_to_user(uptr, "Removing %s", TempChanPtr->Name); UnregExpired(TempChanPtr); } - /* CHANWARNEXPIREDAYS */ - if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANWARNEXPIREDAYS) + else if ( /* CHAN WARN EXPIRE */ + ( (time(NULL) - TempChanPtr->LastAccess) > 3600 * (CHANEXPIREHOURS-CHANWARNEXPIREHOURS) ) + || ( ((time(NULL) - TempChanPtr->LastAccess) > 3600 * (NEWCHANEXPIREHOURS-CHANWARNEXPIREHOURS) ) + && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + ) { Debug(DBGNOTICE, "Channel %s not visited since %lu. Setting a warning topic.", TempChanPtr->Name, TempChanPtr->LastAccess); /* First, change the topic */ @@ -1975,23 +1981,7 @@ /* Save */ WriteChanOpFile(TempChanPtr); } - /* NEWCHANEXPIREDAYS */ - if( ((time(NULL) - TempChanPtr->LastAccess) > 86400 * NEWCHANEXPIREDAYS) && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) - { - Debug(DBGINFO, "Channel %s never visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); - logfile = fopen(ExpiredChanLog, "a"); - if(logfile != 0) - { - ct = time(NULL); - strcpy(tmp, ctime(&ct)); - tmp[strlen(tmp) - 1] = '\0'; - strcpy(lvistime, ctime(&TempChanPtr->LastAccess)); - fprintf(logfile, ":%s: Channel %s removed, never visited since %s", tmp, - TempChanPtr->Name, lvistime); - fclose(logfile); - } - UnregExpired(TempChanPtr); - } + } TempChanPtr = NextChanPtr; } Index: x2/source/config.h diff -u x2/source/config.h:1.72.2.1 x2/source/config.h:1.72.2.2 --- x2/source/config.h:1.72.2.1 Mon Mar 1 21:21:12 2004 +++ x2/source/config.h Sat Mar 27 01:31:37 2004 @@ -64,9 +64,8 @@ /* So does AfterNET's new one :) - Undernet's is http://help.undernet.org/proxyscan.htm, for the record */ #define GATEURL "http://www.afternet.org/support/proxy.html" -/* Uncomment the following for debugging. - #define debugon -*/ +/* Uncomment the following for debugging. */ +/* #define debugon */ /* Older afternet ircu had a mode (+g) added that made * IRC Ops able to override X2 security (God mode) @@ -197,15 +196,17 @@ #define MAXLINELEN 300 /* Channels unvisited by (co)owner will be automatically - * removed when they reach this many days old. + * removed when they reach this many hours since the last + * owner/co-owner login. */ -#define CHANEXPIREDAYS 30 -/* unreg new never-logged-into channels in __ days */ -#define NEWCHANEXPIREDAYS 4 -/* Warn of impending expiration in __ days*/ -#define CHANWARNEXPIREDAYS 28 +#define CHANEXPIREHOURS 5 +/* unreg new never-logged-into channels in this many hours */ +#define NEWCHANEXPIREHOURS 2 +/* Warn of impending expiration this many + * hours before expiration */ +#define CHANWARNEXPIREHOURS 3 /* Warning message */ -#define CHANWARNMESSAGE "ATTENTION: This channel is going to expire soon! An Owner or CoOwner needs to log in!" +#define CHANWARNMESSAGE "ATTENTION: This channel will expire soon due to inactivity! '/msg x2 help expire' for details." /* This time stamp is used as the date registered channels were created in X2. * It should be older then the oldest channel on the network, or X2 wont get Index: x2/source/server.c diff -u x2/source/server.c:1.19 x2/source/server.c:1.19.2.1 --- x2/source/server.c:1.19 Mon Feb 24 01:19:55 2003 +++ x2/source/server.c Sat Mar 27 01:31:37 2004 @@ -116,7 +116,7 @@ char addy[MAXLEN]; char *a = addy; - Debug(DBGINFO, "Testing %s versus %s", gptr->address, ur); + /*Debug(DBGINFO, "Testing %s versus %s", gptr->address, ur); */ strcpy(addy, gptr->address); buff = (char *) mysep(&a, "@"); buff = mysep(&a, "$"); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-03-27 10:26:36
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Branch tags: stable Commit time: 2004-03-27 10:15:29 UTC Modified files: Tag: stable source/config.h Log message: Yeah, lets set the expire to something reasonable.. ---------------------- diff included ---------------------- Index: x2/source/config.h diff -u x2/source/config.h:1.72.2.2 x2/source/config.h:1.72.2.3 --- x2/source/config.h:1.72.2.2 Sat Mar 27 01:31:37 2004 +++ x2/source/config.h Sat Mar 27 02:15:17 2004 @@ -199,12 +199,12 @@ * removed when they reach this many hours since the last * owner/co-owner login. */ -#define CHANEXPIREHOURS 5 +#define CHANEXPIREHOURS (30 * 24) /* unreg new never-logged-into channels in this many hours */ #define NEWCHANEXPIREHOURS 2 /* Warn of impending expiration this many * hours before expiration */ -#define CHANWARNEXPIREHOURS 3 +#define CHANWARNEXPIREHOURS 72 /* Warning message */ #define CHANWARNMESSAGE "ATTENTION: This channel will expire soon due to inactivity! '/msg x2 help expire' for details." ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-03-27 10:49:33
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Branch tags: stable Commit time: 2004-03-27 10:38:29 UTC Added files: Tag: stable HELP/EXPIRE Log message: Adding EXPIRE help file to x2. Explains how to turn off the expire topic message, and how expire works. ---------------------- diff included ---------------------- Index: x2/HELP/EXPIRE diff -u /dev/null x2/HELP/EXPIRE:1.1.2.1 --- /dev/null Sat Mar 27 02:38:29 2004 +++ x2/HELP/EXPIRE Sat Mar 27 02:38:19 2004 @@ -0,0 +1,20 @@ + $n will automatically purge channels that + are not being used anymore. Every time + an owner or coowner joins their channel + the counter is reset. Expirations + occur accorrding to the following: + * NEW (never before logged-into) channels + expire in 2 hours. + * All other channels expire in 30 days. + * Either an Owner or a CoOwner must + join and log in to reset the counter. + * use the .wlist command to see how long + since an owner has been seen. + + NOTE: A special topic will be set to warn + of impending expiration 3 days before. + You must clear this warning manually + after logging in. + /MSG $n #channel topic * + /MSG $n #channel SET TOPICFREQ 0 + See /MSG $n HELP SET for details. ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-09 20:09:19
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-09 20:09:12 UTC Modified files: source/parse.c Log message: fixing typeo ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.84 x2/source/parse.c:1.85 --- x2/source/parse.c:1.84 Tue Mar 16 20:43:03 2004 +++ x2/source/parse.c Wed Jun 9 13:09:01 2004 @@ -98,7 +98,7 @@ { "SH", m_noop, FALSE, TRUE }, { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, - { "402", m_noop, TRUE, TRUE ), + { "402", m_noop, TRUE, TRUE }, { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-09 23:33:23
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-09 23:33:13 UTC Modified files: source/chan.c source/commands.c source/config.h source/help.c source/parse.c source/parse.h source/set.c source/user.c Log message: Improved compatability with ircu/nefarious modes ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.87 x2/source/chan.c:1.88 --- x2/source/chan.c:1.87 Tue Mar 16 20:43:03 2004 +++ x2/source/chan.c Wed Jun 9 16:33:03 2004 @@ -841,6 +841,48 @@ *modeptr = *modeptr | CMODEm; *optr = *optr & ~CMODEm; break; + case 'r': + *modeptr = *modeptr | CMODEr; + *optr = *optr & ~CMODEr; + break; + case 'c': + *modeptr = *modeptr | CMODEc; + *optr = *optr & ~CMODEc; + break; + case 'S': + *modeptr = *modeptr | CMODES; + *optr = *optr & ~CMODES; + break; + case 'C': + *modeptr = *modeptr | CMODEC; + *optr = *optr & ~CMODEC; + break; + case 'M': + *modeptr = *modeptr | CMODEM; + *optr = *optr & ~CMODEM; + break; + case 'N': + *modeptr = *modeptr | CMODEN; + *optr = *optr & ~CMODEN; + break; + case 'O': + *modeptr = *modeptr | CMODEO; + *optr = *optr & ~CMODEO; + break; + case 'Q': + *modeptr = *modeptr | CMODEQ; + *optr = *optr & ~CMODEQ; + break; +#ifdef HAVE_SSL_MODE_z + case 'z': + *modeptr = *modeptr | CMODEz; + *optr = *optr & ~CMODEz; + break; +#endif + case 'T': + *modeptr = *modeptr | CMODET; + *optr = *optr & ~CMODET; + break; case 'k': if (modeptr == MinModes) { @@ -1589,10 +1631,10 @@ free(UpCaseChan); } -char *ConvertChanMode(char *StrModes, unsigned char Modes) +char *ConvertChanMode(char *StrModes, int Modes) { - unsigned char Mode; + int Mode; char *tmp; tmp = StrModes; @@ -1628,6 +1670,49 @@ if ((Mode & Modes) != 0) *StrModes++ = 'l'; + Mode = CMODEr; + if ((Mode & Modes) != 0) + *StrModes++ = 'r'; + + Mode = CMODEc; + if ((Mode & Modes) != 0) + *StrModes++ = 'c'; + + Mode = CMODES; + if ((Mode & Modes) != 0) + *StrModes++ = 'S'; + + Mode = CMODEC; + if ((Mode & Modes) != 0) + *StrModes++ = 'C'; + + Mode = CMODEM; + if ((Mode & Modes) != 0) + *StrModes++ = 'M'; + + Mode = CMODEN; + if ((Mode & Modes) != 0) + *StrModes++ = 'N'; + + Mode = CMODEO; + if ((Mode & Modes) != 0) + *StrModes++ = 'O'; + + Mode = CMODEQ; + if ((Mode & Modes) != 0) + *StrModes++ = 'Q'; + +#ifdef HAVE_SSL_MODE_z + Mode = CMODEz; + if ((Mode & Modes) != 0) + *StrModes++ = 'z'; +#endif + + + Mode = CMODET; + if ((Mode & Modes) != 0) + *StrModes++ = 'T'; + *StrModes = '\0'; return (tmp); } Index: x2/source/commands.c diff -u x2/source/commands.c:1.181 x2/source/commands.c:1.182 --- x2/source/commands.c:1.181 Tue Mar 16 20:43:03 2004 +++ x2/source/commands.c Wed Jun 9 16:33:03 2004 @@ -4672,10 +4672,11 @@ boolean Oper; char *UpCaseStr; char HelpFilePath[LINEBUFFSIZE]; - char* Comm; + char* Comm = NULL; Oper = IsOper(uptr); - Comm = strtok(rest, " "); + if(rest && *rest) + Comm = strtok(rest, " "); if (Comm && (strchr(Comm, '/') || strchr(Comm, '.'))) { @@ -4694,7 +4695,7 @@ } else { - send_to_user(uptr, "The operator help file is not available at the moment."); + send_to_user(uptr, "The operator help file is not available at the moment (%s).", strerror(errno)); return(FALSE); } } @@ -4708,7 +4709,7 @@ } else { - send_to_user(uptr, "The user help file is not available at the moment."); + send_to_user(uptr, "The user help file is not available at the moment (%s).", strerror(errno)); return(FALSE); } } Index: x2/source/config.h diff -u x2/source/config.h:1.75 x2/source/config.h:1.76 --- x2/source/config.h:1.75 Tue Mar 16 20:43:03 2004 +++ x2/source/config.h Wed Jun 9 16:33:03 2004 @@ -67,9 +67,8 @@ #define GATEURL "http://www.afternet.org/support/proxy.html" /* Uncomment the following for debugging. - * - * #define debugon */ +/* #define debugon */ /* If you dont want the word warez in channel names, define this. * TODO : This is a hack, and would do better in a config file. Do it! @@ -181,6 +180,10 @@ #define MAXRECVLEN 2000 #define MAXLINELEN 300 +/* Enable this if your ircu has ssl compiled in (mode +z) + */ +/* #define HAVE_SSL_MODE_z */ + /* Channels unvisited by (co)owner will be automatically * removed when they reach this many days old. */ @@ -206,6 +209,13 @@ /* These are for channel mode parsing */ #define NOMODES 0 +#define CMODET 1048576 +#define CMODEz 524288 +#define CMODEQ 262144 +#define CMODEO 131072 +#define CMODEN 65536 +#define CMODEM 32768 +#define CMODES 16384 #define CMODEu 8192 #define CMODEC 4096 #define CMODEc 2048 @@ -222,6 +232,7 @@ #define CMODEm 1 /* These are for User mode parsing.. */ +#define UMODEf 16384 #define UMODEh 8192 #define UMODEB 4096 #define UMODEaway 2048 Index: x2/source/help.c diff -u x2/source/help.c:1.1 x2/source/help.c:1.2 --- x2/source/help.c:1.1 Fri Mar 2 06:06:26 2001 +++ x2/source/help.c Wed Jun 9 16:33:03 2004 @@ -1,6 +1,6 @@ #include "config.h" -HelpSub(char *Target, char *Source) +int HelpSub(char *Target, char *Source) { char* ptr; int i; @@ -51,6 +51,7 @@ Target++; } *Target=0; + return 0; } int ShowCommHelp(UserListType uptr, FILE * HelpFile) Index: x2/source/parse.c diff -u x2/source/parse.c:1.85 x2/source/parse.c:1.86 --- x2/source/parse.c:1.85 Wed Jun 9 13:09:01 2004 +++ x2/source/parse.c Wed Jun 9 16:33:03 2004 @@ -99,6 +99,7 @@ { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, { "402", m_noop, TRUE, TRUE }, + { "FA", m_sethost, TRUE, FALSE }, { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ @@ -121,6 +122,12 @@ return(0); } +int m_sethost(M_PARAMS) +{ + /* TODO: Change the host part of the structure */ + return(0); +} + int m_notice(M_PARAMS) { char* to; @@ -189,6 +196,7 @@ { char* to; char CSHOST[MAXLEN]; + char buff[MAXLEN]; to = (char *) strtok(rest, " "); rest = (char *) strtok(NULL, "\r\n\0"); @@ -197,7 +205,10 @@ sprintf(CSHOST, "%s@%s", IrcNick, ServiceName); if(!strcasecmp(to, CSHOST)) - strcpy(to, NumNick); + { + to = buff; + strcpy(buff, NumNick); + } if(to[0] == '#') { if(rest[0] == CommandMark) @@ -385,7 +396,7 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes, *account, *hiddenhost; + char* modes, *account, *hiddenhost, *modef; UserListType UserPtr; unsigned int IP; @@ -418,6 +429,10 @@ { hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ } + if(strchr(modes, 'f')) + { + hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask */ + } Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } else Index: x2/source/parse.h diff -u x2/source/parse.h:1.11 x2/source/parse.h:1.12 --- x2/source/parse.h:1.11 Thu Jun 12 20:03:51 2003 +++ x2/source/parse.h Wed Jun 9 16:33:03 2004 @@ -27,4 +27,5 @@ int m_quit(M_PARAMS); int m_kill(M_PARAMS); int m_squit(M_PARAMS); +int m_sethost(M_PARAMS); Index: x2/source/set.c diff -u x2/source/set.c:1.6 x2/source/set.c:1.7 --- x2/source/set.c:1.6 Thu Feb 13 00:25:58 2003 +++ x2/source/set.c Wed Jun 9 16:33:03 2004 @@ -342,7 +342,7 @@ ConvertModeString(param, &cptr->PlusModes, &cptr->MinModes, &cptr->Key, &cptr->Limit); if(cptr->settings[INCHAN]) { - send_chanmode(cptr, "-k %s", cptr->CurrentKey); + /* ircu doesnt require this anymore: send_chanmode(cptr, "-k %s", cptr->CurrentKey); */ send_chanmode(cptr, "%s", GetModeString(ModeString, cptr->PlusModes, cptr->MinModes, cptr->Key, cptr->Limit)); } Index: x2/source/user.c diff -u x2/source/user.c:1.35 x2/source/user.c:1.36 --- x2/source/user.c:1.35 Sat Jun 14 13:24:18 2003 +++ x2/source/user.c Wed Jun 9 16:33:03 2004 @@ -569,6 +569,8 @@ case 'R': UserMode = UMODER; break; + case 'f': + UserMode = UMODEf; case '-': Operator = ch; break; ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-09 23:40:48
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-09 23:40:41 UTC Modified files: source/chan.c source/config.h source/server.c Log message: Forward ported channel expiration improvements from stable branch ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.88 x2/source/chan.c:1.89 --- x2/source/chan.c:1.88 Wed Jun 9 16:33:03 2004 +++ x2/source/chan.c Wed Jun 9 16:40:31 2004 @@ -2023,8 +2023,11 @@ NextChanPtr = TempChanPtr->Next; if((TempChanPtr->Regged) && !(TempChanPtr->settings[NODELETE]) && (TempChanPtr->LastAccess > 0)) /* If its not marked nodelete */ { - /* CHANEXPIREDAYS */ - if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANEXPIREDAYS) /* older than CHANEXPIREDAYS days */ + /* CHANEXPIRE */ + if ( ( (time(NULL) - TempChanPtr->LastAccess) > 3600 * CHANEXPIREHOURS ) /* older than CHANEXPIREhours hours */ + || ( ((time(NULL) - TempChanPtr->LastAccess) > 3600 * NEWCHANEXPIREHOURS) + && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + ) { Debug(DBGNOTICE, "Channel %s not visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); @@ -2045,8 +2048,11 @@ send_to_user(uptr, "Removing %s", TempChanPtr->Name); UnregExpired(TempChanPtr); } - /* CHANWARNEXPIREDAYS */ - if ((time(NULL) - TempChanPtr->LastAccess) > 86400 * CHANWARNEXPIREDAYS) + else if ( /* CHAN WARN EXPIRE */ + ( (time(NULL) - TempChanPtr->LastAccess) > 3600 * (CHANEXPIREHOURS-CHANWARNEXPIREHOURS) ) + || ( ((time(NULL) - TempChanPtr->LastAccess) > 3600 * (NEWCHANEXPIREHOURS-CHANWARNEXPIREHOURS) ) + && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) + ) { Debug(DBGNOTICE, "Channel %s not visited since %lu. Setting a warning topic.", TempChanPtr->Name, TempChanPtr->LastAccess); /* First, change the topic */ @@ -2060,23 +2066,7 @@ /* Save */ WriteChanOpFile(TempChanPtr); } - /* NEWCHANEXPIREDAYS */ - if( ((time(NULL) - TempChanPtr->LastAccess) > 86400 * NEWCHANEXPIREDAYS) && (TempChanPtr->LastAccess==TempChanPtr->CreationDate) ) - { - Debug(DBGINFO, "Channel %s never visited since %lu. Removing..", TempChanPtr->Name, TempChanPtr->LastAccess); - logfile = fopen(ExpiredChanLog, "a"); - if(logfile != 0) - { - ct = time(NULL); - strcpy(tmp, ctime(&ct)); - tmp[strlen(tmp) - 1] = '\0'; - strcpy(lvistime, ctime(&TempChanPtr->LastAccess)); - fprintf(logfile, ":%s: Channel %s removed, never visited since %s", tmp, - TempChanPtr->Name, lvistime); - fclose(logfile); - } - UnregExpired(TempChanPtr); - } + } TempChanPtr = NextChanPtr; } Index: x2/source/config.h diff -u x2/source/config.h:1.76 x2/source/config.h:1.77 --- x2/source/config.h:1.76 Wed Jun 9 16:33:03 2004 +++ x2/source/config.h Wed Jun 9 16:40:31 2004 @@ -185,15 +185,17 @@ /* #define HAVE_SSL_MODE_z */ /* Channels unvisited by (co)owner will be automatically - * removed when they reach this many days old. + * removed when they reach this many hours since the last + * owner/co-owner login. */ -#define CHANEXPIREDAYS 30 -/* unreg new never-logged-into channels in __ days */ -#define NEWCHANEXPIREDAYS 4 -/* Warn of impending expiration in __ days*/ -#define CHANWARNEXPIREDAYS 28 +#define CHANEXPIREHOURS (30 * 24) +/* unreg new never-logged-into channels in this many hours */ +#define NEWCHANEXPIREHOURS 2 +/* Warn of impending expiration this many + * hours before expiration */ +#define CHANWARNEXPIREHOURS 72 /* Warning message */ -#define CHANWARNMESSAGE "ATTENTION: This channel is going to expire soon! An Owner or CoOwner needs to log in!" +#define CHANWARNMESSAGE "ATTENTION: This channel will expire soon due to inactivity! '/msg x2 help expire' for details." /* This time stamp is used as the date registered channels were created in X2. * It should be older then the oldest channel on the network, or X2 wont get Index: x2/source/server.c diff -u x2/source/server.c:1.22 x2/source/server.c:1.23 --- x2/source/server.c:1.22 Thu Oct 23 19:50:18 2003 +++ x2/source/server.c Wed Jun 9 16:40:31 2004 @@ -116,7 +116,7 @@ char addy[MAXLEN]; char *a = addy; - Debug(DBGINFO, "Testing %s versus %s", gptr->address, ur); + /*Debug(DBGINFO, "Testing %s versus %s", gptr->address, ur); */ strcpy(addy, gptr->address); buff = (char *) mysep(&a, "@"); buff = mysep(&a, "$"); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-10 06:30:23
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-10 06:30:14 UTC Modified files: source/parse.c Log message: Apparently, in nefarious, umode +h in a burst does NOT include an argument. ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.86 x2/source/parse.c:1.87 --- x2/source/parse.c:1.86 Wed Jun 9 16:33:03 2004 +++ x2/source/parse.c Wed Jun 9 23:30:04 2004 @@ -425,10 +425,12 @@ { account = (char *) strtok(NULL, " "); /* This user has an account set from another service */ } + /* if(strchr(modes, 'h')) { - hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ + hiddenhost = (char *) strtok(NULL, " "); * This user has an hidden hostmask (asuka only) * } + */ if(strchr(modes, 'f')) { hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask */ ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-11 14:45:19
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-11 14:45:11 UTC Modified files: source/parse.c source/parse.h Log message: silenced 443 error code wallop (generated when inviteme is called while already in a chan) ---------------------- diff included ---------------------- Index: x2/source/parse.c diff -u x2/source/parse.c:1.87 x2/source/parse.c:1.88 --- x2/source/parse.c:1.87 Wed Jun 9 23:30:04 2004 +++ x2/source/parse.c Fri Jun 11 07:45:00 2004 @@ -98,7 +98,8 @@ { "SH", m_noop, FALSE, TRUE }, { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, - { "402", m_noop, TRUE, TRUE }, + { "402", m_logerror, TRUE, TRUE }, + { "443", m_logerror, TRUE, TRUE }, /* user is already on channel (invite attempt error) */ { "FA", m_sethost, TRUE, FALSE }, { NULL, NULL, FALSE, FALSE } }; @@ -122,6 +123,12 @@ return(0); } +int m_logerror(M_PARAMS) +{ + Debug(DBGINFO, "Uplink reported ERROR code: %s\n", rest); + return true; +} + int m_sethost(M_PARAMS) { /* TODO: Change the host part of the structure */ @@ -425,12 +432,10 @@ { account = (char *) strtok(NULL, " "); /* This user has an account set from another service */ } - /* if(strchr(modes, 'h')) { - hiddenhost = (char *) strtok(NULL, " "); * This user has an hidden hostmask (asuka only) * + hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ } - */ if(strchr(modes, 'f')) { hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask */ Index: x2/source/parse.h diff -u x2/source/parse.h:1.12 x2/source/parse.h:1.13 --- x2/source/parse.h:1.12 Wed Jun 9 16:33:03 2004 +++ x2/source/parse.h Fri Jun 11 07:45:00 2004 @@ -28,4 +28,4 @@ int m_kill(M_PARAMS); int m_squit(M_PARAMS); int m_sethost(M_PARAMS); - +int m_logerror(M_PARAMS); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2004-06-11 14:45:43
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-11 14:45:37 UTC Added files: HELP/EXPIRE Log message: adding help for expire command ---------------------- diff included ---------------------- Index: x2/HELP/EXPIRE diff -u /dev/null x2/HELP/EXPIRE:1.2 --- /dev/null Fri Jun 11 07:45:37 2004 +++ x2/HELP/EXPIRE Fri Jun 11 07:45:26 2004 @@ -0,0 +1,20 @@ + $n will automatically purge channels that + are not being used anymore. Every time + an owner or coowner joins their channel + the counter is reset. Expirations + occur accorrding to the following: + * NEW (never before logged-into) channels + expire in 2 hours. + * All other channels expire in 30 days. + * Either an Owner or a CoOwner must + join and log in to reset the counter. + * use the .wlist command to see how long + since an owner has been seen. + + NOTE: A special topic will be set to warn + of impending expiration 3 days before. + You must clear this warning manually + after logging in. + /MSG $n #channel topic * + /MSG $n #channel SET TOPICFREQ 0 + See /MSG $n HELP SET for details. ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2004-06-26 21:02:33
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-26 21:02:27 UTC Modified files: source/commands.c source/parse.c source/parse.h source/send.c Log message: Fix problem with X2 not sending entire server numeric due to %c and not %s. This was causing the problem with automatic reconnecting/rerouting. Added seperate placeholder functions for fakehost and sethost. X2 will now ignore numeric 401. (This commit is in memory of me crashing Hub-Svc.* while working on X2.) :P ---------------------- diff included ---------------------- Index: x2/source/commands.c diff -u x2/source/commands.c:1.182 x2/source/commands.c:1.183 --- x2/source/commands.c:1.182 Wed Jun 9 16:33:03 2004 +++ x2/source/commands.c Sat Jun 26 14:02:15 2004 @@ -1146,7 +1146,7 @@ int c_open(C_PARAM) { - send_chanmode(cptr, "-ilkmntps *"); + send_chanmode(cptr, "-ilkmnrtps *"); send_to_user(uptr, "Clearing %s of all modes.", cptr->Name); if(cptr->Regged) { Index: x2/source/parse.c diff -u x2/source/parse.c:1.88 x2/source/parse.c:1.89 --- x2/source/parse.c:1.88 Fri Jun 11 07:45:00 2004 +++ x2/source/parse.c Sat Jun 26 14:02:16 2004 @@ -59,8 +59,6 @@ { "WV", m_noop, TRUE, TRUE }, { "S", m_server, TRUE, FALSE }, { "B", m_burst, TRUE, FALSE }, -// wtf?? -// { "O", m_ping, TRUE, TRUE }, { "N", m_nick, TRUE, TRUE }, { "C", m_create, FALSE, TRUE }, { "J", m_join, FALSE, TRUE }, @@ -95,12 +93,13 @@ { "PRIVS", m_noop, TRUE, FALSE }, { "WU", m_noop, TRUE, TRUE }, { "LL", m_noop, TRUE, FALSE }, - { "SH", m_noop, FALSE, TRUE }, + { "SH", m_sethost, TRUE, FALSE }, + { "FA", m_fakehost, TRUE, FALSE }, { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, + { "401", m_logerror, TRUE, TRUE }, { "402", m_logerror, TRUE, TRUE }, - { "443", m_logerror, TRUE, TRUE }, /* user is already on channel (invite attempt error) */ - { "FA", m_sethost, TRUE, FALSE }, + { "443", m_logerror, TRUE, TRUE }, /* user is already on channel (invite attempt error) */ { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ @@ -135,6 +134,12 @@ return(0); } +int m_fakehost(M_PARAMS) +{ + /* TODO: Change the host part of the structure */ + return(0); +} + int m_notice(M_PARAMS) { char* to; @@ -403,7 +408,7 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes, *account, *hiddenhost, *modef; + char* modes, *account, *sethost, *fakehost, *modef; UserListType UserPtr; unsigned int IP; @@ -434,11 +439,11 @@ } if(strchr(modes, 'h')) { - hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ + sethost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka/Nefarious only) */ } if(strchr(modes, 'f')) { - hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask */ + fakehost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (GameSurge/Nefarious only) */ } Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } Index: x2/source/parse.h diff -u x2/source/parse.h:1.13 x2/source/parse.h:1.14 --- x2/source/parse.h:1.13 Fri Jun 11 07:45:00 2004 +++ x2/source/parse.h Sat Jun 26 14:02:16 2004 @@ -28,4 +28,5 @@ int m_kill(M_PARAMS); int m_squit(M_PARAMS); int m_sethost(M_PARAMS); +int m_fakehost(M_PARAMS); int m_logerror(M_PARAMS); Index: x2/source/send.c diff -u x2/source/send.c:1.37 x2/source/send.c:1.38 --- x2/source/send.c:1.37 Sun Oct 26 13:45:53 2003 +++ x2/source/send.c Sat Jun 26 14:02:16 2004 @@ -138,7 +138,7 @@ * returns the status, not our uplink. This is important * for getting good away status. */ - send_command_from_nick("W %c :%s", uptr->Numnick[0], uptr->Nick); + send_command_from_nick("W %s :%s", uptr->Numnick[0], uptr->Nick); } void send_chanmode(ChannelListType cptr, char *format, ...) @@ -231,7 +231,7 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("GL %c +%s %lu :%s", num, mask, duration, buff); + send_command_from_server("GL %s +%s %lu :%s", num, mask, duration, buff); } void send_ungline(char *mask) @@ -331,7 +331,7 @@ void send_connect(char *servertoconnect, int port, ServerListType target) { - send_command_from_nick("CO %s %d :%c", servertoconnect, port, target->numnick); + send_command_from_nick("CO %s %d :%s", servertoconnect, port, target->numnick); } void send_spoofserv(char *servname, int Numeric, char *format, ...) @@ -344,8 +344,8 @@ vsprintf(buff, format, args); va_end(args); - send_command_from_server("S %s 1 9999999999 9999999999 P10 %cD] 0 :%s", - servname, NumChar, buff); + send_command_from_server("S %s 1 9999999999 9999999999 P10 %sD] + :%s", + servname, NumChar, buff); } void send_numeric(int number, char *target, char *format, ...) @@ -537,7 +537,7 @@ if(TempChanPtr->settings[INCHAN]) { TempChanPtr->NumOfNicks++; /* Note that we joined the channel */ - sendtosock(Sock, "%c B %s %lu %s:o", + sendtosock(Sock, "%s B %s %lu %s:o", convert2y[ServiceNumeric], /* servers numnick */ TempChanPtr->Name, /* #channel */ TempChanPtr->CreationDate, /* Hopefully already set by other side BURST */ ----------------------- End of diff ----------------------- |