]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | /* Forward declarations */ | |
10 | struct hchannel_struct; | |
11 | struct huser_struct; | |
12 | ||
13 | typedef enum | |
14 | { | |
15 | HLC_CAPS, | |
16 | HLC_REPEAT, | |
17 | HLC_CHARACTER_REPEAT, | |
18 | HLC_FLOOD, | |
19 | HLC_SPAM | |
20 | } hlc_violation; | |
21 | ||
22 | typedef 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 | ||
48 | extern hlc_profile *hlc_profiles; | |
49 | /* just adds a profile, does NOT set any values */ | |
50 | hlc_profile* hlc_add(const char *); | |
51 | hlc_profile *hlc_del(hlc_profile *); | |
52 | void hlc_del_all(void); | |
53 | hlc_profile *hlc_get(const char *); | |
54 | ||
55 | /* checks a string for lameness, returns non-zero if lameness is present and the user is kicked */ | |
56 | int hlc_check(struct hchannel_struct*, struct huser_struct*, const char *); | |
57 | ||
58 | #endif |