]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Convert m_spanningtree
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 18 May 2008 23:47:28 +0000 (23:47 +0000)
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 18 May 2008 23:47:28 +0000 (23:47 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9751 e03df62e-2008-0410-955e-edbf42e46eb7

21 files changed:
src/modules/m_spanningtree/kill.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/modules.cpp
src/modules/m_spanningtree/netburst.cpp
src/modules/m_spanningtree/nickcollide.cpp
src/modules/m_spanningtree/opertype.cpp
src/modules/m_spanningtree/override_admin.cpp
src/modules/m_spanningtree/override_map.cpp
src/modules/m_spanningtree/override_modules.cpp
src/modules/m_spanningtree/override_motd.cpp
src/modules/m_spanningtree/override_squit.cpp
src/modules/m_spanningtree/override_stats.cpp
src/modules/m_spanningtree/override_time.cpp
src/modules/m_spanningtree/override_whois.cpp
src/modules/m_spanningtree/privmsg.cpp
src/modules/m_spanningtree/rconnect.cpp
src/modules/m_spanningtree/rsquit.cpp
src/modules/m_spanningtree/svsnick.cpp
src/modules/m_spanningtree/time.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/uid.cpp

index ca68867e6e7e2c14918437c442ecb0f7e9e0f95f..3fca0a0cb6fec9cce4b0de0f078e1833ef6fb23b 100644 (file)
@@ -42,7 +42,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> &
                Utils->DoOneToAllButSender(prefix,"KILL",params,prefix);
                // NOTE: This is safe with kill hiding on, as RemoteKill is only reached if we have a server prefix.
                // in short this is not executed for USERS.
-               who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick, prefix.c_str(), reason.c_str());
+               who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick.c_str(), prefix.c_str(), reason.c_str());
                this->Instance->Users->QuitUser(who, reason);
        }
        return true;
index 4a401b8c882ead4a12e0f314299ccb8ca51df5ff..585af8fe4b2e3fac4ecd1ec384cbcf7fa9e95f4a 100644 (file)
@@ -77,7 +77,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
        {
                if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))))
                {
-                       if (*user->oper)
+                       if (IS_OPER(user))
                        {
                                 ShowLinks(Current->GetChild(q),user,hops+1);
                        }
@@ -94,7 +94,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
        else if ((Current->Hidden) && (!IS_OPER(user)))
                return;
 
-       user->WriteNumeric(364, "%s %s %s :%d %s",      user->nick,Current->GetName().c_str(),
+       user->WriteNumeric(364, "%s %s %s :%d %s",      user->nick.c_str(),Current->GetName().c_str(),
                        (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName : Parent.c_str(),
                        (Utils->FlatLinks && (!IS_OPER(user))) ? 0 : hops,
                        Current->GetDesc().c_str());
@@ -113,7 +113,7 @@ int ModuleSpanningTree::CountServs()
 void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user)
 {
        ShowLinks(Utils->TreeRoot,user,0);
-       user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick);
+       user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick.c_str());
        return;
 }
 
