Permalink
Browse files

- extend admin commands: CHMAXS,CHMINS

  • Loading branch information...
1 parent 14d8f38 commit 7886cdae27428319be3469480c2846401d3f48df cvs committed Nov 13, 2010
Showing with 108 additions and 68 deletions.
  1. +7 −1 LIESMICH.modDinoex
  2. +7 −1 README.modDinoex
  3. +1 −0 THANKS
  4. +3 −2 de.txt
  5. +3 −2 en.txt
  6. +3 −2 it.txt
  7. +80 −0 src/dinoex_admin.c
  8. +2 −0 src/dinoex_admin.h
  9. +2 −60 src/iroffer_admin.c
View
@@ -3,10 +3,16 @@ Aktuelle Version auf: http://iroffer.dinoex.net/
Ab Version 3.25:
----------------
+340) CHMINS, CHMAXS
+
+ Neue Admin Kommandos:
+ CHMINS <n> <m> <x> Change min speed to <x> KB/s for pack <n> to <m>
+ CHMAXS <n> <m> <x> Change max speed to <x> KB/s for pack <n> to <m>
+
bugfix: autoaddann
Die []-Klammern wurden auf dem Default-Text entfernt.
-338) show_group_of_pack
+339) show_group_of_pack
Zeige zu allen Paketen auch die Gruppe an.
Default Ausgabe ohne die Gruppe
View
@@ -3,10 +3,16 @@ Aktuelle Version auf: http://iroffer.dinoex.net/
With Version 3.25:
------------------
+340) CHMINS, CHMAXS (inspired by CreeW)
+
+ new admin commands:
+ CHMINS <n> <m> <x> Change min speed to <x> KB/s for pack <n> to <m>
+ CHMAXS <n> <m> <x> Change max speed to <x> KB/s for pack <n> to <m>
+
bugfix: autoaddann (reported by Aashiqmunda)
Removed []-brackets from default announce text.
-338) show_group_of_pack (inspired by Zenquibo)
+339) show_group_of_pack (inspired by Zenquibo)
Export your xdcc list with group for each pack.
Default output is just the packs
View
1 THANKS
@@ -549,6 +549,7 @@ CreeW
suggesting "CHCOLOR"
suggesting "autoadd_color"
reporting "CHCOLOR" bug
+ suggesting "CHMAXS" with range
[M]-V
reporting ADDDIR spaces bug
View
5 de.txt
@@ -92,9 +92,9 @@
93 "�ndert die Anmerkung von Packet n auf <msg>"
94 "CHMINS"
95 "n x"
-96 "�ndert die Minimalgeschwindigkeit von Pack <n> auf <x> KB (0 f�r aus)"
+96 "�ndert die Minimalgeschwindigkeit von Pack <n> bis <m> auf <x> KB (0 f�r aus)"
97 "CHMAXS"
-98 "�ndert die Maximalgeschwindigkeit von Pack <n> auf <x> KB (0 f�r aus)"
+98 "�ndert die Maximalgeschwindigkeit von Pack <n> bis <m> auf <x> KB (0 f�r aus)"
99 "CHLIMIT"
100 "�ndert das t�gliche Downloadlimit von Pack <n> auf <x> �bertragungen (0 f�r aus)"
101 "CHLIMITINFO"
@@ -2393,3 +2393,4 @@
2709 "<xdcc>\n"
2710 "</xdcc>\n"
2711 "show_group_of_pack"
+2712 "n [m] x"
View
5 en.txt
@@ -92,9 +92,9 @@
93 "Change note of pack <n> to <msg>"
94 "CHMINS"
95 "n x"
-96 "Change min speed of pack <n> to <x> KB/s"
+96 "Change min speed to <x> KB/s for pack <n> to <m>"
97 "CHMAXS"
-98 "Change max speed of pack <n> to <x> KB/s"
+98 "Change max speed to <x> KB/s for pack <n> to <m>"
99 "CHLIMIT"
100 "Change download limit of pack <n> to <x> transfers per day"
101 "CHLIMITINFO"
@@ -2393,3 +2393,4 @@
2709 "<xdcc>\n"
2710 "</xdcc>\n"
2711 "show_group_of_pack"
+2712 "n [m] x"
View
5 it.txt
@@ -92,9 +92,9 @@
93 "Cambia la nota del pack <n> in <msg>"
94 "CHMINS"
95 "n x"
-96 "Setta per il pack <n> la velocit� minima di <x> KB/s (minspeed)"
+96 "Setta per il pack <n> a <m> la velocit� minima di <x> KB/s (minspeed)"
97 "CHMAXS"
-98 "Setta per il pack <n> la velocit� massima di <x> KB/s (maxspeed)"
+98 "Setta per il pack <n> a <m> la velocit� massima di <x> KB/s (maxspeed)"
99 "CHLIMIT"
100 "Cambia il limite download del pack <n> a <x> trasferimenti al giorno"
101 "CHLIMITINFO"
@@ -2393,3 +2393,4 @@
2709 "<xdcc>\n"
2710 "</xdcc>\n"
2711 "show_group_of_pack"
+2712 "n [m] x"
View
@@ -2431,6 +2431,86 @@ void a_chtime(const userinput * const u)
write_files();
}
+void a_chmins(const userinput * const u)
+{
+ unsigned int num1;
+ unsigned int num2;
+ char *last;
+ xdcc *xd;
+
+ updatecontext();
+
+ num1 = get_pack_nr(u, u->arg1);
+ if (num1 == 0)
+ return;
+
+ last = u->arg2;
+ num2 = num1;
+ if (u->arg3) {
+ num2 = get_pack_nr2(u, u->arg2, num1);
+ if (num2 == 0)
+ return;
+
+ last = u->arg3;
+ }
+ if (!last || !strlen(last)) {
+ a_respond(u,"Try Specifying a Minspeed");
+ return;
+ }
+
+ for (; num1 <= num2; ++num1) {
+ xd = irlist_get_nth(&gdata.xdccs, num1 - 1);
+ if (group_restricted(u, xd))
+ return;
+
+ xd->minspeed = gdata.transferminspeed;
+ if ( atof(last) != gdata.transferminspeed )
+ xd->minspeed = atof(last);
+ a_respond(u, "CHMINS: [Pack %u] Old: %1.1f New: %1.1f", num1, xd->minspeed, atof(last));
+ }
+
+ write_files();
+}
+
+void a_chmaxs(const userinput * const u)
+{
+ unsigned int num1;
+ unsigned int num2;
+ char *last;
+ xdcc *xd;
+
+ updatecontext();
+
+ num1 = get_pack_nr(u, u->arg1);
+ if (num1 == 0)
+ return;
+
+ last = u->arg2;
+ num2 = num1;
+ if (u->arg3) {
+ num2 = get_pack_nr2(u, u->arg2, num1);
+ if (num2 == 0)
+ return;
+
+ last = u->arg3;
+ }
+ if (invalid_maxspeed(u, last) != 0)
+ return;
+
+ for (; num1 <= num2; ++num1) {
+ xd = irlist_get_nth(&gdata.xdccs, num1 - 1);
+ if (group_restricted(u, xd))
+ return;
+
+ xd->maxspeed = gdata.transfermaxspeed;
+ if ( atof(last) != gdata.transfermaxspeed )
+ xd->maxspeed = atof(last);
+ a_respond(u, "CHMAXS: [Pack %u] Old: %1.1f New: %1.1f", num1, xd->maxspeed, atof(last));
+ }
+
+ write_files();
+}
+
void a_chlimit(const userinput * const u)
{
unsigned int num;
View
@@ -68,6 +68,8 @@ void a_addmatch(const userinput * const u);
void a_newgroup(const userinput * const u);
void a_chdesc(const userinput * const u);
void a_chtime(const userinput * const u);
+void a_chmins(const userinput * const u);
+void a_chmaxs(const userinput * const u);
void a_chlimit(const userinput * const u);
void a_chlimitinfo(const userinput * const u);
void a_chtrigger(const userinput * const u);
View
@@ -48,8 +48,6 @@ static void u_psend(const userinput * const u);
static void u_quit(const userinput * const u);
static void u_status(const userinput * const u);
static void u_chnote(const userinput * const u);
-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_chatme(const userinput * const u);
static void u_chatl(const userinput * const u);
@@ -146,8 +144,8 @@ static const userinput_parse_t userinput_parse[] = {
{3,3,method_allow_all,a_chdesc, "CHDESC","n [msg]","Change description of pack <n> to <msg>"},
{3,3,method_allow_all,u_chnote, "CHNOTE","n [msg]","Change note of pack <n> to <msg>"},
{3,3,method_allow_all,a_chtime, "CHTIME","n [msg]","Change add time of pack <n> to <msg>"},
-{3,3,method_allow_all,u_chmins, "CHMINS","n x","Change min speed of pack <n> to <x> KB/s"},
-{3,3,method_allow_all,u_chmaxs, "CHMAXS","n x","Change max speed of pack <n> to <x> KB/s"},
+{3,3,method_allow_all,a_chmins, "CHMINS","n [m] x","Change min speed to <x> KB/s for pack <n> to <m>"},
+{3,3,method_allow_all,a_chmaxs, "CHMAXS","n [m] x","Change max speed to <x> KB/s for pack <n> to <m>"},
{3,3,method_allow_all,a_chlimit, "CHLIMIT","n x","Change download limit of pack <n> to <x> transfers per day"},
{3,3,method_allow_all,a_chlimitinfo, "CHLIMITINFO","n [msg]","Change over limit info of pack <n> to <msg>"},
{3,3,method_allow_all,a_chtrigger, "CHTRIGGER","n [msg]","Change trigger for pack <n> to <msg>"},
@@ -1498,62 +1496,6 @@ static void u_chnote(const userinput * const u) {
write_files();
}
-static void u_chmins(const userinput * const u) {
- unsigned int num;
- xdcc *xd;
-
- updatecontext();
-
- num = get_pack_nr(u, u->arg1);
- if (num <= 0)
- return;
-
- if (!u->arg2 || !strlen(u->arg2)) {
- u_respond(u,"Try Specifying a Minspeed");
- return;
- }
-
- xd = irlist_get_nth(&gdata.xdccs, num-1);
- if (group_restricted(u, xd))
- return;
-
- u_respond(u, "CHMINS: [Pack %u] Old: %1.1f New: %1.1f",
- num,xd->minspeed,atof(u->arg2));
-
- xd->minspeed = gdata.transferminspeed;
- if ( atof(u->arg2) != gdata.transferminspeed )
- xd->minspeed = atof(u->arg2);
-
- write_files();
- }
-
-static void u_chmaxs(const userinput * const u) {
- unsigned int num;
- xdcc *xd;
-
- updatecontext();
-
- num = get_pack_nr(u, u->arg1);
- if (num <= 0)
- return;
-
- if (invalid_maxspeed(u, u->arg2) != 0)
- return;
-
- xd = irlist_get_nth(&gdata.xdccs, num-1);
- if (group_restricted(u, xd))
- return;
-
- u_respond(u, "CHMAXS: [Pack %u] Old: %1.1f New: %1.1f",
- num,xd->maxspeed,atof(u->arg2));
-
- xd->maxspeed = gdata.transfermaxspeed;
- if ( atof(u->arg2) != gdata.transfermaxspeed )
- xd->maxspeed = atof(u->arg2);
-
- write_files();
- }
-
static void u_chgets(const userinput * const u)
{
unsigned int num;

0 comments on commit 7886cda

Please sign in to comment.