+*/
+
+ /* connection reset by peer */
+ if (!strcasecmp(wheel, "peer")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_PEER");
+ if (type < 7)
+ irc_kill(chanserv, user, "Connection reset by peer");
+ else
+ irc_svsquit(chanserv, user, "Connection reset by peer");
+ }
+ /* part all channels */
+ else if (!strcasecmp(wheel, "partall")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_PARTALL");
+ if (lamep)
+ lamepart(user);
+ else
+ sputsock("%s SJ %s 0 "FMT_TIME_T, self->numeric, user->numeric, now);
+ }
+ /* random time gline */
+ else if (!strcasecmp(wheel, "gline")) {
+ char target[HOSTLEN + 3];
+ int wtime = 120 + rand() % 600;
+
+ strcpy(target, "*@");
+ strcat(target, user->hostname);
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_GLINE");
+
+ gline_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, 1, 0);
+// irc_kill(chanserv, user, "Reward for spinning the wheel of misfortune!");
+ }
+ /* random shun */
+ else if (!strcasecmp(wheel, "shun")) {
+ char target[HOSTLEN + 3];
+ int wtime = 120 + rand() % 600;
+
+ strcpy(target, "*@");
+ strcat(target, user->hostname);
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_SHUN");
+
+ shun_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, 1);
+ }
+ /* absolutely nothing */
+ else if (!strcasecmp(wheel, "nothing")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_NOTHING");
+ }
+ /* join random chans and part em several times */
+ else if (!strcasecmp(wheel, "randjoin")) {
+ int complete = 0;
+ int rndchans = 0;
+ int chango = 0;
+ int roundz0r = 0;
+
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_RANDJOIN");
+ while(complete != 1) {
+ if (rndchans != 15) {
+ chango = 120 + rand() % 600;
+ sputsock("%s SJ %s #%d "FMT_TIME_T, self->numeric, user->numeric, chango, now);
+ rndchans++;
+ } else {
+ if (roundz0r != 1) {
+ if (lamep)
+ lamepart(user);
+ else
+ sputsock("%s SJ %s 0 "FMT_TIME_T, self->numeric, user->numeric, now);
+ roundz0r = 1;
+ rndchans = 0;
+ } else {
+ if (lamep)
+ lamepart(user);
+ else
+ sputsock("%s SJ %s 0 "FMT_TIME_T, self->numeric, user->numeric, now);
+ complete = 1;
+ }
+ }
+ }
+ }
+ /* abuse line added to /whois */
+ else if (!strcasecmp(wheel, "abusewhois")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_ABUSEWHOIS");
+ irc_swhois(chanserv, user, "is being defecated on by services");
+ }
+ /* kick from each channel your in */
+ else if (!strcasecmp(wheel, "kickall")) {
+ unsigned int count, n;
+ struct modeNode *mn;
+
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_KICKALL");
+
+ for (n=count=0; n<user->channels.used; n++) {
+ mn = user->channels.list[n];
+ irc_kick(chanserv, user, mn->channel, "Reward for spinning the wheel of misfortune!");
+ }
+ }
+ /* random nick change */
+ else if (!strcasecmp(wheel, "nickchange")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_NICKCHANGE");
+
+ char *oldnick = NULL;
+ char *oldident = NULL;
+ char *oldhost = NULL;
+ char abusednick[NICKLEN] = "";
+ int abusednum = 1 + (int) (10000.0 * (rand() / (RAND_MAX + 1.0)));
+ struct userNode *clone;
+
+ oldnick = strdup(user->nick);
+ oldident = strdup(user->ident);
+ oldhost = strdup(user->hostname);
+
+ //snprintf(abusednick, NICKLEN, "Abused%d", abusednum+(1 + rand() % 120));
+ while (1) {
+ snprintf(abusednick, NICKLEN, "Abused%d", abusednum+(1 + rand() % 120));
+ log_module(MAIN_LOG, LOG_DEBUG, "Abused Nick: %s, Client Nick: %s", abusednick, user->nick);
+ if(!GetUserH(abusednick))
+ break;
+ }
+
+ SVSNickChange(user, abusednick);
+ irc_svsnick(chanserv, user, abusednick);
+ clone = AddLocalUser(oldnick, oldident, oldhost, "I got abused by the wheel of misfortune :D", "+i");
+ timeq_add(now + 300, chanserv_remove_abuse, clone->nick);
+ }
+ /* kill */
+ else if (!strcasecmp(wheel, "kill")) {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_KILL");
+
+ DelUser(user, chanserv, 1, "Reward for spinning the wheel of misfortune!");
+ //irc_kill(chanserv, user, "Reward for spinning the wheel of misfortune!");
+ }
+ /* service ignore */
+ else if (!strcasecmp(wheel, "svsignore")) {
+ int gagged, ignoretime = 0;
+ char target[HOSTLEN + 13];
+
+ if(IsOper(user)) {
+ /* we cant gag opers, so just verbally abuse them */
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_SVSIGNORE_OPER");
+ return 1;
+ }
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_SVSIGNORE");
+
+ strcpy(target, "*!*@");
+ strcat(target, user->hostname);
+ ignoretime = now + (1 + rand() % 120);
+
+ gagged = gag_create(target, "wheelofabuse", "Reward for spinning the wheel of misfortune!", ignoretime);
+ }
+ /* kick and ban from each channel your in */
+ else if (!strcasecmp(wheel, "kickbanall")) {
+ unsigned int count, n;
+ struct modeNode *mn;
+ //char ban[HOSTLEN + 1];
+
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_KICKBANALL");
+
+ //snprintf(ban, sizeof(ban), "*!*@%s", user->hostname);
+ for (n=count=0; n<user->channels.used; n++) {
+ struct mod_chanmode *change;
+/* struct banData *bData; */
+ unsigned int exists;
+/* int duration = 300; */
+ char *ban;
+
+ ban = generate_hostmask(user, GENMASK_STRICT_HOST|GENMASK_ANY_IDENT|GENMASK_USENICK);
+
+ log_module(MAIN_LOG, LOG_DEBUG, "Generated ban %s", ban);
+ mn = user->channels.list[n];
+ if(mn->channel->banlist.used >= MAXBANS) {
+ reply("CSMSG_BANLIST_FULL", mn->channel->name);
+ free(ban);
+ continue;
+ }
+
+/* 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;
+ change->args[0].u.member = GetUserMode(mn->channel, user);
+ change->argc = 1;
+
+ mod_chanmode_announce(chanserv, mn->channel, change);
+ mod_chanmode_free(change);
+
+ exists = ChannelBanExists(mn->channel, ban);
+ if(!exists) {
+ change = mod_chanmode_alloc(1);
+ change->args[0].mode = MODE_BAN;
+ change->args[0].u.hostmask = ban;
+ change->argc = 1;
+ mod_chanmode_announce(chanserv, mn->channel, change);
+ mod_chanmode_free(change);
+ }
+
+ if(exists) {
+ reply("CSMSG_REDUNDANT_BAN", ban, mn->channel->name);
+ free(ban);
+ }
+
+ irc_kick(chanserv, user, mn->channel, "Reward for spinning the wheel of misfortune!");
+ }
+ }
+ else {
+ send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_UNKNOWN", wheel);
+ }
+