@@ -133,7 +133,7 @@ void ModuleSpanningTree::HandleLusers(const std::vector<std::string>& parameters
        /* If ulined are hidden and we're not an oper, count the number of ulined servers hidden,
         * locally and globally (locally means directly connected to us)
         */
-       if ((Utils->HideULines) && (!*user->oper))
+       if ((Utils->HideULines) && (!IS_OPER(user)))
        {
                for (server_hash::iterator q = Utils->serverlist.begin(); q != Utils->serverlist.end(); q++)
                {
@@ -145,23 +145,23 @@ void ModuleSpanningTree::HandleLusers(const std::vector<std::string>& parameters
                        }
                }
        }
-       user->WriteNumeric(251, "%s :There are %d users and %d invisible on %d servers",user->nick,
+       user->WriteNumeric(251, "%s :There are %d users and %d invisible on %d servers",user->nick.c_str(),
                        n_users-ServerInstance->Users->ModeCount('i'),
                        ServerInstance->Users->ModeCount('i'),
                        ulined_count ? this->CountServs() - ulined_count : this->CountServs());
 
        if (ServerInstance->Users->OperCount())
-               user->WriteNumeric(252, "%s %d :operator(s) online",user->nick,ServerInstance->Users->OperCount());
+               user->WriteNumeric(252, "%s %d :operator(s) online",user->nick.c_str(),ServerInstance->Users->OperCount());
 
        if (ServerInstance->Users->UnregisteredUserCount())
-               user->WriteNumeric(253, "%s %d :unknown connections",user->nick,ServerInstance->Users->UnregisteredUserCount());
+               user->WriteNumeric(253, "%s %d :unknown connections",user->nick.c_str(),ServerInstance->Users->UnregisteredUserCount());
        
        if (ServerInstance->ChannelCount())
-               user->WriteNumeric(254, "%s %ld :channels formed",user->nick,ServerInstance->ChannelCount());
+               user->WriteNumeric(254, "%s %ld :channels formed",user->nick.c_str(),ServerInstance->ChannelCount());
        
-       user->WriteNumeric(255, "%s :I have %d clients and %d servers",user->nick,ServerInstance->Users->LocalUserCount(),ulined_local_count ? this->CountLocalServs() - ulined_local_count : this->CountLocalServs());
-       user->WriteNumeric(265, "%s :Current Local Users: %d  Max: %d",user->nick,ServerInstance->Users->LocalUserCount(),max_local);
-       user->WriteNumeric(266, "%s :Current Global Users: %d  Max: %d",user->nick,n_users,max_global);
+       user->WriteNumeric(255, "%s :I have %d clients and %d servers",user->nick.c_str(),ServerInstance->Users->LocalUserCount(),ulined_local_count ? this->CountLocalServs() - ulined_local_count : this->CountLocalServs());
+       user->WriteNumeric(265, "%s :Current Local Users: %d  Max: %d",user->nick.c_str(),ServerInstance->Users->LocalUserCount(),max_local);
+       user->WriteNumeric(266, "%s :Current Global Users: %d  Max: %d",user->nick.c_str(),n_users,max_global);
        return;
 }
 
@@ -344,7 +344,7 @@ int ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters
        if (found)
        {
                std::string Version = found->GetVersion();
-               user->WriteNumeric(351, "%s :%s",user->nick,Version.c_str());
+               user->WriteNumeric(351, "%s :%s",user->nick.c_str(),Version.c_str());
                if (found == Utils->TreeRoot)
                {
                        ServerInstance->Config->Send005(user);
@@ -352,7 +352,7 @@ int ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters
        }
        else
        {
-               user->WriteNumeric(402, "%s %s :No such server",user->nick,parameters[0].c_str());
+               user->WriteNumeric(402, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str());
        }
        return 1;
 }
@@ -390,7 +390,7 @@ void ModuleSpanningTree::RemoteMessage(User* user, const char* format, ...)
        else
        {
                if (IS_LOCAL(user))
-                       user->WriteServ("NOTICE %s :%s", user->nick, text);
+                       user->WriteServ("NOTICE %s :%s", user->nick.c_str(), text);
                else
                        ServerInstance->PI->SendUserNotice(user, text);
        }
@@ -680,7 +680,7 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
 
                /** IMPORTANT: We don't update the TS if the oldnick is just a case change of the newnick!
                 */
-               if (irc::string(user->nick) != assign(oldnick))
+               if (irc::string(user->nick.c_str()) != assign(oldnick))
                        user->age = ServerInstance->Time();
 
                params.push_back(ConvToStr(user->age));
index 7a3c4717ea96318549e0749766c9a599c68c807c..17321c5fdf95ac9ce095d1713c189461a06c5641 100644 (file)
@@ -62,19 +62,19 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
                if (!flagstate[0])
                        strcpy(flagstate,"  <no flags>");
                strlcpy(modulename,module_names[i].c_str(),256);
-               if (*source->oper)
+               if (IS_OPER(source))
                {
-                       snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(unsigned long)m,
+                       snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick.c_str(),(unsigned long)m,
                                        V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2);
                }
                else
                {
-                       snprintf(strbuf, MAXBUF, "::%s 702 %s :%s",Instance->Config->ServerName,source->nick,ServerConfig::CleanFilename(modulename));
+                       snprintf(strbuf, MAXBUF, "::%s 702 %s :%s",Instance->Config->ServerName,source->nick.c_str(),ServerConfig::CleanFilename(modulename));
                }
                par[1] = strbuf;
                Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server);
        }
