summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 11:34:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 11:34:16 +0000
commit78474291ab99852dc92a43286c67f244c7292a31 (patch)
treee664ab445047853e8b5be6894294d8ac54d1529d /src/users.cpp
parent5626380bc94c4c98f068bee0dac04c96b5f0c380 (diff)
A few tidyups, and comment how the new constructors work (so that w00t doesnt wonder where the feck his strlcpys went)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7875 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 5e7828d5b..476a4f1cd 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -860,12 +860,14 @@ 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)
{
+ /* NOTE: Calling this one parameter constructor for userrec automatically
+ * allocates a new UUID and places it in the hash_map.
+ */
userrec* New = new userrec(Instance);
int j = 0;
Instance->unregistered_count++;
- user_hash::iterator iter = Instance->clientlist->find(New->uuid);
char ipaddr[MAXBUF];
#ifdef IPV6
if (socketfamily == AF_INET6)
@@ -875,7 +877,9 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
inet_ntop(AF_INET, &((const sockaddr_in*)ip)->sin_addr, ipaddr, sizeof(ipaddr));
(*(Instance->clientlist))[New->uuid] = New;
- New->fd = socket;
+ New->SetFd(socket);
+
+ /* The users default nick is their UUID */
strlcpy(New->nick, New->uuid, NICKMAX - 1);
New->server = Instance->FindServerNamePtr(Instance->Config->ServerName);