|
|
@ -264,7 +264,8 @@ Currency.prototype.commands = function (data) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
// add currency
|
|
|
|
if (data[4] === 'add') { |
|
|
|
if(parseInt(data[5], 10) > 0 && data[6]) { |
|
|
@ -285,6 +286,7 @@ Currency.prototype.commands = function (data) { |
|
|
|
__self.adjust_currency('push', data[5], data[6]); |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
} |
|
|
|
|
|
|
|
// moderator commands
|
|
|
@ -594,9 +596,6 @@ Currency.prototype.query_rank = function(data, callback) { |
|
|
|
|
|
|
|
callback(ranks, total); |
|
|
|
}); |
|
|
|
|
|
|
|
var file = require('fs'); |
|
|
|
file.appendFile('./../logs/error-log.txt', sql+'\n', function(d){}); |
|
|
|
}; |
|
|
|
|
|
|
|
Currency.prototype.query_top = function (data, callback) { |
|
|
@ -738,6 +737,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
// trigger coin handout
|
|
|
|
function insert_coins() { |
|
|
|
__self.give_coins = __self.streaming; |
|
|
|
console.log('DATA - Inserting coins'); |
|
|
|
if (__self.give_coins) { |
|
|
|
var time = utils.make_interval(__self.give_coins_timer); |
|
|
|
if (time === 0) { |
|
|
@ -762,7 +762,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
} |
|
|
|
|
|
|
|
// execute query
|
|
|
|
__self.db.execute(sql, function () {}); |
|
|
|
__self.db.execute(sql, function () { console.log('DATA - Completed adding coins to ' + __self.viewer_list.length + ' viewers'); }); |
|
|
|
setTimeout(insert_coins, 1000); |
|
|
|
} else { |
|
|
|
setTimeout(insert_coins, time); |
|
|
@ -781,6 +781,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
if(name.charAt(0) === ':') name = name.slice(1); |
|
|
|
if (__self.viewer_list.indexOf(name) < 0 && __self.config.ignorelist.indexOf(name) < 0) { |
|
|
|
__self.viewer_list.push(name); |
|
|
|
console.log("[*ADD NAME*] "+name+" from /names"); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@ -794,6 +795,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
} |
|
|
|
if (__self.viewer_list.indexOf(viewer) < 0 && __self.config.ignorelist.indexOf(viewer) < 0) { |
|
|
|
__self.viewer_list.push(viewer); |
|
|
|
console.log("[*ADD NAME*] "+viewer+" from JOIN"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -807,6 +809,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
var viewer_idx = __self.viewer_list.indexOf(viewer); |
|
|
|
if (viewer_idx >= 0) { |
|
|
|
__self.viewer_list.splice(viewer_idx); |
|
|
|
console.log("[*DEL NAME*] "+viewer+" from PART"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -819,6 +822,7 @@ Currency.prototype.handout_coins = function () { |
|
|
|
} |
|
|
|
if (__self.viewer_list.indexOf(viewer) < 0 && __self.config.ignorelist.indexOf(viewer) < 0) { |
|
|
|
__self.viewer_list.push(viewer); |
|
|
|
console.log("[*ADD NAME*] "+viewer+" from CHAT"); |
|
|
|
} |
|
|
|
if (__self.active_list.indexOf(viewer) < 0) { |
|
|
|
__self.active_list.push(viewer); |
|
|
|