diff --git a/NEWS b/NEWS index 87338e3..7b46089 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,9 @@ * xC: made nick autocompletion offer recent speakers first - * All binaries have been renamed to something even sillier + * All binaries have been renamed to something even sillier, + and all references in the source tree have been redacted; + this represents a major incompatible change for all plugins 1.2.0 (2021-07-08) "There Are Other Countries As Well" diff --git a/plugins/xB/calc b/plugins/xB/calc index e67244b..7d2d660 100755 --- a/plugins/xB/calc +++ b/plugins/xB/calc @@ -77,7 +77,7 @@ (substring line 0 (- len 1)) line)))) (define (get-config name) - (send "ZYKLONB get_config :" name) + (send "XB get_config :" name) (car (message-params (parse-message (get-line-crlf irc-input-port))))) (define (extract-nick prefix) @@ -216,7 +216,7 @@ ; --- Main loop ---------------------------------------------------------------- (define prefix (get-config "prefix")) -(send "ZYKLONB register") +(send "XB register") (define (process msg) (when (string-ci=? (message-command msg) "PRIVMSG") diff --git a/plugins/xB/coin b/plugins/xB/coin index 14cabb5..770cb32 100755 --- a/plugins/xB/coin +++ b/plugins/xB/coin @@ -37,7 +37,7 @@ proc parse {line} { proc get_config {key} { global msg - puts "ZYKLONB get_config :$key" + puts "XB get_config :$key" gets stdin line parse $line return [lindex $msg(param) 0] @@ -53,7 +53,7 @@ fconfigure stdin -translation crlf -encoding iso8859-1 fconfigure stdout -translation crlf -encoding iso8859-1 set prefix [get_config prefix] -puts "ZYKLONB register" +puts "XB register" set eightball [list \ "It is certain" \ diff --git a/plugins/xB/eval b/plugins/xB/eval index 24e4050..48ea28d 100755 --- a/plugins/xB/eval +++ b/plugins/xB/eval @@ -15,7 +15,7 @@ BEGIN \ prefix = get_config("prefix") - print "ZYKLONB register" + print "XB register" fflush("") # All functions have to be in this particular array @@ -258,7 +258,7 @@ function process_end () function get_config (key) { - print "ZYKLONB get_config :" key + print "XB get_config :" key fflush("") getline diff --git a/plugins/xB/factoids b/plugins/xB/factoids index 9e9a7b4..84f6559 100755 --- a/plugins/xB/factoids +++ b/plugins/xB/factoids @@ -24,18 +24,18 @@ sub parse ($) { } sub bot_print { - print "ZYKLONB print :${\shift}"; + print "XB print :${\shift}"; } # --- Initialization ----------------------------------------------------------- my %config; for my $name (qw(prefix)) { - print "ZYKLONB get_config :$name"; + print "XB get_config :$name"; $config{$name} = (parse )->{args}->[0]; } -print "ZYKLONB register"; +print "XB register"; # --- Database ----------------------------------------------------------------- # Simple map of (factoid_name => [definitions]); all factoids are separated diff --git a/plugins/xB/pomodoro b/plugins/xB/pomodoro index 08b87cb..910f707 100755 --- a/plugins/xB/pomodoro +++ b/plugins/xB/pomodoro @@ -206,7 +206,7 @@ def parse (line) end def bot_print (what) - print "ZYKLONB print :#{what}" + print "XB print :#{what}" end # --- Initialization ----------------------------------------------------------- @@ -215,12 +215,12 @@ end # To read it from anywhere else, it has to be done asynchronously $config = {} [:prefix].each do |name| - print "ZYKLONB get_config :#{name}" + print "XB get_config :#{name}" _, _, _, _, args = *parse($stdin.gets.chomp) $config[name] = args[0] end -print "ZYKLONB register" +print "XB register" # --- Plugin logic ------------------------------------------------------------- diff --git a/plugins/xB/script b/plugins/xB/script index 948e7e5..43bd66f 100755 --- a/plugins/xB/script +++ b/plugins/xB/script @@ -1964,12 +1964,12 @@ read_message (void) // --- Interfacing with the bot ------------------------------------------------ -#define BOT_PRINT "ZYKLONB print :script: " +#define BOT_PRINT "XB print :script: " static const char * get_config (const char *key) { - printf ("ZYKLONB get_config :%s\r\n", key); + printf ("XB get_config :%s\r\n", key); struct message *msg = read_message (); if (!msg || msg->n_params <= 0) exit (EXIT_FAILURE); @@ -2298,7 +2298,7 @@ main (int argc, char *argv[]) printf (BOT_PRINT "%s\r\n", "runtime library initialization failed"); g_prefix = strdup (get_config ("prefix")); - printf ("ZYKLONB register\r\n"); + printf ("XB register\r\n"); struct message *msg; while ((msg = read_message ())) process_message (msg); diff --git a/plugins/xB/seen b/plugins/xB/seen index da20972..da43488 100755 --- a/plugins/xB/seen +++ b/plugins/xB/seen @@ -26,7 +26,7 @@ function parse (line) end function get_config (name) - io.write ("ZYKLONB get_config :", name, "\r\n") + io.write ("XB get_config :", name, "\r\n") return parse (io.read ()).params[1] end @@ -34,7 +34,7 @@ end io.output ():setvbuf ('line') local prefix = get_config ('prefix') -io.write ("ZYKLONB register\r\n") +io.write ("XB register\r\n") local db = {} local db_filename = "seen.db" diff --git a/plugins/xB/youtube b/plugins/xB/youtube index 0bf0c1e..feaab96 100755 --- a/plugins/xB/youtube +++ b/plugins/xB/youtube @@ -27,12 +27,12 @@ class Plugin: return (nick, user, host, command, args) def get_config (self, key): - print ("ZYKLONB get_config :%s" % key) + print ("XB get_config :%s" % key) (_, _, _, _, args) = self.parse (sys.stdin.readline ()) return args[0] def bot_print (self, what): - print ('ZYKLONB print :%s' % what) + print ('XB print :%s' % what) class YouTube (Plugin): re_videos = [re.compile (x) for x in [ @@ -98,7 +98,7 @@ class YouTube (Plugin): if self.youtube_api_key == "": self.bot_print ("youtube: missing `youtube_api_key'") - print ("ZYKLONB register") + print ("XB register") for line in sys.stdin: self.process_line (line) diff --git a/xB.adoc b/xB.adoc index 91f7703..0fa48e5 100644 --- a/xB.adoc +++ b/xB.adoc @@ -57,24 +57,24 @@ Plugins ------- Plugins communicate with the bot over their standard input and output streams using the IRC protocol. (Caveat: the standard C library doesn't automatically -flush FILE streams for pipes on newlines.) A special *ZYKLONB* command is -introduced for RPC, with the following subcommands: +flush FILE streams for pipes on newlines.) A special *XB* command is introduced +for RPC, with the following subcommands: -*ZYKLONB get_config* _key_:: +*XB get_config* _key_:: Request the value of the given configuration option. If no such option exists, the value will be empty. The response will be delivered in the following format: + ``` -ZYKLONB :value +XB :value ``` + This is particularly useful for retrieving the *prefix* string. -*ZYKLONB print* _message_:: +*XB print* _message_:: Make the bot print the _message_ on its standard output. -*ZYKLONB register*:: +*XB register*:: Once a plugin issues this command, it will start receiving all of the bot's incoming IRC traffic, which includes data from the initialization period. diff --git a/xB.c b/xB.c index 9e36040..f7c076b 100644 --- a/xB.c +++ b/xB.c @@ -735,7 +735,7 @@ setup_recovery_handler (struct bot_context *ctx, struct error **e) // --- Plugins ----------------------------------------------------------------- /// The name of the special IRC command for interprocess communication -static const char *plugin_ipc_command = "ZYKLONB"; +static const char *plugin_ipc_command = "XB"; static struct plugin * plugin_find_by_pid (struct bot_context *ctx, pid_t pid)