summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--Changes.conf8
-rw-r--r--data/example.conf8
-rw-r--r--include/extern.h1
-rw-r--r--src/botserv.c12
-rw-r--r--src/config.c10
-rw-r--r--version.log6
7 files changed, 43 insertions, 3 deletions
diff --git a/Changes b/Changes
index 405e37704..a70858c82 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version S V N
--------------------
Provided by Anope Dev. <dev@anope.org> - 2005
+09/29 A Configuration option to change fantasy command prefix character. [ #00]
09/28 A Event for fantasy commands triggered without channel access. [ #00]
09/28 F Made module (un)loading code more friendly for modularized core. [ #00]
09/28 F NickServ SASET didn't fill the nick in the 'not registered' line. [ #00]
diff --git a/Changes.conf b/Changes.conf
index e7c4afeb8..f4e9a0088 100644
--- a/Changes.conf
+++ b/Changes.conf
@@ -2,6 +2,14 @@ Anope Version S V N
-------------------
** ADDED CONFIGURATION DIRECTIVES **
+# BSFantasyCharacter [REQUIRED]
+# This option allows you to change the default prefix for fantasy
+# commands in channels. This character will have to be prepended to all
+# fantasy commands. If you choose "!" (the default), fantasy commands
+# will, for example, be "!kick", "!op", etc.
+
+BSFantasyCharacter "!"
+
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
diff --git a/data/example.conf b/data/example.conf
index 6cb6a539f..19a1092fa 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -1048,6 +1048,14 @@ BSGentleBWReason
# BSCaseSensitive
+# BSFantasyCharacter [REQUIRED]
+# This option allows you to change the default prefix for fantasy
+# commands in channels. This character will have to be prepended to all
+# fantasy commands. If you choose "!" (the default), fantasy commands
+# will, for example, be "!kick", "!op", etc.
+
+BSFantasyCharacter "!"
+
###########################################################################
#
# HostServ configuration
diff --git a/include/extern.h b/include/extern.h
index acc735590..51a78a684 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -397,6 +397,7 @@ E int BSBadWordsMax;
E int BSSmartJoin;
E int BSGentleBWReason;
E int BSCaseSensitive;
+E char *BSFantasyCharacter;
E int HideStatsO;
E int GlobalOnCycle;
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) {
diff --git a/version.log b/version.log
index dc8afe5bf..368d0b190 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="11"
VERSION_EXTRA="-svn"
-VERSION_BUILD="902"
+VERSION_BUILD="903"
# $Log$
#
+# BUILD : 1.7.11 (903)
+# BUGS :
+# NOTES : Added BSFantasyCharacter configuration option to change the fantasy prefix character
+#
# BUILD : 1.7.11 (902)
# BUGS :
# NOTES : Changed how /os modload and /os modunload load/unload modules; they are now handled in a queue instead of using the mod_current_* variables