summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 17:43:23 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 17:43:23 +0000
commitdd7cc526c8ae2d5ccfc895f7b9dd7c1075964605 (patch)
treea9c3d072e9dd28d74bde7d27dfdcc129064a5617 /src/modules/m_spanningtree
parent4170a17c3caa3807f6bf8021ee86561cd99695b6 (diff)
TS may be a more elegant solution, but it is fucking horrible to write code for, and hard to get right. Let's just change both.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7900 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp82
1 files changed, 5 insertions, 77 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index e4710b273..3e7d5f2d4 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -969,86 +969,14 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
* Under old protocol rules, we would have had to kill both clients.
* Really, this sucks.
* These days, we have UID. And, so what we do is, force nick change client(s)
- * involved according to timestamp rules.
- *
- * RULES:
- * user@ip equal:
- * Force nick change on OLDER timestamped client
- * user@ip differ:
- * Force nick change on NEWER timestamped client
- * TS EQUAL:
- * FNC both.
- *
- * Note that remote clients MUST be dealt with also to remove desyncs.
- * XXX we don't do this yet.
- *
- * This stops abusive use of collisions, simplifies problems with loops, and so on.
- * -- w00t
+ * involved to their UUID. No more kills. -- w00t
*/
Instance->Log(DEBUG,"*** Collision on %s", tempnick);
- if (age == iter->second->signon)
- {
- /* TS equal, do both */
- Instance->Log(DEBUG,"*** TS EQUAL, colliding both");
- iter->second->ForceNickChange(iter->second->uuid);
- this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+params[0]+" " + params[0]);
- /* also, don't trample on the hash - use their UID as nick */
- tempnick = params[0].c_str();
- }
- else
- {
- /* default to FNC newer (more likely that ident@ip will differ) */
- bool bFNCNewer = true;
-
- if (
- strcmp(iter->second->ident, params[5].c_str()) == 0 &&
- strcmp(iter->second->GetIPString(), params[7].c_str()) == 0
- )
- {
- /* ident@ip same, FNC older client */
- bFNCNewer = false;
- }
-
- if (age > iter->second->signon) /* It will never be equal here */
- {
- Instance->Log(DEBUG,"*** OUR client is older");
- if (bFNCNewer)
- {
- /* incoming client "lost" - for now, send SVSNICK to them .. XXX use SAVE*/
- this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+params[0]+" " + params[0]);
-
- /* also, don't trample on the hash - use their UID as nick */
- tempnick = params[0].c_str();
- Instance->Log(DEBUG,"*** INCOMING client lost, changed theirs");
- }
- else
- {
- /* we "lost", change us */
- iter->second->ForceNickChange(iter->second->uuid);
- Instance->Log(DEBUG,"*** OUR client lost, changing ours");
- }
- }
- else
- {
- Instance->Log(DEBUG,"*** OUR client is newer");
- if (bFNCNewer)
- {
- /* our client is newer */
- iter->second->ForceNickChange(iter->second->uuid);
- Instance->Log(DEBUG,"*** OUR client lost, changing ours");
- }
- else
- {
- /* incoming client "lost" - for now, send SVSNICK to them .. XXX use SAVE*/
- this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+params[0]+" " + params[0]);
-
- /* also, don't trample on the hash - use their UID as nick */
- tempnick = params[0].c_str();
- Instance->Log(DEBUG,"*** INCOMING client lost, changed theirs");
- }
- }
- }
+ iter->second->ForceNickChange(iter->second->uuid);
+ this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+params[0]+" " + params[0]);
+ /* also, don't trample on the hash - use their UID as nick */
+ tempnick = params[0].c_str();
}
/* IMPORTANT NOTE: For remote users, we pass the UUID in the constructor. This automatically