diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-23 05:13:57 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-23 05:13:57 +0000 |
commit | 24d34de00efac5ff04c53a09cab995654bf6f5b7 (patch) | |
tree | dc1444a1d4a9cfcbc32830a4c7eb29eebe4f836a /src | |
parent | a15f95e58613619100cc1a6093fab3d0149a1e96 (diff) |
Collision tweaks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9790 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/nickcollide.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/uid.cpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index d2adbc766..9ef5b48f4 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -27,7 +27,7 @@ * Returns 1 if colliding local client, 2 if colliding remote, 3 if colliding both. * Sends SVSNICKs as appropriate and forces nickchanges too. */ -int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid) +int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remoteident, const std::string &remoteip, const std::string &remoteuid) { /* * Under old protocol rules, we would have had to kill both clients. @@ -51,8 +51,8 @@ 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.c_str(); - const char *localip = u->GetIPString(); + const std::string localident = u->ident; + const std::string localip = u->GetIPString(); /* mmk. let's do this again. */ if (remotets == localts) @@ -64,8 +64,8 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c /* fuck. now it gets complex. */ /* first, let's see if ident@host matches. */ - bool SamePerson = !strcmp(localident, remoteident) - && !strcmp(localip, remoteip); + bool SamePerson = (localident == remoteident) + && (localip == remoteip); /* * if ident@ip is equal, and theirs is newer, or diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 324203f11..fef7b107b 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -227,7 +227,7 @@ class TreeSocket : public BufferedSocket bool ForceJoin(const std::string &source, std::deque<std::string> ¶ms); /* Used on nick collision ... XXX ugly function HACK */ - int DoCollision(User *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid); + int DoCollision(User *u, time_t remotets, const std::string &remoteident, const std::string &remoteip, const std::string &remoteuid); /** UID command */ bool ParseUID(const std::string &source, std::deque<std::string> ¶ms); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 93d99c2ba..5d2471b2c 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -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.c_str(), who->GetIPString(), who->uuid.c_str()); + collideret = this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid); if (collideret != 1) { /* diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index e539e0b18..d5caedd8e 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -86,7 +86,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa * Nick collision. */ Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", tempnick); - int collide = this->DoCollision(iter->second, age_t, params[5].c_str(), params[7].c_str(), params[0].c_str()); + int collide = this->DoCollision(iter->second, age_t, params[5], params[7], params[0]); if (collide == 2) { |