mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 07:27:07 +02:00
feat(users): not to be idle if user have 'roam' medal
This commit is contained in:
8
config/env/torrents.js
vendored
8
config/env/torrents.js
vendored
@@ -480,6 +480,7 @@ module.exports = {
|
||||
* @activeMoreScorePerDay: idle more than one day need extra score
|
||||
* @activeMoreScorePerLevel: idle each level need extra score
|
||||
* @notIdleSafeLevel: safe lavel, more than this level account not to be idle status
|
||||
* @unIdleMedalName: if user has these medal, the account do not to be idle status, value must be a Array
|
||||
*/
|
||||
sign: {
|
||||
openSignup: true,
|
||||
@@ -498,7 +499,8 @@ module.exports = {
|
||||
activeIdleAccountBasicScore: 50000,
|
||||
activeMoreScorePerDay: 100,
|
||||
activeMoreScorePerLevel: 1000,
|
||||
notIdleSafeLevel: 30
|
||||
notIdleSafeLevel: 30,
|
||||
unIdleMedalName: ['roam']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1394,7 +1396,7 @@ module.exports = {
|
||||
* @noticeMsg: notice translate string show at top of home
|
||||
* @noticeShowAt: notice begin time to show
|
||||
* @timeFormats: time string format
|
||||
* @exceptExaminationMedalName: except examination user must have medal name of 'noExamination'
|
||||
* @exceptExaminationMedalName: except examination user must have medal name of 'noExamination', value must is a Array
|
||||
* @detailUrl: detail info of examination, maybe a forum link url
|
||||
* ------------------------------------------------------------------------------
|
||||
* !IMPORTANT NOTE:
|
||||
@@ -1417,7 +1419,7 @@ module.exports = {
|
||||
noticeShowAt: '2018-01-28 00:00:00',
|
||||
timeFormats: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
exceptExaminationMedalName: 'noExamination',
|
||||
exceptExaminationMedalName: ['noExamination'],
|
||||
detailUrl: '/forums/595c4491d5706705f67d93cf/59684780f928f42a9c79c613'
|
||||
},
|
||||
|
||||
|
||||
@@ -322,19 +322,21 @@ function checkUserAccountIdleStatus() {
|
||||
|
||||
User.find({
|
||||
status: 'normal',
|
||||
isVip: false,
|
||||
isOper: false,
|
||||
isAdmin: false,
|
||||
last_signed: {$lt: Date.now() - signConfig.idle.accountIdleForTime},
|
||||
score: {$lt: safeScore}
|
||||
score: {$lt: safeScore},
|
||||
medal: {$nin: signConfig.idle.unIdleMedalName}
|
||||
}).exec(function (err, users) {
|
||||
if (users) {
|
||||
users.forEach(function (u) {
|
||||
if (!u.isOper && !u.isVip) {
|
||||
u.update({
|
||||
$set: {
|
||||
status: 'idle',
|
||||
last_idled: u.last_signed
|
||||
}
|
||||
}).exec();
|
||||
}
|
||||
u.update({
|
||||
$set: {
|
||||
status: 'idle',
|
||||
last_idled: u.last_signed
|
||||
}
|
||||
}).exec();
|
||||
});
|
||||
mtDebug.debugGreen('checkUserAccountIdleStatus: ' + users.length + ' users!');
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ exports.initExaminationData = function (req, res) {
|
||||
isVip: false,
|
||||
isOper: false,
|
||||
isAdmin: false,
|
||||
medals: {$nin: [examinationConfig.exceptExaminationMedalName]}
|
||||
medals: {$nin: examinationConfig.exceptExaminationMedalName}
|
||||
}, {examinationData: exami}, {multi: true}, function (err, num) {
|
||||
if (err) {
|
||||
return res.status(422).send({
|
||||
|
||||
Reference in New Issue
Block a user