throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor");
}
-LocalUser::LocalUser() : User(ServerInstance->GetUID(), ServerInstance->Config->ServerName, USERTYPE_LOCAL)
+LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* servaddr)
+ : User(ServerInstance->GetUID(), ServerInstance->Config->ServerName, USERTYPE_LOCAL)
{
bytes_in = bytes_out = cmds_in = cmds_out = 0;
server_sa.sa.sa_family = AF_UNSPEC;
Penalty = 0;
lastping = nping = 0;
+ SetFd(myfd);
+ memcpy(&client_sa, client, sizeof(irc::sockets::sockaddrs));
+ memcpy(&server_sa, servaddr, sizeof(irc::sockets::sockaddrs));
}
User::~User()
this->InvalidateCache();
this->DecrementModes();
+ if (client_sa.sa.sa_family != AF_UNSPEC)
+ ServerInstance->Users->RemoveCloneCounts(this);
+
ServerInstance->Users->uuidlist->erase(uuid);
return Extensible::cull();
}
else
ServerInstance->Logs->Log("USERS", DEBUG, "Failed to remove user from vector");
- if (client_sa.sa.sa_family != AF_UNSPEC)
- ServerInstance->Users->RemoveCloneCounts(this);
Close();
return User::cull();
}
return;
}
- ServerInstance->Logs->Log("USEROUTPUT", DEBUG,"C[%d] O %s", this->GetFd(), text.c_str());
+ ServerInstance->Logs->Log("USEROUTPUT", DEBUG,"C[%s] O %s", uuid.c_str(), text.c_str());
this->AddWriteBuf(text);
this->AddWriteBuf(wide_newline);