Go to the source code of this file.
Functions | |
static void | cmd_servers (struct userrec *u, int idx, char *par) |
static void | cmd_dump (struct userrec *u, int idx, char *par) |
static void | cmd_jump (struct userrec *u, int idx, char *par) |
static void | cmd_clearqueue (struct userrec *u, int idx, char *par) |
Variables | |
static cmd_t | C_dcc_serv [] |
static void cmd_clearqueue | ( | struct userrec * | u, | |
int | idx, | |||
char * | par | |||
) | [static] |
Definition at line 89 of file cmdsserv.c.
References burst, dcc, double_warned, dprintf, egg_strcasecmp, LOG_CMDS, modeq, msgq_clear(), putlog, and msgq_head::tot.
00090 { 00091 int msgs; 00092 00093 if (!par[0]) { 00094 dprintf(idx, "Usage: clearqueue <mode|server|help|all>\n"); 00095 return; 00096 } 00097 if (!egg_strcasecmp(par, "all")) { 00098 msgs = modeq.tot + mq.tot + hq.tot; 00099 msgq_clear(&modeq); 00100 msgq_clear(&mq); 00101 msgq_clear(&hq); 00102 double_warned = burst = 0; 00103 dprintf(idx, "Removed %d message%s from all queues.\n", msgs, 00104 (msgs != 1) ? "s" : ""); 00105 } else if (!egg_strcasecmp(par, "mode")) { 00106 msgs = modeq.tot; 00107 msgq_clear(&modeq); 00108 if (mq.tot == 0) 00109 burst = 0; 00110 double_warned = 0; 00111 dprintf(idx, "Removed %d message%s from the mode queue.\n", msgs, 00112 (msgs != 1) ? "s" : ""); 00113 } else if (!egg_strcasecmp(par, "help")) { 00114 msgs = hq.tot; 00115 msgq_clear(&hq); 00116 double_warned = 0; 00117 dprintf(idx, "Removed %d message%s from the help queue.\n", msgs, 00118 (msgs != 1) ? "s" : ""); 00119 } else if (!egg_strcasecmp(par, "server")) { 00120 msgs = mq.tot; 00121 msgq_clear(&mq); 00122 if (modeq.tot == 0) 00123 burst = 0; 00124 double_warned = 0; 00125 dprintf(idx, "Removed %d message%s from the server queue.\n", msgs, 00126 (msgs != 1) ? "s" : ""); 00127 } else { 00128 dprintf(idx, "Usage: clearqueue <mode|server|help|all>\n"); 00129 return; 00130 } 00131 putlog(LOG_CMDS, "*", "#%s# clearqueue %s", dcc[idx].nick, par); 00132 }
static void cmd_dump | ( | struct userrec * | u, | |
int | idx, | |||
char * | par | |||
) | [static] |
Definition at line 53 of file cmdsserv.c.
References dcc, DP_SERVER, dprintf, isowner, LOG_CMDS, MISC_NOSUCHCMD, must_be_owner, and putlog.
00054 { 00055 if (!(isowner(dcc[idx].nick)) && (must_be_owner == 2)) { 00056 dprintf(idx, MISC_NOSUCHCMD); 00057 return; 00058 } 00059 if (!par[0]) { 00060 dprintf(idx, "Usage: dump <server stuff>\n"); 00061 return; 00062 } 00063 putlog(LOG_CMDS, "*", "#%s# dump %s", dcc[idx].nick, par); 00064 dprintf(DP_SERVER, "%s\n", par); 00065 }
static void cmd_jump | ( | struct userrec * | u, | |
int | idx, | |||
char * | par | |||
) | [static] |
Definition at line 67 of file cmdsserv.c.
References cycle_time, dcc, default_port, dprintf, IRC_JUMP, LOG_CMDS, newserver, newserverpass, newserverport, newsplit, nuke_server(), server_list::port, putlog, and strncpyz.
00068 { 00069 char *other; 00070 int port; 00071 00072 if (par[0]) { 00073 other = newsplit(&par); 00074 port = atoi(newsplit(&par)); 00075 if (!port) 00076 port = default_port; 00077 putlog(LOG_CMDS, "*", "#%s# jump %s %d %s", dcc[idx].nick, other, 00078 port, par); 00079 strncpyz(newserver, other, sizeof newserver); 00080 newserverport = port; 00081 strncpyz(newserverpass, par, sizeof newserverpass); 00082 } else 00083 putlog(LOG_CMDS, "*", "#%s# jump", dcc[idx].nick); 00084 dprintf(idx, "%s...\n", IRC_JUMP); 00085 cycle_time = 0; 00086 nuke_server("changing servers"); 00087 }
static void cmd_servers | ( | struct userrec * | u, | |
int | idx, | |||
char * | par | |||
) | [static] |
Definition at line 26 of file cmdsserv.c.
References curserv, dcc, default_port, dprintf, egg_snprintf, LOG_CMDS, server_list::name, server_list::next, server_list::port, putlog, realservername, and serverlist.
00027 { 00028 struct server_list *x = serverlist; 00029 int i; 00030 char s[1024]; 00031 00032 putlog(LOG_CMDS, "*", "#%s# servers", dcc[idx].nick); 00033 if (!x) { 00034 dprintf(idx, "There are no servers in the server list.\n"); 00035 } else { 00036 dprintf(idx, "Server list:\n"); 00037 i = 0; 00038 for (; x; x = x->next) { 00039 if ((i == curserv) && realservername) 00040 egg_snprintf(s, sizeof s, " %s:%d (%s) <- I am here", x->name, 00041 x->port ? x->port : default_port, realservername); 00042 else 00043 egg_snprintf(s, sizeof s, " %s:%d %s", x->name, 00044 x->port ? x->port : default_port, 00045 (i == curserv) ? "<- I am here" : ""); 00046 dprintf(idx, "%s\n", s); 00047 i++; 00048 } 00049 dprintf(idx, "End of server list.\n"); 00050 } 00051 }
cmd_t C_dcc_serv[] [static] |
{ {"dump", "m", (IntFunc) cmd_dump, 0 }, {"jump", "m", (IntFunc) cmd_jump, 0 }, {"servers", "o", (IntFunc) cmd_servers, 0 }, {"clearqueue", "m", (IntFunc) cmd_clearqueue, 0 }, { 0 , 0 , 0 , 0 } }
Definition at line 134 of file cmdsserv.c.
Referenced by server_close(), and server_start().