/[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.3 - (hide annotations) (download) (as text)
Mon Jun 28 11:17:00 1999 UTC (22 years, 4 months ago) by arthur2
Branch: MAIN
Changes since 1.2: +13 -2 lines
File MIME type: text/x-csrc
exempt/invite patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23