X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/6aae9404863a9b3175de085e8e574958bf7900ea..512d7958d12cef042c7324ad086cced98dc720bf:/src/modcmd.c diff --git a/src/modcmd.c b/src/modcmd.c index 9f083e3..306e698 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -3,7 +3,7 @@ * * This file is part of x3. * - * srvx is free software; you can redistribute it and/or modify + * x3 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. @@ -18,11 +18,13 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include "../ChangeLog.X3" +#include "../ChangeLog" #include "chanserv.h" #include "conf.h" #include "modcmd.h" +#include "opserv.h" #include "saxdb.h" +#include "timeq.h" struct pending_template { struct svccmd *cmd; @@ -30,6 +32,7 @@ struct pending_template { struct pending_template *next; }; +extern unsigned long god_timeout; static struct dict *modules; static struct dict *services; static struct pending_template *pending_templates; @@ -130,6 +133,7 @@ static const struct message_entry msgtab[] = { { "MCMSG_COMMAND_ACCOUNT_FLAGS", "Requires account flags +%s, prohibits account flags +%s." }, { "MCMSG_COMMAND_ACCESS_LEVEL", "Requires channel access %d and $O access %d." }, { "MCMSG_COMMAND_USES", "%s has been used %d times." }, + { "MCMSG_GOD_EXPIRED", "Security override expired." }, { NULL, NULL } }; struct userData *_GetChannelUser(struct chanData *channel, struct handle_info *handle, int override, int allow_suspended); @@ -1521,6 +1525,18 @@ static MODCMD_FUNC(cmd_modcmd) { return changed; } +static void +timeout_god(void *data) +{ + extern struct userNode *chanserv; + struct userNode *user = data; + + if(!user || !IsHelping(user)) return; + + HANDLE_CLEAR_FLAG(user->handle_info, HELPING); + send_message(user, chanserv, "MCMSG_GOD_EXPIRED"); +} + static MODCMD_FUNC(cmd_god) { int helping; @@ -1547,9 +1563,11 @@ static MODCMD_FUNC(cmd_god) { if (helping) { HANDLE_SET_FLAG(user->handle_info, HELPING); + timeq_add(now + god_timeout, timeout_god, user); reply("MCMSG_NOW_HELPING"); } else { HANDLE_CLEAR_FLAG(user->handle_info, HELPING); + timeq_del(0, timeout_god, user, TIMEQ_IGNORE_WHEN); reply("MCMSG_NOW_NOT_HELPING"); } @@ -1943,13 +1961,32 @@ static MODCMD_FUNC(cmd_version) { * command or its accessibility to normal IRC users, except to add * copyright information pertaining to changes you make to X3. */ - send_message_type(4, user, cmd->parent->bot, "$b"PACKAGE_STRING"$b (Based on srvx 1.3), Built: "__DATE__", "__TIME__"."); - send_message_type(4, user, cmd->parent->bot, "("CVS_VERSION")"); - send_message_type(4, user, cmd->parent->bot, "Copyright 2000-2005 srvx Development Team."); - send_message_type(4, user, cmd->parent->bot, "Copyright 2004-2005 X3 Development Team."); - send_message_type(4, user, cmd->parent->bot, "The srvx 1.3 Development Team includes Paul Chang, Adrian Dewhurst, Miles Peterson, Michael Poole and others."); + + char *svn = NULL, *svnver = NULL, *svndate = NULL, *v = 0, ver[MAXLEN]; + int vc = 0; + + strcpy(ver, CVS_VERSION); + for (svn = x3_strtok(&v, ver, " "); svn; + svn = x3_strtok(&v, 0, " ")) { + if (vc == 2) + svnver = svn; + else if (vc == 3) + svndate = svn; + vc++; + } + + send_message_type(4, user, cmd->parent->bot, "$b"PACKAGE_STRING"+[%s %s]$b (Based on srvx 1.3.x), Built: "__DATE__", "__TIME__".", svnver, svndate); + send_message_type(4, user, cmd->parent->bot, "$b$b"); + send_message_type(4, user, cmd->parent->bot, "Copyright 2000-2006 srvx Development Team."); + send_message_type(4, user, cmd->parent->bot, "Copyright 2004-2006 X3 Development Team."); + send_message_type(4, user, cmd->parent->bot, "$b$b"); + send_message_type(4, user, cmd->parent->bot, "The srvx 1.3.x Development Team includes Paul Chang, Adrian Dewhurst, Miles Peterson, Michael Poole and others."); send_message_type(4, user, cmd->parent->bot, "The X3 Development Team includes Alex Schumann, Reed Loden, Neil Spierling."); - send_message_type(4, user, cmd->parent->bot, "The X3 Development Team can be reached at http://sf.net/projects/x2serv/ or in #evilnet on irc.afternet.org."); + send_message_type(4, user, cmd->parent->bot, "The X3 Development Team can be reached at http://sourceforge.net/projects/evilnet or in #evilnet on irc.afternet.org."); + send_message_type(4, user, cmd->parent->bot, "$b$b"); + send_message_type(4, user, cmd->parent->bot, "Thanks goes to Adrian M (thiefmaster), Joe Hansche (joeatrr), Martijn Smit (wasted), and to any other people who have contributed to X3."); + send_message_type(4, user, cmd->parent->bot, "This program is free software; see COPYING in the distribution."); + return 1; } @@ -2383,6 +2420,7 @@ create_default_binds(int rebind) { { "Global", { "Global", NULL } }, { "NickServ", { "NickServ", NULL } }, { "OpServ", { "OpServ", "modcmd", "sendmail", "saxdb", "proxycheck", NULL } }, + { "SpamServ", { "SpamServ", NULL } }, { NULL, { NULL } } }; unsigned int ii, jj;