测试:添加战斗测试
This commit is contained in:
@@ -138,7 +138,22 @@ export class GachaHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
let userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { hope: hope.map(cur => { return { ...cur, hasGet: false } }) })
|
||||
let userGacha = await UserGachaModel.findByRole(roleId, gachaId);
|
||||
let { hope: userHope = []} = await refreshGacha(gameData.gacha.get(gachaId), userGacha);
|
||||
for (let { id, hid } of hope) {
|
||||
let curHope = userHope.find(cur => cur.id == id);
|
||||
if(curHope) {
|
||||
if(curHope.hasGet) {
|
||||
continue;
|
||||
} else {
|
||||
curHope.hid = hid;
|
||||
curHope.hasGet = false;
|
||||
}
|
||||
} else {
|
||||
userHope.push({ id, hid, hasGet: false })
|
||||
}
|
||||
}
|
||||
userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { hope: userHope });
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
gachaId,
|
||||
|
||||
@@ -256,6 +256,8 @@ export class ShopHandler {
|
||||
} else if (type == TASK_FUN_TYPE.ACHIEVEMENT) {
|
||||
await UserTaskModel.updateInfo(roleId, { achievementBox: [], achievementPoint: 0 });
|
||||
userTask = await removeHistoryTask(roleId, type, new Date(nowSeconds() * 1000 + 86400000));
|
||||
} else if (type == TASK_FUN_TYPE.PVP) {
|
||||
userTask = await removeHistoryTask(roleId, type, new Date(nowSeconds() * 1000 + 86400000));
|
||||
}
|
||||
|
||||
let curTask = await getCurTask(roleId, session);;
|
||||
|
||||
Reference in New Issue
Block a user