Merge remote-tracking branch 'origin/bugfix' into bugfix

This commit is contained in:
dy 2023-12-28 13:39:54 +08:00
commit 053ab1ab23
2 changed files with 34 additions and 11 deletions

View File

@ -38,9 +38,7 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
}
// XstaskFun.delTask(call.uid, task._id);
XstaskFun.changeInfo(call.uid, change);
await PlayerFun.sendPrize(call, taskConf.prize);
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
if (!tequan) {
prizeArr.push(...taskConf.prize)
} else {
@ -50,6 +48,7 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
}
// prizeArr.push(...taskConf.prize)
}
if (prizeArr.length > 0) await PlayerFun.sendPrize(call, prizeArr);
call.succ({
taskList: await XstaskFun.getAllTask(call.uid),
prize: PublicShared.mergePrize(prizeArr)

View File

@ -1,8 +1,9 @@
import { Scheduler, schedulerType } from './scheduler';
import {PublicShared} from "../../shared/public/public";
import {Wjjl} from "../../module/collection_wjjl";
import {ZhanLingTasks} from "../zhanling";
import { PublicShared } from "../../shared/public/public";
import { Wjjl } from "../../module/collection_wjjl";
import { ZhanLingTasks } from "../zhanling";
import { setGud } from '../gud';
import { EmailFun } from '../email';
export class SchedulerNewDayLocalCtor extends Scheduler {
@ -23,8 +24,8 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
async start() {
let users = Object.values(G.server.uid_connections)
if(users.length) {
for (let item of users){
if (users.length) {
for (let item of users) {
let gud = item.gud
let add: k_v<any> = {};
//每天首次登陆
@ -36,23 +37,46 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
if (gud.logoutTime && PublicShared.getToWeekMondayZeroTime(gud.logoutTime) < PublicShared.getToWeekMondayZeroTime(G.time)) {
ZhanLingTasks.clearLog(gud.uid, 'week');
}
G.emit('FIRST_LOGIN_EVERY_DAY', gud, G.time - 24 * 3600, G.time);
G.emit('FIRST_LOGIN_EVERY_DAY', gud, gud.loginTime, G.time);
}
gud.loginTime = G.time;
add.loginTime = G.time;
if (Object.keys(add).length > 0) {
G.mongodb.collection('user').updateOne({ bindUid: gud.bindUid,sid:gud.sid }, {
G.mongodb.collection('user').updateOne({ bindUid: gud.bindUid, sid: gud.sid }, {
$set: {
...add
}
});
setGud(gud.uid,add);
setGud(gud.uid, add);
}
G.server.sendMsgByUid(gud.uid, 'msg_s2c/PlayerChange', gud)
}
G.server.broadcastClusterMsg('msg_s2c/NewDay', {time: this.zeroTime});
G.server.broadcastClusterMsg('msg_s2c/NewDay', { time: this.zeroTime });
}
(async () => {
// 每周一,发放终身卡
if (PublicShared.getWeek(G.time) != 1) return;
let logs = await G.mongodb.collection("payLogNew").find(
{ key: "zhongshengka", del_time: { $exists: false } }, { projection: { _id: 0, } }
).toArray();
let con = G.gc.payEmail.zhongshenka.filter(e => e.day == 7)[0];
for (let i = 0; i < logs.length; i++) {
// 发送邮件
EmailFun.addEmail({
uid: logs[i].uid,
type: con.type,
title: con.title,
content: con.content,
contentInsertArr: [],
createTime: G.time,
prize:con.prize,
})
}
})()
}
}