Only in .: 1.sh Only in .: CVS diff -dur ../iroffer1.4.b02.orig/Configure ./Configure --- ../iroffer1.4.b02.orig/Configure Mon Jan 17 00:17:40 2005 +++ ./Configure Tue May 10 06:26:20 2005 @@ -7,6 +7,7 @@ VERSION=1.4.b02 RELEASE=1 +MOD="1.11" if [ -d BitKeeper -a -f "`type bk 2>/dev/null | awk '{print $NF}'`" ]; then CSET=`bk prs -h -d':UTC:\n' -r+ ChangeSet` @@ -18,9 +19,9 @@ fi if [ $RELEASE -eq 1 ]; then - VERSIONLONG="$VERSION [$CSET]" + VERSIONLONG="$VERSION [$CSET] mod by Dinoex $MOD" else - VERSIONLONG="$VERSION [PRERELEASE $CSET]" + VERSIONLONG="$VERSION [PRERELEASE $CSET] mod by Dinoex $MOD" fi echo Only in .: Makefile Only in .: README.modDinoex Only in .: TODO Only in .: c.sh Only in .: convertxdccfile Only in .: d.sh Only in .: i.sh Only in .: iroffer Only in .: log Only in .: m.sh Only in .: obj Only in .: p.sh Only in .: patch-dinoex-16 Only in .: r.sh diff -dur ../iroffer1.4.b02.orig/sample.config ./sample.config --- ../iroffer1.4.b02.orig/sample.config Mon Jan 17 00:17:40 2005 +++ ./sample.config Tue May 10 06:31:44 2005 @@ -40,6 +40,18 @@ ### needed. ### #xdcclistfile mybot.txt +############################################################################## +### - xdcc listing group only - ### +### Export your xdcc list with group and main information only. ### +### Default ouput is all packs and no group ionformation. ### +#xdcclist_grouponly + +############################################################################# +### - admin job file - ### +### when defined, read this file for commands and execute them. ### +### ouput will be written in .done ### +#admin_job_file mybot.job + ############################################################################## ## IRC ## @@ -131,6 +143,12 @@ ############################################################################## +### - watch this user - ### +### No new "xdcc send" are accepted, when this user is not online. ### +### Old queue entries are still send. ### +#enable_nick master + +############################################################################## ### - virtual hosts - ### ### If the computer you want to run iroffer on has multiple local IP ### ### addressses, you can run iroffer on any of those ip addresses. ### @@ -163,6 +181,12 @@ #usenatip 123.456.789.123 ############################################################################## +### - automatic dcc ip translation - ### +### Get my own IP from the ircserver, and uses this as value for usenatip. ### +### Set usenatip to a default value when using this option. ### +#getipfromserver + +############################################################################## ### - excluded from auto-ignore - ### ### These hostmasks (one per line) will never be ignored. ### #autoignore_exclude nickserv!nickserv@services.domain.com @@ -208,6 +232,30 @@ #filedir /home/me/files ############################################################################## +### - no duplicate files - ### +### When configured, add, adddir and addnew refuses to add a files that ### +### already have been added. Full path is compared. ### +#noduplicatefiles + +############################################################################## +### - groups in caps - ### +### if set, all groups names changed will be folded to uppercase. ### +#groupsincaps + +############################################################################## +### - auto default group - ### +### When adding a new file, search for matching enries and assing the ### +### new file to the same group. ### +#auto_default_group + +############################################################################## +### - adddir exlcude pattern - ### +### When configured, addir and adnew will skip all files that match this ### +### patterns. ### +#adddir_exclude *.txt +#adddir_exclude *.md5 + +############################################################################## ### - restrict xdcc list and xdcc send - ### ### if set, xdcc list and/or xdcc send|info will be restricted to users ### ### who are on a known channel. If a user is not on one of the known ### @@ -221,6 +269,23 @@ #restrictsend ############################################################################## +### - restrictprivlistmain - ### +### if set, "xdcc list" without an option will be rejected. ### +### this allows to list a single group only. ### +#restrictprivlistmain + +############################################################################## +### - restrictprivlistfull - ### +### if set, "xdcc list all" will be rejected. ### +#restrictprivlistfull + +############################################################################## +## - need voice - ## +## Restrict list/send to only voiced/opped users. ## +## restrictlist and restrictsend must be set yes. ## +#need_voice + +############################################################################## ### - channel xdcc commands - ### ### if set, iroffer will respond to xdcc requests sent to a channel in ### ### addition to xdcc requests sent to iroffer directly. ### @@ -300,6 +365,11 @@ ### 5000MB per month, and 1200MB per week, and 200MB per day. ### #transferlimits 200 1200 5000 +############################################################################## +### - start of month - ### +### day of month when to reset the monthly traffic limit, default 1 ### +#start_of_month 1 + ############################################################################## ## Other ## @@ -318,6 +388,11 @@ ### - headline - ### ### Put a headline at the top of all xdcc lists ### #headline New Stuff Just Added!! + +############################################################################## +### - hide_list_info - ### +### Don't print line with "/msg nick xdcc info #x" ### +#hide_list_info ############################################################################## ### - credit line - ### Only in ./src: CVS diff -dur ../iroffer1.4.b02.orig/src/convertxdccfile.c ./src/convertxdccfile.c --- ../iroffer1.4.b02.orig/src/convertxdccfile.c Mon Jan 17 00:17:40 2005 +++ ./src/convertxdccfile.c Wed Jan 19 19:17:58 2005 @@ -25,10 +25,56 @@ static void usage(const char *progname) { - fprintf(stderr, "Usage: %s [-v] -x mybot.xdcc -s mybot.state\n", progname); + fprintf(stderr, "Usage: %s [-v] [-g] -x mybot.xdcc -s mybot.state\n", progname); exit(1); } +int splizzer; + +struct list_s { + struct list_s *l_next; + char *l_data; +} *seen_list; + +static struct list_s *seen_init(const char *data) +{ + struct list_s *new; + + new = malloc(sizeof(struct list_s)); + if (new == NULL) + return NULL; + new->l_next = NULL; + new->l_data = (data != NULL) ? strdup(data) : NULL; + return new; +} + +static int seen(const char *data) +{ + struct list_s *old; + struct list_s *new; + + if (seen_list == NULL) { + new = seen_init(data); + seen_list = new; + return 0; + } + old = seen_list; + while (old->l_next != NULL) { + if (old->l_data != NULL) { + if (strcasecmp(old->l_data,data) == 0) + return 1; + } + old = old->l_next; + } + + if (old->l_data != NULL) { + if (strcasecmp(old->l_data,data) == 0) + return 1; + } + new = seen_init(data); + old->l_next = new; + return 0; +} static void getxdccconfig(const char *filename) { char *templine1 = mycalloc(maxtextlength); @@ -37,6 +83,9 @@ char *templine4 = mycalloc(maxtextlength); char *templine5 = mycalloc(maxtextlength); char *templine6 = mycalloc(maxtextlength); + char *templine7 = mycalloc(maxtextlength); + char *templine8 = mycalloc(maxtextlength); + char *templine9 = mycalloc(maxtextlength); char *msg; int ok,i; int filedescriptor,xfiledescriptor; @@ -136,8 +185,16 @@ if (getfline(templine5,maxtextlength,filedescriptor,0) == NULL) ok++; if (getfline(templine6,maxtextlength,filedescriptor,0) == NULL) ok++; - if (ok) + if (splizzer != 0) { + if (getfline(templine7,maxtextlength,filedescriptor,0) == NULL) ok++; + if (getfline(templine8,maxtextlength,filedescriptor,0) == NULL) ok++; + if (getfline(templine9,maxtextlength,filedescriptor,0) == NULL) ok++; + } + + if (ok) { + printf("** ERROR: to read a XDCC file with group definitions use '-g'\n"); outerror(OUTERROR_TYPE_CRASH,"XDCC file syntax error (missing/extra line)"); + } for (i=strlen(templine1)-1; i>7 && templine1[i] == ' '; i--) templine1[i] = '\0'; @@ -151,6 +208,12 @@ templine5[i] = '\0'; for (i=strlen(templine6)-1; i>7 && templine6[i] == ' '; i--) templine6[i] = '\0'; + for (i=strlen(templine7)-1; i>7 && templine7[i] == ' '; i--) + templine7[i] = '\0'; + for (i=strlen(templine8)-1; i>7 && templine8[i] == ' '; i--) + templine8[i] = '\0'; + for (i=strlen(templine9)-1; i>7 && templine9[i] == ' '; i--) + templine9[i] = '\0'; if ((strlen(templine1) < 8) || strncmp(templine1+3,"file ",5)) ok++; if ((strlen(templine2) < 8) || strncmp(templine2+3,"desc ",5)) ok++; @@ -158,6 +221,13 @@ if ((strlen(templine4) < 8) || strncmp(templine4+3,"gets ",5)) ok++; if ((strlen(templine5) < 8) || strncmp(templine5+3,"mins ",5)) ok++; if ((strlen(templine6) < 8) || strncmp(templine6+3,"maxs ",5)) ok++; + if (splizzer != 0) { + if ((strlen(templine7) < 8) || strncmp(templine7+3,"data ",5)) ok++; + if ((strlen(templine8) < 8) || strncmp(templine8+3,"trig ",5)) ok++; + if ((strlen(templine9) < 8) || strncmp(templine9+3,"trno ",5)) ok++; + } + if (ok) + printf("error=%d, near file=%s\n", ok, templine1); if (ok) outerror(OUTERROR_TYPE_CRASH,"XDCC file syntax error (incorrect order?)"); @@ -176,6 +246,17 @@ xd->gets = atoi(templine4+8); + xd->group = NULL; + xd->group_desc = NULL; + if (splizzer != 0) { + xd->group = mycalloc(strlen(templine7+8)+1); + strcpy(xd->group,templine7+8); + if (seen(templine9+8) == 0) { + xd->group_desc = mycalloc(strlen(templine9+8)+1); + strcpy(xd->group_desc,templine9+8); + } + } + xd->minspeed = gdata.transferminspeed; if ( atof(templine5+8) > 0) xd->minspeed = atof(templine5+8); @@ -239,6 +320,10 @@ mydelete(templine4); mydelete(templine5); mydelete(templine6); + mydelete(templine6); + mydelete(templine7); + mydelete(templine8); + mydelete(templine9); } @@ -254,6 +339,8 @@ gdata.nocolor = 1; gdata.noscreen = 1; gdata.debug = 1; + splizzer = 0; + seen_list = NULL; #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) /* 4GB max size */ @@ -267,12 +354,16 @@ gdata.startuptime = gdata.curtime = time(NULL); gdata.curtimems = ((unsigned long long)gdata.curtime) * 1000; - while ((callval_i = getopt(argc, argv, "vx:s:")) >= 0) + while ((callval_i = getopt(argc, argv, "vgx:s:")) >= 0) { switch (callval_i) { case 'v': gdata.debug++; + break; + + case 'g': + splizzer++; break; case 'x': diff -dur ../iroffer1.4.b02.orig/src/iroffer_admin.c ./src/iroffer_admin.c --- ../iroffer1.4.b02.orig/src/iroffer_admin.c Mon Jan 17 00:17:40 2005 +++ ./src/iroffer_admin.c Thu May 19 07:36:42 2005 @@ -28,6 +28,11 @@ u_respond(const userinput * const u, const char *format, ...); static void u_help(const userinput * const u); +static int u_xdl_space(void); +static void u_xdl_pack(char *tempstr, int i, int s, const xdcc *xd); +static void u_xdl_head(const userinput * const u); +static void u_xdl_full(const userinput * const u); +static void u_xdl_group(const userinput * const u); static void u_xdl(const userinput * const u); static void u_xds(const userinput * const u); static void u_dcl(const userinput * const u); @@ -45,6 +50,7 @@ static void u_remove(const userinput * const u); static void u_removedir(const userinput * const u); static void u_send(const userinput * const u); +static void u_queue(const userinput * const u); static void u_psend(const userinput * const u); static void u_msg(const userinput * const u); static void u_mesg(const userinput * const u); @@ -57,9 +63,15 @@ static void u_chmins(const userinput * const u); static void u_chmaxs(const userinput * const u); static void u_chgets(const userinput * const u); +static void u_lock(const userinput * const u); +static void u_unlock(const userinput * const u); +static void u_groupdesc(const userinput * const u); +static void u_group(const userinput * const u); +static void u_regroup(const userinput * const u); static void u_add(const userinput * const u); static void u_adddir(const userinput * const u); static void u_addnew(const userinput * const u); +static void u_addgroup(const userinput * const u); static void u_chatme(const userinput * const u); static void u_chatl(const userinput * const u); static void u_closec(const userinput * const u); @@ -103,6 +115,8 @@ /* local info */ static const userinput_parse_t userinput_parse[] = { {1,method_allow_all,u_help, "HELP",NULL,"Shows Help"}, +{1,method_allow_all_xdl,u_xdl_full, "XDLFULL",NULL,"Lists All Offered Files"}, +{1,method_allow_all_xdl,u_xdl_group, "XDLGROUP","","Show "}, {1,method_allow_all_xdl,u_xdl, "XDL",NULL,"Lists Offered Files"}, {1,method_allow_all,u_xds, "XDS",NULL,"Save XDCC File"}, {1,method_allow_all,u_dcl, "DCL",NULL,"Lists Current Transfers"}, @@ -119,6 +133,7 @@ {2,method_allow_all,u_nomin, "NOMIN","n","Disables Minspeed For Transfer ID n"}, {2,method_allow_all,u_nomax, "NOMAX","n","Disables Maxspeed For Transfer ID n"}, {2,method_allow_all,u_send, "SEND","nick n","Sends Pack n to nick"}, +{2,method_allow_all,u_queue, "QUEUE","nick n","Queues Pack n for nick"}, {2,method_allow_all,u_psend, "PSEND","