git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11671
e03df62e-2008-0410-955e-
edbf42e46eb7
42 files changed:
CMD_FAILURE = 0, /* Command exists, but failed */
CMD_SUCCESS = 1, /* Command exists, and succeeded */
CMD_INVALID = 2 /* Command doesnt exist at all! */
CMD_FAILURE = 0, /* Command exists, but failed */
CMD_SUCCESS = 1, /* Command exists, and succeeded */
CMD_INVALID = 2 /* Command doesnt exist at all! */
-#define CMD_LOCALONLY CMD_FAILURE
};
/** Translation types for translation of parameters to UIDs.
};
/** Translation types for translation of parameters to UIDs.
* @param parameters The parameters for the command.
* @param user The user who issued the command.
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
* @param parameters The parameters for the command.
* @param user The user who issued the command.
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
- * If the command succeeds but should remain local to this server,
- * return CMD_LOCALONLY.
*/
virtual CmdResult Handle(const std::vector<std::string>& parameters, User* user) = 0;
virtual RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
*/
virtual CmdResult Handle(const std::vector<std::string>& parameters, User* user) = 0;
virtual RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- return ROUTE_BROADCAST;
+ return ROUTE_LOCALONLY;
}
/** Handle an internal request from another command, the core, or a module
* @param Command ID
* @param Zero or more parameters, whos form is specified by the command ID.
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
}
/** Handle an internal request from another command, the core, or a module
* @param Command ID
* @param Zero or more parameters, whos form is specified by the command ID.
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
- * If the command succeeds but should remain local to this server,
- * return CMD_LOCALONLY.
*/
virtual CmdResult HandleInternal(const unsigned int /* id */, const std::deque<classbase*>& /* params */)
{
*/
virtual CmdResult HandleInternal(const unsigned int /* id */, const std::deque<classbase*>& /* params */)
{
* @param parameters The parameters given
* @param servername The server name which issued the command
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
* @param parameters The parameters given
* @param servername The server name which issued the command
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
- * If the command succeeds but should remain local to this server,
- * return CMD_LOCALONLY.
*/
virtual CmdResult HandleServer(const std::vector<std::string>& /* parameters */, const std::string& /* servername */)
{
*/
virtual CmdResult HandleServer(const std::vector<std::string>& /* parameters */, const std::string& /* servername */)
{
/* we want this routed out! */
return CMD_SUCCESS;
}
/* we want this routed out! */
return CMD_SUCCESS;
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
{
if (IS_LOCAL(user))
ListAccept(user);
{
if (IS_LOCAL(user))
ListAccept(user);
}
else if (tok[0] == '-')
{
}
else if (tok[0] == '-')
{
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleCBan : public Module
};
class ModuleCBan : public Module
ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), parameters[2].c_str(), user->host.c_str());
user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2]));
user->Extend("cgiirc_webirc_ip", new std::string(parameters[3]));
ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), parameters[2].c_str(), user->host.c_str());
user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2]));
user->Extend("cgiirc_webirc_ip", new std::string(parameters[3]));
user->WriteServ(clonesstr + " END");
user->WriteServ(clonesstr + " END");
else
user->WriteServ("NOTICE %s :*** No unknown connections found",user->nick.c_str());
else
user->WriteServ("NOTICE %s :*** No unknown connections found",user->nick.c_str());
user->WriteServ("NOTICE %s :Custom title set to '%s'",user->nick.c_str(), title.c_str());
user->WriteServ("NOTICE %s :Custom title set to '%s'",user->nick.c_str(), title.c_str());
}
}
user->WriteServ("NOTICE %s :Invalid title credentials",user->nick.c_str());
}
}
user->WriteServ("NOTICE %s :Invalid title credentials",user->nick.c_str());
Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), true, "", false, ServerInstance->Time());
}
Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), true, "", false, ServerInstance->Time());
}
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
+
void DisplayHelp(User* user)
{
user->WriteNumeric(998, "%s :DCCALLOW [<+|->nick [time]] [list] [help]", user->nick.c_str());
void DisplayHelp(User* user)
{
user->WriteNumeric(998, "%s :DCCALLOW [<+|->nick [time]] [list] [help]", user->nick.c_str());
ServerInstance->SendMode(modes, ServerInstance->FakeClient);
ServerInstance->PI->SendMode(c->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
ServerInstance->SendMode(modes, ServerInstance->FakeClient);
ServerInstance->PI->SendMode(c->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
{
user->WriteServ("NOTICE %s :*** Not enough parameters%s", user->nick.c_str(), extra_text.c_str());
}
{
user->WriteServ("NOTICE %s :*** Not enough parameters%s", user->nick.c_str(), extra_text.c_str());
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class FilterBase : public Module
};
class FilterBase : public Module
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
/** Handle /GUNLOADMODULE
};
/** Handle /GUNLOADMODULE
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
/** Handle /GRELOADMODULE
};
/** Handle /GRELOADMODULE
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleGlobalLoad : public Module
};
class ModuleGlobalLoad : public Module
/* route it (ofc :p) */
return CMD_SUCCESS;
}
/* route it (ofc :p) */
return CMD_SUCCESS;
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleGlobops : public Module
};
class ModuleGlobops : public Module
port = 0;
redirect_to.clear();
port = 0;
redirect_to.clear();
user->WriteServ("NOTICE %s :KNOCKing on %s", user->nick.c_str(), c->name.c_str());
return CMD_SUCCESS;
}
user->WriteServ("NOTICE %s :KNOCKing on %s", user->nick.c_str(), c->name.c_str());
return CMD_SUCCESS;
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
/** Handles channel mode +K
};
/** Handles channel mode +K
user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server);
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick.c_str());
/* Dont send to the network */
user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server);
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick.c_str());
/* Dont send to the network */
user->WriteNumeric(989, "%s %s :Open for new connections", user->nick.c_str(), user->server);
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow for new connections", user->nick.c_str());
/* Dont send to the network */
user->WriteNumeric(989, "%s %s :Open for new connections", user->nick.c_str(), user->server);
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow for new connections", user->nick.c_str());
/* Dont send to the network */
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
/** Abstraction of NetworkPrefixBase for channel mode +Y
};
/** Abstraction of NetworkPrefixBase for channel mode +Y
user->WriteServ(std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD"));
/* don't route me */
user->WriteServ(std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD"));
/* don't route me */
// Slow down the user if they are trying to flood mkpasswd requests
user->IncreasePenalty(5);
// Slow down the user if they are trying to flood mkpasswd requests
user->IncreasePenalty(5);
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleRLine : public Module
};
class ModuleRLine : public Module
if (ServerInstance->Modes->GetLastParse().length())
ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
this->active = false;
if (ServerInstance->Modes->GetLastParse().length())
ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
this->active = false;
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleSASL : public Module
};
class ModuleSASL : public Module
ServerInstance->SNO->WriteToSnoMask('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
ServerInstance->SNO->WriteToSnoMask('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
if (user->ChangeDisplayedHost(parameters[0].c_str()))
{
ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost);
if (user->ChangeDisplayedHost(parameters[0].c_str()))
{
ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost);
user->ChangeIdent(parameters[0].c_str());
ServerInstance->SNO->WriteGlobalSno('a', "%s used SETIDENT to change their ident to '%s'", user->nick.c_str(), user->ident.c_str());
user->ChangeIdent(parameters[0].c_str());
ServerInstance->SNO->WriteGlobalSno('a', "%s used SETIDENT to change their ident to '%s'", user->nick.c_str(), user->ident.c_str());
ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds");
user->WriteNumeric(944, "%s :Idle time set.",user->nick.c_str());
ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds");
user->WriteNumeric(944, "%s :Idle time set.",user->nick.c_str());
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleShun : public Module
};
class ModuleShun : public Module
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class CommandSilence : public Command
};
class CommandSilence : public Command
}
user->WriteNumeric(272, "%s :End of Silence List",user->nick.c_str());
}
user->WriteNumeric(272, "%s :End of Silence List",user->nick.c_str());
}
else if (parameters.size() > 0)
{
}
else if (parameters.size() > 0)
{
}
/* turn the nice human readable pattern into a mask */
}
/* turn the nice human readable pattern into a mask */
Module* srcmodule = thiscmd->creator;
Version ver = srcmodule->GetVersion();
Module* srcmodule = thiscmd->creator;
Version ver = srcmodule->GetVersion();
- // XXX Temporary check to avoid routing cmd_* entries while they default to global routing
- if (srcmodule->ModuleSourceFile[0] == 'c')
- return;
-
if (!(ver.Flags & VF_COMMON))
{
ServerInstance->Logs->Log("m_spanningtree",ERROR,"Routed command %s from non-VF_COMMON module %s",
if (!(ver.Flags & VF_COMMON))
{
ServerInstance->Logs->Log("m_spanningtree",ERROR,"Routed command %s from non-VF_COMMON module %s",
sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")");
ServerInstance->SE->DelFd(sock);
sock->Close();
sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")");
ServerInstance->SE->DelFd(sock);
sock->Close();
user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick.c_str(), cert->GetIssuer().c_str());
user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick.c_str(), cert->GetFingerprint().c_str());
}
user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick.c_str(), cert->GetIssuer().c_str());
user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick.c_str(), cert->GetFingerprint().c_str());
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleSVSHold : public Module
};
class ModuleSVSHold : public Module
user->WriteNumeric(401, "%s %s :No such channel",user->nick.c_str(), parameters[0].c_str());
return CMD_FAILURE;
}
user->WriteNumeric(401, "%s %s :No such channel",user->nick.c_str(), parameters[0].c_str());
return CMD_FAILURE;
}
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleTimedBans : public Module
};
class ModuleTimedBans : public Module
else
user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick.c_str(), n_counted, parameters[0].c_str());
else
user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick.c_str(), n_counted, parameters[0].c_str());
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
};
class ModuleUninvite : public Module
};
class ModuleUninvite : public Module
user->WriteServ(retbuf);
/* Dont send to the network */
user->WriteServ(retbuf);
/* Dont send to the network */
user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
user->ChangeDisplayedHost(mask.c_str());
delete Conf;
user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
user->ChangeDisplayedHost(mask.c_str());
delete Conf;
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ return ROUTE_BROADCAST;
+ }
}
CmdResult add_watch(User* user, const char* nick)
}
CmdResult add_watch(User* user, const char* nick)
}
CommandWatch (InspIRCd* Instance, Module* parent, unsigned int &maxwatch) : Command(Instance,parent,"WATCH",0,0), MAX_WATCH(maxwatch)
}
CommandWatch (InspIRCd* Instance, Module* parent, unsigned int &maxwatch) : Command(Instance,parent,"WATCH",0,0), MAX_WATCH(maxwatch)