]>
jfr.im git - irc/quakenet/newserv.git/blob - chanfix/chanfix.h
4 #include "../channel/channel.h"
6 typedef struct chanfix
{
11 typedef struct regop
{
12 int type
; /* CFACCOUNT or CFHOST */
13 unsigned long hash
; /* hash of the user's account or host */
14 sstring
*uh
; /* account or user@host if the user has enough points */
15 time_t lastopped
; /* when was he last opped */
16 unsigned int score
; /* chanfix score */
26 #define CFSAMPLEINTERVAL 5
27 #define CFEXPIREINTERVAL 60
28 #define CFAUTOSAVEINTERVAL 60
29 #define CFREMEMBEROPS 10*24*60
31 #define CFSAMPLEINTERVAL 300
32 #define CFEXPIREINTERVAL 3600
33 #define CFAUTOSAVEINTERVAL 3600
34 #define CFREMEMBEROPS 10*24*3600
37 /* we won't track scores for channels which have
38 less users than this */
40 /* if you lose a channel after 30 minutes then
41 you really don't need a channel at all */
43 /* a user needs this many points to have his account/host
44 stored in the regop struct */
45 #define CFMINSCOREUH 48
46 /* chanfix won't ever reop more users than this */
48 /* where we store our chanfix data */
49 #define CFSTORAGE "chanfix"
50 /* how many chanfix files we have */
52 /* maximum number of servers which may be split */
53 #define CFMAXSPLITSERVERS 10
55 /* track user by account */
57 /* track user by ident@host */
60 /* channel was fixed */
62 /* no chanfix information available */
63 #define CFX_NOCHANFIX 1
64 /* channel was fixed but less than CFMAXOPS were opped */
65 #define CFX_FIXEDFEWOPS 2
66 /* nobody could be found for a reop */
67 #define CFX_NOUSERSAVAILABLE 3
69 regop
*cf_findregop(nick
*np
, chanindex
*cip
, int type
);
70 chanfix
*cf_findchanfix(chanindex
*cip
);
71 nick
*cf_findnick(regop
*ro
, chanindex
*cip
);
72 int cf_wouldreop(nick
*np
, channel
*cp
);
73 int cf_fixchannel(channel
*cp
);
74 int cf_getsortedregops(chanfix
*cf
, int max
, regop
**list
);
75 int cf_cmpregopnick(regop
*ro
, nick
*np
);
77 #endif /* __CHANFIX_H */