From 4937dca98eb53406c5e79eec1253ca03da28e5a7 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 1 Aug 2013 16:11:11 -0400 Subject: [PATCH] Ceil voteskip requirement instead of truncating --- channel.js | 4 ++-- package.json | 2 +- server.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/channel.js b/channel.js index 9d0a32ee..5558ca75 100644 --- a/channel.js +++ b/channel.js @@ -965,7 +965,7 @@ Channel.prototype.broadcastChatFilters = function() { Channel.prototype.broadcastVoteskipUpdate = function() { var amt = this.voteskip ? this.voteskip.counts[0] : 0; var count = this.users.length - this.afkers.length; - var need = this.voteskip ? parseInt(count * this.opts.voteskip_ratio) : 0; + var need = this.voteskip ? Math.ceil(count * this.opts.voteskip_ratio) : 0; for(var i = 0; i < this.users.length; i++) { if(Rank.hasPermission(this.users[i], "seeVoteskip") || this.leader == this.users[i]) { @@ -1563,7 +1563,7 @@ Channel.prototype.checkVoteskipPass = function () { return false; var count = this.users.length - this.afkers.length; - var need = parseInt(count * this.opts.voteskip_ratio); + var need = Math.ceil(count * this.opts.voteskip_ratio); if(this.server.cfg["debug"]) { console.log("afkers=", this.afkers.length); console.log("users =", this.users.length); diff --git a/package.json b/package.json index 2d5703dc..0aaf3ede 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "2.2.2", + "version": "2.2.3", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/server.js b/server.js index 5ba38b12..34dffed7 100644 --- a/server.js +++ b/server.js @@ -6,7 +6,7 @@ var Logger = require("./logger"); var Channel = require("./channel"); var User = require("./user"); -const VERSION = "2.2.2"; +const VERSION = "2.2.3"; function getIP(req) { var raw = req.connection.remoteAddress;