Make the number of targets tracked for target change a #define.
This commit is contained in:
parent
957ee03b56
commit
d29b1834c3
|
@ -53,6 +53,8 @@ struct Blacklist;
|
||||||
|
|
||||||
#define IDLEN 10
|
#define IDLEN 10
|
||||||
|
|
||||||
|
#define TGCHANGE_NUM 10 /* how many targets we keep track of */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pre declare structs
|
* pre declare structs
|
||||||
*/
|
*/
|
||||||
|
@ -255,7 +257,7 @@ struct LocalUser
|
||||||
struct AuthRequest *auth_request;
|
struct AuthRequest *auth_request;
|
||||||
|
|
||||||
/* target change stuff */
|
/* target change stuff */
|
||||||
uint32_t targets[10]; /* targets were aware of (fnv32(use_id(target_p))) */
|
uint32_t targets[TGCHANGE_NUM]; /* targets were aware of (fnv32(use_id(target_p))) */
|
||||||
unsigned int targinfo[2]; /* cyclic array, no in use */
|
unsigned int targinfo[2]; /* cyclic array, no in use */
|
||||||
time_t target_last; /* last time we cleared a slot */
|
time_t target_last; /* last time we cleared a slot */
|
||||||
|
|
||||||
|
|
|
@ -642,9 +642,9 @@ msg_channel_flags(int p_or_n, const char *command, struct Client *client_p,
|
||||||
command, c, chptr->chname, text);
|
command, c, chptr->chname, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PREV_FREE_TARGET(x) ((FREE_TARGET(x) == 0) ? 9 : FREE_TARGET(x) - 1)
|
#define PREV_FREE_TARGET(x) ((FREE_TARGET(x) == 0) ? TGCHANGE_NUM - 1 : FREE_TARGET(x) - 1)
|
||||||
#define PREV_TARGET(i) ((i == 0) ? i = 9 : --i)
|
#define PREV_TARGET(i) ((i == 0) ? i = TGCHANGE_NUM - 1 : --i)
|
||||||
#define NEXT_TARGET(i) ((i == 9) ? i = 0 : ++i)
|
#define NEXT_TARGET(i) ((i == TGCHANGE_NUM - 1) ? i = 0 : ++i)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
expire_tgchange(void *unused)
|
expire_tgchange(void *unused)
|
||||||
|
@ -715,7 +715,7 @@ add_target(struct Client *source_p, struct Client *target_p)
|
||||||
source_p->localClient->target_last = rb_current_time();
|
source_p->localClient->target_last = rb_current_time();
|
||||||
}
|
}
|
||||||
/* cant clear any, full target list */
|
/* cant clear any, full target list */
|
||||||
else if(USED_TARGETS(source_p) == 10)
|
else if(USED_TARGETS(source_p) == TGCHANGE_NUM)
|
||||||
{
|
{
|
||||||
ServerStats.is_tgch++;
|
ServerStats.is_tgch++;
|
||||||
add_tgchange(source_p->sockhost);
|
add_tgchange(source_p->sockhost);
|
||||||
|
|
Loading…
Reference in New Issue