summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 12:02:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 12:02:07 +0000
commita354b2beeb0fa1dc8bb4f0d5e96d018371bea2f2 (patch)
tree4fe876b5065fbbfaa0a39460d754d3c07db1f0ae /src
parentbb4e045b7c4d5a98ddae1f3ffec4439615c74fa1 (diff)
Added RCONNECT
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3038 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 2be8e16b1..32c908782 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -531,6 +531,31 @@ bool IsServer(std::string ServerName)
return (FindServer(ServerName) != NULL);
}
+
+class cmd_rconnect : public command_t
+{
+ Module* Creator;
+ public:
+ cmd_rconnect (Module* Callback) : command_t("RCONNECT", 'o', 2), Creator(Callback)
+ {
+ this->source = "m_spanningtree.so";
+ }
+
+ void Handle (char **parameters, int pcnt, userrec *user)
+ {
+ /* Is this aimed at our server? */
+ if (Srv->MatchText(Srv->GetServerName(),parameters[0]))
+ {
+ /* Yes, initiate the given connect */
+ char* para[1];
+ para[0] = parameters[1];
+ Creator->OnPreCommand("CONNECT", para, 1, user, true);
+ }
+ }
+};
+
+
+
/* Every SERVER connection inbound or outbound is represented by
* an object of type TreeSocket.
* TreeSockets, being inherited from InspSocket, can be tied into
@@ -2473,6 +2498,7 @@ class ModuleSpanningTree : public Module
std::vector<TreeSocket*> Bindings;
int line;
int NumServers;
+ cmd_rconnect* command_rconnect;
public:
@@ -2486,6 +2512,9 @@ class ModuleSpanningTree : public Module
TreeRoot = new TreeServer(Srv->GetServerName(),Srv->GetServerDescription());
ReadConfiguration(true);
+
+ command_rconnect = new cmd_rconnect(this);
+ Srv->AddCommand(command_rconnect);
}
void ShowLinks(TreeServer* Current, userrec* user, int hops)