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); };