git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9790
e03df62e-2008-0410-955e-
edbf42e46eb7
* Returns 1 if colliding local client, 2 if colliding remote, 3 if colliding both.
* Sends SVSNICKs as appropriate and forces nickchanges too.
*/
* 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.
{
/*
* Under old protocol rules, we would have had to kill both clients.
/* for brevity, don't use the User */
time_t localts = u->age;
/* 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)
/* mmk. let's do this again. */
if (remotets == localts)
/* fuck. now it gets complex. */
/* first, let's see if ident@host matches. */
/* 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
/*
* if ident@ip is equal, and theirs is newer, or
bool ForceJoin(const std::string &source, std::deque<std::string> ¶ms);
/* Used on nick collision ... XXX ugly function HACK */
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);
/** UID command */
bool ParseUID(const std::string &source, std::deque<std::string> ¶ms);
{
int collideret = 0;
/* x is local, who is remote */
{
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)
{
/*
if (collideret != 1)
{
/*
* Nick collision.
*/
Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", tempnick);
* 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]);