Compare commits
5 Commits
f7cf497ded
...
be8691ce6d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
be8691ce6d | ||
![]() |
d5d5d72bad | ||
![]() |
aa671a332b | ||
![]() |
b56a0c4591 | ||
![]() |
bf39147538 |
@ -31,5 +31,5 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
|
|||||||
|
|
||||||
call.succ({prize})
|
call.succ({prize})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['yuandan']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -32,5 +32,5 @@ export default async function (call: ApiCall<ReqDZRec, ResDZRec>) {
|
|||||||
|
|
||||||
call.succ({[gift.id]: prize})
|
call.succ({[gift.id]: prize})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['yuandan']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ export default async function (call: ApiCall<ReqExchange, ResExchange>) {
|
|||||||
|
|
||||||
call.succ({})
|
call.succ({})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['yuandan']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,9 @@ export default async function (call: ApiCall<ReqTaskRec, ResTaskRec>) {
|
|||||||
|
|
||||||
await PlayerFun.sendPrize(call, _prize);
|
await PlayerFun.sendPrize(call, _prize);
|
||||||
let changedata = { data: _mydata, prize: _prize}
|
let changedata = { data: _mydata, prize: _prize}
|
||||||
// 推送红点
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
|
||||||
call.succ(changedata);
|
call.succ(changedata);
|
||||||
|
|
||||||
|
// 推送红点
|
||||||
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
@ -40,5 +40,5 @@ export default async function (call: ApiCall<ReqZLRec, ResZLRec>) {
|
|||||||
|
|
||||||
call.succ({[call.req.id]: prize})
|
call.succ({[call.req.id]: prize})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['yuandan']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export class Yuandanfun {
|
|||||||
exchange: {},
|
exchange: {},
|
||||||
taskfinish: [],
|
taskfinish: [],
|
||||||
taskval: await this.getTaskVal(call),
|
taskval: await this.getTaskVal(call),
|
||||||
qiandaoTime: data?.qiandaoTime || 0,
|
qiandaoTime: data?.qiandaoTime || 1,
|
||||||
refreshTime: G.time
|
refreshTime: G.time
|
||||||
},
|
},
|
||||||
}, {upsert: true, returnDocument: 'after'})).value
|
}, {upsert: true, returnDocument: 'after'})).value
|
||||||
|
@ -349,7 +349,7 @@ export class HuoDongHongDianFun {
|
|||||||
ishd = await this.pobinglibao(call, element)
|
ishd = await this.pobinglibao(call, element)
|
||||||
}
|
}
|
||||||
if (element.htype == 14) {
|
if (element.htype == 14) {
|
||||||
// 检测 htype 10 破冰活动红点
|
// 检测 htype 10 元旦活动红点
|
||||||
ishd = await this.yuandan(call, element)
|
ishd = await this.yuandan(call, element)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ export class HuoDongHongDianFun {
|
|||||||
_res.show = true
|
_res.show = true
|
||||||
_res.val.hdid.push(element.hdid)
|
_res.val.hdid.push(element.hdid)
|
||||||
if (_res.val.htype.indexOf(element.htype) == -1) _res.val.htype.push(element.htype)
|
if (_res.val.htype.indexOf(element.htype) == -1) _res.val.htype.push(element.htype)
|
||||||
_res.val.hdxq[element.stype] = ishd
|
_res.val.hdxq[element.hdid] = ishd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _res;
|
return _res;
|
||||||
@ -392,16 +392,15 @@ export class HuoDongHongDianFun {
|
|||||||
|
|
||||||
if (data?.gameNum < _hd.data.gamefree) return {show: true}
|
if (data?.gameNum < _hd.data.gamefree) return {show: true}
|
||||||
|
|
||||||
if (!PublicShared.chkSameDate(data?.qiandaoTime || 0, G.time)) {
|
if (!PublicShared.chkSameDate(data?.qiandaoTime || 1, G.time)) {
|
||||||
return {show: true}
|
return {show: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 1; i <= data.taskval.length; i++) {
|
for (const i in data.taskval) {
|
||||||
if (data?.taskval[i] >= _hd?.data?.task?.[i]?.pval && !data?.taskfinish.find(v => v == i + '')) {
|
if (data?.taskval[i] >= _hd?.data?.task?.[i]?.pval && !data?.taskfinish.find(v => v == i)) {
|
||||||
return {show: true}
|
return {show: true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {show: false}
|
return {show: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import {ApiCall} from "tsrpc";
|
||||||
import { ReqGetList, ResGetList } from "../../shared/protocols/peijian/PtlGetList";
|
import {ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
||||||
let _maxLv = 0
|
let _maxLv = 0
|
||||||
let color = {}
|
let color = {}
|
||||||
let peijianCon = G.gc.peijian
|
let peijianCon = G.gc.peijian
|
||||||
|
|
||||||
let dbList = (await G.mongodb.collection('peijian').find({ uid: call.uid }).toArray()).map(p => {
|
let dbList = (await G.mongodb.collection('peijian').find({uid: call.uid}).toArray()).map(p => {
|
||||||
let np = G.mongodb.conversionIdObj(p);
|
let np = G.mongodb.conversionIdObj(p);
|
||||||
let { uid, ...ops } = np;
|
let {uid, ...ops} = np;
|
||||||
|
|
||||||
if (np.lv > _maxLv) _maxLv = np.lv
|
if (np.lv > _maxLv) _maxLv = np.lv
|
||||||
if (!color[peijianCon[np.peijianId].colour]) color[peijianCon[np.peijianId].colour] = 0
|
if (!color[peijianCon[np.peijianId].colour]) color[peijianCon[np.peijianId].colour] = 0
|
||||||
@ -16,15 +16,25 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
|||||||
return ops;
|
return ops;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 修复配件穿戴在不存在的英雄身上
|
||||||
|
let heroIds = R.values(call.conn.gud.heroPos)
|
||||||
|
let fixIds = dbList.filter(i => i.wearId && !heroIds.includes(i.wearId)).map(i => G.mongodb.conversionId(i._id))
|
||||||
|
if (fixIds.length) {
|
||||||
|
await G.mongodb.collection('peijian').updateMany({_id: {$in: fixIds}}, {$set: {wearId: ''}})
|
||||||
|
}
|
||||||
|
|
||||||
// 记录玩家最大等级,颜色相关数据 注册任务用
|
// 记录玩家最大等级,颜色相关数据 注册任务用
|
||||||
await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({ uid: call.conn.uid, type: 'usertasklog' },
|
await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({uid: call.conn.uid, type: 'usertasklog'},
|
||||||
{ $set: { maxpeijianlv: _maxLv, peijiancolor: color } }, { upsert: true })
|
{$set: {maxpeijianlv: _maxLv, peijiancolor: color}}, {upsert: true})
|
||||||
|
|
||||||
let list = Object.fromEntries(dbList.map(p => [G.formatRedisKey(p._id), p]));
|
let list = Object.fromEntries(dbList.map(p => [G.formatRedisKey(p._id), p]));
|
||||||
G.redis.set('peijian', call.uid, list);
|
G.redis.set('peijian', call.uid, list);
|
||||||
|
|
||||||
let recLshd = await G.mongodb.collection('playerInfo', 'lshd_peijian').findOne({ uid: call.conn.uid, type: 'lshd_peijian' });
|
let recLshd = await G.mongodb.collection('playerInfo', 'lshd_peijian').findOne({
|
||||||
let { uid, _id, type, ...peijians } = (recLshd || {});
|
uid: call.conn.uid,
|
||||||
|
type: 'lshd_peijian'
|
||||||
|
});
|
||||||
|
let {uid, _id, type, ...peijians} = (recLshd || {});
|
||||||
|
|
||||||
call.conn.lshd.peijian = peijians || {};
|
call.conn.lshd.peijian = peijians || {};
|
||||||
call.succ({
|
call.succ({
|
||||||
|
@ -55,7 +55,7 @@ export type hongdianKey =
|
|||||||
| 'pobinglibao'
|
| 'pobinglibao'
|
||||||
| 'payForDiamond'
|
| 'payForDiamond'
|
||||||
| 'leichonglibao'
|
| 'leichonglibao'
|
||||||
| 'yuandan';
|
|
||||||
export type hongdianVal = {
|
export type hongdianVal = {
|
||||||
show?: boolean;
|
show?: boolean;
|
||||||
// 看功能需要
|
// 看功能需要
|
||||||
|
Loading…
Reference in New Issue
Block a user