X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=24b2928ae052e55503013aa696782be294604bcd;hb=c808355050c368a306cd9d5d62b8c05094c11404;hp=7437e8a209f83baea1e3345608785616883e1732;hpb=5fbb5a0b2c5c08f76f99bd03b51bce2164feade3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 7437e8a20..24b2928ae 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -64,12 +64,14 @@ const char* User::FormatModes(bool showparameters) } User::User(const std::string& uid, Server* srv, int type) - : uuid(uid), server(srv), usertype(type) + : age(ServerInstance->Time()) + , signon(0) + , uuid(uid) + , server(srv) + , registered(REG_NONE) + , quitting(false) + , usertype(type) { - age = ServerInstance->Time(); - signon = 0; - registered = 0; - quitting = false; client_sa.sa.sa_family = AF_UNSPEC; ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New UUID for user: %s", uuid.c_str()); @@ -83,14 +85,24 @@ User::User(const std::string& uid, Server* srv, int type) } LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* servaddr) - : User(ServerInstance->UIDGen.GetUID(), ServerInstance->FakeClient->server, USERTYPE_LOCAL), eh(this), - bytes_in(0), bytes_out(0), cmds_in(0), cmds_out(0), nping(0), CommandFloodPenalty(0), - already_sent(0) -{ - exempt = quitting_sendq = false; - idle_lastmsg = 0; + : User(ServerInstance->UIDGen.GetUID(), ServerInstance->FakeClient->server, USERTYPE_LOCAL) + , eh(this) + , bytes_in(0) + , bytes_out(0) + , cmds_in(0) + , cmds_out(0) + , quitting_sendq(false) + , lastping(true) + , exempt(false) + , nping(0) + , idle_lastmsg(0) + , CommandFloodPenalty(0) + , already_sent(0) +{ + signon = ServerInstance->Time(); + // The user's default nick is their UUID + nick = uuid; ident = "unknown"; - lastping = 0; eh.SetFd(myfd); memcpy(&client_sa, client, sizeof(irc::sockets::sockaddrs)); memcpy(&server_sa, servaddr, sizeof(irc::sockets::sockaddrs)); @@ -927,27 +939,6 @@ void User::ForEachNeighbor(ForEachNeighborHandler& handler, bool include_self) } } -void LocalUser::SendText(const std::string& line) -{ - Write(line); -} - -void RemoteUser::SendText(const std::string& line) -{ - ServerInstance->PI->PushToClient(this, line); -} - -void FakeUser::SendText(const std::string& line) -{ -} - -void User::SendText(const char *text, ...) -{ - std::string line; - VAFORMAT(line, text, text); - SendText(line); -} - void User::WriteRemoteNumeric(const Numeric::Numeric& numeric) { WriteNumeric(numeric);