-       snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", Instance->Config->ServerName, source->nick);
+       snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", Instance->Config->ServerName, source->nick.c_str());
        par[1] = strbuf;
        Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server);
        return true;
index c61211ff91a9a011f9659dd82512b8475199151a..b1f63c01ba2dab958ca40411b621f1e1b4b2da8c 100644 (file)
@@ -97,7 +97,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
        for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
        {
                // The first parameter gets a : before it
-               size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", this->Instance->Modes->ModeString(i->first, c, false).c_str(), i->first->uuid);
+               size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", this->Instance->Modes->ModeString(i->first, c, false).c_str(), i->first->uuid.c_str());
 
                looped_once = true;
 
@@ -221,19 +221,19 @@ void TreeSocket::SendUsers(TreeServer* Current)
                        TreeServer* theirserver = Utils->FindServer(u->second->server);
                        if (theirserver)
                        {
-                               snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid,
-                                               (unsigned long)u->second->age, u->second->nick, u->second->host, u->second->dhost,
-                                               u->second->ident, u->second->FormatModes(), u->second->GetIPString(),
-                                               (unsigned long)u->second->signon, u->second->fullname);
+                               snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid.c_str(),
+                                               (unsigned long)u->second->age, u->second->nick.c_str(), u->second->host, u->second->dhost.c_str(),
+                                               u->second->ident.c_str(), u->second->FormatModes(), u->second->GetIPString(),
+                                               (unsigned long)u->second->signon, u->second->fullname.c_str());
                                this->WriteLine(data);
                                if (IS_OPER(u->second))
                                {
-                                       snprintf(data,MAXBUF,":%s OPERTYPE %s", u->second->uuid, u->second->oper);
+                                       snprintf(data,MAXBUF,":%s OPERTYPE %s", u->second->uuid.c_str(), u->second->oper.c_str());
                                        this->WriteLine(data);
                                }
                                if (IS_AWAY(u->second))
                                {
-                                       snprintf(data,MAXBUF,":%s AWAY :%s", u->second->uuid, u->second->awaymsg);
+                                       snprintf(data,MAXBUF,":%s AWAY :%s", u->second->uuid.c_str(), u->second->awaymsg.c_str());
                                        this->WriteLine(data);
                                }
                        }
index 5dcfcd61595f31310820e2dbe29e53461f90b8b4..d2adbc766d406cb7f4aae786d5f0505675cdd95a 100644 (file)
@@ -51,7 +51,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c
 
        /* for brevity, don't use the User */
        time_t localts = u->age;
-       const char *localident = u->ident;
+       const char *localident = u->ident.c_str();
        const char *localip = u->GetIPString();
 
        /* mmk. let's do this again. */
@@ -87,7 +87,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c
 
        if (bChangeLocal)
        {
-               u->ForceNickChange(u->uuid);
+               u->ForceNickChange(u->uuid.c_str());
 
                if (!bChangeRemote)
                        return 1;
@@ -110,7 +110,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c
                if (remote)
                {
                        /* buh.. nick change collide. force change their nick. */
-                       remote->ForceNickChange(remote->uuid);
+                       remote->ForceNickChange(remote->uuid.c_str());
                }
                else
                {
index 7afa44ae1ea05e96041e0d40cec6dbb1dea2ee76..a5bd07416084645cc5f9424aa5c0df69dc766d85 100644 (file)
@@ -35,7 +35,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
                if (!u->IsModeSet('o'))
                        this->Instance->Users->all_opers.push_back(u);
                u->modes[UM_OPERATOR] = 1;
-               strlcpy(u->oper,opertype.c_str(),NICKMAX-1);
+               u->oper.assign(opertype, 0, NICKMAX - 1);
                Utils->DoOneToAllButSender(u->uuid,"OPERTYPE",params,u->server);
 
                TreeServer* remoteserver = Utils->FindServer(u->server);
@@ -57,7 +57,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
                }
 
                if (dosend)
-                       this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick,u->ident,u->host,irc::Spacify(opertype.c_str()));
+                       this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(),u->host,irc::Spacify(opertype.c_str()));
        }
        return true;
 }
