]> jfr.im git - irc/quakenet/newserv.git/blame - helpmod2/hlamer.h
Small changes to parser/parser.c and Makefile.
[irc/quakenet/newserv.git] / helpmod2 / hlamer.h
CommitLineData
c86edd1d
Q
1/* H lamer control */
2#ifndef HLAMER_H
3#define HLAMER_H
4
5#include "../lib/sstring.h"
6
7#define HLC_DEFAULT_BANTIME (60 * 60 * 24)
8
e908ecfa 9/* Forward declarations */
10struct hchannel_struct;
11struct huser_struct;
12
c86edd1d
Q
13typedef enum
14{
15 HLC_CAPS,
16 HLC_REPEAT,
17 HLC_CHARACTER_REPEAT,
18 HLC_FLOOD,
19 HLC_SPAM
20} hlc_violation;
21
22typedef struct hlamercontrol_profile_struct
23{
24 sstring *name;
25
26 int caps_max_percentage;
27 int caps_min_count;
28
29 int repeats_max_count;
30 int repeats_min_length;
31
32 int symbol_repeat_max_count;
33 int character_repeat_max_count;
34 int symbol_max_count;
35
36 int tolerance_flood;
37
38 int tolerance_spam;
39 float constant_spam;
40
41 int tolerance_warn;
42 int tolerance_kick;
43 int tolerance_remove;
44
45 struct hlamercontrol_profile_struct *next;
46} hlc_profile;
47
48extern hlc_profile *hlc_profiles;
49/* just adds a profile, does NOT set any values */
50hlc_profile* hlc_add(const char *);
51hlc_profile *hlc_del(hlc_profile *);
52void hlc_del_all(void);
53hlc_profile *hlc_get(const char *);
54
e908ecfa 55/* checks a string for lameness, returns non-zero if lameness is present and the user is kicked */
56int hlc_check(struct hchannel_struct*, struct huser_struct*, const char *);
c86edd1d
Q
57
58#endif