]> jfr.im git - irc/quakenet/newserv.git/blame - helpmod2/hlamer.h
Large reorganisation of all Makefiles, including new configure script.
[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
9af95c3d 22/* under construction */
23typedef enum
24{
25 HLC_X,
26 HLC_Y
27} hlc_component;
28
29#define HLC_COMPONENT_COUNT 0
30
c86edd1d
Q
31typedef 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
57extern hlc_profile *hlc_profiles;
58/* just adds a profile, does NOT set any values */
59hlc_profile* hlc_add(const char *);
60hlc_profile *hlc_del(hlc_profile *);
61void hlc_del_all(void);
62hlc_profile *hlc_get(const char *);
63
e908ecfa 64/* checks a string for lameness, returns non-zero if lameness is present and the user is kicked */
65int hlc_check(struct hchannel_struct*, struct huser_struct*, const char *);
c86edd1d 66
9af95c3d 67/* Returns the component name for the given component */
68const char *hlc_get_cname(hlc_component);
69const char *hlc_get_violation_name(hlc_violation);
70
c86edd1d 71#endif