Skip to content

Commit

Permalink
remove userplayers
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jun 20, 2016
1 parent a46b6b8 commit afa5e61
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
14 changes: 0 additions & 14 deletions store/buildSets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ module.exports = function buildSets(db, redis, cb) {
cb(err, t);
});
},
//users in this set have their matches added
"userPlayers": function(cb) {
db.select(['account_id']).from('players').whereNotNull('last_login').asCallback(function(err, docs) {
if (err) {
return cb(err);
}
var t = {};
docs.forEach(function(player) {
t[player.account_id] = true;
});
//console.log(t);
cb(err, t);
});
},
//users in this set are added to the trackedPlayers set
"donators": function(cb) {
db.select(['account_id']).from('players').where('cheese', '>', 0).asCallback(function(err, docs) {
Expand Down
9 changes: 1 addition & 8 deletions store/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ function getSets(redis, cb)
cb(err, JSON.parse(tps || "{}"));
});
},
"userPlayers": function(cb)
{
redis.get("userPlayers", function(err, ups)
{
cb(err, JSON.parse(ups || "{}"));
});
},
"donators": function(cb)
{
redis.get("donators", function(err, ds)
Expand Down Expand Up @@ -426,7 +419,7 @@ function insertMatch(db, redis, match, options, cb)
{
async.each(match.players, function(p, cb)
{
if (options.origin === "scanner" && match.lobby_type === 7 && p.account_id && p.account_id !== constants.anonymous_account_id && (p.account_id in options.userPlayers || (config.ENABLE_RANDOM_MMR_UPDATE && match.match_id % 3 === 0)))
if (options.origin === "scanner" && match.lobby_type === 7 && p.account_id && p.account_id !== constants.anonymous_account_id && config.ENABLE_RANDOM_MMR_UPDATE)
{
addToQueue(mQueue,
{
Expand Down
8 changes: 1 addition & 7 deletions svc/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var getData = utility.getData;
var generateJob = utility.generateJob;
var async = require('async');
var trackedPlayers;
var userPlayers;
var parallelism = config.SCANNER_PARALLELISM;
var PAGE_SIZE = 100;
buildSets(db, redis, function(err)
Expand Down Expand Up @@ -72,7 +71,6 @@ function start()
}
//set local vars
trackedPlayers = result.trackedPlayers;
userPlayers = result.userPlayers;
var arr = [];
var matchBuffer = {};
var completePages = {};
Expand Down Expand Up @@ -122,10 +120,7 @@ function start()
insert = true;
skipParse = false;
}
else if (match.players.some(function(p)
{
return (config.ENABLE_INSERT_ALL_MATCHES || p.account_id in userPlayers);
}))
else if (config.ENABLE_INSERT_ALL_MATCHES)
{
insert = true;
}
Expand All @@ -146,7 +141,6 @@ function start()
type: "api",
origin: "scanner",
cassandra: cassandra,
userPlayers: userPlayers,
skipParse: skipParse,
}, function(err)
{
Expand Down

0 comments on commit afa5e61

Please sign in to comment.