return;
}
+ if(feature_bool(FEAT_CHMODE_A_NOSET) && !(state->flags & MODE_PARSE_FORCE)) /* mode can'T be set. */
+ return;
+
if (!(state->flags & MODE_PARSE_WIPEOUT) &&
(!t_access || t_access == state->chptr->mode.access))
return;
else t_str++; //simply ignore if it's not an opmode
tmp++;
}
- if(tmp[0] == '+' || tmp[0] == '@') {
+ if(tmp[0] == '+' || tmp[0] == '%' || tmp[0] == '@') {
if(tmp[0] == '+') flags |= FLFL_VOICE;
+ if(tmp[0] == '%') flags |= FLFL_HALFOP;
if(tmp[0] == '@') flags |= FLFL_CHANOP;
tmp++;
}
unsigned int noflood_value = time;
noflood_value <<= 10;
noflood_value |= count;
- noflood_value <<= 3;
+ noflood_value <<= 4;
noflood_value |= flags;
state->chptr->mode.noflood_value = noflood_value;
} else {
} else if (req_oplevel <= MAXOPLEVEL)
oplevel = req_oplevel;
}
- if(*flag_p == CHFL_CHANOP && state->member && !IsChanOp(state->member)) {
+ if(*flag_p == CHFL_CHANOP && state->member && !IsChanOp(state->member) && !(state->flags & MODE_PARSE_FORCE)) {
send_notoper(state);
return;
}
int p_pos = 0;
int is_visible = 1, is_ccode = 0, i = 0, j = 0;
char codes[5];
- for(i = 0; p != '\n'; p = stripped_message[++i]) {
+ for(i = 0; p != '\n' && p != 0; p = stripped_message[++i]) {
if(p == 3) {
j = 0;
is_ccode = 1;
struct Membership *member = find_member_link(chptr, cptr);
if(!member) return 0; //TODO: we've no check for -n channels implemented, yet
//check if this user is really affected by +f
- unsigned int flags = (chptr->mode.noflood_value & 0x00000007); //0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007 >> 0
- unsigned int count = (chptr->mode.noflood_value & 0x00001ff8) >> 3; //0000 0000 0000 0000 0001 1111 1111 1000 = 0x00001ff8 >> 3
- int time = (chptr->mode.noflood_value & 0x07ffe000) >> 13; //0000 0111 1111 1111 1110 0000 0000 0000 = 0x07ffe000 >> 13
+ unsigned int flags = (chptr->mode.noflood_value & 0x0000000f); //0000 0000 0000 0000 0000 0000 0000 1111 = 0x0000000f >> 0
+ unsigned int count = (chptr->mode.noflood_value & 0x00002ff0) >> 4; //0000 0000 0000 0000 0011 1111 1111 0000 = 0x00002ff0 >> 4
+ int time = (chptr->mode.noflood_value & 0x0fffc000) >> 14; //0000 1111 1111 1111 1100 0000 0000 0000 = 0x0fffc000 >> 14
if(count == 0 || time == 0) return 0;
if(!(flags & FLFL_NOFLOOD) && HasPriv(cptr, PRIV_FLOOD))
return 0;
if(!(flags & FLFL_CHANOP) && (member->status & CHFL_CHANOP))
return 0;
- if(!(flags & (FLFL_CHANOP | FLFL_VOICE)) && (member->status & CHFL_VOICE))
+ if(!(flags & (FLFL_CHANOP | FLFL_HALFOP)) && (member->status & CHFL_HALFOP))
+ return 0;
+ if(!(flags & (FLFL_CHANOP | FLFL_HALFOP | FLFL_VOICE)) && (member->status & CHFL_VOICE))
return 0;
int floodcount = 0;
struct MemberFlood *floodnode, *prev_floodnode;