mirror of
https://github.com/anope/anope.git
synced 2026-07-04 16:53:16 +02:00
Made fantasy commands configurable
This commit is contained in:
@@ -890,6 +890,8 @@ static bool DoneCommands(ServerConfig *config, const Anope::string &)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
static bool InitPrivileges(ServerConfig *config, const Anope::string &)
|
||||
{
|
||||
PrivilegeManager::ClearPrivileges();
|
||||
@@ -1040,6 +1042,30 @@ static bool DoneServices(ServerConfig *config, const Anope::string &)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
static bool InitFantasy(ServerConfig *config, const Anope::string &)
|
||||
{
|
||||
config->Fantasy.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool DoFantasy(ServerConfig *config, const Anope::string &, const Anope::string *, ValueList &values, int *)
|
||||
{
|
||||
Anope::string name = values[0].GetValue();
|
||||
Anope::string service = values[1].GetValue();
|
||||
Anope::string permission = values[2].GetValue();
|
||||
|
||||
config->Fantasy[name].name = service;
|
||||
config->Fantasy[name].permission = permission;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool DoneFantasy(ServerConfig *config, const Anope::string &)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
ConfigurationFile::ConfigurationFile(const Anope::string &n, bool e) : name(n), executable(e), fp(NULL)
|
||||
{
|
||||
}
|
||||
@@ -1359,6 +1385,11 @@ ConfigItems::ConfigItems(ServerConfig *conf)
|
||||
{"", "", "", ""},
|
||||
{DT_STRING, DT_STRING, DT_INTEGER, DT_STRING},
|
||||
InitPrivileges, DoPrivileges, DonePrivileges},
|
||||
{"fantasy",
|
||||
{"name", "command", "permission", ""},
|
||||
{"", "", "", ""},
|
||||
{DT_STRING, DT_STRING, DT_STRING},
|
||||
InitFantasy, DoFantasy, DoneFantasy},
|
||||
{"",
|
||||
{""},
|
||||
{""},
|
||||
|
||||
Reference in New Issue
Block a user