summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 00:12:59 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 00:12:59 +0000
commit5afa330604799b1a5467b7e09e53c95f3198d2e6 (patch)
treeeba51e60eabfdd3010dd7f27b89065cdcc47b91b /src
parentffd4e65d7892706d70d84dafb4bc9c3842caa2dc (diff)
UUID is now generated and set on client add, and shown after 005 via numeric 042: %s :your unique ID. This also replaces the fd-unknown style of nicks we used prior to recieving NICK from a client, just because it looks tidier.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7848 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/users.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 1dbdb5b40..b76df8ac5 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -858,7 +858,9 @@ void userrec::AddToWhoWas()
/* 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
@@ -891,7 +893,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
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. */
@@ -1098,6 +1101,9 @@ void userrec::FullConnect()
ServerInstance->Config->Send005(this);
+ this->WriteServ("042 %s %s :your unique ID", this->nick, this->uuid);
+
+
this->ShowMOTD();
/* Now registered */