Hallo,
ich bastel zur Zeit an einem neuen Plugin.
Nun möchte ich per svdrp einen Dateinamen (/PFAD/ZUR/channels.conf) an das Plugin übergeben. Fertig ist das:
Code
const char **cPluginChannellists::SVDRPHelpPages(void) {
// Return help text for SVDRP commands this plugin implements
static const char *HelpPages[] = {
"RELOAD\n"
" Reload current channels.conf.",
NULL
};
return HelpPages;
}
cString cPluginChannellists::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) {
// Process SVDRP commands this plugin implements
if (strcasecmp(Command, "RELOAD") == 0) {
char *ListToReload;
asprintf(&ListToReload,"%s/../channels.conf",cPlugin::ConfigDirectory());
Channels.SwitchTo(1);
TimerList timers;
timers.SaveTimer();
Channels.Load(ListToReload);
Channels.SwitchTo(1);
timers.RestoreTimer();
free (ListToReload);
return cString::sprintf("channels.conf successfully reloaded");
}
return NULL;
}
Alles anzeigen
Jetzt möchte ich es so haben, das mit RELOAD die aktuelle channels.conf und mit "RELOAD foo" die angegebene neu geladen wird.
Kann mich mal jemand anschupsen?
Gruß
Marc