This way, the information remains valid after a split.
For clients on TS5 servers, the nick is used; this is
not much of a problem because these are on pseudoservers
and not assumed to change nick much at all.
You will have a set number of 'slots', each different client you message
will take up one slot. A client doing a nick change will not use a new slot,
-however a client leaving the network and reconnecting will. You will
-receive 1 new slot roughly every minute.
+however a client disconnecting from the server it is on and reconnecting
+will. You will receive 1 new slot roughly every minute.
When all slots are filled, messages to new clients will not be accepted.
Messages to clients already filling a slot will be accepted. If all slots
auth_request_t *auth_request;
/* target change stuff */
- void *targets[10]; /* targets were aware of */
+ uint32_t targets[10]; /* targets were aware of (fnv32(use_id(target_p))) */
unsigned int targinfo[2]; /* cyclic array, no in use */
time_t target_last; /* last time we cleared a slot */
add_target(struct Client *source_p, struct Client *target_p)
{
int i, j;
+ uint32_t hashv;
/* can msg themselves or services without using any target slots */
if(source_p == target_p || IsService(target_p))
if(source_p->localClient->target_last > CurrentTime && IsOper(target_p))
return 1;
+ hashv = fnv_hash_upper(use_id(target_p), 32);
+
if(USED_TARGETS(source_p))
{
/* hunt for an existing target */
for(i = PREV_FREE_TARGET(source_p), j = USED_TARGETS(source_p);
j; --j, PREV_TARGET(i))
{
- if(source_p->localClient->targets[i] == target_p)
+ if(source_p->localClient->targets[i] == hashv)
return 1;
}
SetTGChange(source_p);
}
- source_p->localClient->targets[FREE_TARGET(source_p)] = target_p;
+ source_p->localClient->targets[FREE_TARGET(source_p)] = hashv;
NEXT_TARGET(FREE_TARGET(source_p));
++USED_TARGETS(source_p);
return 1;