From 275bad35c45b510397af1645854c30db2976bc34 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 23 Oct 2014 21:34:55 -0400 Subject: [PATCH 1/2] update socket1.0 support --- lib/cytubebot.js | 5 ++--- lib/ioserver.js | 1 - package.json | 4 ++-- www/js/bot.js | 2 +- www/js/emotes.js | 2 +- www/js/internals.js | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/cytubebot.js b/lib/cytubebot.js index 422df5f..93904e7 100644 --- a/lib/cytubebot.js +++ b/lib/cytubebot.js @@ -4,7 +4,6 @@ var commands = require("./chatcommands") var Database = require("./database") var fs = require("fs") var botHandlers = require("./bothandlers") -var io = require("socket.io-client") var IOServer = require("./ioserver") var IRC = require("./ircclient") var logger = require("./logger") @@ -467,12 +466,12 @@ CytubeBot.prototype.getSocketURL = function(server) { if (server.match(defaultReg)) { this.logger.syslog.log("!~~~! Found socketIO info in config") - return io.connect(server) + return require('socket.io-client')(server) } else { this.logger.syslog.log("!~~~! Looking up socketIO info from server") api.APICall(server, "socketlookup", null, function(data) { if (data.match(defaultReg)) { - bot.socket = io.connect(data) + bot.socket = require('socket.io-client')(data) botHandlers.addHandlers(bot) bot.start() } diff --git a/lib/ioserver.js b/lib/ioserver.js index 7a7da0f..ae8de9f 100644 --- a/lib/ioserver.js +++ b/lib/ioserver.js @@ -34,7 +34,6 @@ function IOServer(srv, bot) { }) }) }) - io.set("log level", 1) }; IOServer.prototype.getEmotes = function(callback) { diff --git a/package.json b/package.json index 8fcf3c3..61d68e7 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ }, "dependencies": { "async": "~0.9.0", - "socket.io-client": "<1.0.0", + "socket.io-client": ">1.0.0", "libxmljs": "~0.11.0", "sqlite3": "~2.2.3", "cleverbot-node": "", "mstranslator": "", "express": "~4.4.1", - "socket.io": "<1.0.0", + "socket.io": ">1.0.0", "jade": "~1.3.1", "forever-monitor": "~1.2.3", "irc": "~0.3.7", diff --git a/www/js/bot.js b/www/js/bot.js index 1290a98..e765b44 100644 --- a/www/js/bot.js +++ b/www/js/bot.js @@ -1,4 +1,4 @@ -socket = io.connect(IO_URL) +socket = io(IO_URL) setTimeout(function() { socket.emit("getStats") }, 1000) diff --git a/www/js/emotes.js b/www/js/emotes.js index 8962010..6b86af4 100644 --- a/www/js/emotes.js +++ b/www/js/emotes.js @@ -1,4 +1,4 @@ -socket = io.connect(IO_URL) +socket = io(IO_URL) setTimeout(function() { socket.emit("getRoom") socket.emit("getEmotes") diff --git a/www/js/internals.js b/www/js/internals.js index 556bad8..04110af 100644 --- a/www/js/internals.js +++ b/www/js/internals.js @@ -1,4 +1,4 @@ -socket = io.connect(IO_URL) +socket = io(IO_URL) socket.on("connect", function() { socket.emit("getInternals") From d709cbf22d9dc36b60486e63cfbb5e20213c7505 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 24 Oct 2014 11:54:58 -0400 Subject: [PATCH 2/2] update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 61d68e7..4eab0ad 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ }, "dependencies": { "async": "~0.9.0", - "socket.io-client": ">1.0.0", + "socket.io-client": "^1.1.0", "libxmljs": "~0.11.0", "sqlite3": "~2.2.3", "cleverbot-node": "", "mstranslator": "", "express": "~4.4.1", - "socket.io": ">1.0.0", + "socket.io": "^1.1.0", "jade": "~1.3.1", "forever-monitor": "~1.2.3", "irc": "~0.3.7",