From 823ab91d04438e6c481327b1a9a038a59ce1d7f0 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 4 Apr 2013 18:22:11 -0500 Subject: [PATCH] patch a couple of bugs --- channel.js | 6 +++++- database.js | 3 ++- server.js | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/channel.js b/channel.js index d4dcd8b8..cb975872 100644 --- a/channel.js +++ b/channel.js @@ -633,6 +633,8 @@ Channel.prototype.playNext = function() { // Reset voteskip this.voteskip = false; + this.drinks = 0; + this.broadcastDrinks(); var old = this.position; // Wrap around if the end is hit @@ -676,6 +678,8 @@ Channel.prototype.jumpTo = function(pos) { // Reset voteskip this.voteskip = false; + this.drinks = 0; + this.broadcastDrinks(); var old = this.position; this.position = pos; @@ -881,7 +885,7 @@ Channel.prototype.tryChangeFilter = function(user, data) { catch(e) { return; } - this.updateFilter(data); + this.updateFilter(data.filter); } else if(data.cmd == "remove") { this.removeFilter(data.filter[0]); diff --git a/database.js b/database.js index 7ac7df3e..23372372 100644 --- a/database.js +++ b/database.js @@ -14,6 +14,7 @@ var Config = require("./config.js"); var Logger = require("./logger.js"); var Rank = require("./rank.js"); var Media = require("./media.js").Media; +var Server = require("./server.js"); var initialized = false; @@ -86,7 +87,7 @@ exports.loadChannel = function(chan) { return; } else if(rows[0].name != chan.name) { - chan.name = rows[0].name; + return rows[0].name; } chan.registered = true; diff --git a/server.js b/server.js index 8a8d2efc..942185dd 100644 --- a/server.js +++ b/server.js @@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -const VERSION = "1.1.1"; +const VERSION = "1.1.2"; var fs = require("fs"); var Logger = require("./logger.js"); @@ -49,6 +49,7 @@ exports.io.sockets.on("connection", function(socket) { }); + process.on("uncaughtException", function(err) { Logger.errlog.log("[SEVERE] Uncaught Exception: " + err); }); @@ -57,6 +58,7 @@ process.on("exit", shutdown); process.on("SIGINT", shutdown); + function shutdown() { Logger.syslog.log("Unloading channels..."); for(var name in exports.channels) {