2003-05-26 09:18:31 +00:00
|
|
|
/* NeoStats - IRC Statistical Services
|
2004-01-14 11:36:37 +00:00
|
|
|
** Copyright (c) 1999-2004 Adam Rutter, Justin Hammond
|
2002-09-04 08:40:29 +00:00
|
|
|
** http://www.neostats.net/
|
|
|
|
**
|
|
|
|
** This program is free software; you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation; either version 2 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This program is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with this program; if not, write to the Free Software
|
|
|
|
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
** USA
|
|
|
|
**
|
|
|
|
** NeoStats CVS Identification
|
2003-09-22 15:04:15 +00:00
|
|
|
** $Id$
|
2002-07-30 06:11:23 +00:00
|
|
|
*/
|
2003-06-13 13:11:50 +00:00
|
|
|
|
2002-07-30 06:11:23 +00:00
|
|
|
#include "stats.h"
|
2003-06-26 05:14:16 +00:00
|
|
|
#include "ircd.h"
|
2002-08-10 06:30:44 +00:00
|
|
|
#include "hybrid7.h"
|
2003-04-11 09:26:31 +00:00
|
|
|
#include "log.h"
|
|
|
|
|
2004-01-20 22:56:23 +00:00
|
|
|
static void m_version (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_motd (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_admin (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_credits (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_server (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_squit (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_quit (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_mode (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_kill (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_pong (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_away (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_nick (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_topic (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_kick (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_join (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_part (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_stats (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_ping (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_pass (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_svinfo (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_burst (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_sjoin (char *origin, char **argv, int argc, int srv);
|
|
|
|
static void m_protoctl (char *origin, char **argv, int argc, int srv);
|
2003-12-16 22:51:41 +00:00
|
|
|
|
2003-11-03 13:57:11 +00:00
|
|
|
const char ircd_version[] = "(H)";
|
2003-12-05 00:46:00 +00:00
|
|
|
const char services_bot_modes[]= "+o";
|
2003-11-03 13:57:11 +00:00
|
|
|
|
2003-06-26 05:14:16 +00:00
|
|
|
/* this is the command list and associated functions to run */
|
2004-01-21 22:59:03 +00:00
|
|
|
ircd_cmd cmd_list[] = {
|
2003-06-26 05:14:16 +00:00
|
|
|
/* Command Function srvmsg */
|
2004-02-04 23:36:43 +00:00
|
|
|
{MSG_PRIVATE, m_private, 0},
|
2004-01-23 22:39:09 +00:00
|
|
|
{MSG_NOTICE, m_notice, 0},
|
2004-01-20 22:56:23 +00:00
|
|
|
{MSG_STATS, m_stats, 0},
|
|
|
|
{MSG_VERSION, m_version, 0},
|
|
|
|
{MSG_MOTD, m_motd, 0},
|
|
|
|
{MSG_ADMIN, m_admin, 0},
|
|
|
|
{MSG_CREDITS, m_credits, 0},
|
|
|
|
{MSG_SERVER, m_server, 0},
|
|
|
|
{MSG_SQUIT, m_squit, 0},
|
|
|
|
{MSG_QUIT, m_quit, 0},
|
|
|
|
{MSG_MODE, m_mode, 0},
|
|
|
|
{MSG_KILL, m_kill, 0},
|
|
|
|
{MSG_PONG, m_pong, 0},
|
|
|
|
{MSG_AWAY, m_away, 0},
|
|
|
|
{MSG_NICK, m_nick, 0},
|
|
|
|
{MSG_TOPIC, m_topic, 0},
|
|
|
|
{MSG_KICK, m_kick, 0},
|
|
|
|
{MSG_JOIN, m_join, 0},
|
|
|
|
{MSG_PART, m_part, 0},
|
|
|
|
{MSG_PING, m_ping, 0},
|
|
|
|
{MSG_SVINFO, m_svinfo, 0},
|
|
|
|
{MSG_PASS, m_pass, 0},
|
|
|
|
{MSG_EOB, m_burst, 0},
|
|
|
|
{MSG_SJOIN, m_sjoin, 0},
|
|
|
|
{MSG_CAPAB, m_protoctl, 0},
|
2003-06-26 05:14:16 +00:00
|
|
|
};
|
2002-07-30 06:11:23 +00:00
|
|
|
|
2003-12-12 22:40:32 +00:00
|
|
|
ChanModes chan_modes[] = {
|
2004-01-15 21:33:54 +00:00
|
|
|
/* CMODE_PEON */
|
2003-12-14 21:57:45 +00:00
|
|
|
{CMODE_CHANOP, 'o', 1, 0, '@'},
|
|
|
|
{CMODE_VOICE, 'v', 1, 0, '+'},
|
2004-01-15 21:33:54 +00:00
|
|
|
{CMODE_HALFOP, 'h', 1, 0, '%'},
|
|
|
|
/* CMODE_DEOPPED */
|
2003-12-14 21:57:45 +00:00
|
|
|
{CMODE_PRIVATE, 'p', 0, 0, 0},
|
2004-01-15 21:33:54 +00:00
|
|
|
{CMODE_SECRET, 's', 0, 0, 0},
|
2003-12-14 21:57:45 +00:00
|
|
|
{CMODE_MODERATED, 'm', 0, 0, 0},
|
|
|
|
{CMODE_TOPICLIMIT, 't', 0, 0, 0},
|
|
|
|
{CMODE_INVITEONLY, 'i', 0, 0, 0},
|
|
|
|
{CMODE_NOPRIVMSGS, 'n', 0, 0, 0},
|
|
|
|
{CMODE_BAN, 'b', 0, 1, 0},
|
|
|
|
{CMODE_EXCEPT, 'e', 0, 1, 0},
|
|
|
|
{CMODE_INVEX, 'I', 0, 1, 0},
|
2004-01-15 21:33:54 +00:00
|
|
|
{CMODE_HIDEOPS, 'a', 0, 0, 0},
|
|
|
|
{CMODE_LIMIT, 'l', 0, 1, 0},
|
|
|
|
{CMODE_KEY, 'k', 0, 1, 0},
|
2002-07-30 06:11:23 +00:00
|
|
|
};
|
|
|
|
|
2003-12-12 22:40:32 +00:00
|
|
|
UserModes user_umodes[] = {
|
|
|
|
{UMODE_DEBUG, 'd', NS_ULEVEL_ROOT},
|
2003-12-26 22:49:25 +00:00
|
|
|
{UMODE_ADMIN, 'a', NS_ULEVEL_ADMIN},
|
2003-12-13 17:27:35 +00:00
|
|
|
{UMODE_OPER, 'o', NS_ULEVEL_OPER},
|
|
|
|
{UMODE_LOCOPS, 'l', NS_ULEVEL_OPER},
|
2003-12-12 22:40:32 +00:00
|
|
|
{UMODE_BOTS, 'b', 0},
|
|
|
|
{UMODE_CCONN, 'c', 0},
|
|
|
|
{UMODE_FULL, 'f', 0},
|
|
|
|
{UMODE_CALLERID, 'g', 0},
|
|
|
|
{UMODE_INVISIBLE, 'i', 0},
|
|
|
|
{UMODE_SKILL, 'k', 0},
|
|
|
|
{UMODE_NCHANGE, 'n', 0},
|
|
|
|
{UMODE_REJ, 'r', 0},
|
|
|
|
{UMODE_SERVNOTICE, 's', 0},
|
|
|
|
{UMODE_UNAUTH, 'u', 0},
|
|
|
|
{UMODE_WALLOP, 'w', 0},
|
|
|
|
{UMODE_EXTERNAL, 'x', 0},
|
|
|
|
{UMODE_SPY, 'y', 0},
|
|
|
|
{UMODE_OPERWALL, 'z', 0},
|
2002-07-30 06:11:23 +00:00
|
|
|
};
|
|
|
|
|
2003-12-12 22:40:32 +00:00
|
|
|
const int ircd_cmdcount = ((sizeof (cmd_list) / sizeof (cmd_list[0])));
|
|
|
|
const int ircd_umodecount = ((sizeof (user_umodes) / sizeof (user_umodes[0])));
|
|
|
|
const int ircd_cmodecount = ((sizeof (chan_modes) / sizeof (chan_modes[0])));
|
2002-07-30 06:11:23 +00:00
|
|
|
|
2004-01-15 19:18:27 +00:00
|
|
|
void
|
|
|
|
send_eob (const char *server)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s", server, MSG_EOB);
|
2002-08-10 06:30:44 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_server (const char *sender, const char *name, const int numeric, const char *infoline)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s %d :%s", sender, MSG_SERVER, name, numeric, infoline);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-15 19:18:27 +00:00
|
|
|
void
|
2004-02-07 18:30:11 +00:00
|
|
|
send_server_connect (const char *name, const int numeric, const char *infoline, const char *pass, unsigned long tsboot, unsigned long tslink)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd ("%s %s :TS", MSG_PASS, pass);
|
|
|
|
send_cmd ("CAPAB :TS EX CHW IE EOB KLN GLN KNOCK HOPS HUB AOPS MX");
|
|
|
|
send_cmd ("%s %s %d :%s", MSG_SERVER, name, numeric, infoline);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-28 22:20:28 +00:00
|
|
|
void
|
|
|
|
send_burst (int b)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
|
|
|
send_squit (const char *server, const char *quitmsg)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd ("%s %s :%s", MSG_SQUIT, server, quitmsg);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-12-14 23:40:22 +00:00
|
|
|
void
|
|
|
|
send_quit (const char *who, const char *quitmsg)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s :%s", who, MSG_QUIT, quitmsg);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-12-14 23:40:22 +00:00
|
|
|
void
|
|
|
|
send_part (const char *who, const char *chan)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s", who, MSG_PART, chan);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_join (const char *sender, const char *who, const char *chan, const unsigned long ts)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %lu %s + :%s", sender, MSG_SJOIN, ts, chan, who);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 21:22:08 +00:00
|
|
|
void
|
2004-03-26 20:25:33 +00:00
|
|
|
send_sjoin (const char *sender, const char *who, const char *chan, const unsigned long ts)
|
2004-01-13 21:22:08 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-12-14 23:40:22 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmode (const char *sender, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s %s %s %lu", who, MSG_MODE, chan, mode, args, ts);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_nick (const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname)
|
2004-01-13 21:11:05 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd ("%s %s 1 %lu %s %s %s %s :%s", MSG_NICK, nick, ts, newmode, ident, host, server, realname);
|
2003-06-13 13:11:50 +00:00
|
|
|
}
|
2002-07-30 06:11:23 +00:00
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
|
|
|
send_ping (const char *from, const char *reply, const char *to)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s :%s", from, MSG_PING, reply, to);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-12-14 23:40:22 +00:00
|
|
|
void
|
|
|
|
send_umode (const char *who, const char *target, const char *mode)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s :%s", who, MSG_MODE, target, mode);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-12-10 21:37:43 +00:00
|
|
|
void
|
2004-01-26 23:50:52 +00:00
|
|
|
send_numeric (const char *from, const int numeric, const char *target, const char *buf)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %d %s :%s", from, numeric, target, buf);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 21:11:05 +00:00
|
|
|
void
|
|
|
|
send_pong (const char *reply)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd ("%s %s", MSG_PONG, reply);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2004-01-26 12:22:00 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_snetinfo (const char* from, const int prot, const char* cloak, const char* netname, const unsigned long ts)
|
2004-01-26 12:22:00 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s 0 %lu %d %s 0 0 0 :%s", from, MSG_SNETINFO, ts, prot, cloak, netname);
|
2004-01-26 12:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_netinfo (const char* from, const int prot, const char* cloak, const char* netname, const unsigned long ts)
|
2004-01-26 12:22:00 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s 0 %lu %d %s 0 0 0 :%s", from, MSG_NETINFO, ts, prot, cloak, netname);
|
2004-01-26 12:22:00 +00:00
|
|
|
}
|
|
|
|
|
2003-12-15 00:05:05 +00:00
|
|
|
void
|
|
|
|
send_kill (const char *from, const char *target, const char *reason)
|
2003-06-30 14:56:26 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s :%s", from, MSG_KILL, target, reason);
|
2003-06-30 14:56:26 +00:00
|
|
|
}
|
2002-07-30 06:11:23 +00:00
|
|
|
|
2003-12-14 23:40:22 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_nickchange (const char *oldnick, const char *newnick, const unsigned long ts)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-15 00:43:53 +00:00
|
|
|
void
|
2004-01-26 23:50:52 +00:00
|
|
|
send_kick (const char *who, const char *chan, const char *target, const char *reason)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s %s :%s", who, MSG_KICK, chan, target, (reason ? reason : "No Reason Given"));
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2004-01-25 23:38:53 +00:00
|
|
|
void
|
|
|
|
send_wallops (const char *who, const char *buf)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s :%s", who, MSG_WALLOPS, buf);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-12-15 23:47:21 +00:00
|
|
|
void
|
|
|
|
send_invite (const char *from, const char *to, const char *chan)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s %s", from, MSG_INVITE, to, chan);
|
2003-11-18 11:51:09 +00:00
|
|
|
}
|
2003-06-13 13:11:50 +00:00
|
|
|
|
2004-01-13 21:15:01 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_svinfo (const int tscurrent, const int tsmin, const unsigned long tsnow)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd ("%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-15 23:47:21 +00:00
|
|
|
/* there isn't an akill on Hybrid, so we send a kline to all servers! */
|
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_akill (const char *sender, const char *host, const char *ident, const char *setby, const int length, const char *reason, const unsigned long ts)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s * %d %s %s :%s", setby, MSG_KLINE, length, ident, host, reason);
|
2002-08-31 07:40:35 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-15 23:47:21 +00:00
|
|
|
void
|
2004-02-04 22:59:41 +00:00
|
|
|
send_rakill (const char *sender, const char *host, const char *ident)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2003-10-11 15:46:09 +00:00
|
|
|
if (ircd_srv.unkline) {
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd(":%s %s %s %s", sender, MSG_UNKLINE, ident, host);
|
2003-10-11 15:46:09 +00:00
|
|
|
} else {
|
|
|
|
chanalert (s_Services, "Please Manually remove KLINES using /unkline on each server");
|
|
|
|
}
|
2003-02-14 13:10:38 +00:00
|
|
|
}
|
2002-07-30 06:11:23 +00:00
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
2004-01-26 23:50:52 +00:00
|
|
|
send_privmsg (const char *from, const char *to, const char *buf)
|
2002-07-30 06:11:23 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s :%s", from, MSG_PRIVATE, to, buf);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
|
|
|
void
|
2004-01-26 23:50:52 +00:00
|
|
|
send_notice (const char *from, const char *to, const char *buf)
|
2002-07-30 06:11:23 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s %s :%s", from, MSG_NOTICE, to, buf);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
2004-01-25 23:38:53 +00:00
|
|
|
send_globops (const char *from, const char *buf)
|
2002-07-30 06:11:23 +00:00
|
|
|
{
|
2004-02-04 22:59:41 +00:00
|
|
|
send_cmd (":%s %s :%s", from, MSG_WALLOPS, buf);
|
2002-07-30 06:11:23 +00:00
|
|
|
}
|
2003-06-26 05:14:16 +00:00
|
|
|
|
2004-02-04 22:59:41 +00:00
|
|
|
/* from SJOIN unsigned long chan modes param:" */
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_sjoin (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-28 20:52:37 +00:00
|
|
|
do_sjoin (argv[0], argv[1], ((argc <= 2) ? argv[1] : argv[2]), argv[4], argv, argc);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_burst (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-15 19:18:27 +00:00
|
|
|
send_eob (me.name);
|
2003-12-05 16:51:11 +00:00
|
|
|
init_services_bot ();
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_protoctl (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_protocol (origin, argv, argc);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_stats (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_stats (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_version (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_version (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_motd (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_motd (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_admin (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_admin (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_credits (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_credits (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_server (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-02-02 20:19:17 +00:00
|
|
|
do_server (argv[0], origin, argv[1], NULL, argv[2], srv);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_squit (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_squit (argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_quit (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_quit (origin, argv[0]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_mode (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-21 22:59:03 +00:00
|
|
|
if (argv[0][0] == '#') {
|
2004-01-26 23:50:52 +00:00
|
|
|
do_mode_channel (origin, argv, argc);
|
2004-01-21 22:59:03 +00:00
|
|
|
} else {
|
2004-01-26 23:50:52 +00:00
|
|
|
do_mode_user (argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_kill (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_kill (argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_pong (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_pong (argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_away (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-28 22:20:28 +00:00
|
|
|
do_away (origin, (argc > 0) ? argv[0] : NULL);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_nick (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-20 22:56:23 +00:00
|
|
|
if(!srv) {
|
2004-01-28 22:20:28 +00:00
|
|
|
do_nick (argv[0], argv[1], argv[2], argv[4], argv[5],
|
2004-02-06 20:40:46 +00:00
|
|
|
argv[6], NULL, NULL, argv[3], NULL, argv[7], NULL);
|
2004-01-20 22:56:23 +00:00
|
|
|
} else {
|
2004-01-26 23:50:52 +00:00
|
|
|
do_nickchange (origin, argv[0], NULL);
|
2004-01-20 22:56:23 +00:00
|
|
|
}
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_topic (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2003-12-08 15:08:51 +00:00
|
|
|
/*
|
|
|
|
** Hybrid uses two different formats for the topic change protocol...
|
|
|
|
** :user TOPIC channel :topic
|
|
|
|
** and
|
|
|
|
** :server TOPIC channel author topicts :topic
|
|
|
|
** Both forms must be accepted.
|
|
|
|
** - Hwy
|
|
|
|
*/
|
2003-12-14 23:40:22 +00:00
|
|
|
if (finduser(origin)) {
|
2004-01-28 22:20:28 +00:00
|
|
|
do_topic (argv[0], origin, NULL, argv[1]);
|
2003-12-14 23:40:22 +00:00
|
|
|
} else if (findserver(origin)) {
|
2004-01-28 22:20:28 +00:00
|
|
|
do_topic (argv[0], argv[1], argv[2], argv[3]);
|
2003-06-26 05:14:16 +00:00
|
|
|
} else {
|
2004-01-20 22:56:23 +00:00
|
|
|
nlog(LOG_WARNING, LOG_CORE, "m_topic: can't find topic setter %s for topic %s", origin, argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_kick (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_kick (origin, argv[0], argv[1], argv[2]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_join (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_join (origin, argv[0], NULL);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2004-01-21 22:59:03 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_part (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_part (origin, argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_ping (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-25 23:38:53 +00:00
|
|
|
do_ping (argv[0], argv[1]);
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_svinfo (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
2004-01-26 23:50:52 +00:00
|
|
|
do_svinfo ();
|
2003-06-26 05:14:16 +00:00
|
|
|
}
|
|
|
|
|
2003-12-09 22:17:09 +00:00
|
|
|
static void
|
2004-01-20 22:56:23 +00:00
|
|
|
m_pass (char *origin, char **argv, int argc, int srv)
|
2003-06-26 05:14:16 +00:00
|
|
|
{
|
|
|
|
}
|