#include <string.h>
#include <ctype.h>
#include <stdio.h>
+#include <assert.h>
#include "../nick/nick.h"
#include "../channel/channel.h"
H_TERM_PLUS
};
-void helpmod_cmd_addchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_addchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
if (argc == 0)
{
}
}
-void helpmod_cmd_delchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_delchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
char buffer[256];
helpmod_reply(sender, returntype, "Channel %s deleted succesfully", buffer);
}
-void helpmod_cmd_whoami (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_whoami (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
helpmod_reply(sender, returntype, "You are %s", sender->real_user->nick);
helpmod_reply(sender, returntype, "Your userlevel is %s", hlevel_name(huser_get_level(sender)));
}
}
-void helpmod_cmd_whois (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_whois (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
huser *husr;
int i;
}
*/
-void helpmod_cmd_seen (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_seen (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
huser *target_huser;
haccount *target_haccount;
}
}
-void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, channel* returntype, char* ostr, int argc, char *argv[])
{
huser *target_huser;
haccount *target_haccount;
}
/* pseudo commands for the above */
-void helpmod_cmd_improper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_LAMER, returntype, ostr, argc, argv); }
-void helpmod_cmd_peon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_PEON, returntype, ostr, argc, argv); }
-void helpmod_cmd_trial (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_TRIAL, returntype, ostr, argc, argv); }
-void helpmod_cmd_staff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_STAFF, returntype, ostr, argc, argv); }
-void helpmod_cmd_oper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_OPER, returntype, ostr, argc, argv); }
-void helpmod_cmd_admin (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_ADMIN, returntype, ostr, argc, argv); }
-
-void helpmod_cmd_deluser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_improper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_LAMER, returntype, ostr, argc, argv); }
+static void helpmod_cmd_peon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_PEON, returntype, ostr, argc, argv); }
+static void helpmod_cmd_trial (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_TRIAL, returntype, ostr, argc, argv); }
+static void helpmod_cmd_staff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_STAFF, returntype, ostr, argc, argv); }
+static void helpmod_cmd_oper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_OPER, returntype, ostr, argc, argv); }
+static void helpmod_cmd_admin (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_ADMIN, returntype, ostr, argc, argv); }
+
+static void helpmod_cmd_deluser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
int i;
huser *target_huser;
}
}
-void helpmod_cmd_listuser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_listuser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
char *pattern;
haccount *hack = haccounts;
helpmod_reply(sender, returntype, "Accounts matching pattern %d", count);
}
-void helpmod_cmd_censor (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_censor (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hcensor *hcens;
}
}
-void helpmod_cmd_chanconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
int old_flags=0;
}
}
-void helpmod_cmd_acconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_acconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
haccount *hacc = sender->account;
}
}
-void helpmod_cmd_welcome (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_welcome (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
}
}
-void helpmod_cmd_aliases (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_aliases (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
char buf[512];
int i = 0;
helpmod_reply(sender, returntype, "%s", buf);
}
-void helpmod_cmd_showcommands (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_showcommands (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
int level = H_PEON;
hcommand *tmp;
return;
}
-void helpmod_cmd_lamercontrol (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_lamercontrol (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hlc_profile *ptr;
}
-void helpmod_cmd_term_find_general (huser *sender, channel* returntype, int type, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_general (huser *sender, channel* returntype, int type, char* ostr, int argc, char *argv[])
{
hterm *htrm;
hterm *source;
helpmod_reply(sender, returntype, "(%s): %s", htrm->name->content, htrm->description->content);
}
-void helpmod_cmd_term_find (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
helpmod_cmd_term_find_general(sender, returntype, H_TERM_FIND, ostr, argc, argv);
}
-void helpmod_cmd_term_find_minus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_minus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
helpmod_cmd_term_find_general(sender, returntype, H_TERM_MINUS, ostr, argc, argv);
}
-void helpmod_cmd_term_find_plus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_plus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
helpmod_cmd_term_find_general(sender, returntype, H_TERM_PLUS, ostr, argc, argv);
}
-void helpmod_cmd_klingon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_klingon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
huser *target = NULL;
}
}
-void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hterm *htrm;
hterm **source;
buffer[0] = '\0';
htrm = *source;
- if (argc > 2)
+ if (argc >= 2)
pattern = argv[1];
else
pattern = "*";
helpmod_reply(sender, returntype, "Can not delete term: Term %s not found", argv[i]);
continue;
}
- hterm_del(source, htrm);
+ hterm_del(source != NULL?source:&hterms, htrm);
helpmod_reply(sender, returntype, "Term %s deleted succesfully", argv[i]);
}
-
}
else if (!ci_strcmp(argv[0], "find"))
{
}
}
-void helpmod_cmd_queue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_queue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
int operation;
helpmod_queue_handler(sender, returntype, hchan, operation, ostr, argc, argv);
}
-void helpmod_cmd_done (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_done (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_queue_handler(sender, returntype, hchan, HQ_DONE, ostr, argc, argv);
}
-void helpmod_cmd_next (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_next (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_queue_handler(sender, returntype, hchan, HQ_NEXT, ostr, argc, argv);
}
-void helpmod_cmd_enqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_enqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_queue_handler(sender, returntype, hchan, HQ_ON, ostr, argc, argv);
}
-void helpmod_cmd_dequeue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_dequeue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_queue_handler(sender, returntype, hchan, HQ_OFF, ostr, argc, argv);
}
-void helpmod_cmd_autoqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_autoqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_queue_handler(sender, returntype, hchan, HQ_MAINTAIN, ostr, argc, argv);
}
-void helpmod_cmd_dnmo (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_dnmo (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
int i;
if (argc == 0)
}
}
-void helpmod_cmd_ban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_ban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
if (argc == 0)
{
}
}
-void helpmod_cmd_chanban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
int i;
}
}
-void helpmod_cmd_idlekick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_idlekick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
int tmp;
}
}
-void helpmod_cmd_topic (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_topic (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
DEFINE_HCHANNEL;
helpmod_reply(sender, returntype, "Can not handle the topic of channel %s: Unknown operation %s", hchannel_get_name(hchan), argv[0]);
}
-void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
huser *husr;
int i;
}
}
-void helpmod_cmd_everyoneout (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_everyoneout (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hchannel_user **hchanuser;
helpmod_reply(sender, returntype, "Channel %s has been cleared of normal users", hchannel_get_name(hchan));
}
-void helpmod_cmd_kick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_kick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
int i;
helpmod_kick(hchan, targets[i], reason);
}
-void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
haccount *target = sender->account;
}
}
-void helpmod_cmd_chanstats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanstats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hstat_channel *channel_stats;
}
}
-void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hstat_accounts_array arr;
free(arr.array);
}
-void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hstat_accounts_array arr;
free(arr.array);
}
-void helpmod_cmd_report (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_report (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan, *target;
DEFINE_HCHANNEL;
helpmod_reply(sender, returntype, "Channel %s is now reported to channel %s (%s)", hchannel_get_name(hchan), hchannel_get_name(hchan->report_to), hchannel_get_state(hchan, H_REPORT));
}
-void helpmod_cmd_mode(huser *sender, channel* returntype, int change, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_mode(huser *sender, channel* returntype, int change, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
huser_channel *huserchan;
}
}
-void helpmod_cmd_op (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_OP, ostr, argc, argv); }
-void helpmod_cmd_deop (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEOP, ostr, argc, argv); }
-void helpmod_cmd_voice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_VOICE, ostr, argc, argv); }
-void helpmod_cmd_devoice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEVOICE, ostr, argc, argv); }
+static void helpmod_cmd_op (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_OP, ostr, argc, argv); }
+static void helpmod_cmd_deop (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEOP, ostr, argc, argv); }
+static void helpmod_cmd_voice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_VOICE, ostr, argc, argv); }
+static void helpmod_cmd_devoice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEVOICE, ostr, argc, argv); }
-void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
+static void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
{
hchannel *hchan;
int i;
return;
}
htick = hticket_get(sender->real_user->authname ,hchan);
+
if (htick == NULL)
{
helpmod_reply(sender, returntype, "Can not invite: You do not have an invite ticket for channel %s", argv[0]);
return;
}
- else
+
+ if (nickbanned(sender->real_user, hchan->real_channel))
{
- helpmod_invite(hchan, sender);
- helpmod_reply(sender, returntype, "Invited you to channel %s", hchannel_get_name(hchan));
+ helpmod_reply(sender, returntype, "Can not invite: You are banned from channel channel %s", argv[0]);
+ return;
}
+
+ helpmod_invite(hchan, sender);
+ helpmod_reply(sender, returntype, "Invited you to channel %s", hchannel_get_name(hchan));
return;
}
}
}
-void helpmod_cmd_ticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_ticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
int expiration = HTICKET_EXPIRATION_TIME;
hchannel *hchan;
helpmod_reply(husr, NULL, "You have been issued an invite ticket for channel %s. This ticket is valid for a period of %s. You can use my invite command to get to the channel now. Type /msg %s invite %s",hchannel_get_name(hchan), helpmod_strtime(HTICKET_EXPIRATION_TIME), helpmodnick->nick, hchannel_get_name(hchan));
}
-void helpmod_cmd_resolve (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_resolve (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
int i;
hchannel *hchan;
}
}
-void helpmod_cmd_tickets (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_tickets (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
hticket *htick;
helpmod_reply(sender, returntype, "Done listing tickets. Channel %s had %d valid tickets", hchannel_get_name(hchan), i);
}
-void helpmod_cmd_showticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_showticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
{
hchannel *hchan;
huser *husr;
}
}
+static int helpmod_cmd_termstats_sort(const void *left, const void *right)
+{
+ return (*((hterm**)left))->usage - (*((hterm**)right))->usage;
+}
+
+static void helpmod_cmd_termstats(huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+ hterm **arr, *origin;
+ hchannel *hchan;
+ int i, count;
+
+ DEFINE_HCHANNEL;
+
+ if (hchan == NULL)
+ origin = hterms;
+ else
+ origin = hchan->channel_hterms;
+
+ count = hterm_count(origin);
+
+ if (count == 0)
+ {
+ helpmod_reply(sender, returntype, "Can not list term usage statistics: No terms available");
+ return;
+ }
+
+ arr = malloc(sizeof(hterm*) * count);
+ assert(arr != NULL);
+
+ for (i=0;i < count;i++,origin = origin->next)
+ arr[i] = origin;
+
+ qsort(arr, count, sizeof(hterm*), helpmod_cmd_termstats_sort);
+
+ if (hchan == NULL)
+ helpmod_reply(sender, returntype, "10 Most used global terms");
+ else
+ helpmod_reply(sender, returntype, "10 Most used terms for channel %s", hchannel_get_name(hchan));
+
+ for (i=0;i < 10 && i < count;i++)
+ helpmod_reply(sender, returntype, "#%02d %32s :%d",i, arr[i]->name->content,arr[i]->usage);
+
+ free(arr);
+}
+
+static void helpmod_cmd_checkchannel(huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+ channel *chan;
+ nick *nck;
+ int i;
+
+ if (argc == 0)
+ {
+ helpmod_reply(sender, returntype, "Can not check channel: Channel not defined");
+ return;
+ }
+
+ chan = findchannel(argv[0]);
+ if (chan == NULL)
+ {
+ helpmod_reply(sender, returntype, "Can not check channel: Channel %s not found", argv[0]);
+ return;
+ }
+ /* first pass */
+ for (i=0;i < chan->users->hashsize;i++)
+ {
+ nck = getnickbynumeric(chan->users->content[i]);
+ if (!nck) /* it's a hash, not an array */
+ continue;
+
+ if (IsOper(nck) && strlen(nck->nick) > 1)
+ {
+ helpmod_reply(sender, returntype, "Can not check channel: Permission denied. Channel %s has an oper on it", argv[0]);
+ return;
+ }
+ }
+
+ helpmod_reply(sender, returntype, "Information on channel %s", argv[0]);
+ helpmod_reply(sender, returntype, "Channel created %s ago", helpmod_strtime(time(NULL) - chan->timestamp));
+ /* second pass */
+ for (i=0;i < chan->users->hashsize;i++)
+ {
+ nck = getnickbynumeric(chan->users->content[i]);
+ char buf[256];
+ if (!nck) /* it's a hash, not an array */
+ continue;
+ helpmod_reply(sender, returntype, "%s", visiblehostmask(nck, buf));
+
+ }
+}
+
+static void helpmod_cmd_statsdebug (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+ haccount *hacc = haccounts;
+ hstat_account *ptr;
+ int i;
+
+ helpmod_reply(sender, returntype, "Account statistics");
+ for (;hacc;hacc = hacc->next)
+ for (ptr = hacc->stats;ptr;ptr = ptr->next)
+ {
+ helpmod_reply(sender, returntype, "Account %s channel %s short-term", hacc->name->content, hchannel_get_name(ptr->hchan));
+ for (i = 0;i < 7;i++)
+ helpmod_reply(sender, returntype, "%d %d %d %d", ptr->week[i].time_spent, ptr->week[i].prime_time_spent, ptr->week[i].lines, ptr->week[i].words);
+ helpmod_reply(sender, returntype, "Account %s channel %s long-term", hacc->name->content, hchannel_get_name(ptr->hchan));
+ for (i = 0;i < 10;i++)
+ helpmod_reply(sender, returntype, "%d %d %d %d", ptr->longterm[i].time_spent, ptr->longterm[i].prime_time_spent, ptr->longterm[i].lines, ptr->longterm[i].words);
+ }
+}
+
+static void helpmod_cmd_message (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+ hchannel *hchan;
+
+ if (argc < 2)
+ {
+ helpmod_reply(sender, returntype, "Can not send a message: Insufficient arguments");
+ return;
+ }
+ hchan = hchannel_get_by_name(argv[0]);
+ if (hchan == NULL)
+ {
+ helpmod_reply(sender, returntype, "Can not send a message: Invalid channel %s", argv[0]);
+ return;
+ }
+ SKIP_WORD;
+ helpmod_message_channel(hchan, "(%s) %s", sender->real_user->nick, ostr);
+ helpmod_reply(sender, returntype, "Message sent to %s", hchannel_get_name(hchan));
+}
+
/* old H stuff */
void helpmod_cmd_load (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
{
hcommand_add("tickets", H_STAFF, helpmod_cmd_tickets, "Lists all valid tickets for a channel");
hcommand_add("showticket", H_STAFF, helpmod_cmd_showticket, "Shows the ticket for the user");
+ hcommand_add("termstats", H_OPER, helpmod_cmd_termstats, "Lists usage statistics for terms");
+ hcommand_add("checkchannel", H_STAFF, helpmod_cmd_checkchannel, "Shows channel information for any channel");
+ hcommand_add("statsdebug", H_ADMIN, helpmod_cmd_statsdebug, "Statistics debug command");
+ hcommand_add("message", H_TRIAL, helpmod_cmd_message, "Sends a message to a channel");
/*hcommand_add("megod", H_PEON, helpmod_cmd_megod, "Gives you userlevel 4, if you see this in the final version, please kill strutsi");*/
/*hcommand_add("test", H_PEON, helpmod_cmd_test, "Gives you userlevel 4, if you see this in the final version, please kill strutsi");*/
}
-% H2 version 2.01 database
-% Wed Feb 23 08:58:30 2005
+% H2 database, live Quakenet #feds version
+% A minimal start, can be used for a radical reset
-
-% lamercontrol profile structure:
-% X (string):
-% Y (string):
-% Z (int):
lamercontrol profile
- nazi
- 25 10
- 1 4
- 3 4 4
- 3 0.010 7
- 0 1 2
-lamercontrol profile
- strict
- 35 15
- 2 6
- 4 5 5
- 4 0.010 10
- 0 2 3
+ liberal
+ 50 25
+ 4 9
+ 8 10 14
+ 7 0.006 12
+ 2 5 8
+
lamercontrol profile
default
- 40 20
- 3 7
- 6 7 7
- 5 0.008 10
- 1 3 5
+ 40 20
+ 3 7
+ 6 7 9
+ 5 0.008 10
+ 1 3 5
+
lamercontrol profile
- liberal
- 50 25
- 4 9
- 8 10 10
- 7 0.006 12
- 2 5 8
-
-% channel structure:
-% name (string):
-% flags (integer):
-% welcome message (string):
-% lamercontrol profile (string):
+ strict
+ 35 15
+ 2 6
+ 4 5 7
+ 4 0.01 10
+ 0 2 3
+
+lamercontrol profile
+ nazi
+ 25 10
+ 1 4
+ 3 4 5
+ 3 0.01 7
+ 0 1 2
+
+% Initial channel (#feds), needed to have the terms for the channel
channel
#feds
- 8f03a
- Welcome to #feds
- default
- 0 % censor
- 17 % terms
- takeover
- Support for recovering stolen channels is limited as the responsibility for protecting those channels is your own. However, if you have not already done so, state the #channelname and be patient. If the operator informs you that he or she will not intervene in this case then there is no appeal and you should choose a new channel and consider what security mistakes you made which resulted in the loss of the original channel.
- serverapp
- You can find a server application at http://www.quakenet.org/server_application *READ IT CAREFULLY* Do not ask questions about the application form in #feds. Response time for submitted applications is typically between 2 to 4 weeks.
- score
- You must be in the top 5 recognised chanops to request L. Statistics for L are only recorded when you have op in the channel and there are at least 3 other people in the channel with you (who may or may not be channel ops). Previous op history is kept for approximately 10 days therefore it is possible for previous ops to have op time that greatly exceeds 2 hours, preventing you requesting L to a channel that appears unused. You will simply have to wait until the op time is exceeded or the records expire.
- stats
- Please do not join #feds to question the statistical monitoring we carry out to check your L, Q or S request. Our services count according to internal rules designed to avoid network overload. Despite what you may perceive, services check these statistics much more accurately than you can. If you have failed in a request then you will simply have to try again in the future.
- S
- This is QuakeNet's antispam service. It can be requested from www.quakenet.org. Read the LFAQ on the site before requesting.
- abuse
- This channel can be used for reporting abusive users, not requesting specific punishment for the alleged crimes. Tell us where it is happening, and who is doing it, we will monitor the situation and decide how to deal with it. You may leave once the abuse has been reported. The decision of an operator is final.
- removebot
- Delete all CHANLEV's from the channel, and then L or Q will leave the channel. If the users are not online you will have to use their authname. Type ?? #auth for more.
- logs
- Log files cannot be taken as evidence by IRC operators in most situations, due to the ease with which they can be faked. As such, you should not attempt to send logs to an operator or paste large amounts of them into the channel unless asked to do so.
- L
- QuakeNet's channel service L can be requested at www.quakenet.org, Read the LFAQ on the site before requesting.
- ircops
- IRC Operators of QuakeNet are volunteers. They do not get paid for their work, and often contribute out of their own pocket towards QuakeNet`s costs. Most of the IRC Operators have ordinary work to attend to at day and/or night time, families etc. The IRC Operators of QuakeNet are NOT required or obligated to help users at any time.
- IPv6
- QuakeNet does not support IPv6, and there are no plans to support IPV6 in the near future
- gaveowner
- If you give another user the +n chanlev on Q or L, this user is then allowed to take away your own +n. It does not matter who originally requested the service. For this reason, you should exercise extreme caution when setting the owner on users in channels you currently control.
- freeop
- Operator help for takeovers on freeop channels is not available. If you want support in protecting your channel then use the channel modes and chanlevs wisely and use them to manage your channel, not to win friends and influence.
- business
- QuakeNet does NOT offer any additional support to users wishing to operate, or propogate, a business on our servers. If you wish to do so in spite of this, you will NOT recieve support from our staff, and will be dealt with like any other user on the network. All business activities which make use of QuakeNet resources are at your own risk and QuakeNet in no way guarantees or warrants that a service available currently will be available on a continued basis.
- eggdrop
- We do not provide help with other people`s bots/eggdrops. see the bot administrator for help (a /whois of the bot will often provide information on where to find the administrator).
- question
- State your question. Do not ask if you can ask a question, or if particular staff are available. Do not use 1 word per line when stating your question, and if it is about a channel, provide the #channel name. Do not paste logs or other large text items in the channel.
+ F03A
+ Welcome to #feds
+ default
+ 0 % censor
+ 17 % terms 17 total
#feds
This channel is for matters REQUIRING the assistance of an IRC operator. Questions answered in the FAQs, or that do not require an IRC operator, will be ignored. Read the FAQs at www.quakenet.org, and if that does not help, visit #help.
+ question
+ State your question. Do not ask if you can ask a question, or if particular staff are available. Do not use 1 word per line when stating your question, and if it is about a channel, provide the #channel name. Do not paste logs or other large text items in the channel.
+ eggdrop
+ We do not provide help with other people`s bots/eggdrops. see the bot administrator for help (a /whois of the bot will often provide information on where to find the administrator).
+ business
+ QuakeNet does NOT offer any additional support to users wishing to operate, or propogate, a business on our servers. If you wish to do so in spite of this, you will NOT recieve support from our staff, and will be dealt with like any other user on the network. All business activities which make use of QuakeNet resources are at your own risk and QuakeNet in no way guarantees or warrants that a service available currently will be available on a continued basis.
+ freeop
+ Operator help for takeovers on freeop channels is not available. If you want support in protecting your channel then use the channel modes and chanlevs wisely and use them to manage your channel, not to win friends and influence.
+ gaveowner
+ If you give another user the +n chanlev on Q or L, this user is then allowed to take away your own +n. It does not matter who originally requested the service. For this reason, you should exercise extreme caution when setting the owner on users in channels you currently control.
+ IPv6
+ QuakeNet does not support IPv6, and there are no plans to support IPV6 in the near future
+ ircops
+ IRC Operators of QuakeNet are volunteers. They do not get paid for their work, and often contribute out of their own pocket towards QuakeNet`s costs. Most of the IRC Operators have ordinary work to attend to at day and/or night time, families etc. The IRC Operators of QuakeNet are NOT required or obligated to help users at any time.
+ L
+ QuakeNet's channel service L can be requested at www.quakenet.org, Read the LFAQ on the site before requesting.
+ logs
+ Log files cannot be taken as evidence by IRC operators in most situations, due to the ease with which they can be faked. As such, you should not attempt to send logs to an operator or paste large amounts of them into the channel unless asked to do so.
+ removebot
+ Delete all CHANLEV's from the channel, and then L or Q will leave the channel. If the users are not online you will have to use their authname. Type ?? #auth for more.
+ abuse
+ This channel can be used for reporting abusive users, not requesting specific punishment for the alleged crimes. Tell us where it is happening, and who is doing it, we will monitor the situation and decide how to deal with it. You may leave once the abuse has been reported. The decision of an operator is final.
+ S
+ This is QuakeNet's antispam service. It can be requested from www.quakenet.org. Read the LFAQ on the site before requesting.
+ stats
+ Please do not join #feds to question the statistical monitoring we carry out to check your L, Q or S request. Our services count according to internal rules designed to avoid network overload. Despite what you may perceive, services check these statistics much more accurately than you can. If you have failed in a request then you will simply have to try again in the future.
+ score
+ You must be in the top 5 recognised chanops to request L. Statistics for L are only recorded when you have op in the channel and there are at least 3 other people in the channel with you (who may or may not be channel ops). Previous op history is kept for approximately 10 days therefore it is possible for previous ops to have op time that greatly exceeds 2 hours, preventing you requesting L to a channel that appears unused. You will simply have to wait until the op time is exceeded or the records expire.
+ serverapp
+ You can find a server application at http://www.quakenet.org/server_application *READ IT CAREFULLY* Do not ask questions about the application form in #feds. Response time for submitted applications is typically between 2 to 4 weeks.
+ takeover
+ Support for recovering stolen channels is limited as the responsibility for protecting those channels is your own. However, if you have not already done so, state the #channelname and be patient. If the operator informs you that he or she will not intervene in this case then there is no appeal and you should choose a new channel and consider what security mistakes you made which resulted in the loss of the original channel.
+ 0 0 0 0 0 0
+ 0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
- 0 0 3 0 0 0
0 0 0 0 0 0
- 0 0 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
-
-% account structure:
-% name (string):
-% level (integer):
-account
- minimoo
- 4 0
- 0 % statistics for this channel
+% Initial account (mine)
account
- Deckard
- 4 0
- 0 % statistics for this channel
-account
- Salt
- 4 0
- 0 % statistics for this channel
-account
- rnikkila
+ strutsi
5 0
- 0 % statistics for this channel
-
+ 0
-% ban structure:
-% banmask (string):
-% reason (string):
-% expiration (int):
-
-% term structure:
-% name (string):
-% description (string):
term
- password
- If you have forgotten your auth password use /msg q requestpassword. If you have not set your email address then the auth account is lost - an oper will NOT tell you the password for any auth account. Accounts that formely had owner on a channel will expire in 40 days at which point the next highest chanlev in the channel may use /MSG L (or Q) REQUESTOWNER.
-term
- P
- All clients are scanned upon connection for open proxies. That means that the service tries to connect to the user`s computer, and if successful, try to connect back to QuakeNet, through the proxy. If successful with that, the user gets a temporary ban from QuakeNet. It is up to the user to secure his or her computer. The action of connecting to QuakeNet indicates your acceptance of this security test.
+ #auth
+ If the user is not online at the moment you can still modify his/her account by using the user's auth nick and putting # infront of it (If user John have auth Clan^John it would be #Clan^John). You can list the auth nicks by doing /msg Q chanlev #channel or /msg L chanlev #channel.
term
- requestop
- You can use /msg o requestop #channel to request channel operator status in a channel that has no ops. This command will not work during a netsplit, or if you are not a recognised chanop. If you cannot get op in a channel then an operator will not assist you.
+ authsecure
+ If you are concerned that your auth account is compromised first do /MSG Q WHOIS #authname. If you are the only person authed to the account do /MSG Q WHOAMI and check the email address listed is yours (check it is EXACTLY your email address). If it is incorrect, change it with the EMAIL command. Following this you should use /MSG Q NEWPASS to change the current password.
term
- nickserv
- QuakeNet does not use Nickserv to reserve nicknames. As a result of this, you cannot register your nickname on QuakeNet. If a nickname is available, any user is allowed to use it. However, this does NOT apply to the nicknames of IRC Operators, Helpers and Network services, due to security related issues. If a user uses any of these nicknames, an operator may immediately disconnect the user from the network WITHOUT prior notice.
+ authhack
+ Auth accounts are not 'hacked'. Poor security on your computer, using a compromised/free BNC, messaging your auth details to someone other than Q, clicking URLs pasted in channels and running decode scripts and commands without understanding beforehand what they do is the cause of lost auths. If you want help you will have to identify HOW your auth was compromised first.
term
- netrider
- If you create a channel during a netsplit which exists on the other side of the split and has +i or +k set, then you will be automatically kicked off the channel when the net rejoins with the kick message 'NetRider'.
+ FAQ
+ QuakeNet FAQs can be found at www.quakenet.org. These contain information on security, channel and user modes, IRCing, channel services and our network rules.
term
- expire
- An unused L bot will expire from a channel after 20 days of inactivity (No known users joining), or if the channel usercount is insufficient over a period of time. A Q bot will expire after 40 days of inactivity. You will need to request L into the channel again if you wish to secure it. These unused services are removed during a cleanup process which typically takes place every 40 days, but may on occasion occur later.
+ modes
+ QuakeNet channels have a number of channel and user modes to provide protection against harrasment, advertising and other unwelcome behaviour, and to help you manage your channel. Visit www.quakenet.org and read the IRC FAQ for a full list of the current modes.
term
- fixtakeover
- Use /msg L (or Q) recover #channel to recover your channel. This command requires at least +m in your chanlev. If you are +ao only you can /msg L (or Q) invite #channel to enter the channel and remove channel modes manually. Note that if a Q ban has been set on you the invite command will not be effective.
+ chanserv
+ You can not register channels on QuakeNet. Instead, you can request the channel service bot called 'L' to join your channel. You will first need an auth account, and then you can request the L bot using that auth account. Visit www.quakenet.org and read the General FAQ for details of auth accounts, and the L FAQ for details of the L bot.
term
fishbot
Fishbot exists to remind our users that fish do indeed go m00! To get fishbot in your channel, do /invite fishbot #channel. To remove fishbot from your channel, just kick it. Fishbot has NO other purpose and is not part of some secret, evil conspiracy.
term
- chanserv
- You can not register channels on QuakeNet. Instead, you can request the channel service bot called 'L' to join your channel. You will first need an auth account, and then you can request the L bot using that auth account. Visit www.quakenet.org and read the General FAQ for details of auth accounts, and the L FAQ for details of the L bot.
+ fixtakeover
+ Use /msg L (or Q) recover #channel to recover your channel. This command requires at least +m in your chanlev. If you are +ao only you can /msg L (or Q) invite #channel to enter the channel and remove channel modes manually. Note that if a Q ban has been set on you the invite command will not be effective.
term
- modes
- QuakeNet channels have a number of channel and user modes to provide protection against harrasment, advertising and other unwelcome behaviour, and to help you manage your channel. Visit www.quakenet.org and read the IRC FAQ for a full list of the current modes.
+ expire
+ An unused L bot will expire from a channel after 20 days of inactivity (No known users joining), or if the channel usercount is insufficient over a period of time. A Q bot will expire after 40 days of inactivity. You will need to request L into the channel again if you wish to secure it. These unused services are removed during a cleanup process which typically takes place every 40 days, but may on occasion occur later.
term
- FAQ
- QuakeNet FAQs can be found at www.quakenet.org. These contain information on security, channel and user modes, IRCing, channel services and our network rules.
+ netrider
+ If you create a channel during a netsplit which exists on the other side of the split and has +i or +k set, then you will be automatically kicked off the channel when the net rejoins with the kick message 'NetRider'.
term
- authhack
- Auth accounts are not 'hacked'. Poor security on your computer, using a compromised/free BNC, messaging your auth details to someone other than Q, clicking URLs pasted in channels and running decode scripts and commands without understanding beforehand what they do is the cause of lost auths. If you want help you will have to identify HOW your auth was compromised first.
+ nickserv
+ QuakeNet does not use Nickserv to reserve nicknames. As a result of this, you cannot register your nickname on QuakeNet. If a nickname is available, any user is allowed to use it. However, this does NOT apply to the nicknames of IRC Operators, Helpers and Network services, due to security related issues. If a user uses any of these nicknames, an operator may immediately disconnect the user from the network WITHOUT prior notice.
term
- authsecure
- If you are concerned that your auth account is compromised first do /MSG Q WHOIS #authname. If you are the only person authed to the account do /MSG Q WHOAMI and check the email address listed is yours (check it is EXACTLY your email address). If it is incorrect, change it with the EMAIL command. Following this you should use /MSG Q NEWPASS to change the current password.
+ requestop
+ You can use /msg o requestop #channel to request channel operator status in a channel that has no ops. This command will not work during a netsplit, or if you are not a recognised chanop. If you cannot get op in a channel then an operator will not assist you.
term
- #auth
- If the user is not online at the moment you can still modify his/her account by using the user's auth nick and putting # infront of it (If user John have auth Clan^John it would be #Clan^John). You can list the auth nicks by doing /msg Q chanlev #channel or /msg L chanlev #channel.
-
-% ticket structure:
-% channel (string)
-% authname (string)
-% expiration time (int)
-
-% report structure:
-% channel reported
-% channel reported to
-
-% global variables
-% hstat_cycle
-globals
- 3
+ P
+ All clients are scanned upon connection for open proxies. That means that the service tries to connect to the user`s computer, and if successful, try to connect back to QuakeNet, through the proxy. If successful with that, the user gets a temporary ban from QuakeNet. It is up to the user to secure his or her computer. The action of connecting to QuakeNet indicates your acceptance of this security test.
+term
+ password
+ If you have forgotten your auth password use /msg q requestpassword. If you have not set your email address then the auth account is lost - an oper will NOT tell you the password for any auth account. Accounts that formely had owner on a channel will expire in 40 days at which point the next highest chanlev in the channel may use /MSG L (or Q) REQUESTOWNER.