index 31d146edad63c2cb3734506b1cc4925cf5e52bb7..2122a3a243a4742d8032d3481b70e0839f782cc9 100644 (file)
@@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleAdmin(const std::vector<std::string>& parameters,
                        Utils->DoOneToOne(user->uuid, "ADMIN", params, s->GetName());
                }
                else
-                       user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str());
+                       user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str());
                return 1;
        }
        return 0;
index fa93f8280884cda1a2afa469700107bcfb973e69..01423b60a2a57b57c05b3f27106e0e4ee749b8e9 100644 (file)
@@ -82,16 +82,16 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha
                        ServerInstance->Logs->Log("map",DEBUG,"Hidden? %d HideULines? %d GetName %s", Current->GetChild(q)->Hidden, Utils->HideULines, Current->GetChild(q)->GetName().c_str());
                        if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))))
                        {
-                               if (*user->oper)
+                               if (IS_OPER(user))
                                {
-                                       ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers);
+                                       ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers);
                                        ServerInstance->Logs->Log("map",DEBUG,"Show to oper");
                                }
                                ServerInstance->Logs->Log("map",DEBUG,"Fall through");
                        }
                        else
                        {
-                               ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers);
+                               ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers);
                                ServerInstance->Logs->Log("map",DEBUG,"Show to non oper");
                        }
                }
@@ -117,7 +117,7 @@ int ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, Us
                bool ret = false;
                if (!s)
                {
-                       user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str());
+                       user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str());
                        ret = true;
                }
                else if (s && s != Utils->TreeRoot)
@@ -196,10 +196,10 @@ int ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, Us
                ServerInstance->Logs->Log("map",DEBUG,"local");
                for (int t = 0; t < line; t++)
                {
-                       user->WriteNumeric(6, "%s :%s",user->nick,&matrix[t][0]);
+                       user->WriteNumeric(6, "%s :%s",user->nick.c_str(),&matrix[t][0]);
                }
-               user->WriteNumeric(270, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick,totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
-               user->WriteNumeric(7, "%s :End of /MAP",user->nick);
+               user->WriteNumeric(270, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick.c_str(),totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
+               user->WriteNumeric(7, "%s :End of /MAP",user->nick.c_str());
        }
        else
        {
index 19c15b372adbc9a1b512910dd16280751f82b1b1..0a1dd2d3d3218dfad079c45ac72dd4bbf1e0cd0d 100644 (file)
@@ -49,7 +49,7 @@ int ModuleSpanningTree::HandleModules(const std::vector<std::string>& parameters
                        Utils->DoOneToOne(user->uuid, "MODULES", params, s->GetName());
                }
                else
-                       user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str());
+                       user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str());
                return 1;
        }
        return 0;
index 1090b2adbca69b774b53ede10ad6cdb4e8e060b1..3a1182973a2837df17eb7f385c6df7bcf9a503c1 100644 (file)
@@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleMotd(const std::vector<std::string>& parameters, U
                        Utils->DoOneToOne(user->uuid, "MOTD", params, s->GetName());
                }
                else
-                       user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str());
+                       user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str());
                return 1;
        }
        return 0;
index 581a00ef5a1da5b8ef68ee124cc9de9c8c3019e7..02833464fd9891abc9e3fb111c564a775e31e29f 100644 (file)
@@ -40,7 +40,7 @@ int ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parameters,
        {
                if (s == Utils->TreeRoot)
                {
-                       user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick,parameters[0].c_str());
+                       user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick.c_str(),parameters[0].c_str());
                        return 1;
                }
 
