fix 配件
This commit is contained in:
parent
bf39147538
commit
b56a0c4591
@ -16,6 +16,13 @@ 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({uid: call.uid, _id: {$in: fixIds}}, {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})
|
||||||
@ -23,7 +30,10 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
|||||||
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({
|
||||||
|
uid: call.conn.uid,
|
||||||
|
type: 'lshd_peijian'
|
||||||
|
});
|
||||||
let {uid, _id, type, ...peijians} = (recLshd || {});
|
let {uid, _id, type, ...peijians} = (recLshd || {});
|
||||||
|
|
||||||
call.conn.lshd.peijian = peijians || {};
|
call.conn.lshd.peijian = peijians || {};
|
||||||
|
Loading…
Reference in New Issue
Block a user