return 0;
}
- if(hash_find_nd(nick))
+ if(irc_dictionary_find(nd_dict, nick))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
return 0;
}
- if(hash_find_nd(nick))
+ if(irc_dictionary_find(nd_dict, nick))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
ServerStats->is_kill++;
sendto_realops_snomask(SNO_DEBUG, L_ALL,
"Bad Nick: %s From: %s(via %s)",
- parv[1], source_p->user->server, client_p->name);
+ parv[1], source_p->servptr->name, client_p->name);
sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.name, parv[1], me.name);
/* bad nick change, issue kill for the old nick to the rest
set_initial_nick(struct Client *client_p, struct Client *source_p, char *nick)
{
char buf[USERLEN + 1];
+ char note[NICKLEN + 10];
/* This had to be copied here to avoid problems.. */
- source_p->tsinfo = CurrentTime;
+ source_p->tsinfo = rb_current_time();
if(source_p->name[0])
del_from_client_hash(source_p->name, source_p);
strcpy(source_p->name, nick);
add_to_client_hash(nick, source_p);
- /* fd_desc is long enough */
- comm_note(client_p->localClient->fd, "Nick: %s", nick);
+ rb_snprintf(note, sizeof(note), "Nick: %s", nick);
+ rb_note(client_p->localClient->F, note);
if(source_p->flags & FLAGS_SENTUSER)
{
char *nick, int dosend)
{
struct Client *target_p;
- dlink_node *ptr, *next_ptr;
+ rb_dlink_node *ptr, *next_ptr;
struct Channel *chptr;
+ char note[NICKLEN + 10];
int samenick;
if (dosend)
nick, chptr->chname);
return;
}
- if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < CurrentTime)
+ if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < rb_current_time())
source_p->localClient->number_of_nick_changes = 0;
- source_p->localClient->last_nick_change = CurrentTime;
+ source_p->localClient->last_nick_change = rb_current_time();
source_p->localClient->number_of_nick_changes++;
if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
if(!samenick)
{
/* force the TS to increase -- jilles */
- if (source_p->tsinfo >= CurrentTime)
+ if (source_p->tsinfo >= rb_current_time())
source_p->tsinfo++;
else
- source_p->tsinfo = CurrentTime;
+ source_p->tsinfo = rb_current_time();
monitor_signoff(source_p);
/* we only do bancache for local users -- jilles */
if(source_p->user)
* to clear a clients own list of accepted clients. So just remove
* them from everyone elses list --anfl
*/
- DLINK_FOREACH_SAFE(ptr, next_ptr, source_p->on_allow_list.head)
+ RB_DLINK_FOREACH_SAFE(ptr, next_ptr, source_p->on_allow_list.head)
{
target_p = ptr->data;
- dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
- dlinkDestroy(ptr, &source_p->on_allow_list);
+ rb_dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
+ rb_dlinkDestroy(ptr, &source_p->on_allow_list);
}
- /* fd_desc is long enough */
- comm_note(client_p->localClient->fd, "Nick: %s", nick);
+ rb_snprintf(note, sizeof(note), "Nick: %s", nick);
+ rb_note(client_p->localClient->F, note);
return;
}
/* client changing their nick - dont reset ts if its same */
if(!samenick)
{
- source_p->tsinfo = newts ? newts : CurrentTime;
+ source_p->tsinfo = newts ? newts : rb_current_time();
monitor_signoff(source_p);
}
del_from_client_hash(source_p->name, source_p);
/* invalidate nick delay when a remote client uses the nick.. */
- if((nd = hash_find_nd(nick)))
+ if((nd = irc_dictionary_retrieve(nd_dict, nick)))
free_nd_entry(nd);
strcpy(source_p->name, nick);
const char *m;
int flag;
+ if(server == NULL)
+ {
+ if((server = find_server(NULL, parv[7])) == NULL)
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "Ghost killed: %s on invalid server %s",
+ nick, parv[7]);
+ sendto_one(client_p, ":%s KILL %s :%s (Server doesn't exist)",
+ get_id(&me, client_p), nick, me.name);
+ return 0;
+ }
+ }
+
source_p = make_client(client_p);
user = make_user(source_p);
- dlinkAddTail(source_p, &source_p->node, &global_client_list);
+ rb_dlinkAddTail(source_p, &source_p->node, &global_client_list);
source_p->hopcount = atoi(parv[2]);
source_p->tsinfo = newts;
if(parc == 12)
{
- user->server = find_or_add(server->name);
strlcpy(source_p->info, parv[11], sizeof(source_p->info));
strlcpy(source_p->sockhost, parv[7], sizeof(source_p->sockhost));
strlcpy(source_p->id, parv[8], sizeof(source_p->id));
}
else if(parc == 10)
{
- user->server = find_or_add(server->name);
strlcpy(source_p->info, parv[9], sizeof(source_p->info));
strlcpy(source_p->sockhost, parv[7], sizeof(source_p->sockhost));
strlcpy(source_p->id, parv[8], sizeof(source_p->id));
}
else
{
- user->server = find_or_add(parv[7]);
strlcpy(source_p->info, parv[8], sizeof(source_p->info));
}
/* remove any nd entries for this nick */
- if((nd = hash_find_nd(nick)))
+ if((nd = irc_dictionary_retrieve(nd_dict, nick)))
free_nd_entry(nd);
add_to_client_hash(nick, source_p);
if(flag & UMODE_SERVICE)
{
int hit = 0;
- dlink_node *ptr;
+ rb_dlink_node *ptr;
- DLINK_FOREACH(ptr, service_list.head)
+ RB_DLINK_FOREACH(ptr, service_list.head)
{
- if(!irccmp((const char *) ptr->data, user->server))
+ if(!irccmp((const char *) ptr->data, server->name))
{
hit++;
break;
}
if(IsOper(source_p) && !IsService(source_p))
- dlinkAddAlloc(source_p, &oper_list);
+ rb_dlinkAddAlloc(source_p, &oper_list);
SetRemoteClient(source_p);
if(++Count.total > Count.max_tot)
Count.max_tot = Count.total;
- if(server == NULL)
- {
- if((source_p->servptr = find_server(NULL, user->server)) == NULL)
- {
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "Ghost killed: %s on invalid server %s",
- source_p->name, user->server);
- kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name);
- source_p->flags |= FLAGS_KILLED;
- return exit_client(NULL, source_p, &me, "Ghosted Client");
- }
- }
- else
- source_p->servptr = server;
+ source_p->servptr = server;
- dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
+ rb_dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
/* fake direction */
if(source_p->servptr->from != source_p->from)
"Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
client_p->name, source_p->name,
source_p->username, source_p->host,
- user->server, target_p->name, target_p->from->name);
+ server->name, target_p->name, target_p->from->name);
kill_client(client_p, source_p,
"%s (NICK from wrong direction (%s != %s))",
- me.name, user->server, target_p->from->name);
+ me.name, server->name, target_p->from->name);
source_p->flags |= FLAGS_KILLED;
return exit_client(source_p, source_p, &me, "USER server wrong direction");
}