/[cvs]/eggdrop1.4/src/chan.h
ViewVC logotype

Contents of /eggdrop1.4/src/chan.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Wed Sep 15 07:06:38 1999 UTC (20 years, 2 months ago) by poptix
Branch: MAIN
Changes since 1.4: +4 -0 lines
File MIME type: text/x-csrc

revenge.patch
refresh_ban_kick.patch

1 /* stuff common to chan.c & mode.c */
2 /* users.h needs to be loaded too */
3 /*
4 * This file is part of the eggdrop source code
5 * copyright (c) 1997 Robey Pointer
6 * and is distributed according to the GNU general public license.
7 * For full details, read the top of 'main.c' or the file called
8 * COPYING that was distributed with this code.
9 */
10 #ifndef _H_CHAN
11 #define _H_CHAN
12
13 typedef struct memstruct {
14 char nick[NICKLEN]; /* "dalnet" allows 30 */
15 char userhost[UHOSTLEN];
16 time_t joined;
17 unsigned short flags;
18 time_t split; /* in case they were just netsplit */
19 time_t last; /* for measuring idle time */
20 struct userrec *user;
21 struct memstruct *next;
22 } memberlist;
23
24 #define CHANMETA "#&!+"
25
26 #define CHANOP 0x0001 /* channel +o */
27 #define CHANVOICE 0x0002 /* channel +v */
28 #define FAKEOP 0x0004 /* op'd by server */
29 #define SENTOP 0x0008 /* a mode +o was already sent out for
30 * this user */
31 #define SENTDEOP 0x0010 /* a mode -o was already sent out for
32 * this user */
33 #define SENTKICK 0x0020 /* a kick was already sent out for this user */
34 #define SENTVOICE 0x0040 /* a mode +v was already sent out for
35 * this user */
36 #define SENTDEVOICE 0x0080 /* a devoice has been sent */
37 #define WASOP 0x0100 /* was an op before a split */
38 #define STOPWHO 0x0200
39
40 #define chan_hasvoice(x) (x->flags & CHANVOICE)
41 #define chan_hasop(x) (x->flags & CHANOP)
42 #define chan_fakeop(x) (x->flags & FAKEOP)
43 #define chan_sentop(x) (x->flags & SENTOP)
44 #define chan_sentdeop(x) (x->flags & SENTDEOP)
45 #define chan_sentkick(x) (x->flags & SENTKICK)
46 #define chan_sentvoice(x) (x->flags & SENTVOICE)
47 #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
48 #define chan_issplit(x) (x->split > 0)
49 #define chan_wasop(x) (x->flags & WASOP)
50
51 typedef struct banstruct {
52 char *ban;
53 char *who;
54 time_t timer;
55 struct banstruct *next;
56 } banlist;
57
58 /* Next 2 structures created for IRCnet server module - Daemus - 2/1/1999 */
59 typedef struct exbanstruct {
60 char *exempt;
61 char *who;
62 time_t timer;
63 struct exbanstruct *next;
64 } exemptlist;
65
66 typedef struct exinvitestruct {
67 char *invite;
68 char *who;
69 time_t timer;
70 struct exinvitestruct *next;
71 } invitelist;
72
73 /* for every channel i join */
74 struct chan_t {
75 memberlist *member;
76 banlist *ban;
77 exemptlist *exempt;
78 invitelist *invite;
79 char *topic;
80 char *key;
81 unsigned short int mode;
82 int maxmembers;
83 int members;
84 };
85
86 #define CHANINV 0x0001 /* +i */
87 #define CHANPRIV 0x0002 /* +p */
88 #define CHANSEC 0x0004 /* +s */
89 #define CHANMODER 0x0008 /* +m */
90 #define CHANTOPIC 0x0010 /* +t */
91 #define CHANNOMSG 0x0020 /* +n */
92 #define CHANLIMIT 0x0040 /* -l -- used only for protecting modes */
93 #define CHANKEY 0x0080 /* -k -- used only for protecting modes */
94 #define CHANANON 0x0100 /* +a -- ircd 2.9 */
95 #define CHANQUIET 0x0200 /* +q -- ircd 2.9 */
96
97 /* for every channel i'm supposed to be active on */
98 struct chanset_t {
99 struct chanset_t *next;
100 struct chan_t channel; /* current information */
101 char name[81];
102 char need_op[121];
103 char need_key[121];
104 char need_limit[121];
105 char need_unban[121];
106 char need_invite[121];
107 int flood_pub_thr;
108 int flood_pub_time;
109 int flood_join_thr;
110 int flood_join_time;
111 int flood_deop_thr;
112 int flood_deop_time;
113 int flood_kick_thr;
114 int flood_kick_time;
115 int flood_ctcp_thr;
116 int flood_ctcp_time;
117 int status;
118 int ircnet_status;
119 int idle_kick;
120 struct banrec *bans; /* temporary channel bans */
121 struct exemptrec *exempts; /* temporary channel exempts */
122 struct inviterec *invites; /* temporary channel invites */
123 /* desired channel modes: */
124 int mode_pls_prot; /* modes to enforce */
125 int mode_mns_prot; /* modes to reject */
126 int limit_prot; /* desired limit */
127 char key_prot[121]; /* desired password */
128 /* queued mode changes: */
129 char pls[21]; /* positive mode changes */
130 char mns[21]; /* negative mode changes */
131 char key[81]; /* new key to set */
132 char rmkey[81]; /* old key to remove */
133 int limit; /* new limit to set */
134 int bytes; /* total bytes so far */
135 struct {
136 char *op;
137 char type;
138 } cmode[6]; /* parameter-type mode changes - */
139 /* detect floods */
140 char floodwho[FLOOD_CHAN_MAX][81];
141 time_t floodtime[FLOOD_CHAN_MAX];
142 int floodnum[FLOOD_CHAN_MAX];
143 char deopd[NICKLEN]; /* last person deop'd (must change) */
144 };
145
146 /* behavior modes for the channel */
147 #define CHAN_CLEARBANS 0x0001 /* clear bans on join */
148 #define CHAN_ENFORCEBANS 0x0002 /* kick people who match channel bans */
149 #define CHAN_DYNAMICBANS 0x0004 /* only activate bans when needed */
150 #define CHAN_NOUSERBANS 0x0008 /* don't let non-bots place bans */
151 #define CHAN_OPONJOIN 0x0010 /* op +o people as soon as they join */
152 #define CHAN_BITCH 0x0020 /* be a tightwad with ops */
153 #define CHAN_GREET 0x0040 /* greet people with their info line */
154 #define CHAN_PROTECTOPS 0x0080 /* re-op any +o people who get deop'd */
155 #define CHAN_LOGSTATUS 0x0100 /* log channel status every 5 mins */
156 #define CHAN_STOPNETHACK 0x0200 /* deop netsplit hackers */
157 #define CHAN_REVENGE 0x0400 /* get revenge on bad people */
158 #define CHAN_SECRET 0x0800 /* don't advertise channel on botnet */
159 #define CHAN_AUTOVOICE 0x1000 /* dish out voice stuff automatically */
160 #define CHAN_CYCLE 0x2000 /* cycle the channel if possible */
161 #define CHAN_DONTKICKOPS 0x4000 /* never kick +o flag people - arthur2 */
162 #define CHAN_WASOPTEST 0x8000 /* wasop test for all +o user
163 * when +stopnethack */
164 #define CHAN_INACTIVE 0x10000 /* no irc support for this channel - drummer */
165 #define CHAN_PROTECTFRIENDS 0x20000 /* re-op any +f people who get deop'd */
166 /* 0x40000 */
167 /* 0x80000 */
168 #define CHAN_ACTIVE 0x1000000 /* like i'm actually on the channel
169 * and stuff */
170 #define CHAN_PEND 0x2000000 /* just joined; waiting for end of
171 * WHO list */
172 #define CHAN_FLAGGED 0x4000000 /* flagged during rehash for delete */
173 #define CHAN_STATIC 0x8000000 /* channels that are NOT dynamic */
174 #define CHAN_SHARED 0x10000000 /* channel is being shared */
175 #define CHAN_ASKEDBANS 0x20000000
176 #define CHAN_SEEN 0x40000000
177 #define CHAN_REVENGEBOT 0x80000000 /* revenge on actions against the bot */
178
179 #define CHAN_ASKED_EXEMPTS 0x0001
180 #define CHAN_ASKED_INVITED 0x0002
181
182 #define CHAN_DYNAMICEXEMPTS 0x0004
183 #define CHAN_NOUSEREXEMPTS 0x0008
184 #define CHAN_DYNAMICINVITES 0x0010
185 #define CHAN_NOUSERINVITES 0x0020
186
187 /* prototypes */
188 memberlist *ismember(struct chanset_t *, char *);
189 struct chanset_t *findchan();
190
191 /* is this channel +s/+p? */
192 #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC))
193 /* is this channel +t? */
194 #define channel_optopic(chan) (chan->channel.mode & CHANTOPIC)
195 #define channel_active(chan) (chan->status & CHAN_ACTIVE)
196 #define channel_pending(chan) (chan->status & CHAN_PEND)
197 #define channel_bitch(chan) (chan->status & CHAN_BITCH)
198 #define channel_autoop(chan) (chan->status & CHAN_OPONJOIN)
199 #define channel_wasoptest(chan) (chan->status & CHAN_WASOPTEST)
200 #define channel_autovoice(chan) (chan->status & CHAN_AUTOVOICE)
201 #define channel_greet(chan) (chan->status & CHAN_GREET)
202 #define channel_logstatus(chan) (chan->status & CHAN_LOGSTATUS)
203 #define channel_clearbans(chan) (chan->status & CHAN_CLEARBANS)
204 #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
205 #define channel_revenge(chan) (chan->status & CHAN_REVENGE)
206 #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
207 #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
208 #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
209 #define channel_protectfriends(chan) (chan->status & CHAN_PROTECTFRIENDS)
210 #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)
211 #define channel_stopnethack(chan) (chan->status & CHAN_STOPNETHACK)
212 #define channel_secret(chan) (chan->status & CHAN_SECRET)
213 #define channel_shared(chan) (chan->status & CHAN_SHARED)
214 #define channel_static(chan) (chan->status & CHAN_STATIC)
215 #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
216 #define channel_seen(chan) (chan->status & CHAN_SEEN)
217 #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
218 #define channel_revengebot(chan) (chan->status & CHAN_REVENGEBOT)
219 #define channel_dynamicexempts(chan) (chan->ircnet_status & CHAN_DYNAMICEXEMPTS)
220 #define channel_nouserexempts(chan) (chan->ircnet_status & CHAN_NOUSEREXEMPTS)
221 #define channel_dynamicinvites(chan) (chan->ircnet_status & CHAN_DYNAMICINVITES)
222 #define channel_nouserinvites(chan) (chan->ircnet_status & CHAN_NOUSERINVITES)
223
224 struct server_list {
225 struct server_list *next;
226 char *name;
227 int port;
228 char *pass;
229 char *realname;
230 };
231
232 struct msgq_head {
233 struct msgq *head;
234 struct msgq *last;
235 int tot;
236 int warned;
237 };
238
239 /* used to queue a lot of things */
240 struct msgq {
241 struct msgq *next;
242 int len;
243 char *msg;
244 };
245
246 #endif

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23