From 8404cb42458a9662dd4244c90d8c567624e3a69a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 17:48:48 +0000 Subject: [PATCH] genericise --- modules/{rc => udp}/README.md | 4 ++-- modules/{rc => udp}/config.json | 2 +- modules/{rc/rc.js => udp/udp.js} | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) rename modules/{rc => udp}/README.md (76%) rename modules/{rc => udp}/config.json (74%) rename modules/{rc/rc.js => udp/udp.js} (58%) diff --git a/modules/rc/README.md b/modules/udp/README.md similarity index 76% rename from modules/rc/README.md rename to modules/udp/README.md index 57ba5ae..1c2b284 100644 --- a/modules/rc/README.md +++ b/modules/udp/README.md @@ -1,5 +1,5 @@ -# RC -Prints UDP packets; designed for a MediaWiki installation. +# UDP +Prints UDP packets; designed for a [MediaWiki installation](https://www.mediawiki.org/wiki/Manual:$wgRC2UDPAddress). # Configuration ## server diff --git a/modules/rc/config.json b/modules/udp/config.json similarity index 74% rename from modules/rc/config.json rename to modules/udp/config.json index b1ba13a..4619fcd 100644 --- a/modules/rc/config.json +++ b/modules/udp/config.json @@ -2,5 +2,5 @@ "port":14628, "address": "127.0.0.1", "server": "freenode", - "channel": "#zuzak2" + "channel": "#oaosidl" } diff --git a/modules/rc/rc.js b/modules/udp/udp.js similarity index 58% rename from modules/rc/rc.js rename to modules/udp/udp.js index c494636..b7d9b76 100644 --- a/modules/rc/rc.js +++ b/modules/udp/udp.js @@ -1,22 +1,22 @@ /** - * Module Name: RC + * Module Name: UDP * Description: Relays UDP packets, intended for * a feed of RecentChanges on a MediaWiki install. */ var dgram = require('dgram'); -var rc = function(dbot) { +var udp = function(dbot) { var server = dgram.createSocket("udp4"); server.on("message", function(msg, msginfo) { var message = msg.toString(); console.log(message); - if (msginfo.address == dbot.config.rc.address) { - dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); + if (msginfo.address == dbot.config.udp.address) { + dbot.say(dbot.config.udp.server, dbot.config.udp.channel, message); } }); - server.bind(dbot.config.rc.port); + server.bind(dbot.config.udp.port); }; exports.fetch = function(dbot) { - return new rc(dbot); + return new udp(dbot); };