diff options
-rw-r--r-- | src/usermanager.cpp | 13 | ||||
-rw-r--r-- | src/users.cpp | 14 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index d518b790e..c980e0eb3 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -49,6 +49,19 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac #endif inet_ntop(AF_INET, &((const sockaddr_in*)ip)->sin_addr, ipaddr, sizeof(ipaddr)); + (*(Instance->clientlist))[New->uuid] = New; + + /* The users default nick is their UUID */ + strlcpy(New->nick, New->uuid, NICKMAX - 1); + + New->server = Instance->FindServerNamePtr(Instance->Config->ServerName); + /* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */ + strcpy(New->ident, "unknown"); + + New->registered = REG_NONE; + New->signon = Instance->Time() + Instance->Config->dns_timeout; + New->lastping = 1; + New->SetSockAddr(socketfamily, ipaddr, port); New->SetFd(socket); diff --git a/src/users.cpp b/src/users.cpp index 2f1c86a33..d7671de3c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -210,20 +210,6 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance (*Instance->uuidlist)[uuid] = this; else throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor"); - - (*(Instance->clientlist))[this->uuid] = this; - - /* The users default nick is their UUID */ - strlcpy(this->nick, this->uuid, NICKMAX - 1); - - this->server = Instance->FindServerNamePtr(Instance->Config->ServerName); - /* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */ - strcpy(this->ident, "unknown"); - - this->registered = REG_NONE; - this->signon = Instance->Time() + Instance->Config->dns_timeout; - this->lastping = 1; - } User::~User() |