userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance)
{
- // the PROPER way to do it, AVOID bzero at *ALL* costs
- *password = *nick = *ident = *host = *dhost = *fullname = *awaymsg = *oper = 0;
+ *password = *nick = *ident = *host = *dhost = *fullname = *awaymsg = *oper = *uuid = 0;
server = (char*)Instance->FindServerNamePtr(Instance->Config->ServerName);
reset_due = ServerInstance->Time();
age = ServerInstance->Time(true);
/* add a client connection to the sockets list */
void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached, int socketfamily, sockaddr* ip)
{
- std::string tempnick = ConvToStr(socket) + "-unknown";
+ std::string tempnick = Instance->GetUID();
+
+ Instance->Log(DEBUG,"New client has UID %s ..", tempnick.c_str());
user_hash::iterator iter = Instance->clientlist->find(tempnick);
char ipaddr[MAXBUF];
#ifdef IPV6
New = new userrec(Instance);
(*(Instance->clientlist))[tempnick] = New;
New->fd = socket;
- strlcpy(New->nick,tempnick.c_str(),NICKMAX-1);
+ strlcpy(New->nick, tempnick.c_str(), NICKMAX - 1);
+ strlcpy(New->uuid, tempnick.c_str(), UUID_LENGTH);
New->server = Instance->FindServerNamePtr(Instance->Config->ServerName);
/* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */
ServerInstance->Config->Send005(this);
+ this->WriteServ("042 %s %s :your unique ID", this->nick, this->uuid);
+
+
this->ShowMOTD();
/* Now registered */