mirror of
https://github.com/anope/anope.git
synced 2026-07-03 18:03:14 +02:00
Bug 1001: Added support for internal tracking of +j channel mode (throttling).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1940 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
Anope Version 1.8 SVN
|
||||
-------------------
|
||||
Provided by Anope Dev. <team@anope.org> - 2009
|
||||
01/03 F Updated install.js url for windows build help. [ #00]
|
||||
01/17 F Fixed MySQL DB saving failing due to unsafe queries. [#994]
|
||||
01/18 F Fixed check for backtrace() in configure. [ #00]
|
||||
01/03 F Updated install.js url for windows build help. [ #00]
|
||||
01/17 F Fixed MySQL DB saving failing due to unsafe queries. [ #994]
|
||||
01/18 F Fixed check for backtrace() in configure. [ #00]
|
||||
01/22 F Do not allow invalied nicks to be grouped. [#1000]
|
||||
01/26 F Do not allow empty vIdent when loading from MySQL. [ #00]
|
||||
01/26 F Readonly/noexpire are now checked before saving on shutdown. [ #00]
|
||||
01/28 F Added internal support for +j channelmodes. [#1001]
|
||||
|
||||
Anope Version 1.8.0
|
||||
-------------------
|
||||
|
||||
@@ -446,6 +446,11 @@ How To Add IRCd Support
|
||||
Contact the anope Dev Team if this is the case.
|
||||
Set to 0 if CIDR's are not supported by your IRCd.
|
||||
|
||||
88) Throttle Mode: The IRCd has a channelmode for throttling joins per-user.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
89) CMode j: CMODE_ that defines throttle mode. Use 0 for no support.
|
||||
|
||||
So we've had this long list. Now there's a second struct to fill. This
|
||||
struct isn't as long as the previous one though, so we'll handle it quite
|
||||
quick compared to the previous one.
|
||||
|
||||
@@ -92,6 +92,7 @@ E void chan_adduser2(User * user, Channel * c);
|
||||
E void add_invite(Channel * chan, char *mask);
|
||||
E void chan_delete(Channel * c);
|
||||
E void del_ban(Channel * chan, char *mask);
|
||||
E void chan_set_throttle(Channel * chan, char *value);
|
||||
E void chan_set_key(Channel * chan, char *value);
|
||||
E void set_limit(Channel * chan, char *value);
|
||||
E void del_invite(Channel * chan, char *mask);
|
||||
@@ -104,6 +105,8 @@ E void add_exception(Channel * chan, char *mask);
|
||||
E void del_exception(Channel * chan, char *mask);
|
||||
E char *get_flood(Channel * chan);
|
||||
E void set_flood(Channel * chan, char *value);
|
||||
E char *get_throttle(Channel * chan);
|
||||
E void set_throttle(Channel * chan, char *value);
|
||||
E char *get_redirect(Channel * chan);
|
||||
E void set_redirect(Channel * chan, char *value);
|
||||
|
||||
@@ -204,6 +207,8 @@ E void stick_mask(ChannelInfo * ci, AutoKick * akick);
|
||||
E void stick_all(ChannelInfo * ci);
|
||||
E char *cs_get_flood(ChannelInfo * ci);
|
||||
E void cs_set_flood(ChannelInfo * ci, char *value);
|
||||
E char *cs_get_throttle(ChannelInfo * ci);
|
||||
E void cs_set_throttle(ChannelInfo * ci, char *value);
|
||||
E char *cs_get_key(ChannelInfo * ci);
|
||||
E void cs_set_key(ChannelInfo * ci, char *value);
|
||||
E char *cs_get_limit(ChannelInfo * ci);
|
||||
@@ -702,6 +707,7 @@ E void pmodule_secret_cmode(int mode);
|
||||
E void pmodule_private_cmode(int mode);
|
||||
E void pmodule_key_mode(int mode);
|
||||
E void pmodule_limit_mode(int mode);
|
||||
E void pmodule_jointhrottle_mode_check(int (*func) (char *value));
|
||||
|
||||
E int anope_get_secret_mode();
|
||||
E int anope_get_invite_mode();
|
||||
@@ -1369,6 +1375,7 @@ E void anope_cmd_svid_umode2(User *u, char *ts);
|
||||
E void anope_cmd_svid_umode3(User *u, char *ts);
|
||||
E void anope_cmd_nc_change(User *u);
|
||||
E int anope_flood_mode_check(char *value);
|
||||
E int anope_jointhrottle_mode_check(char *value);
|
||||
|
||||
E void anope_cmd_jupe(char *jserver, char *who, char *reason);
|
||||
|
||||
|
||||
@@ -361,6 +361,8 @@ struct ircdvars_ {
|
||||
int cidrchanbei; /* channel bans/excepts/invites support CIDR (syntax: +b *!*@192.168.0.0/15)
|
||||
* 0 for no support, 1 for strict cidr support, anything else
|
||||
* for ircd specific support (nefarious only cares about first /mask) */
|
||||
int jmode; /* +j join throttle */
|
||||
uint32 chan_jmode; /* Mode */
|
||||
};
|
||||
|
||||
struct ircdcapab_ {
|
||||
@@ -668,6 +670,7 @@ struct chaninfo_ {
|
||||
char *mlock_key; /* NULL if no key */
|
||||
char *mlock_flood; /* NULL if no +f */
|
||||
char *mlock_redirect; /* NULL if no +L */
|
||||
char *mlock_throttle; /* NULL if no +j */
|
||||
|
||||
char *entry_message; /* Notice sent on entering channel */
|
||||
|
||||
@@ -990,6 +993,7 @@ struct channel_ {
|
||||
char *key; /* NULL if none */
|
||||
char *redirect; /* +L; NULL if none */
|
||||
char *flood; /* +f; NULL if none */
|
||||
char *throttle; /* +j: NULL if none */
|
||||
EList *bans;
|
||||
EList *excepts;
|
||||
EList *invites;
|
||||
@@ -1208,6 +1212,7 @@ typedef struct ircd_proto_ {
|
||||
int (*ircd_valid_nick)(char *nick);
|
||||
int (*ircd_valid_chan)(char *chan);
|
||||
int (*ircd_flood_mode_check)(char *value);
|
||||
int (*ircd_jointhrottle_mode_check)(char *value);
|
||||
} IRCDProto;
|
||||
|
||||
typedef struct ircd_modes_ {
|
||||
|
||||
@@ -445,6 +445,10 @@ void get_channel_stats(long *nrec, long *memuse)
|
||||
if (chan->redirect)
|
||||
mem += strlen(chan->redirect) + 1;
|
||||
}
|
||||
if (ircd->jmode) {
|
||||
if (chan->throttle)
|
||||
mem += strlen(chan->throttle) + 1;
|
||||
}
|
||||
mem += get_memuse(chan->bans);
|
||||
if (ircd->except) {
|
||||
mem += get_memuse(chan->excepts);
|
||||
@@ -1648,6 +1652,10 @@ void chan_delete(Channel * c)
|
||||
if (c->redirect)
|
||||
free(c->redirect);
|
||||
}
|
||||
if (ircd->jmode) {
|
||||
if (c->throttle)
|
||||
free (c->throttle);
|
||||
}
|
||||
|
||||
if (c->bans && c->bans->count) {
|
||||
while (c->bans->entries) {
|
||||
@@ -1759,6 +1767,13 @@ char *get_flood(Channel * chan)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
char *get_throttle(Channel * chan)
|
||||
{
|
||||
return chan->throttle;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
char *get_key(Channel * chan)
|
||||
{
|
||||
return chan->key;
|
||||
@@ -1825,6 +1840,19 @@ void set_flood(Channel * chan, char *value)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void chan_set_throttle(Channel * chan, char *value)
|
||||
{
|
||||
if (chan->throttle)
|
||||
free(chan->throttle);
|
||||
chan->throttle = value ? sstrdup(value) : NULL;
|
||||
|
||||
if (debug)
|
||||
alog("debug: Throttle mode for channel %s set to %s", chan->name,
|
||||
chan->throttle ? chan->throttle : "none");
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void chan_set_key(Channel * chan, char *value)
|
||||
{
|
||||
if (chan->key)
|
||||
|
||||
@@ -342,6 +342,10 @@ void get_chanserv_stats(long *nrec, long *memuse)
|
||||
if (ci->mlock_redirect)
|
||||
mem += strlen(ci->mlock_redirect) + 1;
|
||||
}
|
||||
if (ircd->jmode) {
|
||||
if (ci->mlock_throttle)
|
||||
mem += strlen(ci->mlock_throttle) + 1;
|
||||
}
|
||||
if (ci->last_topic)
|
||||
mem += strlen(ci->last_topic) + 1;
|
||||
if (ci->entry_message)
|
||||
@@ -675,6 +679,16 @@ void load_cs_dbase(void)
|
||||
if (s)
|
||||
free(s);
|
||||
}
|
||||
/* We added support for channelmode +j tracking,
|
||||
* however unless for some other reason we need to
|
||||
* change the DB format, it is being saved to DB. ~ Viper
|
||||
if (ircd->jmode) {
|
||||
SAFE(read_string(&ci->mlock_throttle, f));
|
||||
} else {
|
||||
SAFE(read_string(&s, f));
|
||||
if (s)
|
||||
free(s);
|
||||
}*/
|
||||
}
|
||||
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
@@ -934,6 +948,13 @@ void save_cs_dbase(void)
|
||||
} else {
|
||||
SAFE(write_string(NULL, f));
|
||||
}
|
||||
/* Current DB format does not hold +j yet.. ~ Viper
|
||||
if (ircd->jmode) {
|
||||
SAFE(write_string(ci->mlock_throttle, f));
|
||||
} else {
|
||||
SAFE(write_string(NULL, f));
|
||||
}
|
||||
*/
|
||||
SAFE(write_int16(ci->memos.memocount, f));
|
||||
SAFE(write_int16(ci->memos.memomax, f));
|
||||
memos = ci->memos.memos;
|
||||
@@ -2139,6 +2160,10 @@ int delchan(ChannelInfo * ci)
|
||||
if (ci->mlock_redirect)
|
||||
free(ci->mlock_redirect);
|
||||
}
|
||||
if (ircd->jmode) {
|
||||
if (ci->mlock_throttle)
|
||||
free(ci->mlock_throttle);
|
||||
}
|
||||
if (ci->last_topic)
|
||||
free(ci->last_topic);
|
||||
if (ci->forbidby)
|
||||
@@ -2410,6 +2435,17 @@ char *cs_get_flood(ChannelInfo * ci)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
char *cs_get_throttle(ChannelInfo * ci)
|
||||
{
|
||||
if (!ci) {
|
||||
return NULL;
|
||||
} else {
|
||||
return ci->mlock_throttle;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
char *cs_get_key(ChannelInfo * ci)
|
||||
{
|
||||
if (!ci) {
|
||||
@@ -2470,6 +2506,24 @@ void cs_set_flood(ChannelInfo * ci, char *value)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void cs_set_throttle(ChannelInfo * ci, char *value)
|
||||
{
|
||||
if (!ci)
|
||||
return;
|
||||
|
||||
if (ci->mlock_throttle)
|
||||
free(ci->mlock_throttle);
|
||||
|
||||
if (anope_jointhrottle_mode_check(value)) {
|
||||
ci->mlock_throttle = sstrdup(value);
|
||||
} else {
|
||||
ci->mlock_on &= ~ircd->chan_jmode;
|
||||
ci->mlock_throttle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void cs_set_key(ChannelInfo * ci, char *value)
|
||||
{
|
||||
if (!ci) {
|
||||
|
||||
+13
@@ -113,6 +113,7 @@ void initIrcdProto()
|
||||
ircdproto.ircd_valid_nick = NULL;
|
||||
ircdproto.ircd_valid_chan = NULL;
|
||||
ircdproto.ircd_cmd_ctcp = NULL;
|
||||
ircdproto.ircd_jointhrottle_mode_check = NULL;
|
||||
}
|
||||
|
||||
/* Special function, returns 1 if executed, 0 if not */
|
||||
@@ -639,6 +640,13 @@ int anope_flood_mode_check(char *value)
|
||||
void anope_cmd_svsjoin(char *source, char *nick, char *chan, char *param)
|
||||
{
|
||||
ircdproto.ircd_cmd_svsjoin(source, nick, chan, param);
|
||||
}
|
||||
|
||||
void anope_cmd_svspart(char *source, char *nick, char *chan)
|
||||
{
|
||||
ircdproto.ircd_cmd_svspart(source, nick, chan);
|
||||
}
|
||||
|
||||
void anope_cmd_swhois(char *source, char *who, char *mask)
|
||||
{
|
||||
ircdproto.ircd_cmd_swhois(source, who, mask);
|
||||
@@ -1137,6 +1145,11 @@ void pmodule_ircd_csmodes(char mode[128])
|
||||
|
||||
void pmodule_ircd_cbmodes(CBMode modes[128])
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < 128; i++) {
|
||||
cbmodes[i] = modes[i];
|
||||
}
|
||||
}
|
||||
|
||||
void pmodule_ircd_cmmodes(CMMode modes[128])
|
||||
{
|
||||
|
||||
@@ -108,6 +108,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -36,7 +36,7 @@ IRCDVar myIrcd[] = {
|
||||
"+oiS", /* Global alias mode */
|
||||
"+oiS", /* Used by BotServ Bots */
|
||||
2, /* Chan Max Symbols */
|
||||
"-cilmnpstrgzQF", /* Modes to Remove */
|
||||
"-cijlmnpstrgzQF", /* Modes to Remove */
|
||||
"+o", /* Channel Umode used by Botserv bots */
|
||||
1, /* SVSNICK */
|
||||
1, /* Vhost */
|
||||
@@ -105,6 +105,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
1, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j Mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -125,6 +125,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -56,7 +56,7 @@ IRCDVar myIrcd[] = {
|
||||
"+ioI", /* Global alias mode */
|
||||
"+sI", /* Used by BotServ Bots */
|
||||
5, /* Chan Max Symbols */
|
||||
"-cilmnpstuzACGHKNOQRSV", /* Modes to Remove */
|
||||
"-cijlmnpstuzACGHKNOQRSV", /* Modes to Remove */
|
||||
"+ao", /* Channel Umode used by Botserv bots */
|
||||
1, /* SVSNICK */
|
||||
1, /* Vhost */
|
||||
@@ -125,6 +125,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
1, /* CIDR channelbans */
|
||||
1, /* +j */
|
||||
CMODE_j, /* +j Mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
@@ -284,7 +286,7 @@ CBMode myCbmodes[128] = {
|
||||
{0}, /* g */
|
||||
{0}, /* h */
|
||||
{CMODE_i, 0, NULL, NULL},
|
||||
{0}, /* j */
|
||||
{CMODE_j, CBM_MINUS_NO_ARG | CBM_NO_MLOCK, chan_set_throttle, cs_set_throttle}, /* j */
|
||||
{CMODE_k, 0, chan_set_key, cs_set_key},
|
||||
{CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit},
|
||||
{CMODE_m, 0, NULL, NULL},
|
||||
@@ -308,6 +310,7 @@ CBModeInfo myCbmodeinfos[] = {
|
||||
{'f', CMODE_f, 0, NULL, NULL},
|
||||
{'c', CMODE_c, 0, NULL, NULL},
|
||||
{'i', CMODE_i, 0, NULL, NULL},
|
||||
{'j', CMODE_j, 0, get_throttle, cs_get_throttle},
|
||||
{'k', CMODE_k, 0, get_key, cs_get_key},
|
||||
{'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
|
||||
{'m', CMODE_m, 0, NULL, NULL},
|
||||
@@ -1806,6 +1809,27 @@ void inspircd_cmd_ctcp(char *source, char *dest, char *buf)
|
||||
}
|
||||
|
||||
|
||||
int inspircd_jointhrottle_mode_check(char *value)
|
||||
{
|
||||
char *tempValue, *one, *two;
|
||||
int param1, param2;
|
||||
|
||||
if (!value)
|
||||
return 0;
|
||||
|
||||
tempValue = sstrdup(value);
|
||||
one = strtok(tempValue, ":");
|
||||
two = strtok(NULL, "");
|
||||
if (one && two) {
|
||||
param1 = atoi(one);
|
||||
param2 = atoi(two);
|
||||
}
|
||||
if ((param1 >= 1) && (param1 <= 255) && (param2 >= 1) && (param2 <= 999))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tell anope which function we want to perform each task inside of anope.
|
||||
* These prototypes must match what anope expects.
|
||||
@@ -1886,6 +1910,7 @@ void moduleAddAnopeCmds()
|
||||
pmodule_valid_chan(inspircd_valid_chan);
|
||||
pmodule_cmd_ctcp(inspircd_cmd_ctcp);
|
||||
pmodule_set_umode(inspircd_set_umode);
|
||||
pmodule_jointhrottle_mode_check(inspircd_jointhrottle_mode_check);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define CMODE_N 0x01000000
|
||||
#define CMODE_R 0x00000100 /* Only identified users can join */
|
||||
#define CMODE_r 0x00000200 /* Set for all registered channels */
|
||||
#define CMODE_j 0x02000000
|
||||
|
||||
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
|
||||
|
||||
@@ -121,6 +122,8 @@ int inspircd_flood_mode_check(char *value);
|
||||
void inspircd_cmd_jupe(char *jserver, char *who, char *reason);
|
||||
int inspircd_valid_nick(char *nick);
|
||||
void inspircd_cmd_ctcp(char *source, char *dest, char *buf);
|
||||
int inspircd_jointhrottle_mode_check(char *value);
|
||||
|
||||
int anope_event_fjoin(char *source, int ac, char **av);
|
||||
int anope_event_fmode(char *source, int ac, char **av);
|
||||
int anope_event_ftopic(char *source, int ac, char **av);
|
||||
|
||||
@@ -104,6 +104,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -104,6 +104,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -107,6 +107,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -108,6 +108,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -106,6 +106,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
@@ -108,6 +108,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
0, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
+26
-2
@@ -39,7 +39,7 @@ IRCDVar myIrcd[] = {
|
||||
"+ioS", /* Global alias mode */
|
||||
"+qS", /* Used by BotServ Bots */
|
||||
5, /* Chan Max Symbols */
|
||||
"-cilmnpstuzACGHKMNOQRSTV", /* Modes to Remove */
|
||||
"-cijlmnpstuzACGKMNOQRSTV", /* Modes to Remove */
|
||||
"+ao", /* Channel Umode used by Botserv bots */
|
||||
1, /* SVSNICK */
|
||||
1, /* Vhost */
|
||||
@@ -108,6 +108,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
1, /* +j */
|
||||
CMODE_j, /* +j Mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
@@ -316,7 +318,7 @@ CBMode myCbmodes[128] = {
|
||||
{0}, /* g */
|
||||
{0}, /* h */
|
||||
{CMODE_i, 0, NULL, NULL},
|
||||
{0}, /* j */
|
||||
{CMODE_j, CBM_MINUS_NO_ARG | CBM_NO_MLOCK, chan_set_throttle, cs_set_throttle}, /* j */
|
||||
{CMODE_k, 0, chan_set_key, cs_set_key},
|
||||
{CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit},
|
||||
{CMODE_m, 0, NULL, NULL},
|
||||
@@ -340,6 +342,7 @@ CBModeInfo myCbmodeinfos[] = {
|
||||
{'c', CMODE_c, 0, NULL, NULL},
|
||||
{'f', CMODE_f, 0, get_flood, cs_get_flood},
|
||||
{'i', CMODE_i, 0, NULL, NULL},
|
||||
{'j', CMODE_j, 0, get_throttle, cs_get_throttle},
|
||||
{'k', CMODE_k, 0, get_key, cs_get_key},
|
||||
{'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
|
||||
{'m', CMODE_m, 0, NULL, NULL},
|
||||
@@ -1854,6 +1857,26 @@ void unreal_cmd_ctcp(char *source, char *dest, char *buf)
|
||||
free(s);
|
||||
}
|
||||
|
||||
int unreal_jointhrottle_mode_check(char *value)
|
||||
{
|
||||
char *tempValue, *one, *two;
|
||||
int param1, param2;
|
||||
|
||||
if (!value)
|
||||
return 0;
|
||||
|
||||
tempValue = sstrdup(value);
|
||||
one = strtok(tempValue, ":");
|
||||
two = strtok(NULL, "");
|
||||
if (one && two) {
|
||||
param1 = atoi(one);
|
||||
param2 = atoi(two);
|
||||
}
|
||||
if ((param1 >= 1) && (param1 <= 255) && (param2 >= 1) && (param2 <= 999))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
void moduleAddIRCDMsgs(void) {
|
||||
Message *m;
|
||||
@@ -2192,6 +2215,7 @@ void moduleAddAnopeCmds()
|
||||
pmodule_valid_chan(unreal_valid_chan);
|
||||
pmodule_cmd_ctcp(unreal_cmd_ctcp);
|
||||
pmodule_set_umode(unreal_set_umode);
|
||||
pmodule_jointhrottle_mode_check(unreal_jointhrottle_mode_check);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#define CMODE_N 0x01000000
|
||||
#define CMODE_T 0x02000000
|
||||
#define CMODE_M 0x04000000
|
||||
#define CMODE_j 0x08000000
|
||||
|
||||
|
||||
/* Default Modes with MLOCK */
|
||||
@@ -150,4 +151,5 @@ int unreal_flood_mode_check(char *value);
|
||||
void unreal_cmd_jupe(char *jserver, char *who, char *reason);
|
||||
int unreal_valid_nick(char *nick);
|
||||
void unreal_cmd_ctcp(char *source, char *dest, char *buf);
|
||||
int unreal_jointhrottle_mode_check(char *value);
|
||||
|
||||
|
||||
@@ -107,6 +107,8 @@ IRCDVar myIrcd[] = {
|
||||
NULL, /* character set */
|
||||
1, /* reports sync state */
|
||||
0, /* CIDR channelbans */
|
||||
0, /* +j */
|
||||
0, /* +j mode */
|
||||
}
|
||||
,
|
||||
{NULL}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="8"
|
||||
VERSION_PATCH="0"
|
||||
VERSION_EXTRA="-svn"
|
||||
VERSION_BUILD="1924"
|
||||
VERSION_BUILD="1939"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user