diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/botserv.c | 12 | ||||
-rw-r--r-- | src/config.c | 10 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/botserv.c b/src/botserv.c index f1a89578d..735e608c4 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -400,13 +400,21 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* Fantaisist commands */ - if (buf && (ci->botflags & BS_FANTASY) && *buf == '!') { + if (buf && (ci->botflags & BS_FANTASY) && *buf == *BSFantasyCharacter) { cmd = strtok(buf, " "); - if (cmd && (cmd[0] == '!')) { + if (cmd && (cmd[0] == *BSFantasyCharacter)) { char *params = strtok(NULL, ""); char *event_name = EVENT_BOT_FANTASY_NO_ACCESS; + /* Warning: Hack Ahead + * To allow older modules to still work safely with the fantasy + * events, we replace the first char with '!' so that the cmd will + * be !trigger, and not *trigger or whatever, which will confuse + * them. Should be replaced after 1.8 -GD + */ + cmd[0] = '!'; + if (check_access(u, ci, CA_FANTASIA)) event_name = EVENT_BOT_FANTASY; diff --git a/src/config.c b/src/config.c index 5f956b229..cf75ce052 100644 --- a/src/config.c +++ b/src/config.c @@ -207,6 +207,7 @@ int BSBadWordsMax; int BSSmartJoin; int BSGentleBWReason; int BSCaseSensitive; +char *BSFantasyCharacter; int HideStatsO; int GlobalOnCycle; @@ -387,6 +388,8 @@ Directive directives[] = { {"BSDefFantasy", {{PARAM_SET, PARAM_RELOAD, &BSDefFantasy}}}, {"BSDefSymbiosis", {{PARAM_SET, PARAM_RELOAD, &BSDefSymbiosis}}}, {"BSCaseSensitive", {{PARAM_SET, PARAM_RELOAD, &BSCaseSensitive}}}, + {"BSFantasyCharacter", + {{PARAM_STRING, PARAM_RELOAD, &BSFantasyCharacter}}}, {"BSGentleBWReason", {{PARAM_SET, PARAM_RELOAD, &BSGentleBWReason}}}, {"BSKeepData", {{PARAM_TIME, PARAM_RELOAD, &BSKeepData}}}, {"BSMinUsers", {{PARAM_POSINT, PARAM_RELOAD, &BSMinUsers}}}, @@ -1316,6 +1319,7 @@ int read_config(int reload) CHECK(BSBadWordsMax); CHECK(BSMinUsers); CHECK(BSKeepData); + CHECK(BSFantasyCharacter); if (s_BotServAlias) { if (!stricmp(s_BotServ, s_BotServAlias)) { printf @@ -1323,6 +1327,12 @@ int read_config(int reload) retval = 0; } } + if (BSFantasyCharacter && (strlen(BSFantasyCharacter) > 1)) { + printf + ("*** BSFantasyCharacter is more than 1 character long. Only the first\n" + "*** character ('%c') will be used. The others will be ignored.\n", + *BSFantasyCharacter); + } } if (s_HostServ) { |