- /* Safe, we know its non-null because IsValidModuleCommand returned true */
- Command* thiscmd = ServerInstance->Parser->GetHandler(command);
- // this bit of code cleverly routes all module commands
- // to all remote severs *automatically* so that modules
- // can just handle commands locally, without having
- // to have any special provision in place for remote
- // commands and linking protocols.
- std::deque<std::string> params;
- params.clear();
- unsigned int n_translate = thiscmd->translation.size();
- TranslateType translate_to;
+ TreeServer* sdest = FindServer(routing.serverdest);
+ if (!sdest)
+ {
+ ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Trying to route ENCAP to nonexistant server %s",
+ routing.serverdest.c_str());
+ return;
+ }
+ params.push_back(sdest->GetID());
+ params.push_back(command);
+ }
+ else
+ {
+ Module* srcmodule = thiscmd->creator;
+ Version ver = srcmodule->GetVersion();