diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index 6db04dd..f62c238 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -3,17 +3,13 @@ import {ReqDMRec, ResDMRec} from "../../../shared/protocols/event/yuandan/PtlDMR import {HuoDongFun} from "../../../public/huodongfun"; import {PlayerFun} from "../../../public/player"; import {HongDianChange} from "../../hongdian/fun"; +import {PublicShared} from "../../../shared/public/public"; export default async function (call: ApiCall) { // 查询活动是否存在 let _hd = (await HuoDongFun.gethdList(call, 14))[0] if (!_hd) return call.errorCode(-1) - // 奖励不符合 - let toPrize = call.req.prize - let prize = _hd.data.game.find(i => i.a == toPrize?.a && i.t == toPrize?.t && i.n == toPrize?.n) - if (toPrize && !prize) return call.errorCode(-4) - // 扣除免费次数或相应货币 let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) let rec = data?.gameNum @@ -23,8 +19,9 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - if (prize) { - await PlayerFun.sendPrize(call, [prize]); + if (call.req.id) { + let prize = PublicShared.randomDropGroup(call.req.id, 1, _hd.data.game); + await PlayerFun.sendPrize(call, prize); } await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index cd4111e..0f18459 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -2,7 +2,7 @@ * 元旦达摩领奖 */ export type ReqDMRec = { - prize: { a: string, t: string, n: number } | null + id: string | null } export type ResDMRec = {} diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index f0d7d73..17478cc 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11403,37 +11403,14 @@ export const serviceProto: ServiceProto = { "properties": [ { "id": 0, - "name": "prize", + "name": "id", "type": { "type": "Union", "members": [ { "id": 0, "type": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "a", - "type": { - "type": "String" - } - }, - { - "id": 1, - "name": "t", - "type": { - "type": "String" - } - }, - { - "id": 2, - "name": "n", - "type": { - "type": "Number" - } - } - ] + "type": "String" } }, {