X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/92f63dd42b085e72a5a4d970f521492ad4f06c73..4cb36ef05734bc040784d67794a3376b0e3a5ec2:/src/chanserv.c diff --git a/src/chanserv.c b/src/chanserv.c index 0ded733..b39dd9b 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -199,6 +199,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_ALREADY_DOWN", "You are not opped, halfopped, or voiced in $b%s$b." }, { "CSMSG_ALREADY_OPCHANNED", "There has been no net.join since the last opchan in $b%s$b." }, { "CSMSG_OPCHAN_DONE", "I have (re-)opped myself in $b%s$b." }, + { "CSMSG_NOT_IN_CHANNEL", "I am not in %s." }, /* Removing yourself from a channel. */ { "CSMSG_NO_OWNER_DELETEME", "You cannot delete your owner access in $b%s$b." }, @@ -278,7 +279,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_BAD_SETLEVEL", "You cannot change any setting to above your level." }, { "CSMSG_BAD_SETTERS", "You cannot change Setters to above your level." }, { "CSMSG_INVALID_MODE_LOCK", "$b%s$b is an invalid mode lock." }, - { "CSMSG_INVALID_NUMERIC", "$b%d$b is not a valid choice. Choose one:" }, + { "CSMSG_INVALID_NUMERIC", "$b%s$b is not a valid choice. Choose one:" }, { "CSMSG_SET_DEFAULT_TOPIC", "$bDefaultTopic$b %s" }, { "CSMSG_SET_TOPICMASK", "$bTopicMask $b %s" }, { "CSMSG_SET_GREETING", "$bGreeting $b %s" }, @@ -324,7 +325,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_DEVOICED_USERS", "Devoiced users in $b%s$b." }, { "CSMSG_AUTOMODE_NONE", "Noone will be automatically oped, half-oped, or voiced." }, - { "CSMSG_AUTOMODE_NORMAL", "Give voice to peons, half-op to halfops, and op to ops." }, + { "CSMSG_AUTOMODE_NORMAL", "Give voice to pals, half-op to halfops, and op to ops." }, { "CSMSG_AUTOMODE_VOICE", "#1 plus give voice to everyone." }, { "CSMSG_AUTOMODE_HOP", "#1 plus give halfops to everyone." }, { "CSMSG_AUTOMODE_OP", "#1 plus give ops to everyone (not advised)" }, @@ -524,7 +525,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_HUGGLES_HIM", "\001ACTION huggles %s\001" }, { "CSMSG_HUGGLES_YOU", "\001ACTION huggles you\001" }, { "CSMSG_ROULETTE_LOADS", "\001ACTION loads the gun and sets it on the table\001" }, - { "CSMSG_ROULETTE_NEW", "Please type .roulette to start a new round" } , + { "CSMSG_ROULETTE_NEW", "Please type %croulette to start a new round" } , { "CSMSG_ROULETTE_BETTER_LUCK", "Better luck next time, %s" }, { "CSMSG_ROULETTE_BANG", "Bang!!!" } , { "CSMSG_ROULETTE_CLICK", "Click" } , @@ -690,6 +691,7 @@ static const struct { unsigned short level; char ch; } accessLevels[] = { /* MUST be orderd less to most! */ + { "pal", "Pal", UL_PEON, '+' }, { "peon", "Peon", UL_PEON, '+' }, { "halfop", "HalfOp", UL_HALFOP, '%' }, { "op", "Op", UL_OP, '@' }, @@ -839,7 +841,7 @@ user_level_name_from_level(int level) highest = "None"; if(level >= 1) - highest = "Peon"; + highest = "Pal"; for(ii = 0; (ii < ArrayLength(accessLevels)); ii++) if(level >= accessLevels[ii].level) highest = accessLevels[ii].title; @@ -2751,6 +2753,10 @@ static CHANSERV_FUNC(cmd_opchan) reply("CSMSG_ALREADY_OPCHANNED", channel->name); return 0; } + if(!IsInChannel(channel,chanserv)) { + reply("CSMSG_NOT_IN_CHANNEL", channel->name); + return 0; + } channel->channel_info->may_opchan = 0; mod_chanmode_init(&change); change.argc = 1; @@ -3026,6 +3032,10 @@ static CHANSERV_FUNC(cmd_mdelpeon) return cmd_mdel_user(user, channel, UL_PEON, UL_HALFOP-1, argv[1], cmd); } +static CHANSERV_FUNC(cmd_mdelpal) +{ + return cmd_mdel_user(user, channel, UL_PEON, UL_HALFOP-1, argv[1], cmd); +} static CHANSERV_FUNC(cmd_levels) { @@ -6189,6 +6199,16 @@ static MODCMD_FUNC(chan_opt_nodelete) static MODCMD_FUNC(chan_opt_dynlimit) { + struct mod_chanmode change; + + if (argc > 1) { + if (disabled_string(argv[1])) { + mod_chanmode_init(&change); + change.modes_clear |= MODE_LIMIT; + mod_chanmode_announce(chanserv, channel, &change); + } + } + CHANNEL_BINARY_OPTION("CSMSG_SET_DYNLIMIT", CHANNEL_DYNAMIC_LIMIT); } @@ -6388,7 +6408,7 @@ channel_multiple_option(enum charOption option, struct userNode *user, struct ch if(!isdigit(argv[1][0]) || (index < 0) || (index >= count)) { - reply("CSMSG_INVALID_NUMERIC", index); + reply("CSMSG_INVALID_NUMERIC", argv[1]); /* Show possible values. */ for(index = 0; index < count; index++) reply(charOptions[option].format_name, index, user_find_message(user, charOptions[option].values[index].format_name)); @@ -7029,7 +7049,10 @@ static CHANSERV_FUNC(cmd_shoot) struct chanData *cData = channel->channel_info; if (cData->roulette_chamber <= 0) { - reply("CSMSG_ROULETTE_NEW"); + struct service *service; + if ((service = service_find(chanserv->nick))) { + reply("CSMSG_ROULETTE_NEW", service->trigger); + } return 1; } @@ -7075,7 +7098,7 @@ static CHANSERV_FUNC(cmd_spin) if(!channel) return 1; - int type, lamep = 1; + int type = 0, lamep = 1; char *tstr; tstr = conf_get_data("server/type", RECDB_QSTRING); @@ -7160,7 +7183,7 @@ static CHANSERV_FUNC(cmd_spin) while(complete != 1) { if (rndchans != 15) { chango = 120 + rand() % 600; - sputsock("%s SJ %s #%d %ld", self->numeric, user->numeric, chango, now); + sputsock("%s SJ %s #%d %d", self->numeric, user->numeric, chango, now); rndchans++; } else { if (roundz0r != 1) { @@ -7262,9 +7285,9 @@ static CHANSERV_FUNC(cmd_spin) //snprintf(ban, sizeof(ban), "*!*@%s", user->hostname); for (n=count=0; nchannels.used; n++) { struct mod_chanmode *change; - struct banData *bData; +/* struct banData *bData; */ unsigned int exists; - int duration = 300; +/* int duration = 300; */ char *ban; ban = generate_hostmask(user, GENMASK_STRICT_HOST|GENMASK_ANY_IDENT|GENMASK_USENICK); @@ -7277,7 +7300,7 @@ static CHANSERV_FUNC(cmd_spin) continue; } - bData = add_channel_ban(mn->channel->channel_info, ban, chanserv->nick, now, now, now + duration, "Reward for spinning the wheel of misfortune!"); +/* bData = add_channel_ban(mn->channel->channel_info, ban, chanserv->nick, now, now, now + duration, "Reward for spinning the wheel of misfortune!"); */ change = mod_chanmode_alloc(1); change->args[0].mode = MODE_REMOVE|MODE_CHANOP|MODE_HALFOP|MODE_VOICE; @@ -8463,7 +8486,8 @@ chanserv_conf_read(void) static const char *list[] = { "peer", "partall", "gline", /* "shun", */ "nothing", "randjoin", "abusewhois", "kickall", - "nickchange", "kill", "svsignore", "kickbanall" }; + "nickchange", "kill", "svsignore", "kickbanall", + NULL}; unsigned int ii; strlist = alloc_string_list(ArrayLength(list)-1); for(ii=0; list[ii]; ii++) @@ -9356,6 +9380,7 @@ init_chanserv(const char *nick) DEFINE_COMMAND(mdelmanager, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL); DEFINE_COMMAND(mdelop, 2, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); DEFINE_COMMAND(mdelpeon, 2, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); + DEFINE_COMMAND(mdelpal, 2, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); DEFINE_COMMAND(mdelhalfop, 2, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); DEFINE_COMMAND(levels, 1, 0, NULL);