From 9e7d67a19700a05cd989dcb9681ccef2e6fcc88a Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 3 Mar 2015 14:05:49 -0500 Subject: [PATCH] bump socket.io --- index.js | 4 ++-- lib/cytubebot.js | 18 +++++++++--------- package.json | 4 ++-- www/js/bot.js | 3 +-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index bee9cec..5732bbe 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var forever = require("forever-monitor") var fs = require("fs") -var child = new(forever.Monitor)("./lib/start.js", { +var child = new (forever.Monitor)("./lib/start.js", { max: 21, silent: false, minUptime: 5000, @@ -30,4 +30,4 @@ child.on("restart", function() { }) child.start() -writeTimes() \ No newline at end of file +writeTimes() diff --git a/lib/cytubebot.js b/lib/cytubebot.js index 104a134..a66810e 100644 --- a/lib/cytubebot.js +++ b/lib/cytubebot.js @@ -298,7 +298,7 @@ CytubeBot.prototype.blockVideo = function() { // Returns true or false depending if they have that perm // username - The user we're looking up // rank - The rank the user should have -// permission - The permission to look up +// permission - The permission to look up // callback - The callback function CytubeBot.prototype.checkPermission = function(username, rank, permission, callback) { var permData = { @@ -312,7 +312,7 @@ CytubeBot.prototype.checkPermission = function(username, rank, permission, callb }; // Checks if users have too many items on the playlist -// And if so, delete them +// And if so, delete them CytubeBot.prototype.checkPlaylist = function() { var bot = this if (!this.stats["userLimit"]) @@ -460,10 +460,10 @@ CytubeBot.prototype.getQuote = function(nick) { }; // Gets the Cytube socketIO port -// server - The input from config.json +// server - The input from config.json CytubeBot.prototype.getSocketURL = function(server) { var bot = this - var defaultReg = new RegExp("(https?:\/\/)?(.*:\d*)") + var defaultReg = /(https?:\/\/)?(.*:\d*)/ if (server.match(defaultReg)) { this.logger.syslog.log("!~~~! Found socketIO info in config") @@ -592,7 +592,7 @@ CytubeBot.prototype.handleChangeMedia = function(data) { // Handles chatMsg frames from the server // If the first character of the msg is $, we interpet it as a command. // We ignore chat from before the bot was started, in order to avoid old -// commands. +// commands. CytubeBot.prototype.handleChatMsg = function(data, pm) { var bot = this var username = data["username"] @@ -685,7 +685,7 @@ CytubeBot.prototype.handleEmoteUpdate = function(emote) { // Handles a change in hybridMods or calls sendHybridModPermissions if no permission // is given. // permission - The permission we are changing, or undefined if there is none -// name - name of the user we want to change permissions for, or look up +// name - name of the user we want to change permissions for, or look up CytubeBot.prototype.handleHybridModPermissionChange = function(permission, name) { var permData = { permission: permission, @@ -721,7 +721,7 @@ CytubeBot.prototype.handleLogin = function(data) { // Handles mediaUpdate frames from the server // If we are managing and the playlist only has one item -// and the video is about to end, we add a random video +// and the video is about to end, we add a random video CytubeBot.prototype.handleMediaUpdate = function(data) { console.log("#~~~# Current video time: " + data["currentTime"] + " Paused: " + data["paused"]) @@ -917,7 +917,7 @@ CytubeBot.prototype.listBlockedUsers = function() { // Reads the persistent settings or has the callback write the defaults // callback - callback function, used to write the persistent settings -// if they don't exist +// if they don't exist CytubeBot.prototype.readPersistentSettings = function(callback) { var bot = this fs.readFile("persistent.json", function(err, data) { @@ -1250,4 +1250,4 @@ CytubeBot.prototype.writePersistentSettings = function() { process.exit(1) } }) -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index fe4c8d8..0959849 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ }, "dependencies": { "async": "~0.9.0", - "socket.io-client": "^1.3.3", + "socket.io-client": "^1.3.5", "libxmljs": "~0.13.0", "sqlite3": "~3.0.5", "cleverbot-node": "", "mstranslator": "", "express": "~4.4.1", - "socket.io": "^1.3.3", + "socket.io": "^1.3.5", "jade": "~1.3.1", "forever-monitor": "~1.2.3", "irc": "~0.3.9", diff --git a/www/js/bot.js b/www/js/bot.js index e765b44..e98232e 100644 --- a/www/js/bot.js +++ b/www/js/bot.js @@ -26,7 +26,6 @@ google.setOnLoadCallback(function() { pieSliceBorderColor: "#404040" } - socket.on("roomStats", function(data) { console.log(data) $("h1").text(data["room"] + " Statistics") @@ -116,4 +115,4 @@ google.setOnLoadCallback(function() { }) socket.disconnect() }) -}) \ No newline at end of file +})