|
|||
|
|||
|
#include <rconnect.h>
Inheritance diagram for cmd_rconnect:


Public Member Functions | |
| cmd_rconnect (InspIRCd *Instance, Module *Callback, SpanningTreeUtilities *Util) | |
| CmdResult | Handle (const char **parameters, int pcnt, userrec *user) |
| Handle the command from a user. | |
Private Attributes | |
| Module * | Creator |
| SpanningTreeUtilities * | Utils |
Definition at line 19 of file rconnect.h.
|
||||||||||||||||
|
Definition at line 37 of file rconnect.cpp. References command_t::source, and command_t::syntax. 00037 : command_t(Instance, "RCONNECT", 'o', 2), Creator(Callback), Utils(Util) 00038 { 00039 this->source = "m_spanningtree.so"; 00040 syntax = "<remote-server-mask> <target-server-mask>"; 00041 }
|
|
||||||||||||||||
|
Handle the command from a user.
Implements command_t. Definition at line 43 of file rconnect.cpp. References CMD_FAILURE, CMD_SUCCESS, InspIRCd::Config, Creator, SpanningTreeUtilities::FindServerMask(), IS_LOCAL, InspIRCd::MatchText(), userrec::nick, Module::OnPreCommand(), command_t::ServerInstance, ServerConfig::ServerName, InspIRCd::SNO, Utils, userrec::WriteServ(), and SnomaskManager::WriteToSnoMask(). 00044 { 00045 if (IS_LOCAL(user)) 00046 { 00047 if (!Utils->FindServerMask(parameters[0])) 00048 { 00049 user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0]); 00050 return CMD_FAILURE; 00051 } 00052 user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]); 00053 } 00054 00055 /* Is this aimed at our server? */ 00056 if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) 00057 { 00058 /* Yes, initiate the given connect */ 00059 ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0],parameters[1]); 00060 const char* para[1]; 00061 para[0] = parameters[1]; 00062 std::string original_command = std::string("CONNECT ") + parameters[1]; 00063 Creator->OnPreCommand("CONNECT", para, 1, user, true, original_command); 00064 } 00065 return CMD_SUCCESS; 00066 }
|
|
|
Definition at line 21 of file rconnect.h. Referenced by Handle(). |
|
|
Definition at line 22 of file rconnect.h. Referenced by Handle(). |