@@ -48,19 +48,19 @@ int ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parameters,
 
                if (sock)
                {
-                       ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick);
+                       ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick.c_str());
                        sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost());
                        ServerInstance->SE->DelFd(sock);
                        sock->Close();
                }
                else
                {
-                       user->WriteServ("NOTICE %s :*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead.",user->nick);
+                       user->WriteServ("NOTICE %s :*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead.",user->nick.c_str());
                }
        }
        else
        {
-                user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick,parameters[0].c_str());
+                user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick.c_str(),parameters[0].c_str());
        }
        return 1;
 }
index b22517b13f74c6a45f2c7aaf2920b2d9daeb1fb4..740694643e2ae2d90882f11b48bf7d728e6c9ebc 100644 (file)
@@ -54,7 +54,7 @@ int ModuleSpanningTree::HandleStats(const std::vector<std::string>& parameters,
                }
                else
                {
-                       user->WriteServ( "402 %s %s :No such server", user->nick, parameters[1].c_str());
+                       user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[1].c_str());
                }
                return 1;
        }
@@ -72,7 +72,7 @@ int ModuleSpanningTree::OnStats(char statschar, User* user, string_list &results
                                results.push_back(std::string(ServerInstance->Config->ServerName)+" 244 "+user->nick+" H * * "+Utils->LinkBlocks[i].Name.c_str());
                }
                results.push_back(std::string(ServerInstance->Config->ServerName)+" 219 "+user->nick+" "+statschar+" :End of /STATS report");
-               ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick,user->ident,user->host);
+               ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick.c_str(),user->ident.c_str(),user->host);
                return 1;
        }
 
index c24e6c95d66772ecac13e94e2011a6ad144224ff..b0a37b7bede35d774f422f6095a4afd7fa02b131 100644 (file)
@@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleTime(const std::vector<std::string>& parameters, U
                }
                else
                {
-                       user->WriteNumeric(402, "%s %s :No such server",user->nick,parameters[0].c_str());
+                       user->WriteNumeric(402, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str());
                }
        }
        return 1;
index 8e4d20b6f6e7638ab74c25b3c14a794aff1219a8..5d9705a87f73f3691740d3b29122acc6bdbb2fb9 100644 (file)
@@ -47,8 +47,8 @@ int ModuleSpanningTree::HandleRemoteWhois(const std::vector<std::string>& parame
                }
                else if (!remote)
                {
-                       user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[1].c_str());
-                       user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick, parameters[1].c_str());
+                       user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[1].c_str());
+                       user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick.c_str(), parameters[1].c_str());
                        return 1;
                }
        }
index 316ad2e5cd996997d5560876b9521f95f009476f..5b2ea865a17bfb858e5db5d22ee427c18d483dbe 100644 (file)
@@ -75,7 +75,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                                if (s)
                                {
                                        FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, user, TYPE_USER, text, status, except_list));
-                                       user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick, text.c_str());
+                                       user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick.c_str(), text.c_str());
                                }
 
                        }
index a252268285074325b2262d9978b4bc760830fd30..78adae28cf007d85a7cc1cfc705f68934309b4b1 100644 (file)
@@ -42,17 +42,17 @@ CmdResult cmd_rconnect::Handle (const std::vector<std::string>& parameters, User
        {
                if (!Utils->FindServerMask(parameters[0]))
                {
-                       user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0].c_str());
+                       user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick.c_str(), parameters[0].c_str());
                        return CMD_FAILURE;
                }
-               user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0].c_str(),parameters[1].c_str());
+               user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str());
        }
 
        /* Is this aimed at our server? */
        if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0]))
        {
                /* Yes, initiate the given connect */
-               ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0].c_str(),parameters[1].c_str());
+               ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str());
                std::vector<std::string> para;
                para.push_back(parameters[1]);
                std::string original_command = std::string("CONNECT ") + parameters[1];
index 2a906dfe0fe663e4f703eae766734a8386616f48..e4c9519cc79e1537cb7a74d3fe821712ef0bcec1 100644 (file)
@@ -44,7 +44,7 @@ CmdResult cmd_rsquit::Handle (const std::vector<std::string>& parameters, User *
        server_target = Utils->FindServerMask(parameters[0]);
        if (!server_target)
        {
-               user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0].c_str());
+               user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick.c_str(), parameters[0].c_str());
                return CMD_FAILURE;
        }
 
