]> jfr.im git - irc/quakenet/newserv.git/blob - helpmod2/hlamer.h
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / helpmod2 / hlamer.h
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 /* under construction */
23 typedef enum
24 {
25 HLC_X,
26 HLC_Y
27 } hlc_component;
28
29 #define HLC_COMPONENT_COUNT 0
30
31 typedef struct hlamercontrol_profile_struct
32 {
33 sstring *name;
34
35 int caps_max_percentage;
36 int caps_min_count;
37
38 int repeats_max_count;
39 int repeats_min_length;
40
41 int symbol_repeat_max_count;
42 int character_repeat_max_count;
43 int symbol_max_count;
44
45 int tolerance_flood;
46
47 int tolerance_spam;
48 float constant_spam;
49
50 int tolerance_warn;
51 int tolerance_kick;
52 int tolerance_remove;
53
54 struct hlamercontrol_profile_struct *next;
55 } hlc_profile;
56
57 extern hlc_profile *hlc_profiles;
58 /* just adds a profile, does NOT set any values */
59 hlc_profile* hlc_add(const char *);
60 hlc_profile *hlc_del(hlc_profile *);
61 void hlc_del_all(void);
62 hlc_profile *hlc_get(const char *);
63
64 /* checks a string for lameness, returns non-zero if lameness is present and the user is kicked */
65 int hlc_check(struct hchannel_struct*, struct huser_struct*, const char *);
66
67 /* Returns the component name for the given component */
68 const char *hlc_get_cname(hlc_component);
69 const char *hlc_get_violation_name(hlc_violation);
70
71 #endif