summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-04 13:39:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-04 13:39:56 +0000
commit0632c03ad21882ffab750a093558cf3dd2e90a5e (patch)
tree5962de3472e19de20b6c8adcff6d2d4c5bc7f110 /src/modules
parentdd9e56a88e5c13da9ed5d81f7054a6b7f24cfe97 (diff)
Reverted dodgy changes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2138 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp99
1 files changed, 4 insertions, 95 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 6ab7a5953..9992c02d4 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -306,7 +306,6 @@ class TreeSocket : public InspSocket
std::string InboundDescription;
int num_lost_users;
int num_lost_servers;
- nspace::hash_map<std::string,std::string> replacements;
public:
@@ -518,29 +517,6 @@ class TreeSocket : public InspSocket
log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS);
- // corect all nicknames that have been force changed due to collision
- for (unsigned int usernum = 2; usernum < params.size(); usernum++)
- {
- log(DEBUG,"Collision translation: In=%s",params[usernum].c_str());
- char* usr = (char*)params[usernum].c_str();
- char permissions = *usr;
- switch (permissions)
- {
- case '@':
- case '%':
- case '+':
- usr++;
- break;
- }
- std::string nickname = this->GetFJoinReplacement(usr);
- if ((permissions == '@') || (permissions == '%') || (permissions == '+'))
- {
- nickname = permissions + nickname;
- }
- params[usernum] = nickname;
- log(DEBUG,"Collision translation: Out=%s",params[usernum].c_str());
- }
-
// do this first, so our mode reversals are correctly received by other servers
// if there is a TS collision.
DoOneToAllButSender(source,"FJOIN",params,source);
@@ -549,7 +525,6 @@ class TreeSocket : public InspSocket
{
// process one channel at a time, applying modes.
char* usr = (char*)params[usernum].c_str();
- std::string nickname;
char permissions = *usr;
switch (permissions)
{
@@ -625,33 +600,6 @@ class TreeSocket : public InspSocket
return true;
}
- bool ClearFJoinReplacement()
- {
- replacements.clear();
- return true;
- }
-
- void AddFJoinReplacement(std::string oldnick, std::string newnick)
- {
- nspace::hash_map<std::string,std::string>::iterator iter = replacements.find(oldnick);
- if (iter != replacements.end())
- return;
- replacements[oldnick] = newnick;
- }
-
- std::string GetFJoinReplacement(std::string nickname)
- {
- nspace::hash_map<std::string,std::string>::iterator iter = replacements.find(nickname);
- if (iter != replacements.end())
- {
- return iter->second;
- }
- else
- {
- return nickname;
- }
- }
-
bool IntroduceClient(std::string source, std::deque<std::string> params)
{
if (params.size() < 8)
@@ -681,14 +629,8 @@ class TreeSocket : public InspSocket
{
// nick collision
log(DEBUG,"Nick collision on %s!%s@%s: %lu %lu",tempnick,ident.c_str(),host.c_str(),(unsigned long)age,(unsigned long)iter->second->age);
- if (iter->second->age >= age)
- {
- // ours is older than theirs, ours stays. Set a new nick here, send SVSNICK
- params[1] = nick = "Guest0";
- this->WriteLine(":"+Srv->GetServerName()+" FNICK "+tempnick+" "+nick);
- // temporarily (until end of burst) we auto-replace occurances of the old nick with the new nick
- AddFJoinReplacement(tempnick,nick);
- }
+ this->WriteLine(":"+Srv->GetServerName()+" KILL "+tempnick+" :Nickname collision");
+ return true;
}
clientlist[tempnick] = new userrec();
@@ -790,7 +732,7 @@ class TreeSocket : public InspSocket
this->SendServers(TreeRoot,s,1);
// Send users and their channels
this->SendUsers(s);
- this->WriteLine("ENDUSERS");
+ // TODO: Send everything else (channel modes etc)
this->SendChannelModes(s);
this->WriteLine("ENDBURST");
}
@@ -860,21 +802,6 @@ class TreeSocket : public InspSocket
return true;
}
- bool ForceNick(std::string prefix, std::deque<std::string> params)
- {
- if (params.size() != 2)
- return true;
- std::string oldnick = params[0];
- std::string newnick = params[1];
- userrec* u = Srv->FindNick(oldnick);
- if (u)
- {
- Srv->ChangeUserNick(u,newnick);
- DoOneToAllButSender(prefix,"FNICK",params,prefix);
- }
- return true;
- }
-
bool RemoteRehash(std::string prefix, std::deque<std::string> params)
{
if (params.size() < 1)
@@ -964,8 +891,6 @@ class TreeSocket : public InspSocket
params[3] = ":" + params[3];
DoOneToAllButSender(TreeRoot->GetName(),"SERVER",params,servername);
this->DoBurst(Node);
- this->SendChannelModes(Node);
- this->WriteLine("ENDBURST");
return true;
}
}
@@ -1123,14 +1048,7 @@ class TreeSocket : public InspSocket
params.push_back("1");
params.push_back(":"+InboundDescription);
DoOneToAllButSender(TreeRoot->GetName(),"SERVER",params,InboundServerName);
- }
- else if (command == "ENDUSERS")
- {
- // one server must wait till the other servers list of synched users
- // before starting, so we have time to resolve collisions
- this->DoBurst(Node);
- this->SendChannelModes(Node);
- this->WriteLine("ENDBURST");
+ this->DoBurst(Node);
}
else if (command == "ERROR")
{
@@ -1198,14 +1116,6 @@ class TreeSocket : public InspSocket
{
return this->RemoteRehash(prefix,params);
}
- else if (command == "FNICK")
- {
- return this->ForceNick(prefix,params);
- }
- else if (command == "ENDBURST")
- {
- return this->ClearFJoinReplacement();
- }
else if (command == "SQUIT")
{
if (params.size() == 2)
@@ -1981,4 +1891,3 @@ extern "C" void * init_module( void )
{
return new ModuleSpanningTreeFactory;
}
-