@@ -63,7 +63,7 @@ CmdResult cmd_rsquit::Handle (const std::vector<std::string>& parameters, User *
                if (sock)
                {
                        const char *reason = parameters.size() == 2 ? parameters[1].c_str() : "No reason";
-                       ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick, reason);
+                       ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick.c_str(), reason);
                        sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")");
                        ServerInstance->SE->DelFd(sock);
                        sock->Close();
@@ -79,7 +79,7 @@ void cmd_rsquit::NoticeUser(User* user, const std::string &msg)
 {
        if (IS_LOCAL(user))
        {
-               user->WriteServ("NOTICE %s :%s",user->nick,msg.c_str());
+               user->WriteServ("NOTICE %s :%s",user->nick.c_str(),msg.c_str());
        }
        else
        {
index adf8f012e79614dfeba1e97be5d5aea94349767f..9b0d3bed303fabea58dc7d36b568409c00c3d7d9 100644 (file)
@@ -52,7 +52,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
                        if (!u->ForceNickChange(params[1].c_str()))
                        {
                                /* buh. UID them */
-                               if (!u->ForceNickChange(u->uuid))
+                               if (!u->ForceNickChange(u->uuid.c_str()))
                                {
                                        this->Instance->Users->QuitUser(u, "Nickname collision");
                                        return true;
index 4149aee5897d4125034a69b51b26f1ef30a47c35..5b6b8df8297090f88b2a5c6f81d8dcce610aa1d3 100644 (file)
@@ -67,7 +67,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
                        char tms[26];
                        snprintf(tms,26,"%s",asctime(timeinfo));
                        tms[24] = 0;
-                       u->WriteNumeric(391, "%s %s :%s",u->nick,prefix.c_str(),tms);
+                       u->WriteNumeric(391, "%s %s :%s",u->nick.c_str(),prefix.c_str(),tms);
                }
                else
                {
index 5d2471b2cd1b8333d6243c0f4bbf6e2cb525a668..93d99c2bad1fb58c1854934aa103e0ca40f822f0 100644 (file)
@@ -575,7 +575,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                        {
                                                int collideret = 0;
                                                /* x is local, who is remote */
-                                               collideret = this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid);
+                                               collideret = this->DoCollision(x, who->age, who->ident.c_str(), who->GetIPString(), who->uuid.c_str());
                                                if (collideret != 1)
                                                {
                                                        /*
index 7179e4eccfc34597ea4b6b70277e535222efb25d..f68da8a1c79e862b49674bb8473d780df9fd3dce 100644 (file)
@@ -111,12 +111,12 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        }
        (*(this->Instance->Users->clientlist))[tempnick] = _new;
        _new->SetFd(FD_MAGIC_NUMBER);
-       strlcpy(_new->nick, tempnick, NICKMAX - 1);
+       _new->nick.assign(tempnick, NICKMAX - 1);
        strlcpy(_new->host, params[3].c_str(),64);
-       strlcpy(_new->dhost, params[4].c_str(),64);
+       _new->dhost.assign(params[4], 0, 64);
        _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str());
-       strlcpy(_new->ident, params[5].c_str(),IDENTMAX + 1);
-       strlcpy(_new->fullname, params[9].c_str(),MAXGECOS);
+       _new->ident.assign(params[5], 0, IDENTMAX + 1);
+       _new->fullname.assign(params[9], 0, MAXGECOS);
        _new->registered = REG_ALL;
        _new->signon = signon;
        _new->age = age_t;
@@ -157,7 +157,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                dosend = false;
        
        if (dosend)
-               this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]",_new->server,_new->nick,_new->ident,_new->host, _new->GetIPString(), _new->fullname);
+               this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]",_new->server,_new->nick.c_str(),_new->ident.c_str(),_new->host, _new->GetIPString(), _new->fullname.c_str());
 
        params[9] = ":" + params[9];
        Utils->DoOneToAllButSender(source, "UID", params, source);