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

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

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


Revision 1.6 - (hide annotations) (download) (as text)
Wed Sep 15 07:26:28 1999 UTC (20 years, 3 months ago) by poptix
Branch: MAIN
Changes since 1.5: +1 -0 lines
File MIME type: text/x-csrc
newmode.diff
: Modified Files:
: 	Makefile TODO eggdrop.conf.dist doc/UPDATES1.3 src/chan.h
: 	src/main.h src/tclegg.h src/mod/irc.mod/cmdsirc.c
: 	src/mod/irc.mod/irc.c src/mod/irc.mod/mode.c

1 segfault 1.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 guppy 1.4 #define SENTVOICE 0x0040 /* a mode +v was already sent out for
35     * this user */
36 segfault 1.1 #define SENTDEVOICE 0x0080 /* a devoice has been sent */
37     #define WASOP 0x0100 /* was an op before a split */
38 guppy 1.4 #define STOPWHO 0x0200
39 segfault 1.1
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 guppy 1.4 #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
48 segfault 1.1 #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 arthur2 1.3 struct exemptrec *exempts; /* temporary channel exempts */
122     struct inviterec *invites; /* temporary channel invites */
123 segfault 1.1 /* 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 poptix 1.6 int compat; /* to prevent mixing old/new modes */
136 segfault 1.1 struct {
137     char *op;
138     char type;
139     } cmode[6]; /* parameter-type mode changes - */
140     /* detect floods */
141     char floodwho[FLOOD_CHAN_MAX][81];
142     time_t floodtime[FLOOD_CHAN_MAX];
143     int floodnum[FLOOD_CHAN_MAX];
144     char deopd[NICKLEN]; /* last person deop'd (must change) */
145     };
146    
147     /* behavior modes for the channel */
148     #define CHAN_CLEARBANS 0x0001 /* clear bans on join */
149     #define CHAN_ENFORCEBANS 0x0002 /* kick people who match channel bans */
150     #define CHAN_DYNAMICBANS 0x0004 /* only activate bans when needed */
151     #define CHAN_NOUSERBANS 0x0008 /* don't let non-bots place bans */
152     #define CHAN_OPONJOIN 0x0010 /* op +o people as soon as they join */
153     #define CHAN_BITCH 0x0020 /* be a tightwad with ops */
154     #define CHAN_GREET 0x0040 /* greet people with their info line */
155     #define CHAN_PROTECTOPS 0x0080 /* re-op any +o people who get deop'd */
156     #define CHAN_LOGSTATUS 0x0100 /* log channel status every 5 mins */
157     #define CHAN_STOPNETHACK 0x0200 /* deop netsplit hackers */
158     #define CHAN_REVENGE 0x0400 /* get revenge on bad people */
159     #define CHAN_SECRET 0x0800 /* don't advertise channel on botnet */
160     #define CHAN_AUTOVOICE 0x1000 /* dish out voice stuff automatically */
161     #define CHAN_CYCLE 0x2000 /* cycle the channel if possible */
162     #define CHAN_DONTKICKOPS 0x4000 /* never kick +o flag people - arthur2 */
163     #define CHAN_WASOPTEST 0x8000 /* wasop test for all +o user
164     * when +stopnethack */
165     #define CHAN_INACTIVE 0x10000 /* no irc support for this channel - drummer */
166 segfault 1.2 #define CHAN_PROTECTFRIENDS 0x20000 /* re-op any +f people who get deop'd */
167 poptix 1.5 /* 0x40000 */
168     /* 0x80000 */
169 segfault 1.1 #define CHAN_ACTIVE 0x1000000 /* like i'm actually on the channel
170     * and stuff */
171     #define CHAN_PEND 0x2000000 /* just joined; waiting for end of
172     * WHO list */
173     #define CHAN_FLAGGED 0x4000000 /* flagged during rehash for delete */
174     #define CHAN_STATIC 0x8000000 /* channels that are NOT dynamic */
175     #define CHAN_SHARED 0x10000000 /* channel is being shared */
176     #define CHAN_ASKEDBANS 0x20000000
177     #define CHAN_SEEN 0x40000000
178 poptix 1.5 #define CHAN_REVENGEBOT 0x80000000 /* revenge on actions against the bot */
179 segfault 1.1
180 arthur2 1.3 #define CHAN_ASKED_EXEMPTS 0x0001
181     #define CHAN_ASKED_INVITED 0x0002
182    
183     #define CHAN_DYNAMICEXEMPTS 0x0004
184     #define CHAN_NOUSEREXEMPTS 0x0008
185     #define CHAN_DYNAMICINVITES 0x0010
186     #define CHAN_NOUSERINVITES 0x0020
187 segfault 1.1
188     /* prototypes */
189     memberlist *ismember(struct chanset_t *, char *);
190     struct chanset_t *findchan();
191    
192     /* is this channel +s/+p? */
193     #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC))
194     /* is this channel +t? */
195     #define channel_optopic(chan) (chan->channel.mode & CHANTOPIC)
196     #define channel_active(chan) (chan->status & CHAN_ACTIVE)
197     #define channel_pending(chan) (chan->status & CHAN_PEND)
198     #define channel_bitch(chan) (chan->status & CHAN_BITCH)
199     #define channel_autoop(chan) (chan->status & CHAN_OPONJOIN)
200     #define channel_wasoptest(chan) (chan->status & CHAN_WASOPTEST)
201     #define channel_autovoice(chan) (chan->status & CHAN_AUTOVOICE)
202     #define channel_greet(chan) (chan->status & CHAN_GREET)
203     #define channel_logstatus(chan) (chan->status & CHAN_LOGSTATUS)
204     #define channel_clearbans(chan) (chan->status & CHAN_CLEARBANS)
205     #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
206     #define channel_revenge(chan) (chan->status & CHAN_REVENGE)
207     #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
208     #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
209     #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
210 segfault 1.2 #define channel_protectfriends(chan) (chan->status & CHAN_PROTECTFRIENDS)
211 segfault 1.1 #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)
212     #define channel_stopnethack(chan) (chan->status & CHAN_STOPNETHACK)
213     #define channel_secret(chan) (chan->status & CHAN_SECRET)
214     #define channel_shared(chan) (chan->status & CHAN_SHARED)
215     #define channel_static(chan) (chan->status & CHAN_STATIC)
216     #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
217     #define channel_seen(chan) (chan->status & CHAN_SEEN)
218     #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
219 poptix 1.5 #define channel_revengebot(chan) (chan->status & CHAN_REVENGEBOT)
220 arthur2 1.3 #define channel_dynamicexempts(chan) (chan->ircnet_status & CHAN_DYNAMICEXEMPTS)
221     #define channel_nouserexempts(chan) (chan->ircnet_status & CHAN_NOUSEREXEMPTS)
222     #define channel_dynamicinvites(chan) (chan->ircnet_status & CHAN_DYNAMICINVITES)
223     #define channel_nouserinvites(chan) (chan->ircnet_status & CHAN_NOUSERINVITES)
224 segfault 1.1
225     struct server_list {
226     struct server_list *next;
227     char *name;
228     int port;
229     char *pass;
230     char *realname;
231     };
232    
233     struct msgq_head {
234     struct msgq *head;
235     struct msgq *last;
236     int tot;
237     int warned;
238     };
239    
240     /* used to queue a lot of things */
241     struct msgq {
242     struct msgq *next;
243     int len;
244     char *msg;
245     };
246    
247     #endif

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23