Merge branch 'fix/conglinshoulie' into dev
This commit is contained in:
commit
26fd486595
@ -19,9 +19,10 @@ export default async function (call: ApiCall<ReqFindEnemy, ResFindEnemy>) {
|
|||||||
// 在自定范围内随机一个对手
|
// 在自定范围内随机一个对手
|
||||||
let others = await G.mongodb.collection("clslCrossUser").aggregate([
|
let others = await G.mongodb.collection("clslCrossUser").aggregate([
|
||||||
{
|
{
|
||||||
$match: [
|
$match: {
|
||||||
{ allStar: { $gte: starConf.fighter[0], $lte: starConf.fighter[1] } }
|
allStar: { $gte: starConf.fighter[0], $lte: starConf.fighter[1] }
|
||||||
],
|
}
|
||||||
|
}, {
|
||||||
$sample: { size: 1 }
|
$sample: { size: 1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,14 +16,7 @@ export default async function (call: ApiCall<ReqUpLoad, ResUpLoad>) {
|
|||||||
{ upsert: true, returnDocument: "after" }
|
{ upsert: true, returnDocument: "after" }
|
||||||
)).value;
|
)).value;
|
||||||
|
|
||||||
let week = PublicShared.getToWeek();
|
if (a.group){ // 分完组之后就可以更新排行榜了
|
||||||
let group_time = G.gc.clsl_com.divideTime;
|
|
||||||
let week_zero_time = PublicShared.getToWeekMondayZeroTime();
|
|
||||||
|
|
||||||
if (G.time > week_zero_time + group_time) {
|
|
||||||
if (!a.group){
|
|
||||||
|
|
||||||
}
|
|
||||||
if (allStar != undefined && ops.info) {
|
if (allStar != undefined && ops.info) {
|
||||||
let rank;
|
let rank;
|
||||||
if (Rank.list[`clslCross_${a.group}`]) {
|
if (Rank.list[`clslCross_${a.group}`]) {
|
||||||
|
@ -56,7 +56,7 @@ export default async function (call: ApiCall<ReqFind, ResFind>) {
|
|||||||
let content = G.gc.clsl_com.email_dan.content;
|
let content = G.gc.clsl_com.email_dan.content;
|
||||||
G.gc.clsl_com.danPrize.forEach(conf => {
|
G.gc.clsl_com.danPrize.forEach(conf => {
|
||||||
// 段位未达到 或者 奖励已经发放
|
// 段位未达到 或者 奖励已经发放
|
||||||
if (conf.star > curMaxStar || danPrize.includes[conf.star]) {
|
if (conf.star > curMaxStar || danPrize.includes(conf.star)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +67,7 @@ export default async function (call: ApiCall<ReqFind, ResFind>) {
|
|||||||
title: title,
|
title: title,
|
||||||
content: content,
|
content: content,
|
||||||
prize: conf.prize,
|
prize: conf.prize,
|
||||||
|
contentInsertArr:[conf.title]
|
||||||
})
|
})
|
||||||
|
|
||||||
danPrize.push(conf.star);
|
danPrize.push(conf.star);
|
||||||
|
@ -19,6 +19,12 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
|||||||
buyFightNum: 0
|
buyFightNum: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 隔周刷新星级
|
||||||
|
if(ops?.refreshTime < PublicShared.getToWeekMondayZeroTime()){
|
||||||
|
change.allStar = 0;
|
||||||
|
change.curMaxStar = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(ops, change);
|
Object.assign(ops, change);
|
||||||
|
|
||||||
clslDb().updateOne({ uid: call.uid, type: 'clsl' }, { $set: change }, { upsert: true });
|
clslDb().updateOne({ uid: call.uid, type: 'clsl' }, { $set: change }, { upsert: true });
|
||||||
|
@ -32,13 +32,13 @@
|
|||||||
],
|
],
|
||||||
//段位奖励
|
//段位奖励
|
||||||
danPrize: [
|
danPrize: [
|
||||||
{ star: 49, prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '631', n:3 },{ a: 'item', t: '40', n:1 }] },
|
{ star: 49, title: "clsl_7", prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '631', n:3 },{ a: 'item', t: '40', n:1 }] },
|
||||||
{ star: 39, prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:2 }] },
|
{ star: 39, title: "clsl_6", prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:2 }] },
|
||||||
{ star: 29, prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:1 }] },
|
{ star: 29, title: "clsl_5", prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:1 }] },
|
||||||
{ star: 21, prize: [{ a: 'item', t: '606', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:1000 }] },
|
{ star: 21, title: "clsl_4", prize: [{ a: 'item', t: '606', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:1000 }] },
|
||||||
{ star: 13, prize: [{ a: 'item', t: '606', n:1 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:800 }] },
|
{ star: 13, title: "clsl_3", prize: [{ a: 'item', t: '606', n:1 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:800 }] },
|
||||||
{ star: 7, prize: [{ a: 'item', t: '29', n:10 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:600 }] },
|
{ star: 7, title: "clsl_2", prize: [{ a: 'item', t: '29', n:10 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:600 }] },
|
||||||
{ star: 0, prize: [{ a: 'item', t: '29', n:5 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:400 }] }
|
{ star: 0, title: "clsl_1", prize: [{ a: 'item', t: '29', n:5 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:400 }] }
|
||||||
],
|
],
|
||||||
//王者排名邮件信息
|
//王者排名邮件信息
|
||||||
email_rank: {
|
email_rank: {
|
||||||
|
@ -44,9 +44,13 @@ export class SchedulerClslLocalCtor extends Scheduler {
|
|||||||
*/
|
*/
|
||||||
export class SchedulerClslCrossCtor extends Scheduler {
|
export class SchedulerClslCrossCtor extends Scheduler {
|
||||||
id: schedulerType = 'clsl_cross_group';
|
id: schedulerType = 'clsl_cross_group';
|
||||||
|
|
||||||
|
num: number = 2;
|
||||||
|
|
||||||
|
type: 'day' | 'week' = 'week';
|
||||||
time = G.gc.clsl_com.divideTime;
|
time = G.gc.clsl_com.divideTime;
|
||||||
name = '丛林猎手赛季区间划分 周四00:00';
|
name = '丛林猎手赛季区间划分 周四00:00';
|
||||||
type: 'day' | 'week' = 'week';
|
|
||||||
star = Object.values(G.gc.clsl_dan).slice(-1)[0].allStar;
|
star = Object.values(G.gc.clsl_dan).slice(-1)[0].allStar;
|
||||||
|
|
||||||
async read() {
|
async read() {
|
||||||
@ -69,16 +73,16 @@ export class SchedulerClslCrossCtor extends Scheduler {
|
|||||||
|
|
||||||
// 每100个玩家划分一个区间
|
// 每100个玩家划分一个区间
|
||||||
let groups: { [group: string]: { st: number, et: number, users: string[] } } = {};
|
let groups: { [group: string]: { st: number, et: number, users: string[] } } = {};
|
||||||
for (let i = 0; i < wzusers.length / 100; i++) {
|
for (let i = 0; i < wzusers.length / this.num; i++) {
|
||||||
groups['group' + i] = {
|
groups['group' + i] = {
|
||||||
st: wzusers[i * 100].info.player.cTime,
|
st: wzusers[i * this.num].info.player.cTime,
|
||||||
et: wzusers[(i + 1) * 100 - 1].info.player.cTime,
|
et: wzusers[(i + 1) * this.num - 1].info.player.cTime,
|
||||||
users: wzusers.slice(i * 100, (i + 1) * 100).map(u => u.uid),
|
users: wzusers.slice(i * this.num, (i + 1) * this.num).map(u => u.uid),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 剩余玩家
|
// 剩余玩家
|
||||||
let remaining_users = [].concat(wzusers.slice((wzusers.length / 100) * 100)); // 王者剩余玩家
|
let remaining_users = [].concat(wzusers.slice((wzusers.length / this.num) * this.num)); // 王者剩余玩家
|
||||||
remaining_users = remaining_users.concat(users.filter(u => u.allStar < this.star)); // 非王者剩余玩家
|
remaining_users = remaining_users.concat(users.filter(u => u.allStar < this.star)); // 非王者剩余玩家
|
||||||
for (let i = 0; i < remaining_users.length; i++) {
|
for (let i = 0; i < remaining_users.length; i++) {
|
||||||
for (let group in groups) {
|
for (let group in groups) {
|
||||||
@ -97,7 +101,11 @@ export class SchedulerClslCrossCtor extends Scheduler {
|
|||||||
await G.mongodb.collection("clslCrossGroup").updateOne({ week: week }, { $set: { groups: groups } }, { upsert: true });
|
await G.mongodb.collection("clslCrossGroup").updateOne({ week: week }, { $set: { groups: groups } }, { upsert: true });
|
||||||
|
|
||||||
// 初始化丛林猎手排行榜
|
// 初始化丛林猎手排行榜
|
||||||
await RankClslCrossInit()
|
G.mongodb.collection('clslCrossUser').find({allStar:{$gte:this.star}}).toArray().then(users=>{
|
||||||
|
users.forEach(u=>{
|
||||||
|
new RankClslCross(u.group).addNew({valArr:[u.allStar, u.info.player.power], player:u.info, roles:u.info.roles})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
await this.record();
|
await this.record();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { GanHaiRed } from './api_s2c/ganhai/ApiOpen';
|
|||||||
import { FriendManage } from './public/friend/manage';
|
import { FriendManage } from './public/friend/manage';
|
||||||
import { GHManage } from './public/gonghui/manage';
|
import { GHManage } from './public/gonghui/manage';
|
||||||
import { JJCFun } from './public/jjc';
|
import { JJCFun } from './public/jjc';
|
||||||
import { RankClslCross } from './public/rank/rank_clsl';
|
import { RankClslCross, RankClslCrossInit } from './public/rank/rank_clsl';
|
||||||
//import { RankHbzbJfsCross, RankHbzbJfsLocal, RankHbzbZbsCross } from './public/rank/rank_hbzb_jfs';
|
//import { RankHbzbJfsCross, RankHbzbJfsLocal, RankHbzbZbsCross } from './public/rank/rank_hbzb_jfs';
|
||||||
import { RankKbzz } from './public/rank/rank_kbzz';
|
import { RankKbzz } from './public/rank/rank_kbzz';
|
||||||
import { RankPower } from './public/rank/rank_power';
|
import { RankPower } from './public/rank/rank_power';
|
||||||
@ -104,18 +104,19 @@ export async function startAfter() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else if (G.argv.serverType == 'cross') {
|
} else if (G.argv.serverType == 'cross') {
|
||||||
|
|
||||||
RankKbzz.init();
|
RankKbzz.init();
|
||||||
new RankClslCross();
|
RankClslCrossInit();
|
||||||
// new RankHbzbJfsCross().loadAllPlayer();
|
|
||||||
// new RankHbzbZbsCross();
|
|
||||||
new RankWzryCross();
|
new RankWzryCross();
|
||||||
|
|
||||||
new SchedulerKbzzGroup().init();
|
new SchedulerKbzzGroup().init();
|
||||||
new Scheduler_hbzb_zbs_cross_clear().init();
|
|
||||||
//new Scheduler_hbzb_corss_reset();
|
new SchedulerClslPrize().init();
|
||||||
new Scheduler_hbzb_zbs_cross_group().init();
|
|
||||||
new SchedulerClslCrossCtor().init();
|
new SchedulerClslCrossCtor().init();
|
||||||
|
new SchedulerClslLocalCtor ().init();
|
||||||
|
|
||||||
|
new Scheduler_hbzb_zbs_cross_clear().init();
|
||||||
|
new Scheduler_hbzb_zbs_cross_group().init();
|
||||||
|
|
||||||
new SchedulerWzryDlDstart().init();
|
new SchedulerWzryDlDstart().init();
|
||||||
new SchedulerWzryDlDjinji().init();
|
new SchedulerWzryDlDjinji().init();
|
||||||
new SchedulerWzryZuanshiOne().init();
|
new SchedulerWzryZuanshiOne().init();
|
||||||
|
Loading…
Reference in New Issue
Block a user