From 00804fa8c1a45022d9409bf45fc21a315b6c06df Mon Sep 17 00:00:00 2001 From: dy Date: Mon, 25 Dec 2023 13:48:18 +0800 Subject: [PATCH 01/26] =?UTF-8?q?init=20=E5=85=83=E6=97=A6=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMOpen.ts | 16 + src/api_s2c/event/yuandan/ApiDMRec.ts | 27 + src/api_s2c/event/yuandan/ApiDZOpen.ts | 17 + src/api_s2c/event/yuandan/ApiDZRec.ts | 27 + src/api_s2c/event/yuandan/ApiExchange.ts | 28 + src/api_s2c/event/yuandan/ApiExchangeOpen.ts | 10 + src/api_s2c/event/yuandan/ApiTaskFinish.ts | 40 + src/api_s2c/event/yuandan/ApiTaskOpen.ts | 0 src/api_s2c/event/yuandan/ApiZLOpen.ts | 16 + src/api_s2c/event/yuandan/ApiZLRec.ts | 27 + src/api_s2c/event/yuandan/fun.ts | 214 +++++ src/clusterUtils.ts | 6 +- src/module/collection_event.ts | 6 + src/public/pay.ts | 15 +- .../protocols/event/yuandan/PtlDMOpen.ts | 13 + .../protocols/event/yuandan/PtlDMRec.ts | 11 + .../protocols/event/yuandan/PtlDZOpen.ts | 16 + .../protocols/event/yuandan/PtlDZRec.ts | 10 + .../protocols/event/yuandan/PtlExchange.ts | 11 + .../event/yuandan/PtlExchangeOpen.ts | 12 + .../protocols/event/yuandan/PtlZLOpen.ts | 13 + .../protocols/event/yuandan/PtlZLRec.ts | 11 + .../protocols/event/zhoumolibao/PtlReceive.ts | 4 +- src/shared/protocols/hongdian/PtlGet.ts | 3 +- src/shared/protocols/serviceProto.ts | 764 ++++++++++++------ 25 files changed, 1048 insertions(+), 269 deletions(-) create mode 100644 src/api_s2c/event/yuandan/ApiDMOpen.ts create mode 100644 src/api_s2c/event/yuandan/ApiDMRec.ts create mode 100644 src/api_s2c/event/yuandan/ApiDZOpen.ts create mode 100644 src/api_s2c/event/yuandan/ApiDZRec.ts create mode 100644 src/api_s2c/event/yuandan/ApiExchange.ts create mode 100644 src/api_s2c/event/yuandan/ApiExchangeOpen.ts create mode 100644 src/api_s2c/event/yuandan/ApiTaskFinish.ts create mode 100644 src/api_s2c/event/yuandan/ApiTaskOpen.ts create mode 100644 src/api_s2c/event/yuandan/ApiZLOpen.ts create mode 100644 src/api_s2c/event/yuandan/ApiZLRec.ts create mode 100644 src/api_s2c/event/yuandan/fun.ts create mode 100644 src/shared/protocols/event/yuandan/PtlDMOpen.ts create mode 100644 src/shared/protocols/event/yuandan/PtlDMRec.ts create mode 100644 src/shared/protocols/event/yuandan/PtlDZOpen.ts create mode 100644 src/shared/protocols/event/yuandan/PtlDZRec.ts create mode 100644 src/shared/protocols/event/yuandan/PtlExchange.ts create mode 100644 src/shared/protocols/event/yuandan/PtlExchangeOpen.ts create mode 100644 src/shared/protocols/event/yuandan/PtlZLOpen.ts create mode 100644 src/shared/protocols/event/yuandan/PtlZLRec.ts diff --git a/src/api_s2c/event/yuandan/ApiDMOpen.ts b/src/api_s2c/event/yuandan/ApiDMOpen.ts new file mode 100644 index 0000000..c0c659a --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiDMOpen.ts @@ -0,0 +1,16 @@ +import {ApiCall} from "tsrpc"; +import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PayFun} from "../../../public/pay"; + +export default async function (call: ApiCall) { + let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) + + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + + let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) + + call.succ({ + record: data?.record || {} + }) +} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts new file mode 100644 index 0000000..d850556 --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -0,0 +1,27 @@ +import {ApiCall} from "tsrpc"; +import {ReqDMRec, ResDMRec} from "../../../shared/protocols/event/yuandan/PtlDMRec"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PlayerFun} from "../../../public/player"; +import {HongDianChange} from "../../hongdian/fun"; + +export default async function (call: ApiCall) { + // 查询活动是否有当前领奖的免费选项 + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) + if (!gift) return call.errorCode(-1) + + // 取奖励列表,判断是否有可领取奖励 + let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) + let rec = data?.record?.[call.req.id] + if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + + await PlayerFun.sendPrize(call, gift.prize); + + await G.mongodb.cEvent('yuandandamo').updateOne({uid: call.uid, type: 'yuandandamo'}, { + $inc: {[`record.${gift.id}`]: 1}, + }, {upsert: true}) + + call.succ({}) + + HongDianChange.sendChangeKey(call.uid, ['yuandan']); +} diff --git a/src/api_s2c/event/yuandan/ApiDZOpen.ts b/src/api_s2c/event/yuandan/ApiDZOpen.ts new file mode 100644 index 0000000..ae9a55a --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiDZOpen.ts @@ -0,0 +1,17 @@ +import {ApiCall} from "tsrpc"; +import {ReqDZOpen, ResDZOpen} from "../../../shared/protocols/event/yuandan/PtlDZOpen"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PayFun} from "../../../public/pay"; + +export default async function (call: ApiCall) { + let data = await G.mongodb.cEvent('yuandandingzhi').findOne({uid: call.uid, type: 'yuandandingzhi'}) + + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + + let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) + + call.succ({ + record: data?.record || {}, + buyLog: await PayFun.getPayLogs(call.uid, payIds) + }) +} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiDZRec.ts b/src/api_s2c/event/yuandan/ApiDZRec.ts new file mode 100644 index 0000000..9374b56 --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiDZRec.ts @@ -0,0 +1,27 @@ +import {ApiCall} from "tsrpc"; +import {ReqDZRec, ResDZRec} from "../../../shared/protocols/event/yuandan/PtlDZRec"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PlayerFun} from "../../../public/player"; +import {HongDianChange} from "../../hongdian/fun"; + +export default async function (call: ApiCall) { + // 查询活动是否有当前领奖的免费选项 + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) + if (!gift) return call.errorCode(-1) + + // 取奖励列表,判断是否有可领取奖励 + let data = await G.mongodb.cEvent('yuandandingzhi').findOne({uid: call.uid, type: 'yuandandingzhi'}) + let rec = data?.record?.[call.req.id] + if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + + await PlayerFun.sendPrize(call, gift.prize); + + await G.mongodb.cEvent('yuandandingzhi').updateOne({uid: call.uid, type: 'yuandandingzhi'}, { + $inc: {[`record.${gift.id}`]: 1}, + }, {upsert: true}) + + call.succ({}) + + HongDianChange.sendChangeKey(call.uid, ['yuandan']); +} diff --git a/src/api_s2c/event/yuandan/ApiExchange.ts b/src/api_s2c/event/yuandan/ApiExchange.ts new file mode 100644 index 0000000..1724dcd --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiExchange.ts @@ -0,0 +1,28 @@ +import {ApiCall} from "tsrpc"; +import {ReqExchange, ResExchange} from "../../../shared/protocols/event/yuandan/PtlExchange"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PlayerFun} from "../../../public/player"; +import {HongDianChange} from "../../hongdian/fun"; + +export default async function (call: ApiCall) { + // 查询活动是否有当前领奖的免费选项 + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) + if (!gift) return call.errorCode(-1) + + // 取奖励列表,判断是否有可领取奖励 + let data = await G.mongodb.cEvent('yuandanduihuan').findOne({uid: call.uid, type: 'yuandanduihuan'}) + let rec = data?.record?.[call.req.id] + if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + + await PlayerFun.sendPrize(call, gift.prize); + await PlayerFun.cutNeed(call, gift.prize) + + await G.mongodb.cEvent('yuandanduihuan').updateOne({uid: call.uid, type: 'yuandanduihuan'}, { + $inc: {[`record.${gift.id}`]: 1}, + }, {upsert: true}) + + call.succ({}) + + HongDianChange.sendChangeKey(call.uid, ['yuandan']); +} diff --git a/src/api_s2c/event/yuandan/ApiExchangeOpen.ts b/src/api_s2c/event/yuandan/ApiExchangeOpen.ts new file mode 100644 index 0000000..36910a4 --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiExchangeOpen.ts @@ -0,0 +1,10 @@ +import {ApiCall} from "tsrpc"; +import {ReqExchangeOpen, ResExchangeOpen} from "../../../shared/protocols/event/yuandan/PtlExchangeOpen"; + +export default async function (call: ApiCall) { + let data = await G.mongodb.cEvent('yuandanduihuan').findOne({uid: call.uid, type: 'yuandanduihuan'}) + + call.succ({ + record: data?.record || {}, + }) +} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiTaskFinish.ts b/src/api_s2c/event/yuandan/ApiTaskFinish.ts new file mode 100644 index 0000000..d0af2c9 --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiTaskFinish.ts @@ -0,0 +1,40 @@ +import { ApiCall } from "tsrpc"; +import { ReqTaskRec, ResTaskRec } from "../../../shared/protocols/event/christmas/PtlTaskRec"; +import {Christmasfun} from "./fun"; +import {HongDianChange} from "../../hongdian/fun"; +import {PlayerFun} from "../../../public/player"; + +export default async function (call: ApiCall) { + let initCon = await Christmasfun.getCon(call) + let taskid = call.req.taskid; + let _con = initCon[call.req.hdid].data.task[taskid]; + if (!_con) { + // 任务id 不存在 + return call.error('', { code: -1, message: globalThis.lng.yangchengmubiao_2 }) + } + let _mydata = await Christmasfun.getMyData(call, call.req.hdid) + if (_mydata.taskval[taskid] < _con.pval) { + // 任务未完成 + return call.error('', { code: -2, message: globalThis.lng.yangchengmubiao_3 }) + } + if (_mydata.taskfinish.includes(taskid)) { + // 任务已领取 + return call.error('', { code: -3, message: globalThis.lng.yangchengmubiao_4 }) + } + _mydata.taskfinish.push(taskid) + let _addval = _con.addval + let _setData = {} + _mydata["val"] += _addval + _setData["val"] = _mydata.val + _setData["taskfinish"] = _mydata.taskfinish + await Christmasfun.setMyData(call.uid, call.req.hdid, { $set: _setData }) + let _prize = _con.prize + + await PlayerFun.sendPrize(call, _prize); + let changedata = { mydata: _mydata, prize: _prize} + // 推送红点 + HongDianChange.sendChangeKey(call.uid, ['huodonghd']); + call.succ(changedata); + + +} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiTaskOpen.ts b/src/api_s2c/event/yuandan/ApiTaskOpen.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/api_s2c/event/yuandan/ApiZLOpen.ts b/src/api_s2c/event/yuandan/ApiZLOpen.ts new file mode 100644 index 0000000..ebbdc52 --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiZLOpen.ts @@ -0,0 +1,16 @@ +import {ApiCall} from "tsrpc"; +import {ReqZLOpen, ResZLOpen} from "../../../shared/protocols/event/yuandan/PtlZLOpen"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PayFun} from "../../../public/pay"; + +export default async function (call: ApiCall) { + let data = await G.mongodb.cEvent('yuandanzengli').findOne({uid: call.uid, type: 'yuandanzengli'}) + + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + + let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) + + call.succ({ + record: data?.record || {}, + }) +} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts new file mode 100644 index 0000000..27624bd --- /dev/null +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -0,0 +1,27 @@ +import {ApiCall} from "tsrpc"; +import {ReqZLRec, ResZLRec} from "../../../shared/protocols/event/yuandan/PtlZLRec"; +import {HuoDongFun} from "../../../public/huodongfun"; +import {PlayerFun} from "../../../public/player"; +import {HongDianChange} from "../../hongdian/fun"; + +export default async function (call: ApiCall) { + // 查询活动是否有当前领奖的免费选项 + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) + if (!gift) return call.errorCode(-1) + + // 取奖励列表,判断是否有可领取奖励 + let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) + let rec = data?.record?.[call.req.id] + if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + + await PlayerFun.sendPrize(call, gift.prize); + + await G.mongodb.cEvent('yuandandamo').updateOne({uid: call.uid, type: 'yuandandamo'}, { + $inc: {[`record.${gift.id}`]: 1}, + }, {upsert: true}) + + call.succ({}) + + HongDianChange.sendChangeKey(call.uid, ['yuandan']); +} diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts new file mode 100644 index 0000000..7ac4168 --- /dev/null +++ b/src/api_s2c/event/yuandan/fun.ts @@ -0,0 +1,214 @@ +import {ApiCall} from 'tsrpc'; +import {ReqAddHuoDong} from '../../../monopoly/protocols/PtlAddHuoDong'; +import {HuoDongFun} from '../../../public/huodongfun'; +import {christmas} from '../../../shared/protocols/event/christmas/PtlOpen'; +import {PublicShared} from '../../../shared/public/public'; +import {PlayerFun} from "../../../public/player"; + +export class Yuandanfun { + /**配置 */ + static async getCon(call: ApiCall) { + let _con: { [id: string]: ReqAddHuoDong } = {} + let _hd = await HuoDongFun.gethdList(call, 8) + for (let index = 0; index < _hd.length; index++) { + const element = _hd[index]; + if (element && element._id) delete element._id + _con[element.hdid] = element + } + return _con + } + + /**获取所有符合时间的活动 */ + static async gethdids(call: ApiCall) { + let _hdids = [] + let _hd = await HuoDongFun.gethdList(call, 8) + for (let index = 0; index < _hd.length; index++) { + const element = _hd[index]; + _hdids.push(element.hdid) + } + return _hdids + } + + /**获取我的数据 */ + static async getMyData(call: ApiCall, hdid: number) { + let db: any = await G.mongodb.cEvent(`christmas${hdid}`).findOne({ + uid: call.uid, + type: `christmas${hdid}`, + hdid: hdid + }); + if (!db) { + db = await this.initData(call, hdid) + await G.mongodb.cEvent(`christmas${hdid}`).updateOne( + {uid: call.uid, type: `christmas${hdid}`, hdid: hdid}, + {$set: db}, + {upsert: true} + ) + } + let {_id, ..._myData} = db + if (!PublicShared.chkSameDate(_myData.refresh, G.time)) { + // 刷新每日任务 + _myData = await this.refreTask(call, _myData, hdid) + + } + return _myData + } + + /**初始数据 */ + static async initData(call: ApiCall, hdid: number) { + let _initCon = await this.getCon(call) + let _con = _initCon[hdid] + let _r: christmas = { + type: `christmas${hdid}`, + uid: call.uid, + hdid: hdid, + taskval: await this.getTaskVal(call, hdid), + taskfinish: [], + refresh: G.time, + gamenum: 0, + pt: [], + gj: [], + pay: false, + select: {}, + val: 0, + qiandao: [], + libao: {} + } + return _r + } + + /**设置数据 */ + static async setMyData(uid: string, hdid: number, set: {}) { + await G.mongodb.cEvent(`christmas${hdid}`).updateOne( + {uid: uid, type: `christmas${hdid}`, hdid: hdid}, + set + ) + } + + /**获取所有taskid 及对应的值 */ + static async getTaskVal(call: ApiCall, hdid: number) { + let _initCon = await this.getCon(call) + let _tasks = _initCon[hdid].data.task + let _res = {} + for (let index = 0; index < Object.keys(_tasks).length; index++) { + const element = Object.keys(_tasks)[index]; + let _tmp = _tasks[element] + _tmp["id"] = element + // 每日登录直接完成 + if (element == "1") { + _res[element] = 1 + } else { + _res[element] = 0 + } + + + } + return _res + } + + /**刷新每日任务 */ + static async refreTask(call: ApiCall, mydata: christmas, hdid: number) { + let _initCon = await this.getCon(call) + let _con = _initCon[hdid].data.task + if (!_con) return mydata + mydata.taskfinish = [] + mydata.taskval = await this.getTaskVal(call, hdid) + mydata.refresh = G.time + mydata.gamenum = 0 + mydata.libao = {} + await this.setMyData(call.uid, hdid, { + $set: { + refresh: mydata.refresh, + taskfinish: mydata.taskfinish, + taskval: mydata.taskval, + gamenum: mydata.gamenum, + libao: mydata.libao + } + }) + return mydata + } + + static async payChristmas(payid, call: any) { + let _hd = await HuoDongFun.gethdList(call, 8) + for (let index = 0; index < _hd.length; index++) { + const hdinfo = _hd[index]; + const _hdid = hdinfo.hdid + if (payid == hdinfo.data.zlpayid) { + let _mydata = await Yuandanfun.getMyData(call, _hdid) + if (_mydata.pay) continue + await this.setMyData(call.uid, _hdid, {$set: {pay: true}}) + // let _prize = hdinfo.data.zlpayprize + // await PlayerFun.sendPrize(call, _prize); + } else { + const libaos = hdinfo.data.libao + for (let index = 0; index < Object.keys(libaos).length; index++) { + const lbid = Object.keys(libaos)[index]; + let _tmp = libaos[lbid] + if (_tmp['payid'] != payid) continue + let _mydata = await Yuandanfun.getMyData(call, _hdid) + let _buyNum = _mydata.libao[lbid] || 0 + if (_buyNum >= _tmp["buynum"]) continue + _mydata.libao[lbid] = _buyNum + 1 + this.setMyData(call.uid, _hdid, {$set: {libao: _mydata.libao}}) + let _select = _mydata.select[lbid] || {} + let _prize: atn[] = _tmp["basep"] + for (let key in _select) { + _prize.push(_tmp["dlz"][parseInt(key)][_select[key]]) + } + await PlayerFun.sendPrize(call, _prize); + break + + } + } + } + } + + + /**设置任务 */ + static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) { + let hdids = await this.gethdids(call) + if (hdids.length <= 0) return // 活动过期,不计数 + let _initCon = await this.getCon(call) + + for (let index = 0; index < hdids.length; index++) { + const hdid = hdids[index]; + // let _mydata = await Christmasfun.getMyData(call, hdid) + let _tasks = _initCon[hdid].data.task + + let _setData = { + $inc: {}, + $set: {} + } + let isset = 0 + for (let indextask = 0; indextask < Object.keys(_tasks).length; indextask++) { + const ele = Object.keys(_tasks)[indextask]; + // 具体任务配置 + let _taskCon = _tasks[ele] + if (_taskCon.stype != stype) continue + + let _pval = _taskCon.pval + // 不符合任务要求 + if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue + + // 根据需求改写 + val = await alchangeVal(call, _taskCon, val, arg) + + isset = 1 + if (isinc == 1) { // 累加 + _setData["$inc"][`taskval.${ele}`] = val + } else { + _setData["$set"][`taskval.${ele}`] = val + } + } + + // 设置任务 + if (isset == 1) { + await G.mongodb.collection('event').updateMany( + {uid: call.uid, type: {$regex: "christmas"}, hdid: parseInt(hdid)}, + _setData + ) + } + } + } + + +} diff --git a/src/clusterUtils.ts b/src/clusterUtils.ts index 05b3006..de15e84 100644 --- a/src/clusterUtils.ts +++ b/src/clusterUtils.ts @@ -44,10 +44,10 @@ export function clusterPublish(key: string, data: any) { * 在集群的N个进程中,只运行一次,在业务逻辑中也可使用 */ export function clusterRunOnce(fun) { - console.log(`${process.pid}环境变量pm_id===>${process.env.pm_id}`); + // console.log(`${process.pid}环境变量pm_id===>${process.env.pm_id}`); if (process.env.pm_id == null || process.env.pm_id === '0') { //非pm2启动的,或是pm2下启动的第一个进程 - console.log("run clusterRunOnce1 ===>", process.pid) + // console.log("run clusterRunOnce1 ===>", process.pid) fun(); return; } @@ -56,7 +56,7 @@ export function clusterRunOnce(fun) { if (firstPid == process.pid) { //pm2的其中一个进程 - console.log("run clusterRunOnce2 ===>", process.pid) + // console.log("run clusterRunOnce2 ===>", process.pid) fun(); return; } diff --git a/src/module/collection_event.ts b/src/module/collection_event.ts index 6e47a03..3e1418a 100644 --- a/src/module/collection_event.ts +++ b/src/module/collection_event.ts @@ -57,6 +57,11 @@ export type eventType = { payForDiamond: { [time: number]: number } + yuandandingzhi: ResOpenZhoumolibao & { refreshTime: number; }; + yuandanduihuan: ResOpenZhoumolibao & { refreshTime: number; }; + yuandandamo: ResOpenZhoumolibao & { refreshTime: number; }; + yuandanzengli: ResOpenZhoumolibao & { refreshTime: number; }; + } & { [k: `${number}jijin`]: ResOpenYuedujijin; [k: `yangchengmubiao${number}`]: yangchengmubiao; @@ -67,6 +72,7 @@ export type eventType = { [k: `leijichongzhi${number}`]: Omit; [k: `qiridenglu${number}`]: Pick; [k: `leichonglibao${number}`]: ResOpenLeiChongLiBao & { opentime: number }; + [k: `yuandan${number}`]: christmas; }; export type CollectionEvent = { diff --git a/src/public/pay.ts b/src/public/pay.ts index b1302b5..884798a 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -233,12 +233,21 @@ export class PayFun { prize.push(...conf.prize) } //圣诞节活动充值 - try{ + try { await Christmasfun.payChristmas(payId, call); - }catch (e) { - console.log("Christmasfun.payChristmas Error",e); + } catch (e) { + console.log("Christmasfun.payChristmas Error", e); } + /** + * 如果是自选奖励,payArgs里传入自选项,直接发奖 + * 在check里判断拦截自选项的奖励 + */ + if (payArgs.selectPrize) { + prize.push(...payArgs.selectPrize) + } + + let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs, player) if (isReplaceConf) { let prizePayId = `zuanshi_${conf.money}` diff --git a/src/shared/protocols/event/yuandan/PtlDMOpen.ts b/src/shared/protocols/event/yuandan/PtlDMOpen.ts new file mode 100644 index 0000000..0724ba5 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlDMOpen.ts @@ -0,0 +1,13 @@ + +/** + * 元旦达摩 + */ +export type ReqDMOpen = { + +}; + +export type ResDMOpen = { + record:{ + [k: string]: any; + } +}; \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts new file mode 100644 index 0000000..5aa6964 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -0,0 +1,11 @@ + +/** + * 元旦达摩领奖 + */ +export type ReqDMRec = { + id: string +} + +export type ResDMRec = { + +} diff --git a/src/shared/protocols/event/yuandan/PtlDZOpen.ts b/src/shared/protocols/event/yuandan/PtlDZOpen.ts new file mode 100644 index 0000000..ef0f7b2 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlDZOpen.ts @@ -0,0 +1,16 @@ + +/** + * 元旦定制 + */ +export type ReqDZOpen = { + +}; + +export type ResDZOpen = { + record:{ + [k: string]: any; + } + buyLog:{ + [k: string]: any; + } +}; \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlDZRec.ts b/src/shared/protocols/event/yuandan/PtlDZRec.ts new file mode 100644 index 0000000..1942987 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlDZRec.ts @@ -0,0 +1,10 @@ +/** + * 元旦定制领奖 + */ +export type ReqDZRec = { + id: string +} + +export type ResDZRec = { + +} diff --git a/src/shared/protocols/event/yuandan/PtlExchange.ts b/src/shared/protocols/event/yuandan/PtlExchange.ts new file mode 100644 index 0000000..25817f1 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlExchange.ts @@ -0,0 +1,11 @@ + +/** + * 元旦兑换领奖 + */ +export type ReqExchange = { + id: string +} + +export type ResExchange = { + +} diff --git a/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts b/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts new file mode 100644 index 0000000..ca3afad --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts @@ -0,0 +1,12 @@ +/** + * 元旦兑换 + */ +export type ReqExchangeOpen = { + +} + +export type ResExchangeOpen = { + record:{ + [k: string]: any; + } +} diff --git a/src/shared/protocols/event/yuandan/PtlZLOpen.ts b/src/shared/protocols/event/yuandan/PtlZLOpen.ts new file mode 100644 index 0000000..f8e1829 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlZLOpen.ts @@ -0,0 +1,13 @@ + +/** + * 元旦赠礼 + */ +export type ReqZLOpen = { + +}; + +export type ResZLOpen = { + record:{ + [k: string]: any; + } +}; \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlZLRec.ts b/src/shared/protocols/event/yuandan/PtlZLRec.ts new file mode 100644 index 0000000..3152d3a --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlZLRec.ts @@ -0,0 +1,11 @@ + +/** + * 元旦赠礼领奖 + */ +export type ReqZLRec = { + id: string +} + +export type ResZLRec = { + +} diff --git a/src/shared/protocols/event/zhoumolibao/PtlReceive.ts b/src/shared/protocols/event/zhoumolibao/PtlReceive.ts index 72a0c09..9652cb7 100644 --- a/src/shared/protocols/event/zhoumolibao/PtlReceive.ts +++ b/src/shared/protocols/event/zhoumolibao/PtlReceive.ts @@ -1,10 +1,10 @@ /** * 周末礼包领奖 */ -export interface ReqReceive { +export type ReqReceive = { id: string } -export interface ResReceive { +export type ResReceive = { } diff --git a/src/shared/protocols/hongdian/PtlGet.ts b/src/shared/protocols/hongdian/PtlGet.ts index 67ceb0d..2d661c0 100644 --- a/src/shared/protocols/hongdian/PtlGet.ts +++ b/src/shared/protocols/hongdian/PtlGet.ts @@ -54,7 +54,8 @@ export type hongdianKey = | 'zhoumolibao' | 'pobinglibao' | 'payForDiamond' - | 'leichonglibao'; + | 'leichonglibao' + | 'yuandan'; export type hongdianVal = { show?: boolean; // 看功能需要 diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 2afc7e8..9d4a22e 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -94,6 +94,14 @@ import { ReqRec as ReqRec_8, ResRec as ResRec_8 } from './event/yangchengmubiao/ import { ReqOpen as ReqOpen_26, ResOpen as ResOpen_26 } from './event/yibaichou/PtlOpen'; import { ReqRec as ReqRec_9, ResRec as ResRec_9 } from './event/yibaichou/PtlRec'; import { ReqRecAll, ResRecAll } from './event/yibaichou/PtlRecAll'; +import { ReqDMOpen, ResDMOpen } from './event/yuandan/PtlDMOpen'; +import { ReqDMRec, ResDMRec } from './event/yuandan/PtlDMRec'; +import { ReqDZOpen, ResDZOpen } from './event/yuandan/PtlDZOpen'; +import { ReqDZRec, ResDZRec } from './event/yuandan/PtlDZRec'; +import { ReqExchange, ResExchange } from './event/yuandan/PtlExchange'; +import { ReqExchangeOpen, ResExchangeOpen } from './event/yuandan/PtlExchangeOpen'; +import { ReqZLOpen, ResZLOpen } from './event/yuandan/PtlZLOpen'; +import { ReqZLRec, ResZLRec } from './event/yuandan/PtlZLRec'; import { ReqOpen as ReqOpen_27, ResOpen as ResOpen_27 } from './event/yuedujijin/PtlOpen'; import { ReqRec as ReqRec_10, ResRec as ResRec_10 } from './event/yuedujijin/PtlRec'; import { ReqBuyLv, ResBuyLv } from './event/zhanling/PtlBuyLv'; @@ -325,7 +333,7 @@ import { ReqRenownGetPrize, ResRenownGetPrize } from './user/PtlRenownGetPrize'; import { ReqRenownOpen, ResRenownOpen } from './user/PtlRenownOpen'; import { ReqTujian, ResTujian } from './user/PtlTujian'; import { ReqDecompose, ResDecompose } from './weixiuchang/PtlDecompose'; -import { ReqExchange, ResExchange } from './weixiuchang/PtlExchange'; +import { ReqExchange as ReqExchange_1, ResExchange as ResExchange_1 } from './weixiuchang/PtlExchange'; import { ReqOpen as ReqOpen_60, ResOpen as ResOpen_60 } from './weixiuchang/PtlOpen'; import { ReqUpLv, ResUpLv } from './weixiuchang/PtlUpLv'; import { ReqUpStar, ResUpStar } from './weixiuchang/PtlUpStar'; @@ -735,6 +743,38 @@ export interface ServiceType { req: ReqRecAll, res: ResRecAll }, + "event/yuandan/DMOpen": { + req: ReqDMOpen, + res: ResDMOpen + }, + "event/yuandan/DMRec": { + req: ReqDMRec, + res: ResDMRec + }, + "event/yuandan/DZOpen": { + req: ReqDZOpen, + res: ResDZOpen + }, + "event/yuandan/DZRec": { + req: ReqDZRec, + res: ResDZRec + }, + "event/yuandan/Exchange": { + req: ReqExchange, + res: ResExchange + }, + "event/yuandan/ExchangeOpen": { + req: ReqExchangeOpen, + res: ResExchangeOpen + }, + "event/yuandan/ZLOpen": { + req: ReqZLOpen, + res: ResZLOpen + }, + "event/yuandan/ZLRec": { + req: ReqZLRec, + res: ResZLRec + }, "event/yuedujijin/Open": { req: ReqOpen_27, res: ResOpen_27 @@ -1544,8 +1584,8 @@ export interface ServiceType { res: ResDecompose }, "weixiuchang/Exchange": { - req: ReqExchange, - res: ResExchange + req: ReqExchange_1, + res: ResExchange_1 }, "weixiuchang/Open": { req: ReqOpen_60, @@ -2164,6 +2204,46 @@ export const serviceProto: ServiceProto = { }, { "id": 95, + "name": "event/yuandan/DMOpen", + "type": "api" + }, + { + "id": 96, + "name": "event/yuandan/DMRec", + "type": "api" + }, + { + "id": 97, + "name": "event/yuandan/DZOpen", + "type": "api" + }, + { + "id": 98, + "name": "event/yuandan/DZRec", + "type": "api" + }, + { + "id": 99, + "name": "event/yuandan/Exchange", + "type": "api" + }, + { + "id": 100, + "name": "event/yuandan/ExchangeOpen", + "type": "api" + }, + { + "id": 101, + "name": "event/yuandan/ZLOpen", + "type": "api" + }, + { + "id": 102, + "name": "event/yuandan/ZLRec", + "type": "api" + }, + { + "id": 103, "name": "event/yuedujijin/Open", "type": "api", "conf": { @@ -2171,157 +2251,157 @@ export const serviceProto: ServiceProto = { } }, { - "id": 96, + "id": 104, "name": "event/yuedujijin/Rec", "type": "api" }, { - "id": 97, + "id": 105, "name": "event/zhanling/BuyLv", "type": "api" }, { - "id": 98, + "id": 106, "name": "event/zhanling/Open", "type": "api" }, { - "id": 99, + "id": 107, "name": "event/zhanling/RecPrize", "type": "api" }, { - "id": 100, + "id": 108, "name": "event/zhanling/RecTask", "type": "api" }, { - "id": 101, + "id": 109, "name": "event/zhoulibao/Open", "type": "api" }, { - "id": 102, + "id": 110, "name": "event/zhoumolibao/Open", "type": "api" }, { - "id": 103, + "id": 111, "name": "event/zhoumolibao/Receive", "type": "api" }, { - "id": 104, + "id": 112, "name": "event/zixuanlibao/Buy", "type": "api" }, { - "id": 105, + "id": 113, "name": "event/zixuanlibao/Open", "type": "api" }, { - "id": 106, + "id": 114, "name": "eventlist/hdGetList", "type": "api" }, { - "id": 107, + "id": 115, "name": "friend/Apply", "type": "api" }, { - "id": 108, + "id": 116, "name": "friend/Del", "type": "api" }, { - "id": 109, + "id": 117, "name": "friend/Gift", "type": "api" }, { - "id": 110, + "id": 118, "name": "friend/List", "type": "api" }, { - "id": 111, + "id": 119, "name": "friend/Open", "type": "api" }, { - "id": 112, + "id": 120, "name": "friend/Respond", "type": "api" }, { - "id": 113, + "id": 121, "name": "friend/RmBlackList", "type": "api" }, { - "id": 114, + "id": 122, "name": "friend/Search", "type": "api" }, { - "id": 115, + "id": 123, "name": "ganbutexun/Challenge", "type": "api" }, { - "id": 116, + "id": 124, "name": "ganbutexun/Open", "type": "api" }, { - "id": 117, + "id": 125, "name": "ganhai/Fast", "type": "api" }, { - "id": 118, + "id": 126, "name": "ganhai/Fight", "type": "api" }, { - "id": 119, + "id": 127, "name": "ganhai/Log", "type": "api" }, { - "id": 120, + "id": 128, "name": "ganhai/Open", "type": "api" }, { - "id": 121, + "id": 129, "name": "ganhai/Refresh", "type": "api" }, { - "id": 122, + "id": 130, "name": "ganhai/RefreshShip", "type": "api" }, { - "id": 123, + "id": 131, "name": "ganhai/Select", "type": "api" }, { - "id": 124, + "id": 132, "name": "gmapi/Gift", "type": "api" }, { - "id": 125, + "id": 133, "name": "gmapi/Post", "type": "api" }, { - "id": 126, + "id": 134, "name": "gonghui/Apply", "type": "api", "conf": { @@ -2331,7 +2411,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 127, + "id": 135, "name": "gonghui/ApplyAll", "type": "api", "conf": { @@ -2341,7 +2421,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 128, + "id": 136, "name": "gonghui/ApplyList", "type": "api", "conf": { @@ -2351,7 +2431,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 129, + "id": 137, "name": "gonghui/Change", "type": "api", "conf": { @@ -2361,12 +2441,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 130, + "id": 138, "name": "gonghui/Create", "type": "api" }, { - "id": 131, + "id": 139, "name": "gonghui/Dissolve", "type": "api", "conf": { @@ -2376,7 +2456,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 132, + "id": 140, "name": "gonghui/Exit", "type": "api", "conf": { @@ -2386,12 +2466,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 133, + "id": 141, "name": "gonghui/FbBuyNum", "type": "api" }, { - "id": 134, + "id": 142, "name": "gonghui/FbFight", "type": "api", "conf": { @@ -2401,7 +2481,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 135, + "id": 143, "name": "gonghui/FbOpen", "type": "api", "conf": { @@ -2411,17 +2491,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 136, + "id": 144, "name": "gonghui/GetList", "type": "api" }, { - "id": 137, + "id": 145, "name": "gonghui/Join", "type": "api" }, { - "id": 138, + "id": 146, "name": "gonghui/Jx", "type": "api", "conf": { @@ -2431,7 +2511,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 139, + "id": 147, "name": "gonghui/JxOpen", "type": "api", "conf": { @@ -2441,7 +2521,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 140, + "id": 148, "name": "gonghui/List", "type": "api", "conf": { @@ -2451,7 +2531,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 141, + "id": 149, "name": "gonghui/Manage", "type": "api", "conf": { @@ -2461,7 +2541,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 142, + "id": 150, "name": "gonghui/Open", "type": "api", "conf": { @@ -2471,7 +2551,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 143, + "id": 151, "name": "gonghui/TanHe", "type": "api", "conf": { @@ -2481,7 +2561,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 144, + "id": 152, "name": "gonghui/TaskOpen", "type": "api", "conf": { @@ -2491,7 +2571,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 145, + "id": 153, "name": "gonghui/TaskReceive", "type": "api", "conf": { @@ -2501,7 +2581,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 146, + "id": 154, "name": "gonghui/UpWz", "type": "api", "conf": { @@ -2511,137 +2591,137 @@ export const serviceProto: ServiceProto = { } }, { - "id": 147, + "id": 155, "name": "gonghuibaozang/Lottery", "type": "api" }, { - "id": 148, + "id": 156, "name": "gonghuibaozang/Open", "type": "api" }, { - "id": 149, + "id": 157, "name": "gonglukuangbiao/Buy", "type": "api" }, { - "id": 150, + "id": 158, "name": "gonglukuangbiao/Fight", "type": "api" }, { - "id": 151, + "id": 159, "name": "gonglukuangbiao/Open", "type": "api" }, { - "id": 152, + "id": 160, "name": "gonglukuangbiao/Refresh", "type": "api" }, { - "id": 153, + "id": 161, "name": "gongyu/mingdao/Active", "type": "api" }, { - "id": 154, + "id": 162, "name": "gongyu/mingdao/Open", "type": "api" }, { - "id": 155, + "id": 163, "name": "gongyu/mingdao/RecPrize", "type": "api" }, { - "id": 156, + "id": 164, "name": "gongyu/mingdao/Repair", "type": "api" }, { - "id": 157, + "id": 165, "name": "gongyu/xunlianjihua/Reset", "type": "api" }, { - "id": 158, + "id": 166, "name": "gongyu/xunlianjihua/UpSkill", "type": "api" }, { - "id": 159, + "id": 167, "name": "gongyu/zuozhanjihua/SetSkill", "type": "api" }, { - "id": 160, + "id": 168, "name": "hbzb/jfs/BuyNum", "type": "api" }, { - "id": 161, + "id": 169, "name": "hbzb/jfs/Fight", "type": "api" }, { - "id": 162, + "id": 170, "name": "hbzb/jfs/GetLog", "type": "api" }, { - "id": 163, + "id": 171, "name": "hbzb/jfs/Open", "type": "api" }, { - "id": 164, + "id": 172, "name": "hbzb/jfs/Rec", "type": "api" }, { - "id": 165, + "id": 173, "name": "hbzb/jfs/Refresh", "type": "api" }, { - "id": 166, + "id": 174, "name": "hbzb/GetStatus", "type": "api" }, { - "id": 167, + "id": 175, "name": "hbzb/zbs/BuyNum", "type": "api" }, { - "id": 168, + "id": 176, "name": "hbzb/zbs/Fight", "type": "api" }, { - "id": 169, + "id": 177, "name": "hbzb/zbs/GetLog", "type": "api" }, { - "id": 170, + "id": 178, "name": "hbzb/zbs/Open", "type": "api" }, { - "id": 171, + "id": 179, "name": "hbzb/zbs/Refresh", "type": "api" }, { - "id": 172, + "id": 180, "name": "hero/Awake", "type": "api" }, { - "id": 173, + "id": 181, "name": "hero/ChangePos", "type": "api", "conf": { @@ -2649,17 +2729,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 174, + "id": 182, "name": "hero/GetList", "type": "api" }, { - "id": 175, + "id": 183, "name": "hero/JinJie", "type": "api" }, { - "id": 176, + "id": 184, "name": "hero/LvUp", "type": "api", "conf": { @@ -2667,32 +2747,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 177, + "id": 185, "name": "hero/Potency", "type": "api" }, { - "id": 178, + "id": 186, "name": "hero/Rec", "type": "api" }, { - "id": 179, + "id": 187, "name": "hero/Reset", "type": "api" }, { - "id": 180, + "id": 188, "name": "hero/Talent", "type": "api" }, { - "id": 181, + "id": 189, "name": "hero/WeaponUp", "type": "api" }, { - "id": 182, + "id": 190, "name": "hongdian/Get", "type": "api", "conf": { @@ -2700,117 +2780,117 @@ export const serviceProto: ServiceProto = { } }, { - "id": 183, + "id": 191, "name": "item/GetList", "type": "api" }, { - "id": 184, + "id": 192, "name": "item/Use", "type": "api" }, { - "id": 185, + "id": 193, "name": "jiaotang/Lottery", "type": "api" }, { - "id": 186, + "id": 194, "name": "jiaotang/Open", "type": "api" }, { - "id": 187, + "id": 195, "name": "jiuba/Lottery", "type": "api" }, { - "id": 188, + "id": 196, "name": "jiuba/Open", "type": "api" }, { - "id": 189, + "id": 197, "name": "jjc/BuyFightNum", "type": "api" }, { - "id": 190, + "id": 198, "name": "jjc/Fight", "type": "api" }, { - "id": 191, + "id": 199, "name": "jjc/FightLog", "type": "api" }, { - "id": 192, + "id": 200, "name": "jjc/Open", "type": "api" }, { - "id": 193, + "id": 201, "name": "jjc/Receive", "type": "api" }, { - "id": 194, + "id": 202, "name": "jjc/Refresh", "type": "api" }, { - "id": 195, + "id": 203, "name": "kaifujingsai/Open", "type": "api" }, { - "id": 196, + "id": 204, "name": "kaifujingsai/Receive", "type": "api" }, { - "id": 197, + "id": 205, "name": "kbzz/Apply", "type": "api" }, { - "id": 198, + "id": 206, "name": "kbzz/AutoApply", "type": "api" }, { - "id": 199, + "id": 207, "name": "kbzz/BuyNum", "type": "api" }, { - "id": 200, + "id": 208, "name": "kbzz/Fight", "type": "api" }, { - "id": 201, + "id": 209, "name": "kbzz/FightLog", "type": "api" }, { - "id": 202, + "id": 210, "name": "kbzz/GroupState", "type": "api" }, { - "id": 203, + "id": 211, "name": "kbzz/Open", "type": "api" }, { - "id": 204, + "id": 212, "name": "kbzz/RecPrize", "type": "api" }, { - "id": 205, + "id": 213, "name": "kbzz/Refresh", "type": "api", "conf": { @@ -2818,287 +2898,287 @@ export const serviceProto: ServiceProto = { } }, { - "id": 206, + "id": 214, "name": "kuangdong/AddPkNum", "type": "api" }, { - "id": 207, + "id": 215, "name": "kuangdong/GetPrize", "type": "api" }, { - "id": 208, + "id": 216, "name": "kuangdong/KdInfo", "type": "api" }, { - "id": 209, + "id": 217, "name": "kuangdong/Log", "type": "api" }, { - "id": 210, + "id": 218, "name": "kuangdong/Open", "type": "api" }, { - "id": 211, + "id": 219, "name": "kuangdong/YanShi", "type": "api" }, { - "id": 212, + "id": 220, "name": "kuangdong/ZhanLing", "type": "api" }, { - "id": 213, + "id": 221, "name": "lingzhulaixi/Open", "type": "api" }, { - "id": 214, + "id": 222, "name": "lingzhulaixi/PkBoss", "type": "api" }, { - "id": 215, + "id": 223, "name": "lingzhulaixi/PkRank", "type": "api" }, { - "id": 216, + "id": 224, "name": "lingzhulaixi/SaoDang", "type": "api" }, { - "id": 217, + "id": 225, "name": "meirishilian/Buy", "type": "api" }, { - "id": 218, + "id": 226, "name": "meirishilian/Fight", "type": "api" }, { - "id": 219, + "id": 227, "name": "meirishilian/Open", "type": "api" }, { - "id": 220, + "id": 228, "name": "msg_c2s/BindUid", "type": "msg" }, { - "id": 221, + "id": 229, "name": "msg_c2s/Pay", "type": "msg" }, { - "id": 222, + "id": 230, "name": "msg_c2s/Sync", "type": "msg" }, { - "id": 223, + "id": 231, "name": "msg_s2c/Chat", "type": "msg" }, { - "id": 224, + "id": 232, "name": "msg_s2c/ChatHelp", "type": "msg" }, { - "id": 225, + "id": 233, "name": "msg_s2c/Collection", "type": "msg" }, { - "id": 226, + "id": 234, "name": "msg_s2c/Email", "type": "msg" }, { - "id": 227, + "id": 235, "name": "msg_s2c/EmailDel", "type": "msg" }, { - "id": 228, + "id": 236, "name": "msg_s2c/EquipChange", "type": "msg" }, { - "id": 229, + "id": 237, "name": "msg_s2c/Friend", "type": "msg" }, { - "id": 230, + "id": 238, "name": "msg_s2c/GhChange", "type": "msg" }, { - "id": 231, + "id": 239, "name": "msg_s2c/GongHuiBaoZang", "type": "msg" }, { - "id": 232, + "id": 240, "name": "msg_s2c/HeroChange", "type": "msg" }, { - "id": 233, + "id": 241, "name": "msg_s2c/HongDianChange", "type": "msg" }, { - "id": 234, + "id": 242, "name": "msg_s2c/ItemChange", "type": "msg" }, { - "id": 235, + "id": 243, "name": "msg_s2c/LoginQueue", "type": "msg" }, { - "id": 236, + "id": 244, "name": "msg_s2c/LshdChange", "type": "msg" }, { - "id": 237, + "id": 245, "name": "msg_s2c/NewDay", "type": "msg" }, { - "id": 238, + "id": 246, "name": "msg_s2c/OtherLogin", "type": "msg" }, { - "id": 239, + "id": 247, "name": "msg_s2c/PayChange", "type": "msg" }, { - "id": 240, + "id": 248, "name": "msg_s2c/PayResult", "type": "msg" }, { - "id": 241, + "id": 249, "name": "msg_s2c/PeijianChange", "type": "msg" }, { - "id": 242, + "id": 250, "name": "msg_s2c/PlayerChange", "type": "msg" }, { - "id": 243, + "id": 251, "name": "msg_s2c/Private", "type": "msg" }, { - "id": 244, + "id": 252, "name": "msg_s2c/PushGiftChange", "type": "msg" }, { - "id": 245, + "id": 253, "name": "msg_s2c/SendGift", "type": "msg" }, { - "id": 246, + "id": 254, "name": "msg_s2c/ShiwuChange", "type": "msg" }, { - "id": 247, + "id": 255, "name": "msg_s2c/TaskChange", "type": "msg" }, { - "id": 248, + "id": 256, "name": "msg_s2c/Xianshilibao", "type": "msg" }, { - "id": 249, + "id": 257, "name": "pata/Fight", "type": "api" }, { - "id": 250, + "id": 258, "name": "pata/GetPrize", "type": "api" }, { - "id": 251, + "id": 259, "name": "pata/Open", "type": "api" }, { - "id": 252, + "id": 260, "name": "pata/SaoDang", "type": "api" }, { - "id": 253, + "id": 261, "name": "pay/GetList", "type": "api" }, { - "id": 254, + "id": 262, "name": "peijian/GetList", "type": "api" }, { - "id": 255, + "id": 263, "name": "peijian/JingLian", "type": "api" }, { - "id": 256, + "id": 264, "name": "peijian/JinJie", "type": "api" }, { - "id": 257, + "id": 265, "name": "peijian/LvUp", "type": "api" }, { - "id": 258, + "id": 266, "name": "peijian/OneKeyLvUp", "type": "api" }, { - "id": 259, + "id": 267, "name": "peijian/OneKeyWear", "type": "api" }, { - "id": 260, + "id": 268, "name": "peijian/Reset", "type": "api" }, { - "id": 261, + "id": 269, "name": "peijian/Rm", "type": "api" }, { - "id": 262, + "id": 270, "name": "peijian/TakeOff", "type": "api", "conf": { @@ -3106,32 +3186,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 263, + "id": 271, "name": "peijian/UnLock", "type": "api" }, { - "id": 264, + "id": 272, "name": "peijian/Wear", "type": "api" }, { - "id": 265, + "id": 273, "name": "peijiancangku/Deal", "type": "api" }, { - "id": 266, + "id": 274, "name": "peijiancangku/Jump", "type": "api" }, { - "id": 267, + "id": 275, "name": "peijiancangku/Open", "type": "api" }, { - "id": 268, + "id": 276, "name": "Bingo", "type": "api", "conf": { @@ -3139,147 +3219,147 @@ export const serviceProto: ServiceProto = { } }, { - "id": 269, + "id": 277, "name": "FightTest", "type": "api" }, { - "id": 270, + "id": 278, "name": "SyncBtn", "type": "api" }, { - "id": 271, + "id": 279, "name": "Test", "type": "api" }, { - "id": 272, + "id": 280, "name": "pushgift/ItemNoEnough", "type": "api" }, { - "id": 273, + "id": 281, "name": "pushgift/Open", "type": "api" }, { - "id": 274, + "id": 282, "name": "qjzzd/Fight", "type": "api" }, { - "id": 275, + "id": 283, "name": "qjzzd/Open", "type": "api" }, { - "id": 276, + "id": 284, "name": "rank/Open", "type": "api" }, { - "id": 277, + "id": 285, "name": "shiwu/Concise", "type": "api" }, { - "id": 278, + "id": 286, "name": "shiwu/Extract", "type": "api" }, { - "id": 279, + "id": 287, "name": "shiwu/GetList", "type": "api" }, { - "id": 280, + "id": 288, "name": "shiwu/LvUp", "type": "api" }, { - "id": 281, + "id": 289, "name": "shiwu/Recast", "type": "api" }, { - "id": 282, + "id": 290, "name": "shiwu/TakeOff", "type": "api" }, { - "id": 283, + "id": 291, "name": "shiwu/Wear", "type": "api" }, { - "id": 284, + "id": 292, "name": "shootGame/Open", "type": "api" }, { - "id": 285, + "id": 293, "name": "shootGame/Rec", "type": "api" }, { - "id": 286, + "id": 294, "name": "shop/Buy", "type": "api" }, { - "id": 287, + "id": 295, "name": "shop/Open", "type": "api" }, { - "id": 288, + "id": 296, "name": "shop/Refresh", "type": "api" }, { - "id": 289, + "id": 297, "name": "sign/GetBoxPrize", "type": "api" }, { - "id": 290, + "id": 298, "name": "sign/GetPrize", "type": "api" }, { - "id": 291, + "id": 299, "name": "sign/Open", "type": "api" }, { - "id": 292, + "id": 300, "name": "slzd/Aim", "type": "api" }, { - "id": 293, + "id": 301, "name": "slzd/BuyNum", "type": "api" }, { - "id": 294, + "id": 302, "name": "slzd/Fight", "type": "api" }, { - "id": 295, + "id": 303, "name": "slzd/FightLog", "type": "api" }, { - "id": 296, + "id": 304, "name": "slzd/MyRank", "type": "api" }, { - "id": 297, + "id": 305, "name": "slzd/Open", "type": "api", "conf": { @@ -3289,77 +3369,77 @@ export const serviceProto: ServiceProto = { } }, { - "id": 298, + "id": 306, "name": "slzd/OpenFort", "type": "api" }, { - "id": 299, + "id": 307, "name": "slzd/Rec", "type": "api" }, { - "id": 300, + "id": 308, "name": "slzd/Refresh", "type": "api" }, { - "id": 301, + "id": 309, "name": "slzd/Slot", "type": "api" }, { - "id": 302, + "id": 310, "name": "tanxian/Event", "type": "api" }, { - "id": 303, + "id": 311, "name": "tanxian/FastGuaJi", "type": "api" }, { - "id": 304, + "id": 312, "name": "tanxian/Fight", "type": "api" }, { - "id": 305, + "id": 313, "name": "tanxian/GuaJi", "type": "api" }, { - "id": 306, + "id": 314, "name": "tanxian/Open", "type": "api" }, { - "id": 307, + "id": 315, "name": "tanxian/Receive", "type": "api" }, { - "id": 308, + "id": 316, "name": "task/AllFinsh", "type": "api" }, { - "id": 309, + "id": 317, "name": "task/Finsh", "type": "api" }, { - "id": 310, + "id": 318, "name": "task/Open", "type": "api" }, { - "id": 311, + "id": 319, "name": "user/CDKEY", "type": "api" }, { - "id": 312, + "id": 320, "name": "user/ChangeInfo", "type": "api", "conf": { @@ -3367,202 +3447,202 @@ export const serviceProto: ServiceProto = { } }, { - "id": 313, + "id": 321, "name": "user/ChangeName", "type": "api" }, { - "id": 314, + "id": 322, "name": "user/Dot", "type": "api" }, { - "id": 315, + "id": 323, "name": "user/Fight", "type": "api" }, { - "id": 316, + "id": 324, "name": "user/GetInfo", "type": "api" }, { - "id": 317, + "id": 325, "name": "user/InfoOpen", "type": "api" }, { - "id": 318, + "id": 326, "name": "user/Login", "type": "api" }, { - "id": 319, + "id": 327, "name": "user/Ping", "type": "api" }, { - "id": 320, + "id": 328, "name": "user/Renown", "type": "api" }, { - "id": 321, + "id": 329, "name": "user/RenownBuy", "type": "api" }, { - "id": 322, + "id": 330, "name": "user/RenownGetPrize", "type": "api" }, { - "id": 323, + "id": 331, "name": "user/RenownOpen", "type": "api" }, { - "id": 324, + "id": 332, "name": "user/Tujian", "type": "api" }, { - "id": 325, + "id": 333, "name": "weixiuchang/Decompose", "type": "api" }, { - "id": 326, + "id": 334, "name": "weixiuchang/Exchange", "type": "api" }, { - "id": 327, + "id": 335, "name": "weixiuchang/Open", "type": "api" }, { - "id": 328, + "id": 336, "name": "weixiuchang/UpLv", "type": "api" }, { - "id": 329, + "id": 337, "name": "weixiuchang/UpStar", "type": "api" }, { - "id": 330, + "id": 338, "name": "wzry/AutoBaoMing", "type": "api" }, { - "id": 331, + "id": 339, "name": "wzry/BaoMing", "type": "api" }, { - "id": 332, + "id": 340, "name": "wzry/catFightLog", "type": "api" }, { - "id": 333, + "id": 341, "name": "wzry/CatGroup", "type": "api" }, { - "id": 334, + "id": 342, "name": "wzry/DldFight", "type": "api" }, { - "id": 335, + "id": 343, "name": "wzry/DldRefre", "type": "api" }, { - "id": 336, + "id": 344, "name": "wzry/JingCai", "type": "api" }, { - "id": 337, + "id": 345, "name": "wzry/JingCaiOpen", "type": "api" }, { - "id": 338, + "id": 346, "name": "wzry/Open", "type": "api" }, { - "id": 339, + "id": 347, "name": "wzry/UpdateFight", "type": "api" }, { - "id": 340, + "id": 348, "name": "wzry/Wzzd", "type": "api" }, { - "id": 341, + "id": 349, "name": "wzry/ZuanShiOpen", "type": "api" }, { - "id": 342, + "id": 350, "name": "xstask/AllGet", "type": "api" }, { - "id": 343, + "id": 351, "name": "xstask/Get", "type": "api" }, { - "id": 344, + "id": 352, "name": "xstask/LvUp", "type": "api" }, { - "id": 345, + "id": 353, "name": "xstask/OnekeyReceive", "type": "api" }, { - "id": 346, + "id": 354, "name": "xstask/Open", "type": "api" }, { - "id": 347, + "id": 355, "name": "xstask/Receive", "type": "api" }, { - "id": 348, + "id": 356, "name": "xstask/Refresh", "type": "api" }, { - "id": 349, + "id": 357, "name": "yongbingzhuzhan/Handle", "type": "api" }, { - "id": 350, + "id": 358, "name": "zhanqianbushu/ChangePos", "type": "api" }, { - "id": 351, + "id": 359, "name": "zhanqianbushu/Select", "type": "api" }, { - "id": 352, + "id": 360, "name": "zhanqianbushu/Up", "type": "api" } @@ -11338,6 +11418,163 @@ export const serviceProto: ServiceProto = { } ] }, + "event/yuandan/PtlDMOpen/ReqDMOpen": { + "type": "Interface" + }, + "event/yuandan/PtlDMOpen/ResDMOpen": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "record", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + } + ] + }, + "event/yuandan/PtlDMRec/ReqDMRec": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + } + ] + }, + "event/yuandan/PtlDMRec/ResDMRec": { + "type": "Interface" + }, + "event/yuandan/PtlDZOpen/ReqDZOpen": { + "type": "Interface" + }, + "event/yuandan/PtlDZOpen/ResDZOpen": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "record", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + }, + { + "id": 1, + "name": "buyLog", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + } + ] + }, + "event/yuandan/PtlDZRec/ReqDZRec": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + } + ] + }, + "event/yuandan/PtlDZRec/ResDZRec": { + "type": "Interface" + }, + "event/yuandan/PtlExchange/ReqExchange": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + } + ] + }, + "event/yuandan/PtlExchange/ResExchange": { + "type": "Interface" + }, + "event/yuandan/PtlExchangeOpen/ReqExchangeOpen": { + "type": "Interface" + }, + "event/yuandan/PtlExchangeOpen/ResExchangeOpen": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "record", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + } + ] + }, + "event/yuandan/PtlZLOpen/ReqZLOpen": { + "type": "Interface" + }, + "event/yuandan/PtlZLOpen/ResZLOpen": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "record", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + } + ] + }, + "event/yuandan/PtlZLRec/ReqZLRec": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + } + ] + }, + "event/yuandan/PtlZLRec/ResZLRec": { + "type": "Interface" + }, "event/yuedujijin/PtlOpen/ReqOpen": { "type": "Interface", "properties": [ @@ -15331,6 +15568,13 @@ export const serviceProto: ServiceProto = { "type": "Literal", "literal": "leichonglibao" } + }, + { + "id": 40, + "type": { + "type": "Literal", + "literal": "yuandan" + } } ] }, From cba4f4563d1aced1ebe6869d394544818f6af9fe Mon Sep 17 00:00:00 2001 From: dy Date: Mon, 25 Dec 2023 14:00:30 +0800 Subject: [PATCH 02/26] json --- src/json/attr.json | 20 ++ src/json/dixiaheishi.json5 | 1 + src/json/huodong.json5 | 569 ++++++++++++++++++++++++++++++++++++- src/json/openCond.json | 13 + src/json/shop.json | 12 + 5 files changed, 614 insertions(+), 1 deletion(-) diff --git a/src/json/attr.json b/src/json/attr.json index d9f5ad4..0c99340 100644 --- a/src/json/attr.json +++ b/src/json/attr.json @@ -138,5 +138,25 @@ "sicon": "icon_hspj", "describe": "intr_attr_describe_15", "advancedEffects": "" + }, + "weiwang": { + "id": "weiwang", + "name": "intr_attr_name_16", + "undefined": "威望", + "colour": 4, + "icon": "icon_weiwang", + "sicon": "icon_weiwang", + "describe": "intr_attr_describe_16", + "advancedEffects": "" + }, + "yuandanyouxi": { + "id": "yuandanyouxi", + "name": "intr_attr_name_17", + "undefined": "元旦游戏币", + "colour": 5, + "icon": "icon_hspj", + "sicon": "icon_hspj", + "describe": "intr_attr_describe_17", + "advancedEffects": "ani_xiangzikuang" } } \ No newline at end of file diff --git a/src/json/dixiaheishi.json5 b/src/json/dixiaheishi.json5 index c8c23fd..97b7c29 100644 --- a/src/json/dixiaheishi.json5 +++ b/src/json/dixiaheishi.json5 @@ -33,6 +33,7 @@ }, //136礼包 '136Gift': [ + { payId: '136Gift1', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, { prize: [{"a": "attr", "t": "rmbmoney", "n": 10},{"a": "item", "t": "12", "n": 10},{"a": "attr", "t": "jinbi", "n": 10000}] }, { payId: '136Gift2', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, { payId: '136Gift3', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, diff --git a/src/json/huodong.json5 b/src/json/huodong.json5 index 5caa64d..417fc76 100644 --- a/src/json/huodong.json5 +++ b/src/json/huodong.json5 @@ -4283,5 +4283,572 @@ } } } - } + }, + { + "hdid" : 14000, // 唯一活动id 元旦活动 + "htype" : 14, + "stype" : 1400, + "ttype" : 4, // 0 按照开服时间计算,1 玩家注册时间计算 4 屏蔽此活动 + "stime" : 60, + "rtime" : 90, + "etime" : 90, + "name" : "xnhd_tips_1", + "icon" : "icon_xfdj", + "showtime" : "根据玩家注册时间,游戏返回时复写", + "data" : { + //任务 + "task" : { + "1": { + "pval" : 1, + "stype" : "128", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 100 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "attr", + "t" : "rmbmoney", + "n" : 200 + }, + { + "a" : "item", + "t" : "1", + "n" : 100000 + } + ], + "des" : "intr_cszl_des_1" + }, + "2": { + "pval" : 300, + "stype" : "116", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 200 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 3 + }, + { + "a" : "item", + "t" : "600", + "n" : 5 + }, + { + "a" : "item", + "t" : "1", + "n" : 500000 + } + ], + "des" : "intr_cszl_des_2" + }, + "3": { + "pval" : 1000, + "stype" : "116", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 300 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 5 + }, + { + "a" : "item", + "t" : "600", + "n" : 10 + }, + { + "a" : "item", + "t" : "1", + "n" : 1000000 + } + ], + "des" : "intr_cszl_des_3" + }, + "4": { + "pval" : 2000, + "stype" : "116", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 150 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "item", + "t" : "6", + "n" : 10 + }, + { + "a" : "item", + "t" : "1", + "n" : 200000 + } + ], + "des" : "intr_cszl_des_4" + }, + "5": { + "pval" : 3, + "stype" : "142", + "cond": [2], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 100 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "item", + "t" : "2", + "n" : 500 + }, + { + "a" : "item", + "t" : "1", + "n" : 200000 + } + ], + "des" : "intr_cszl_des_5" + }, + "6": { + "pval" : 3, + "stype" : "122", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 200 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "item", + "t" : "12", + "n" : 400 + }, + { + "a" : "item", + "t" : "1", + "n" : 200000 + } + ], + "des" : "intr_cszl_des_6" + }, + "7": { + "pval" : 1, + "stype" : "155", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 100 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "attr", + "t" : "rmbmoney", + "n" : 200 + }, + { + "a" : "item", + "t" : "1", + "n" : 100000 + } + ], + "des" : "intr_cszl_des_7" + }, + "8": { + "pval" : 1, + "stype" : "127", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 100 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "item", + "t" : "21", + "n" : 50 + }, + { + "a" : "item", + "t" : "1", + "n" : 100000 + } + ], + "des" : "intr_cszl_des_8" + }, + "9": { + "pval" : 1, + "stype" : "154", + "cond": [], + "prize" : [ + { + "a" : "attr", + "t" : "shengdanExp", + "n" : 100 + }, + { + "a" : "attr", + "t" : "shengdanBullet", + "n" : 2 + }, + { + "a" : "attr", + "t" : "jinbi", + "n" : 100000 + }, + { + "a" : "item", + "t" : "1", + "n" : 100000 + } + ], + "des" : "intr_cszl_des_9" + }, + }, + //玩游戏需要消耗 + "gameneed": [{"a": "attr", "t":"yuandanyouxi", "n": 1}], + //游戏奖品池 + "game": [ + {"a": "item", "t":"1", "n": 10000000, "p": 10}, + {"a": "item", "t":"12", "n": 1000, "p": 20}, + {"a": "item", "t":"2", "n": 2000, "p": 30}, + {"a": "item", "t":"18", "n": 100, "p": 50}, + {"a": "item", "t":"18", "n": 200, "p": 40}, + {"a": "item", "t":"18", "n": 300, "p": 100}, + {"a": "item", "t":"18", "n": 400, "p": 15} + + ], + //免费玩游戏次数 + "gamefree": 3, + //钻石兑换 + "duihuan": [ + { need: [{a: 'attr', t: 'rmbmoney', n: 1000}], prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}], buyNum: 2 }, + { need: [{a: 'attr', t: 'rmbmoney', n: 2000}], prize: [{a: 'item', t: '610', n: 2},{a: 'item', t: '2', n: 600},{a: 'item', t: '1', n: 550}], buyNum: 1 }, + { need: [{a: 'attr', t: 'rmbmoney', n: 3000}], prize: [{a: 'item', t: '610', n: 3},{a: 'item', t: '2', n: 700},{a: 'item', t: '1', n: 230}], buyNum: 1 }, + { need: [{a: 'attr', t: 'rmbmoney', n: 4000}], prize: [{a: 'item', t: '610', n: 4},{a: 'item', t: '2', n: 800},{a: 'item', t: '1', n: 690}], buyNum: 3 }, + { need: [{a: 'attr', t: 'rmbmoney', n: 5000}], prize: [{a: 'item', t: '610', n: 5},{a: 'item', t: '2', n: 900},{a: 'item', t: '1', n: 3300}], buyNum: 5 }, + { need: [{a: 'attr', t: 'rmbmoney', n: 6000}], prize: [{a: 'item', t: '610', n: 6},{a: 'item', t: '2', n: 1000},{a: 'item', t: '1', n: 130}], buyNum: 6 } + ], + //活动礼包 + "libao": { + "1": { + "payid": "", + "buynum": 1, + //固定奖励 + "basep": [{"a": "attr", "t":"rmbmoney", "n": 100}], + "des" : "intr_cszl_des_10", + //自选池 + "dlz": [ + { + "1": {"a": "attr", "t":"jinbi", "n": 100000}, + "2": {"a": "item", "t":"1", "n": 50000} + } + ] + }, + "2": { + "payid": "pay_name_sdhd_libao_2", + "buynum": 2, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 120}], + "des" : "intr_cszl_des_11", + "dlz": [ + { + "1": {"a": "item", "t":"2", "n": 400}, + "2": {"a": "item", "t":"12", "n": 200} + }, + { + "1": {"a": "attr", "t":"jinbi", "n": 1000000}, + "2": {"a": "item", "t":"1", "n": 500000} + } + ] + }, + "3": { + "payid": "pay_name_sdhd_libao_3", + "buynum": 2, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 300}], + "des" : "intr_cszl_des_12", + "dlz": [ + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + }, + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + }, + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + } + ] + }, + "4": { + "payid": "pay_name_sdhd_libao_4", + "buynum": 5, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 680}], + "des" : "intr_cszl_des_12", + "dlz": [ + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + }, + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + }, + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + } + ] + }, + "5": { + "payid": "pay_name_sdhd_libao_5", + "buynum": 9, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 1280}], + "des" : "intr_cszl_des_13", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 10}, + "2": {"a": "item", "t":"605", "n": 2}, + "3": {"a": "item", "t":"606", "n": 1} + }, + { + "1": {"a": "item", "t":"600", "n": 10}, + "2": {"a": "item", "t":"605", "n": 2}, + "3": {"a": "item", "t":"606", "n": 1} + }, + { + "1": {"a": "item", "t":"1", "n": 5000000}, + "2": {"a": "attr", "t":"jinbi", "n": 10000000} + } + ] + }, + "6": { + "payid": "pay_name_sdhd_libao_6", + "buynum": 9, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 3280}], + "des" : "intr_cszl_des_14", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 20}, + "2": {"a": "item", "t":"5002", "n": 10}, + "3": {"a": "item", "t":"5004", "n": 10} + }, + { + "1": {"a": "item", "t":"600", "n": 20}, + "2": {"a": "item", "t":"5002", "n": 10}, + "3": {"a": "item", "t":"5004", "n": 10} + }, + { + "1": {"a": "item", "t":"1", "n": 10000000}, + "2": {"a": "item", "t":"12", "n": 1000}, + "3": {"a": "item", "t":"2", "n": 2000}, + "4": {"a": "item", "t":"18", "n": 500} + } + ] + }, + "7": { + "payid": "pay_name_sdhd_libao_7", + "buynum": 9, + "basep": [{"a": "attr", "t":"rmbmoney", "n": 6480}], + "des" : "intr_cszl_des_14", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 30}, + "2": {"a": "item", "t":"5002", "n": 20}, + "3": {"a": "item", "t":"5004", "n": 20} + }, + { + "1": {"a": "item", "t":"600", "n": 30}, + "2": {"a": "item", "t":"5002", "n": 20}, + "3": {"a": "item", "t":"5004", "n": 20} + }, + { + "1": {"a": "item", "t":"605", "n": 4}, + "2": {"a": "item", "t":"606", "n": 2}, + "3": {"a": "item", "t":"18", "n": 1000}, + "4": {"a": "item", "t":"23", "n": 1000000} + } + ] + }, + }, + //签到奖励 + "qiandao": [ + { + "1": { + //固定奖励 + "basep": [{"a": "attr", "t":"rmbmoney", "n": 100}], + "des" : "intr_cszl_des_10", + //自选池 + "dlz": [ + { + "1": {"a": "attr", "t":"jinbi", "n": 100000}, + "2": {"a": "item", "t":"1", "n": 50000} + } + ] + }, + "2": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 120}], + "des" : "intr_cszl_des_11", + "dlz": [ + { + "1": {"a": "item", "t":"2", "n": 400}, + "2": {"a": "item", "t":"12", "n": 200} + }, + { + "1": {"a": "attr", "t":"jinbi", "n": 1000000}, + "2": {"a": "item", "t":"1", "n": 500000} + } + ] + }, + "3": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 300}], + "des" : "intr_cszl_des_12", + "dlz": [ + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + }, + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + }, + { + "1": {"a": "item", "t":"9", "n": 500}, + "2": {"a": "item", "t":"10", "n": 100} + } + ] + }, + "4": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 680}], + "des" : "intr_cszl_des_12", + "dlz": [ + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + }, + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + }, + { + "1": {"a": "item", "t":"615", "n": 1}, + "2": {"a": "item", "t":"18", "n": 200} + } + ] + }, + "5": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 1280}], + "des" : "intr_cszl_des_13", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 10}, + "2": {"a": "item", "t":"605", "n": 2}, + "3": {"a": "item", "t":"606", "n": 1} + }, + { + "1": {"a": "item", "t":"600", "n": 10}, + "2": {"a": "item", "t":"605", "n": 2}, + "3": {"a": "item", "t":"606", "n": 1} + }, + { + "1": {"a": "item", "t":"1", "n": 5000000}, + "2": {"a": "attr", "t":"jinbi", "n": 10000000} + } + ] + }, + "6": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 3280}], + "des" : "intr_cszl_des_14", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 20}, + "2": {"a": "item", "t":"5002", "n": 10}, + "3": {"a": "item", "t":"5004", "n": 10} + }, + { + "1": {"a": "item", "t":"600", "n": 20}, + "2": {"a": "item", "t":"5002", "n": 10}, + "3": {"a": "item", "t":"5004", "n": 10} + }, + { + "1": {"a": "item", "t":"1", "n": 10000000}, + "2": {"a": "item", "t":"12", "n": 1000}, + "3": {"a": "item", "t":"2", "n": 2000}, + "4": {"a": "item", "t":"18", "n": 500} + } + ] + }, + "7": { + "basep": [{"a": "attr", "t":"rmbmoney", "n": 6480}], + "des" : "intr_cszl_des_14", + "dlz": [ + { + "1": {"a": "item", "t":"600", "n": 30}, + "2": {"a": "item", "t":"5002", "n": 20}, + "3": {"a": "item", "t":"5004", "n": 20} + }, + { + "1": {"a": "item", "t":"600", "n": 30}, + "2": {"a": "item", "t":"5002", "n": 20}, + "3": {"a": "item", "t":"5004", "n": 20} + }, + { + "1": {"a": "item", "t":"605", "n": 4}, + "2": {"a": "item", "t":"606", "n": 2}, + "3": {"a": "item", "t":"18", "n": 1000}, + "4": {"a": "item", "t":"23", "n": 1000000} + } + ] + } + } + ] + } + } ] \ No newline at end of file diff --git a/src/json/openCond.json b/src/json/openCond.json index 06d9d8c..b97e5f0 100644 --- a/src/json/openCond.json +++ b/src/json/openCond.json @@ -1378,5 +1378,18 @@ "display": { "lv": 15 } + }, + "weiwang": { + "name": "weiwang", + "undefined": "威望", + "and": { + "lv": 15 + }, + "or": {}, + "time": 0, + "tips": "openCond_tips_96", + "display": { + "lv": 15 + } } } \ No newline at end of file diff --git a/src/json/shop.json b/src/json/shop.json index 4e0b020..c27331a 100644 --- a/src/json/shop.json +++ b/src/json/shop.json @@ -2,6 +2,7 @@ "1": { "id": 1, "type": 1, + "version": 1, "name": "wsw_wz_zhsd", "undefined": "杂货店", "openCond": [ @@ -46,6 +47,7 @@ "2": { "id": 2, "type": 5, + "version": 1, "name": "wsw_wz_slsd", "undefined": "势力商店", "openCond": [ @@ -84,6 +86,7 @@ "3": { "id": 3, "type": 6, + "version": 1, "name": "wsw_wz_zzsd", "undefined": "战争商店", "openCond": [ @@ -125,6 +128,7 @@ "4": { "id": 4, "type": 7, + "version": 1, "name": "wsw_wz_spsd", "undefined": "饰品商店", "openCond": [ @@ -169,6 +173,7 @@ "5": { "id": 5, "type": 2, + "version": 1, "name": "intr_shop_name_5", "undefined": "杂货", "openCond": [ @@ -208,6 +213,7 @@ "6": { "id": 6, "type": 2, + "version": 1, "name": "intr_shop_name_6", "undefined": "紫装", "openCond": [ @@ -264,6 +270,7 @@ "8": { "id": 8, "type": 3, + "version": 1, "name": "wsw_wz_rcsc", "undefined": "人才市场", "openCond": [ @@ -327,6 +334,7 @@ "9": { "id": 9, "type": 4, + "version": 1, "name": "wsw_wz_pjsd", "undefined": "配件商店", "openCond": [ @@ -384,6 +392,7 @@ "10": { "id": 10, "type": 8, + "version": 1, "name": "wsw_wz_rysd", "undefined": "荣誉商店", "openCond": [ @@ -427,6 +436,7 @@ "11": { "id": 11, "type": 9, + "version": 1, "name": "wsw_wz_jgsd", "undefined": "军功商店", "openCond": [ @@ -468,6 +478,7 @@ "12": { "id": 12, "type": 11, + "version": 1, "name": "wsw_wz_ltsd", "undefined": "擂台商店", "openCond": [ @@ -499,6 +510,7 @@ "13": { "id": 13, "type": 12, + "version": 1, "name": "wsw_wz_mrjxdh", "undefined": "每日精选兑换商店", "openCond": [ From 1d6143794c5d2483d1f38ef26ff0b2fa6bd45723 Mon Sep 17 00:00:00 2001 From: dy Date: Mon, 25 Dec 2023 17:13:59 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/yuandan/{ApiDMOpen.ts => ApiOpen.ts} | 9 +++------ src/api_s2c/event/yuandan/fun.ts | 11 +++-------- src/shared/protocols/event/yuandan/PtlDMOpen.ts | 2 +- src/shared/protocols/serviceProto.ts | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) rename src/api_s2c/event/yuandan/{ApiDMOpen.ts => ApiOpen.ts} (54%) diff --git a/src/api_s2c/event/yuandan/ApiDMOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts similarity index 54% rename from src/api_s2c/event/yuandan/ApiDMOpen.ts rename to src/api_s2c/event/yuandan/ApiOpen.ts index c0c659a..a22e2cc 100644 --- a/src/api_s2c/event/yuandan/ApiDMOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -2,15 +2,12 @@ import {ApiCall} from "tsrpc"; import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen"; import {HuoDongFun} from "../../../public/huodongfun"; import {PayFun} from "../../../public/pay"; +import {Yuandanfun} from "./fun"; export default async function (call: ApiCall) { - let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) - - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - - let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) + let _hd = await Yuandanfun.getCon(call) call.succ({ - record: data?.record || {} + data: (await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: 'yuandandamo'})) || {} }) } \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 7ac4168..7612211 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -8,14 +8,9 @@ import {PlayerFun} from "../../../public/player"; export class Yuandanfun { /**配置 */ static async getCon(call: ApiCall) { - let _con: { [id: string]: ReqAddHuoDong } = {} - let _hd = await HuoDongFun.gethdList(call, 8) - for (let index = 0; index < _hd.length; index++) { - const element = _hd[index]; - if (element && element._id) delete element._id - _con[element.hdid] = element - } - return _con + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + if (!_hd) return call.errorCode(-1) + return _hd } /**获取所有符合时间的活动 */ diff --git a/src/shared/protocols/event/yuandan/PtlDMOpen.ts b/src/shared/protocols/event/yuandan/PtlDMOpen.ts index 0724ba5..d4f06ef 100644 --- a/src/shared/protocols/event/yuandan/PtlDMOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlDMOpen.ts @@ -7,7 +7,7 @@ export type ReqDMOpen = { }; export type ResDMOpen = { - record:{ + data:{ [k: string]: any; } }; \ No newline at end of file diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 9d4a22e..e6a6bff 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11426,7 +11426,7 @@ export const serviceProto: ServiceProto = { "properties": [ { "id": 0, - "name": "record", + "name": "myData", "type": { "type": "Interface", "indexSignature": { From 5486c2adf7a4a3651879283531b2c528609aea52 Mon Sep 17 00:00:00 2001 From: dy Date: Mon, 25 Dec 2023 18:03:15 +0800 Subject: [PATCH 04/26] json --- src/json/attr.json | 2 +- src/json/clsl_com.json5 | 6 +- src/json/dixiaheishi.json5 | 1 - src/json/g123item.json | 48 +- src/json/huodong.json5 | 88 ++- src/json/item.json | 28 +- src/json/pay.json | 206 ++++++- .../protocols/event/yuandan/PtlDMOpen.ts | 13 - src/shared/protocols/serviceProto.ts | 559 +++++++++--------- 9 files changed, 587 insertions(+), 364 deletions(-) delete mode 100644 src/shared/protocols/event/yuandan/PtlDMOpen.ts diff --git a/src/json/attr.json b/src/json/attr.json index 0c99340..6c07a87 100644 --- a/src/json/attr.json +++ b/src/json/attr.json @@ -142,7 +142,7 @@ "weiwang": { "id": "weiwang", "name": "intr_attr_name_16", - "undefined": "威望", + "undefined": "影响力", "colour": 4, "icon": "icon_weiwang", "sicon": "icon_weiwang", diff --git a/src/json/clsl_com.json5 b/src/json/clsl_com.json5 index 0e36ee7..def4d62 100644 --- a/src/json/clsl_com.json5 +++ b/src/json/clsl_com.json5 @@ -39,9 +39,9 @@ ], //段位奖励 danPrize: [ - { star: [49, 49], prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '38', n:3 },{ a: 'item', t: '40', n:1 }] }, - { star: [39, 48], prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '38', n:2 }] }, - { star: [29, 38], prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '38', n:1 }] }, + { star: [49, 49], prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '631', n:3 },{ a: 'item', t: '40', n:1 }] }, + { star: [39, 48], prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:2 }] }, + { star: [29, 38], prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:1 }] }, { star: [21, 28], prize: [{ a: 'item', t: '606', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:1000 }] }, { star: [13, 20], prize: [{ a: 'item', t: '606', n:1 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:800 }] }, { star: [7, 12], prize: [{ a: 'item', t: '29', n:10 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:600 }] }, diff --git a/src/json/dixiaheishi.json5 b/src/json/dixiaheishi.json5 index 97b7c29..c8c23fd 100644 --- a/src/json/dixiaheishi.json5 +++ b/src/json/dixiaheishi.json5 @@ -33,7 +33,6 @@ }, //136礼包 '136Gift': [ - { payId: '136Gift1', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, { prize: [{"a": "attr", "t": "rmbmoney", "n": 10},{"a": "item", "t": "12", "n": 10},{"a": "attr", "t": "jinbi", "n": 10000}] }, { payId: '136Gift2', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, { payId: '136Gift3', prize: [], bonus: [{"a": "attr", "t": "jingxuanbi", "n": 10}] }, diff --git a/src/json/g123item.json b/src/json/g123item.json index 0a5e360..670fbf3 100644 --- a/src/json/g123item.json +++ b/src/json/g123item.json @@ -10669,7 +10669,7 @@ }, "attr^shengdanExp": { "itemId": "attr^shengdanExp", - "name": "圣诞战令经验", + "name": "圣诞积分", "i18nKey": "intr_attr_name_13", "detailI18nKey": "intr_attr_describe_13", "iconUrl": "https://ik.imagekit.io/g123/production-ctw-box/game-box/preview/6ffd84658d75d5247f7f01b2f00ae3e6beda7163237c025ff8f0a58c.png", @@ -10690,7 +10690,7 @@ }, "attr^shengdanBullet": { "itemId": "attr^shengdanBullet", - "name": "圣诞打靶币", + "name": "圣诞喷漆", "i18nKey": "intr_attr_name_14", "detailI18nKey": "intr_attr_describe_14", "iconUrl": "https://ik.imagekit.io/g123/production-ctw-box/game-box/preview/6ffd84658d75d5247f7f01b2f00ae3e6beda7163237c025ff8f0a58c.png", @@ -10711,7 +10711,7 @@ }, "attr^jingxuanbi": { "itemId": "attr^jingxuanbi", - "name": "每日精选兑换币", + "name": "黑市票券", "i18nKey": "intr_attr_name_15", "detailI18nKey": "intr_attr_describe_15", "iconUrl": "https://ik.imagekit.io/g123/production-ctw-box/game-box/preview/6ffd84658d75d5247f7f01b2f00ae3e6beda7163237c025ff8f0a58c.png", @@ -10729,5 +10729,47 @@ "sellMaxCp": 500, "rarity": 4 } + }, + "attr^weiwang": { + "itemId": "attr^weiwang", + "name": "影响力", + "i18nKey": "intr_attr_name_16", + "detailI18nKey": "intr_attr_describe_16", + "iconUrl": "https://ik.imagekit.io/g123/production-ctw-box/game-box/preview/6ffd84658d75d5247f7f01b2f00ae3e6beda7163237c025ff8f0a58c.png", + "value": 0, + "typeId": "attr", + "typeName": "货币", + "isStoreSupported": true, + "isAiSupported": true, + "attributes": { + "storeDisplayPrice": null, + "storeCategory": "", + "setQuantity": 1, + "purchaseLimit": 0, + "sellMinCp": 100, + "sellMaxCp": 500, + "rarity": 4 + } + }, + "attr^yuandanyouxi": { + "itemId": "attr^yuandanyouxi", + "name": "新年庆典币", + "i18nKey": "intr_attr_name_17", + "detailI18nKey": "intr_attr_describe_17", + "iconUrl": "https://ik.imagekit.io/g123/production-ctw-box/game-box/preview/6ffd84658d75d5247f7f01b2f00ae3e6beda7163237c025ff8f0a58c.png", + "value": 0, + "typeId": "attr", + "typeName": "货币", + "isStoreSupported": true, + "isAiSupported": true, + "attributes": { + "storeDisplayPrice": null, + "storeCategory": "", + "setQuantity": 1, + "purchaseLimit": 0, + "sellMinCp": 100, + "sellMaxCp": 500, + "rarity": 5 + } } } \ No newline at end of file diff --git a/src/json/huodong.json5 b/src/json/huodong.json5 index 417fc76..b004311 100644 --- a/src/json/huodong.json5 +++ b/src/json/huodong.json5 @@ -485,7 +485,12 @@ free: false, payId: 'ycmb_5_1', buyNum: 1, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 60},{'a': 'item', 't': '21', 'n': 200} ] + dlz: [ + { + "1": {'a': 'attr', 't': 'rmbmoney', 'n': 60}, + "2": {'a': 'item', 't': '21', 'n': 200} + } + ] }, { index: 2, @@ -493,7 +498,12 @@ free: false, payId: 'ycmb_5_2', buyNum: 2, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 300},{'a': 'item', 't': '21', 'n': 600} ] + dlz: [ + { + "1":{'a': 'attr', 't': 'rmbmoney', 'n': 300}, + "2":{'a': 'item', 't': '21', 'n': 600} + } + ] }, { index: 3, @@ -501,7 +511,12 @@ free: false, payId: 'ycmb_5_3', buyNum: 2, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 680},{'a': 'item', 't': '21', 'n': 1500} ] + dlz: [ + { + "1":{'a': 'attr', 't': 'rmbmoney', 'n': 680}, + "2":{'a': 'item', 't': '21', 'n': 1500} + } + ] }, { index: 4, @@ -509,7 +524,12 @@ free: false, payId: 'ycmb_5_4', buyNum: 2, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 1280},{'a': 'item', 't': '21', 'n': 2500} ] + dlz: [ + { + "1":{'a': 'attr', 't': 'rmbmoney', 'n': 1280}, + "2":{'a': 'item', 't': '21', 'n': 2500} + } + ] }, { index: 5, @@ -517,7 +537,12 @@ free: false, payId: 'ycmb_5_5', buyNum: 3, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 3280},{'a': 'item', 't': '21', 'n': 6000} ] + dlz: [ + { + "1":{'a': 'attr', 't': 'rmbmoney', 'n': 3280}, + "2":{'a': 'item', 't': '21', 'n': 6000} + } + ] }, { index: 6, @@ -525,7 +550,12 @@ free: false, payId: 'ycmb_5_6', buyNum: 3, - prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 6480},{'a': 'item', 't': '21', 'n': 12000} ] + dlz: [ + { + "1":{'a': 'attr', 't': 'rmbmoney', 'n': 6480}, + "2":{'a': 'item', 't': '21', 'n': 12000} + } + ] } ], //任务相关 type 1 每日任务(每天刷新) 2 活动任务(轮数) 3 每日登录 4-一次性任务 任务hdid一定要唯一 @@ -4576,12 +4606,12 @@ { need: [{a: 'attr', t: 'rmbmoney', n: 6000}], prize: [{a: 'item', t: '610', n: 6},{a: 'item', t: '2', n: 1000},{a: 'item', t: '1', n: 130}], buyNum: 6 } ], //活动礼包 - "libao": { - "1": { + "gift": [ + { "payid": "", "buynum": 1, //固定奖励 - "basep": [{"a": "attr", "t":"rmbmoney", "n": 100}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 100}], "des" : "intr_cszl_des_10", //自选池 "dlz": [ @@ -4591,10 +4621,10 @@ } ] }, - "2": { + { "payid": "pay_name_sdhd_libao_2", "buynum": 2, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 120}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 120}], "des" : "intr_cszl_des_11", "dlz": [ { @@ -4607,10 +4637,10 @@ } ] }, - "3": { + { "payid": "pay_name_sdhd_libao_3", "buynum": 2, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 300}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 300}], "des" : "intr_cszl_des_12", "dlz": [ { @@ -4627,10 +4657,10 @@ } ] }, - "4": { + { "payid": "pay_name_sdhd_libao_4", "buynum": 5, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 680}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 680}], "des" : "intr_cszl_des_12", "dlz": [ { @@ -4647,10 +4677,10 @@ } ] }, - "5": { + { "payid": "pay_name_sdhd_libao_5", "buynum": 9, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 1280}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 1280}], "des" : "intr_cszl_des_13", "dlz": [ { @@ -4669,10 +4699,10 @@ } ] }, - "6": { + { "payid": "pay_name_sdhd_libao_6", "buynum": 9, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 3280}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 3280}], "des" : "intr_cszl_des_14", "dlz": [ { @@ -4693,10 +4723,10 @@ } ] }, - "7": { + { "payid": "pay_name_sdhd_libao_7", "buynum": 9, - "basep": [{"a": "attr", "t":"rmbmoney", "n": 6480}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 6480}], "des" : "intr_cszl_des_14", "dlz": [ { @@ -4717,13 +4747,13 @@ } ] }, - }, + ], //签到奖励 "qiandao": [ { "1": { //固定奖励 - "basep": [{"a": "attr", "t":"rmbmoney", "n": 100}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 100}], "des" : "intr_cszl_des_10", //自选池 "dlz": [ @@ -4734,7 +4764,7 @@ ] }, "2": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 120}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 120}], "des" : "intr_cszl_des_11", "dlz": [ { @@ -4748,7 +4778,7 @@ ] }, "3": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 300}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 300}], "des" : "intr_cszl_des_12", "dlz": [ { @@ -4766,7 +4796,7 @@ ] }, "4": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 680}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 680}], "des" : "intr_cszl_des_12", "dlz": [ { @@ -4784,7 +4814,7 @@ ] }, "5": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 1280}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 1280}], "des" : "intr_cszl_des_13", "dlz": [ { @@ -4804,7 +4834,7 @@ ] }, "6": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 3280}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 3280}], "des" : "intr_cszl_des_14", "dlz": [ { @@ -4826,7 +4856,7 @@ ] }, "7": { - "basep": [{"a": "attr", "t":"rmbmoney", "n": 6480}], + "prize": [{"a": "attr", "t":"rmbmoney", "n": 6480}], "des" : "intr_cszl_des_14", "dlz": [ { diff --git a/src/json/item.json b/src/json/item.json index a5551b3..7c757d5 100644 --- a/src/json/item.json +++ b/src/json/item.json @@ -804,7 +804,7 @@ "40": { "id": 40, "name": "intr_item_name_40", - "undefined": "丛林狩猎霸主级玩家的特殊身份标识", + "undefined": "丛林狩猎霸主级玩家的特殊身份标识,使用后持续7天", "type": 7, "sort": 1, "colour": 5, @@ -1230,6 +1230,16 @@ "a": "item", "t": "4013", "n": 1 + }, + { + "a": "item", + "t": "4002", + "n": 1 + }, + { + "a": "item", + "t": "4012", + "n": 1 } ], "payId": "", @@ -2087,30 +2097,15 @@ "useNeed": [], "usePrize": [], "selecPrize": [ - { - "a": "hero", - "t": "5001", - "n": 1 - }, { "a": "hero", "t": "5002", "n": 1 }, - { - "a": "hero", - "t": "5003", - "n": 1 - }, { "a": "hero", "t": "5004", "n": 1 - }, - { - "a": "hero", - "t": "5005", - "n": 1 } ], "payId": "", @@ -4024,6 +4019,7 @@ "50010": { "id": 50010, "name": "playerheadFrame_name_24", + "undefined": "使用后解锁头像框“披星戴月”", "type": 7, "sort": 1, "colour": 4, diff --git a/src/json/pay.json b/src/json/pay.json index 367e17d..b5ce33f 100644 --- a/src/json/pay.json +++ b/src/json/pay.json @@ -630,7 +630,7 @@ { "a": "item", "t": "1", - "n": 1000000 + "n": 2000000 } ], "firstPayPrize": [], @@ -661,7 +661,7 @@ { "a": "item", "t": "1", - "n": 2000000 + "n": 5000000 } ], "firstPayPrize": [], @@ -764,7 +764,7 @@ { "a": "item", "t": "1", - "n": 12000000 + "n": 30000000 } ], "firstPayPrize": [], @@ -6473,5 +6473,205 @@ "needVip": 0, "front": {}, "currency": "CNY" + }, + "xnhd_libao_1": { + "id": "xnhd_libao_1", + "money": 0.5, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 5 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_1", + "undefined": "新年活动_1", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_2": { + "id": "xnhd_libao_2", + "money": 1, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 10 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_2", + "undefined": "新年活动_2", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_3": { + "id": "xnhd_libao_3", + "money": 6, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 60 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_3", + "undefined": "新年活动_3", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_4": { + "id": "xnhd_libao_4", + "money": 18, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 180 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_4", + "undefined": "新年活动_4", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_5": { + "id": "xnhd_libao_5", + "money": 30, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 300 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_5", + "undefined": "新年活动_5", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_6": { + "id": "xnhd_libao_6", + "money": 68, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 680 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_6", + "undefined": "新年活动_6", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_7": { + "id": "xnhd_libao_7", + "money": 128, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 1280 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_7", + "undefined": "新年活动_7", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_8": { + "id": "xnhd_libao_8", + "money": 198, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 1980 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_8", + "undefined": "新年活动_8", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_9": { + "id": "xnhd_libao_9", + "money": 328, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 3280 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_9", + "undefined": "新年活动_9", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "xnhd_libao_10": { + "id": "xnhd_libao_10", + "money": 648, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 6480 + } + ], + "prize": [], + "firstPayPrize": [], + "name": "pay_name_xnhd_libao_10", + "undefined": "新年活动_10", + "time": -1, + "buys": 0, + "needVip": 0, + "front": {}, + "currency": "CNY" } } \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlDMOpen.ts b/src/shared/protocols/event/yuandan/PtlDMOpen.ts deleted file mode 100644 index d4f06ef..0000000 --- a/src/shared/protocols/event/yuandan/PtlDMOpen.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * 元旦达摩 - */ -export type ReqDMOpen = { - -}; - -export type ResDMOpen = { - data:{ - [k: string]: any; - } -}; \ No newline at end of file diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index e6a6bff..a9f23a3 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -94,7 +94,6 @@ import { ReqRec as ReqRec_8, ResRec as ResRec_8 } from './event/yangchengmubiao/ import { ReqOpen as ReqOpen_26, ResOpen as ResOpen_26 } from './event/yibaichou/PtlOpen'; import { ReqRec as ReqRec_9, ResRec as ResRec_9 } from './event/yibaichou/PtlRec'; import { ReqRecAll, ResRecAll } from './event/yibaichou/PtlRecAll'; -import { ReqDMOpen, ResDMOpen } from './event/yuandan/PtlDMOpen'; import { ReqDMRec, ResDMRec } from './event/yuandan/PtlDMRec'; import { ReqDZOpen, ResDZOpen } from './event/yuandan/PtlDZOpen'; import { ReqDZRec, ResDZRec } from './event/yuandan/PtlDZRec'; @@ -743,10 +742,6 @@ export interface ServiceType { req: ReqRecAll, res: ResRecAll }, - "event/yuandan/DMOpen": { - req: ReqDMOpen, - res: ResDMOpen - }, "event/yuandan/DMRec": { req: ReqDMRec, res: ResDMRec @@ -2204,46 +2199,41 @@ export const serviceProto: ServiceProto = { }, { "id": 95, - "name": "event/yuandan/DMOpen", - "type": "api" - }, - { - "id": 96, "name": "event/yuandan/DMRec", "type": "api" }, { - "id": 97, + "id": 96, "name": "event/yuandan/DZOpen", "type": "api" }, { - "id": 98, + "id": 97, "name": "event/yuandan/DZRec", "type": "api" }, { - "id": 99, + "id": 98, "name": "event/yuandan/Exchange", "type": "api" }, { - "id": 100, + "id": 99, "name": "event/yuandan/ExchangeOpen", "type": "api" }, { - "id": 101, + "id": 100, "name": "event/yuandan/ZLOpen", "type": "api" }, { - "id": 102, + "id": 101, "name": "event/yuandan/ZLRec", "type": "api" }, { - "id": 103, + "id": 102, "name": "event/yuedujijin/Open", "type": "api", "conf": { @@ -2251,157 +2241,157 @@ export const serviceProto: ServiceProto = { } }, { - "id": 104, + "id": 103, "name": "event/yuedujijin/Rec", "type": "api" }, { - "id": 105, + "id": 104, "name": "event/zhanling/BuyLv", "type": "api" }, { - "id": 106, + "id": 105, "name": "event/zhanling/Open", "type": "api" }, { - "id": 107, + "id": 106, "name": "event/zhanling/RecPrize", "type": "api" }, { - "id": 108, + "id": 107, "name": "event/zhanling/RecTask", "type": "api" }, { - "id": 109, + "id": 108, "name": "event/zhoulibao/Open", "type": "api" }, { - "id": 110, + "id": 109, "name": "event/zhoumolibao/Open", "type": "api" }, { - "id": 111, + "id": 110, "name": "event/zhoumolibao/Receive", "type": "api" }, { - "id": 112, + "id": 111, "name": "event/zixuanlibao/Buy", "type": "api" }, { - "id": 113, + "id": 112, "name": "event/zixuanlibao/Open", "type": "api" }, { - "id": 114, + "id": 113, "name": "eventlist/hdGetList", "type": "api" }, { - "id": 115, + "id": 114, "name": "friend/Apply", "type": "api" }, { - "id": 116, + "id": 115, "name": "friend/Del", "type": "api" }, { - "id": 117, + "id": 116, "name": "friend/Gift", "type": "api" }, { - "id": 118, + "id": 117, "name": "friend/List", "type": "api" }, { - "id": 119, + "id": 118, "name": "friend/Open", "type": "api" }, { - "id": 120, + "id": 119, "name": "friend/Respond", "type": "api" }, { - "id": 121, + "id": 120, "name": "friend/RmBlackList", "type": "api" }, { - "id": 122, + "id": 121, "name": "friend/Search", "type": "api" }, { - "id": 123, + "id": 122, "name": "ganbutexun/Challenge", "type": "api" }, { - "id": 124, + "id": 123, "name": "ganbutexun/Open", "type": "api" }, { - "id": 125, + "id": 124, "name": "ganhai/Fast", "type": "api" }, { - "id": 126, + "id": 125, "name": "ganhai/Fight", "type": "api" }, { - "id": 127, + "id": 126, "name": "ganhai/Log", "type": "api" }, { - "id": 128, + "id": 127, "name": "ganhai/Open", "type": "api" }, { - "id": 129, + "id": 128, "name": "ganhai/Refresh", "type": "api" }, { - "id": 130, + "id": 129, "name": "ganhai/RefreshShip", "type": "api" }, { - "id": 131, + "id": 130, "name": "ganhai/Select", "type": "api" }, { - "id": 132, + "id": 131, "name": "gmapi/Gift", "type": "api" }, { - "id": 133, + "id": 132, "name": "gmapi/Post", "type": "api" }, { - "id": 134, + "id": 133, "name": "gonghui/Apply", "type": "api", "conf": { @@ -2411,7 +2401,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 135, + "id": 134, "name": "gonghui/ApplyAll", "type": "api", "conf": { @@ -2421,7 +2411,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 136, + "id": 135, "name": "gonghui/ApplyList", "type": "api", "conf": { @@ -2431,7 +2421,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 137, + "id": 136, "name": "gonghui/Change", "type": "api", "conf": { @@ -2441,12 +2431,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 138, + "id": 137, "name": "gonghui/Create", "type": "api" }, { - "id": 139, + "id": 138, "name": "gonghui/Dissolve", "type": "api", "conf": { @@ -2456,7 +2446,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 140, + "id": 139, "name": "gonghui/Exit", "type": "api", "conf": { @@ -2466,12 +2456,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 141, + "id": 140, "name": "gonghui/FbBuyNum", "type": "api" }, { - "id": 142, + "id": 141, "name": "gonghui/FbFight", "type": "api", "conf": { @@ -2481,7 +2471,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 143, + "id": 142, "name": "gonghui/FbOpen", "type": "api", "conf": { @@ -2491,17 +2481,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 144, + "id": 143, "name": "gonghui/GetList", "type": "api" }, { - "id": 145, + "id": 144, "name": "gonghui/Join", "type": "api" }, { - "id": 146, + "id": 145, "name": "gonghui/Jx", "type": "api", "conf": { @@ -2511,7 +2501,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 147, + "id": 146, "name": "gonghui/JxOpen", "type": "api", "conf": { @@ -2521,7 +2511,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 148, + "id": 147, "name": "gonghui/List", "type": "api", "conf": { @@ -2531,7 +2521,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 149, + "id": 148, "name": "gonghui/Manage", "type": "api", "conf": { @@ -2541,7 +2531,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 150, + "id": 149, "name": "gonghui/Open", "type": "api", "conf": { @@ -2551,7 +2541,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 151, + "id": 150, "name": "gonghui/TanHe", "type": "api", "conf": { @@ -2561,7 +2551,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 152, + "id": 151, "name": "gonghui/TaskOpen", "type": "api", "conf": { @@ -2571,7 +2561,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 153, + "id": 152, "name": "gonghui/TaskReceive", "type": "api", "conf": { @@ -2581,7 +2571,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 154, + "id": 153, "name": "gonghui/UpWz", "type": "api", "conf": { @@ -2591,137 +2581,137 @@ export const serviceProto: ServiceProto = { } }, { - "id": 155, + "id": 154, "name": "gonghuibaozang/Lottery", "type": "api" }, { - "id": 156, + "id": 155, "name": "gonghuibaozang/Open", "type": "api" }, { - "id": 157, + "id": 156, "name": "gonglukuangbiao/Buy", "type": "api" }, { - "id": 158, + "id": 157, "name": "gonglukuangbiao/Fight", "type": "api" }, { - "id": 159, + "id": 158, "name": "gonglukuangbiao/Open", "type": "api" }, { - "id": 160, + "id": 159, "name": "gonglukuangbiao/Refresh", "type": "api" }, { - "id": 161, + "id": 160, "name": "gongyu/mingdao/Active", "type": "api" }, { - "id": 162, + "id": 161, "name": "gongyu/mingdao/Open", "type": "api" }, { - "id": 163, + "id": 162, "name": "gongyu/mingdao/RecPrize", "type": "api" }, { - "id": 164, + "id": 163, "name": "gongyu/mingdao/Repair", "type": "api" }, { - "id": 165, + "id": 164, "name": "gongyu/xunlianjihua/Reset", "type": "api" }, { - "id": 166, + "id": 165, "name": "gongyu/xunlianjihua/UpSkill", "type": "api" }, { - "id": 167, + "id": 166, "name": "gongyu/zuozhanjihua/SetSkill", "type": "api" }, { - "id": 168, + "id": 167, "name": "hbzb/jfs/BuyNum", "type": "api" }, { - "id": 169, + "id": 168, "name": "hbzb/jfs/Fight", "type": "api" }, { - "id": 170, + "id": 169, "name": "hbzb/jfs/GetLog", "type": "api" }, { - "id": 171, + "id": 170, "name": "hbzb/jfs/Open", "type": "api" }, { - "id": 172, + "id": 171, "name": "hbzb/jfs/Rec", "type": "api" }, { - "id": 173, + "id": 172, "name": "hbzb/jfs/Refresh", "type": "api" }, { - "id": 174, + "id": 173, "name": "hbzb/GetStatus", "type": "api" }, { - "id": 175, + "id": 174, "name": "hbzb/zbs/BuyNum", "type": "api" }, { - "id": 176, + "id": 175, "name": "hbzb/zbs/Fight", "type": "api" }, { - "id": 177, + "id": 176, "name": "hbzb/zbs/GetLog", "type": "api" }, { - "id": 178, + "id": 177, "name": "hbzb/zbs/Open", "type": "api" }, { - "id": 179, + "id": 178, "name": "hbzb/zbs/Refresh", "type": "api" }, { - "id": 180, + "id": 179, "name": "hero/Awake", "type": "api" }, { - "id": 181, + "id": 180, "name": "hero/ChangePos", "type": "api", "conf": { @@ -2729,17 +2719,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 182, + "id": 181, "name": "hero/GetList", "type": "api" }, { - "id": 183, + "id": 182, "name": "hero/JinJie", "type": "api" }, { - "id": 184, + "id": 183, "name": "hero/LvUp", "type": "api", "conf": { @@ -2747,32 +2737,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 185, + "id": 184, "name": "hero/Potency", "type": "api" }, { - "id": 186, + "id": 185, "name": "hero/Rec", "type": "api" }, { - "id": 187, + "id": 186, "name": "hero/Reset", "type": "api" }, { - "id": 188, + "id": 187, "name": "hero/Talent", "type": "api" }, { - "id": 189, + "id": 188, "name": "hero/WeaponUp", "type": "api" }, { - "id": 190, + "id": 189, "name": "hongdian/Get", "type": "api", "conf": { @@ -2780,117 +2770,117 @@ export const serviceProto: ServiceProto = { } }, { - "id": 191, + "id": 190, "name": "item/GetList", "type": "api" }, { - "id": 192, + "id": 191, "name": "item/Use", "type": "api" }, { - "id": 193, + "id": 192, "name": "jiaotang/Lottery", "type": "api" }, { - "id": 194, + "id": 193, "name": "jiaotang/Open", "type": "api" }, { - "id": 195, + "id": 194, "name": "jiuba/Lottery", "type": "api" }, { - "id": 196, + "id": 195, "name": "jiuba/Open", "type": "api" }, { - "id": 197, + "id": 196, "name": "jjc/BuyFightNum", "type": "api" }, { - "id": 198, + "id": 197, "name": "jjc/Fight", "type": "api" }, { - "id": 199, + "id": 198, "name": "jjc/FightLog", "type": "api" }, { - "id": 200, + "id": 199, "name": "jjc/Open", "type": "api" }, { - "id": 201, + "id": 200, "name": "jjc/Receive", "type": "api" }, { - "id": 202, + "id": 201, "name": "jjc/Refresh", "type": "api" }, { - "id": 203, + "id": 202, "name": "kaifujingsai/Open", "type": "api" }, { - "id": 204, + "id": 203, "name": "kaifujingsai/Receive", "type": "api" }, { - "id": 205, + "id": 204, "name": "kbzz/Apply", "type": "api" }, { - "id": 206, + "id": 205, "name": "kbzz/AutoApply", "type": "api" }, { - "id": 207, + "id": 206, "name": "kbzz/BuyNum", "type": "api" }, { - "id": 208, + "id": 207, "name": "kbzz/Fight", "type": "api" }, { - "id": 209, + "id": 208, "name": "kbzz/FightLog", "type": "api" }, { - "id": 210, + "id": 209, "name": "kbzz/GroupState", "type": "api" }, { - "id": 211, + "id": 210, "name": "kbzz/Open", "type": "api" }, { - "id": 212, + "id": 211, "name": "kbzz/RecPrize", "type": "api" }, { - "id": 213, + "id": 212, "name": "kbzz/Refresh", "type": "api", "conf": { @@ -2898,287 +2888,287 @@ export const serviceProto: ServiceProto = { } }, { - "id": 214, + "id": 213, "name": "kuangdong/AddPkNum", "type": "api" }, { - "id": 215, + "id": 214, "name": "kuangdong/GetPrize", "type": "api" }, { - "id": 216, + "id": 215, "name": "kuangdong/KdInfo", "type": "api" }, { - "id": 217, + "id": 216, "name": "kuangdong/Log", "type": "api" }, { - "id": 218, + "id": 217, "name": "kuangdong/Open", "type": "api" }, { - "id": 219, + "id": 218, "name": "kuangdong/YanShi", "type": "api" }, { - "id": 220, + "id": 219, "name": "kuangdong/ZhanLing", "type": "api" }, { - "id": 221, + "id": 220, "name": "lingzhulaixi/Open", "type": "api" }, { - "id": 222, + "id": 221, "name": "lingzhulaixi/PkBoss", "type": "api" }, { - "id": 223, + "id": 222, "name": "lingzhulaixi/PkRank", "type": "api" }, { - "id": 224, + "id": 223, "name": "lingzhulaixi/SaoDang", "type": "api" }, { - "id": 225, + "id": 224, "name": "meirishilian/Buy", "type": "api" }, { - "id": 226, + "id": 225, "name": "meirishilian/Fight", "type": "api" }, { - "id": 227, + "id": 226, "name": "meirishilian/Open", "type": "api" }, { - "id": 228, + "id": 227, "name": "msg_c2s/BindUid", "type": "msg" }, { - "id": 229, + "id": 228, "name": "msg_c2s/Pay", "type": "msg" }, { - "id": 230, + "id": 229, "name": "msg_c2s/Sync", "type": "msg" }, { - "id": 231, + "id": 230, "name": "msg_s2c/Chat", "type": "msg" }, { - "id": 232, + "id": 231, "name": "msg_s2c/ChatHelp", "type": "msg" }, { - "id": 233, + "id": 232, "name": "msg_s2c/Collection", "type": "msg" }, { - "id": 234, + "id": 233, "name": "msg_s2c/Email", "type": "msg" }, { - "id": 235, + "id": 234, "name": "msg_s2c/EmailDel", "type": "msg" }, { - "id": 236, + "id": 235, "name": "msg_s2c/EquipChange", "type": "msg" }, { - "id": 237, + "id": 236, "name": "msg_s2c/Friend", "type": "msg" }, { - "id": 238, + "id": 237, "name": "msg_s2c/GhChange", "type": "msg" }, { - "id": 239, + "id": 238, "name": "msg_s2c/GongHuiBaoZang", "type": "msg" }, { - "id": 240, + "id": 239, "name": "msg_s2c/HeroChange", "type": "msg" }, { - "id": 241, + "id": 240, "name": "msg_s2c/HongDianChange", "type": "msg" }, { - "id": 242, + "id": 241, "name": "msg_s2c/ItemChange", "type": "msg" }, { - "id": 243, + "id": 242, "name": "msg_s2c/LoginQueue", "type": "msg" }, { - "id": 244, + "id": 243, "name": "msg_s2c/LshdChange", "type": "msg" }, { - "id": 245, + "id": 244, "name": "msg_s2c/NewDay", "type": "msg" }, { - "id": 246, + "id": 245, "name": "msg_s2c/OtherLogin", "type": "msg" }, { - "id": 247, + "id": 246, "name": "msg_s2c/PayChange", "type": "msg" }, { - "id": 248, + "id": 247, "name": "msg_s2c/PayResult", "type": "msg" }, { - "id": 249, + "id": 248, "name": "msg_s2c/PeijianChange", "type": "msg" }, { - "id": 250, + "id": 249, "name": "msg_s2c/PlayerChange", "type": "msg" }, { - "id": 251, + "id": 250, "name": "msg_s2c/Private", "type": "msg" }, { - "id": 252, + "id": 251, "name": "msg_s2c/PushGiftChange", "type": "msg" }, { - "id": 253, + "id": 252, "name": "msg_s2c/SendGift", "type": "msg" }, { - "id": 254, + "id": 253, "name": "msg_s2c/ShiwuChange", "type": "msg" }, { - "id": 255, + "id": 254, "name": "msg_s2c/TaskChange", "type": "msg" }, { - "id": 256, + "id": 255, "name": "msg_s2c/Xianshilibao", "type": "msg" }, { - "id": 257, + "id": 256, "name": "pata/Fight", "type": "api" }, { - "id": 258, + "id": 257, "name": "pata/GetPrize", "type": "api" }, { - "id": 259, + "id": 258, "name": "pata/Open", "type": "api" }, { - "id": 260, + "id": 259, "name": "pata/SaoDang", "type": "api" }, { - "id": 261, + "id": 260, "name": "pay/GetList", "type": "api" }, { - "id": 262, + "id": 261, "name": "peijian/GetList", "type": "api" }, { - "id": 263, + "id": 262, "name": "peijian/JingLian", "type": "api" }, { - "id": 264, + "id": 263, "name": "peijian/JinJie", "type": "api" }, { - "id": 265, + "id": 264, "name": "peijian/LvUp", "type": "api" }, { - "id": 266, + "id": 265, "name": "peijian/OneKeyLvUp", "type": "api" }, { - "id": 267, + "id": 266, "name": "peijian/OneKeyWear", "type": "api" }, { - "id": 268, + "id": 267, "name": "peijian/Reset", "type": "api" }, { - "id": 269, + "id": 268, "name": "peijian/Rm", "type": "api" }, { - "id": 270, + "id": 269, "name": "peijian/TakeOff", "type": "api", "conf": { @@ -3186,32 +3176,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 271, + "id": 270, "name": "peijian/UnLock", "type": "api" }, { - "id": 272, + "id": 271, "name": "peijian/Wear", "type": "api" }, { - "id": 273, + "id": 272, "name": "peijiancangku/Deal", "type": "api" }, { - "id": 274, + "id": 273, "name": "peijiancangku/Jump", "type": "api" }, { - "id": 275, + "id": 274, "name": "peijiancangku/Open", "type": "api" }, { - "id": 276, + "id": 275, "name": "Bingo", "type": "api", "conf": { @@ -3219,147 +3209,147 @@ export const serviceProto: ServiceProto = { } }, { - "id": 277, + "id": 276, "name": "FightTest", "type": "api" }, { - "id": 278, + "id": 277, "name": "SyncBtn", "type": "api" }, { - "id": 279, + "id": 278, "name": "Test", "type": "api" }, { - "id": 280, + "id": 279, "name": "pushgift/ItemNoEnough", "type": "api" }, { - "id": 281, + "id": 280, "name": "pushgift/Open", "type": "api" }, { - "id": 282, + "id": 281, "name": "qjzzd/Fight", "type": "api" }, { - "id": 283, + "id": 282, "name": "qjzzd/Open", "type": "api" }, { - "id": 284, + "id": 283, "name": "rank/Open", "type": "api" }, { - "id": 285, + "id": 284, "name": "shiwu/Concise", "type": "api" }, { - "id": 286, + "id": 285, "name": "shiwu/Extract", "type": "api" }, { - "id": 287, + "id": 286, "name": "shiwu/GetList", "type": "api" }, { - "id": 288, + "id": 287, "name": "shiwu/LvUp", "type": "api" }, { - "id": 289, + "id": 288, "name": "shiwu/Recast", "type": "api" }, { - "id": 290, + "id": 289, "name": "shiwu/TakeOff", "type": "api" }, { - "id": 291, + "id": 290, "name": "shiwu/Wear", "type": "api" }, { - "id": 292, + "id": 291, "name": "shootGame/Open", "type": "api" }, { - "id": 293, + "id": 292, "name": "shootGame/Rec", "type": "api" }, { - "id": 294, + "id": 293, "name": "shop/Buy", "type": "api" }, { - "id": 295, + "id": 294, "name": "shop/Open", "type": "api" }, { - "id": 296, + "id": 295, "name": "shop/Refresh", "type": "api" }, { - "id": 297, + "id": 296, "name": "sign/GetBoxPrize", "type": "api" }, { - "id": 298, + "id": 297, "name": "sign/GetPrize", "type": "api" }, { - "id": 299, + "id": 298, "name": "sign/Open", "type": "api" }, { - "id": 300, + "id": 299, "name": "slzd/Aim", "type": "api" }, { - "id": 301, + "id": 300, "name": "slzd/BuyNum", "type": "api" }, { - "id": 302, + "id": 301, "name": "slzd/Fight", "type": "api" }, { - "id": 303, + "id": 302, "name": "slzd/FightLog", "type": "api" }, { - "id": 304, + "id": 303, "name": "slzd/MyRank", "type": "api" }, { - "id": 305, + "id": 304, "name": "slzd/Open", "type": "api", "conf": { @@ -3369,77 +3359,77 @@ export const serviceProto: ServiceProto = { } }, { - "id": 306, + "id": 305, "name": "slzd/OpenFort", "type": "api" }, { - "id": 307, + "id": 306, "name": "slzd/Rec", "type": "api" }, { - "id": 308, + "id": 307, "name": "slzd/Refresh", "type": "api" }, { - "id": 309, + "id": 308, "name": "slzd/Slot", "type": "api" }, { - "id": 310, + "id": 309, "name": "tanxian/Event", "type": "api" }, { - "id": 311, + "id": 310, "name": "tanxian/FastGuaJi", "type": "api" }, { - "id": 312, + "id": 311, "name": "tanxian/Fight", "type": "api" }, { - "id": 313, + "id": 312, "name": "tanxian/GuaJi", "type": "api" }, { - "id": 314, + "id": 313, "name": "tanxian/Open", "type": "api" }, { - "id": 315, + "id": 314, "name": "tanxian/Receive", "type": "api" }, { - "id": 316, + "id": 315, "name": "task/AllFinsh", "type": "api" }, { - "id": 317, + "id": 316, "name": "task/Finsh", "type": "api" }, { - "id": 318, + "id": 317, "name": "task/Open", "type": "api" }, { - "id": 319, + "id": 318, "name": "user/CDKEY", "type": "api" }, { - "id": 320, + "id": 319, "name": "user/ChangeInfo", "type": "api", "conf": { @@ -3447,202 +3437,202 @@ export const serviceProto: ServiceProto = { } }, { - "id": 321, + "id": 320, "name": "user/ChangeName", "type": "api" }, { - "id": 322, + "id": 321, "name": "user/Dot", "type": "api" }, { - "id": 323, + "id": 322, "name": "user/Fight", "type": "api" }, { - "id": 324, + "id": 323, "name": "user/GetInfo", "type": "api" }, { - "id": 325, + "id": 324, "name": "user/InfoOpen", "type": "api" }, { - "id": 326, + "id": 325, "name": "user/Login", "type": "api" }, { - "id": 327, + "id": 326, "name": "user/Ping", "type": "api" }, { - "id": 328, + "id": 327, "name": "user/Renown", "type": "api" }, { - "id": 329, + "id": 328, "name": "user/RenownBuy", "type": "api" }, { - "id": 330, + "id": 329, "name": "user/RenownGetPrize", "type": "api" }, { - "id": 331, + "id": 330, "name": "user/RenownOpen", "type": "api" }, { - "id": 332, + "id": 331, "name": "user/Tujian", "type": "api" }, { - "id": 333, + "id": 332, "name": "weixiuchang/Decompose", "type": "api" }, { - "id": 334, + "id": 333, "name": "weixiuchang/Exchange", "type": "api" }, { - "id": 335, + "id": 334, "name": "weixiuchang/Open", "type": "api" }, { - "id": 336, + "id": 335, "name": "weixiuchang/UpLv", "type": "api" }, { - "id": 337, + "id": 336, "name": "weixiuchang/UpStar", "type": "api" }, { - "id": 338, + "id": 337, "name": "wzry/AutoBaoMing", "type": "api" }, { - "id": 339, + "id": 338, "name": "wzry/BaoMing", "type": "api" }, { - "id": 340, + "id": 339, "name": "wzry/catFightLog", "type": "api" }, { - "id": 341, + "id": 340, "name": "wzry/CatGroup", "type": "api" }, { - "id": 342, + "id": 341, "name": "wzry/DldFight", "type": "api" }, { - "id": 343, + "id": 342, "name": "wzry/DldRefre", "type": "api" }, { - "id": 344, + "id": 343, "name": "wzry/JingCai", "type": "api" }, { - "id": 345, + "id": 344, "name": "wzry/JingCaiOpen", "type": "api" }, { - "id": 346, + "id": 345, "name": "wzry/Open", "type": "api" }, { - "id": 347, + "id": 346, "name": "wzry/UpdateFight", "type": "api" }, { - "id": 348, + "id": 347, "name": "wzry/Wzzd", "type": "api" }, { - "id": 349, + "id": 348, "name": "wzry/ZuanShiOpen", "type": "api" }, { - "id": 350, + "id": 349, "name": "xstask/AllGet", "type": "api" }, { - "id": 351, + "id": 350, "name": "xstask/Get", "type": "api" }, { - "id": 352, + "id": 351, "name": "xstask/LvUp", "type": "api" }, { - "id": 353, + "id": 352, "name": "xstask/OnekeyReceive", "type": "api" }, { - "id": 354, + "id": 353, "name": "xstask/Open", "type": "api" }, { - "id": 355, + "id": 354, "name": "xstask/Receive", "type": "api" }, { - "id": 356, + "id": 355, "name": "xstask/Refresh", "type": "api" }, { - "id": 357, + "id": 356, "name": "yongbingzhuzhan/Handle", "type": "api" }, { - "id": 358, + "id": 357, "name": "zhanqianbushu/ChangePos", "type": "api" }, { - "id": 359, + "id": 358, "name": "zhanqianbushu/Select", "type": "api" }, { - "id": 360, + "id": 359, "name": "zhanqianbushu/Up", "type": "api" } @@ -11418,27 +11408,6 @@ export const serviceProto: ServiceProto = { } ] }, - "event/yuandan/PtlDMOpen/ReqDMOpen": { - "type": "Interface" - }, - "event/yuandan/PtlDMOpen/ResDMOpen": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "myData", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - } - ] - }, "event/yuandan/PtlDMRec/ReqDMRec": { "type": "Interface", "properties": [ From d5ef0b3187f715a12424cf0b55213c44eca2c8a5 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 09:40:15 +0800 Subject: [PATCH 05/26] yuandan --- src/api_s2c/event/yuandan/ApiOpen.ts | 4 ++-- src/shared/protocols/event/yuandan/PtlOpen.ts | 11 +++++++++++ src/shared/protocols/serviceProto.ts | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/shared/protocols/event/yuandan/PtlOpen.ts diff --git a/src/api_s2c/event/yuandan/ApiOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts index a22e2cc..3125332 100644 --- a/src/api_s2c/event/yuandan/ApiOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -1,10 +1,10 @@ import {ApiCall} from "tsrpc"; -import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen"; +import {ReqOpen, ResOpen} from "../../../shared/protocols/event/yuandan/PtlOpen"; import {HuoDongFun} from "../../../public/huodongfun"; import {PayFun} from "../../../public/pay"; import {Yuandanfun} from "./fun"; -export default async function (call: ApiCall) { +export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) call.succ({ diff --git a/src/shared/protocols/event/yuandan/PtlOpen.ts b/src/shared/protocols/event/yuandan/PtlOpen.ts new file mode 100644 index 0000000..59e1de9 --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlOpen.ts @@ -0,0 +1,11 @@ + +/** + * 元旦 + */ +export type ReqOpen = { + id: string +} + +export type ResOpen = { + +} diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index a9f23a3..d0ea1d1 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -94,7 +94,7 @@ import { ReqRec as ReqRec_8, ResRec as ResRec_8 } from './event/yangchengmubiao/ import { ReqOpen as ReqOpen_26, ResOpen as ResOpen_26 } from './event/yibaichou/PtlOpen'; import { ReqRec as ReqRec_9, ResRec as ResRec_9 } from './event/yibaichou/PtlRec'; import { ReqRecAll, ResRecAll } from './event/yibaichou/PtlRecAll'; -import { ReqDMRec, ResDMRec } from './event/yuandan/PtlDMRec'; +import { ReqDMRec, ResDMRec } from './event/yuandan/PtlOpen'; import { ReqDZOpen, ResDZOpen } from './event/yuandan/PtlDZOpen'; import { ReqDZRec, ResDZRec } from './event/yuandan/PtlDZRec'; import { ReqExchange, ResExchange } from './event/yuandan/PtlExchange'; From fd035faf86c6d5c5ea202bdaf8053f39defa2ec3 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 14:04:19 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 26 +- src/api_s2c/event/yuandan/ApiDZOpen.ts | 17 -- src/api_s2c/event/yuandan/ApiDZRec.ts | 10 +- src/api_s2c/event/yuandan/ApiExchange.ts | 13 +- src/api_s2c/event/yuandan/ApiExchangeOpen.ts | 10 - src/api_s2c/event/yuandan/ApiOpen.ts | 4 +- src/api_s2c/event/yuandan/ApiTaskFinish.ts | 14 +- src/api_s2c/event/yuandan/ApiTaskOpen.ts | 0 src/api_s2c/event/yuandan/ApiZLOpen.ts | 16 -- src/api_s2c/event/yuandan/ApiZLRec.ts | 27 +- src/api_s2c/event/yuandan/fun.ts | 248 ++++++----------- src/module/collection_event.ts | 7 +- src/public/taskclass.ts | 3 + .../protocols/event/yuandan/PtlDMRec.ts | 8 +- .../protocols/event/yuandan/PtlDZOpen.ts | 16 -- .../event/yuandan/PtlExchangeOpen.ts | 12 - src/shared/protocols/event/yuandan/PtlOpen.ts | 3 +- .../protocols/event/yuandan/PtlTaskRec.ts | 10 + .../protocols/event/yuandan/PtlZLOpen.ts | 13 - .../protocols/event/yuandan/PtlZLRec.ts | 3 +- src/shared/protocols/serviceProto.ts | 262 +++++++++--------- 21 files changed, 298 insertions(+), 424 deletions(-) delete mode 100644 src/api_s2c/event/yuandan/ApiDZOpen.ts delete mode 100644 src/api_s2c/event/yuandan/ApiExchangeOpen.ts delete mode 100644 src/api_s2c/event/yuandan/ApiTaskOpen.ts delete mode 100644 src/api_s2c/event/yuandan/ApiZLOpen.ts delete mode 100644 src/shared/protocols/event/yuandan/PtlDZOpen.ts delete mode 100644 src/shared/protocols/event/yuandan/PtlExchangeOpen.ts create mode 100644 src/shared/protocols/event/yuandan/PtlTaskRec.ts delete mode 100644 src/shared/protocols/event/yuandan/PtlZLOpen.ts diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index d850556..aa64623 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -5,20 +5,28 @@ import {PlayerFun} from "../../../public/player"; import {HongDianChange} from "../../hongdian/fun"; export default async function (call: ApiCall) { - // 查询活动是否有当前领奖的免费选项 + // 查询活动是否存在 let _hd = (await HuoDongFun.gethdList(call, 14))[0] - let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) - if (!gift) return call.errorCode(-1) + 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 (!prize) return call.errorCode(-2) // 取奖励列表,判断是否有可领取奖励 - let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) - let rec = data?.record?.[call.req.id] - if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) + let rec = data?.gameNum - await PlayerFun.sendPrize(call, gift.prize); + if (rec && rec >= _hd.data?.gamefree) { + await PlayerFun.checkNeedIsMeet(call, _hd.data.gameneed); + await PlayerFun.cutNeed(call, _hd.data.gameneed); + } - await G.mongodb.cEvent('yuandandamo').updateOne({uid: call.uid, type: 'yuandandamo'}, { - $inc: {[`record.${gift.id}`]: 1}, + await PlayerFun.sendPrize(call, prize); + + await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { + $inc: {[`gameNum`]: 1}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/ApiDZOpen.ts b/src/api_s2c/event/yuandan/ApiDZOpen.ts deleted file mode 100644 index ae9a55a..0000000 --- a/src/api_s2c/event/yuandan/ApiDZOpen.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {ApiCall} from "tsrpc"; -import {ReqDZOpen, ResDZOpen} from "../../../shared/protocols/event/yuandan/PtlDZOpen"; -import {HuoDongFun} from "../../../public/huodongfun"; -import {PayFun} from "../../../public/pay"; - -export default async function (call: ApiCall) { - let data = await G.mongodb.cEvent('yuandandingzhi').findOne({uid: call.uid, type: 'yuandandingzhi'}) - - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - - let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) - - call.succ({ - record: data?.record || {}, - buyLog: await PayFun.getPayLogs(call.uid, payIds) - }) -} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiDZRec.ts b/src/api_s2c/event/yuandan/ApiDZRec.ts index 9374b56..ce3f3f2 100644 --- a/src/api_s2c/event/yuandan/ApiDZRec.ts +++ b/src/api_s2c/event/yuandan/ApiDZRec.ts @@ -11,14 +11,14 @@ export default async function (call: ApiCall) { if (!gift) return call.errorCode(-1) // 取奖励列表,判断是否有可领取奖励 - let data = await G.mongodb.cEvent('yuandandingzhi').findOne({uid: call.uid, type: 'yuandandingzhi'}) - let rec = data?.record?.[call.req.id] - if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) + let rec = data?.gift?.[call.req.id] + if (rec && rec >= gift.buynum) return call.errorCode(-2) await PlayerFun.sendPrize(call, gift.prize); - await G.mongodb.cEvent('yuandandingzhi').updateOne({uid: call.uid, type: 'yuandandingzhi'}, { - $inc: {[`record.${gift.id}`]: 1}, + await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { + $inc: {[`gift.${gift.id}`]: 1}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/ApiExchange.ts b/src/api_s2c/event/yuandan/ApiExchange.ts index 1724dcd..a3285db 100644 --- a/src/api_s2c/event/yuandan/ApiExchange.ts +++ b/src/api_s2c/event/yuandan/ApiExchange.ts @@ -7,19 +7,20 @@ import {HongDianChange} from "../../hongdian/fun"; export default async function (call: ApiCall) { // 查询活动是否有当前领奖的免费选项 let _hd = (await HuoDongFun.gethdList(call, 14))[0] - let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) + let gift = _hd?.data?.duihuan?.find(i => i.id == call.req.id) if (!gift) return call.errorCode(-1) // 取奖励列表,判断是否有可领取奖励 - let data = await G.mongodb.cEvent('yuandanduihuan').findOne({uid: call.uid, type: 'yuandanduihuan'}) - let rec = data?.record?.[call.req.id] + let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) + let rec = data?.exchange?.[call.req.id] if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + await PlayerFun.checkNeedIsMeet(call, gift.need); + await PlayerFun.cutNeed(call, gift.need) await PlayerFun.sendPrize(call, gift.prize); - await PlayerFun.cutNeed(call, gift.prize) - await G.mongodb.cEvent('yuandanduihuan').updateOne({uid: call.uid, type: 'yuandanduihuan'}, { - $inc: {[`record.${gift.id}`]: 1}, + await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { + $inc: {[`exchange.${gift.id}`]: 1}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/ApiExchangeOpen.ts b/src/api_s2c/event/yuandan/ApiExchangeOpen.ts deleted file mode 100644 index 36910a4..0000000 --- a/src/api_s2c/event/yuandan/ApiExchangeOpen.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {ApiCall} from "tsrpc"; -import {ReqExchangeOpen, ResExchangeOpen} from "../../../shared/protocols/event/yuandan/PtlExchangeOpen"; - -export default async function (call: ApiCall) { - let data = await G.mongodb.cEvent('yuandanduihuan').findOne({uid: call.uid, type: 'yuandanduihuan'}) - - call.succ({ - record: data?.record || {}, - }) -} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts index 3125332..ea6aa7b 100644 --- a/src/api_s2c/event/yuandan/ApiOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -7,7 +7,5 @@ import {Yuandanfun} from "./fun"; export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) - call.succ({ - data: (await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: 'yuandandamo'})) || {} - }) + call.succ((await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})) || {}) } \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiTaskFinish.ts b/src/api_s2c/event/yuandan/ApiTaskFinish.ts index d0af2c9..14dd38d 100644 --- a/src/api_s2c/event/yuandan/ApiTaskFinish.ts +++ b/src/api_s2c/event/yuandan/ApiTaskFinish.ts @@ -1,18 +1,18 @@ import { ApiCall } from "tsrpc"; -import { ReqTaskRec, ResTaskRec } from "../../../shared/protocols/event/christmas/PtlTaskRec"; -import {Christmasfun} from "./fun"; +import { ReqTaskRec, ResTaskRec } from "../../../shared/protocols/event/yuandan/PtlTaskRec"; +import {Yuandanfun, Yuandanfun as Christmasfun} from "./fun"; import {HongDianChange} from "../../hongdian/fun"; import {PlayerFun} from "../../../public/player"; export default async function (call: ApiCall) { - let initCon = await Christmasfun.getCon(call) + let _hd = await Christmasfun.getCon(call) let taskid = call.req.taskid; - let _con = initCon[call.req.hdid].data.task[taskid]; + let _con = _hd.data.task[taskid]; if (!_con) { // 任务id 不存在 return call.error('', { code: -1, message: globalThis.lng.yangchengmubiao_2 }) } - let _mydata = await Christmasfun.getMyData(call, call.req.hdid) + let _mydata = await Yuandanfun.getData(call, _hd.hdid) if (_mydata.taskval[taskid] < _con.pval) { // 任务未完成 return call.error('', { code: -2, message: globalThis.lng.yangchengmubiao_3 }) @@ -27,11 +27,11 @@ export default async function (call: ApiCall) { _mydata["val"] += _addval _setData["val"] = _mydata.val _setData["taskfinish"] = _mydata.taskfinish - await Christmasfun.setMyData(call.uid, call.req.hdid, { $set: _setData }) + await Yuandanfun.setData(call.uid, _hd.hdid, { $set: _setData }) let _prize = _con.prize await PlayerFun.sendPrize(call, _prize); - let changedata = { mydata: _mydata, prize: _prize} + let changedata = { data: _mydata, prize: _prize} // 推送红点 HongDianChange.sendChangeKey(call.uid, ['huodonghd']); call.succ(changedata); diff --git a/src/api_s2c/event/yuandan/ApiTaskOpen.ts b/src/api_s2c/event/yuandan/ApiTaskOpen.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/api_s2c/event/yuandan/ApiZLOpen.ts b/src/api_s2c/event/yuandan/ApiZLOpen.ts deleted file mode 100644 index ebbdc52..0000000 --- a/src/api_s2c/event/yuandan/ApiZLOpen.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {ApiCall} from "tsrpc"; -import {ReqZLOpen, ResZLOpen} from "../../../shared/protocols/event/yuandan/PtlZLOpen"; -import {HuoDongFun} from "../../../public/huodongfun"; -import {PayFun} from "../../../public/pay"; - -export default async function (call: ApiCall) { - let data = await G.mongodb.cEvent('yuandanzengli').findOne({uid: call.uid, type: 'yuandanzengli'}) - - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - - let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) - - call.succ({ - record: data?.record || {}, - }) -} \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index 27624bd..46f3b47 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -3,22 +3,27 @@ import {ReqZLRec, ResZLRec} from "../../../shared/protocols/event/yuandan/PtlZLR import {HuoDongFun} from "../../../public/huodongfun"; import {PlayerFun} from "../../../public/player"; import {HongDianChange} from "../../hongdian/fun"; +import {Yuandanfun} from "./fun"; export default async function (call: ApiCall) { - // 查询活动是否有当前领奖的免费选项 - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) - if (!gift) return call.errorCode(-1) + let _hd = await Yuandanfun.getCon(call) + if (!_hd) return call.errorCode(-1) - // 取奖励列表,判断是否有可领取奖励 - let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) - let rec = data?.record?.[call.req.id] - if (rec && rec >= gift?.buyNum) return call.errorCode(-2) + // 查询是否存在当前传入id的礼品 + let gift = _hd?.data?.qiandao?.[call.req.id] + if (!gift) return call.errorCode(-2) - await PlayerFun.sendPrize(call, gift.prize); + // 奖励已领取 + let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) + let rec = data?.qiandao?.[call.req.id] + if (rec) return call.errorCode(-3) - await G.mongodb.cEvent('yuandandamo').updateOne({uid: call.uid, type: 'yuandandamo'}, { - $inc: {[`record.${gift.id}`]: 1}, + let prize = [gift.prize, ...gift.dlz.map((v, i) => v[call.req.dlz[i]])] + + await PlayerFun.sendPrize(call, prize); + + await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { + $inc: {[`qiandao.${call.req.id}`]: prize}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 7612211..7c9174d 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -1,82 +1,32 @@ import {ApiCall} from 'tsrpc'; -import {ReqAddHuoDong} from '../../../monopoly/protocols/PtlAddHuoDong'; import {HuoDongFun} from '../../../public/huodongfun'; import {christmas} from '../../../shared/protocols/event/christmas/PtlOpen'; import {PublicShared} from '../../../shared/public/public'; -import {PlayerFun} from "../../../public/player"; export class Yuandanfun { /**配置 */ static async getCon(call: ApiCall) { - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - if (!_hd) return call.errorCode(-1) - return _hd - } - - /**获取所有符合时间的活动 */ - static async gethdids(call: ApiCall) { - let _hdids = [] - let _hd = await HuoDongFun.gethdList(call, 8) - for (let index = 0; index < _hd.length; index++) { - const element = _hd[index]; - _hdids.push(element.hdid) - } - return _hdids + return (await HuoDongFun.gethdList(call, 14))[0] } /**获取我的数据 */ - static async getMyData(call: ApiCall, hdid: number) { - let db: any = await G.mongodb.cEvent(`christmas${hdid}`).findOne({ - uid: call.uid, - type: `christmas${hdid}`, - hdid: hdid - }); - if (!db) { - db = await this.initData(call, hdid) - await G.mongodb.cEvent(`christmas${hdid}`).updateOne( - {uid: call.uid, type: `christmas${hdid}`, hdid: hdid}, - {$set: db}, - {upsert: true} - ) - } - let {_id, ..._myData} = db - if (!PublicShared.chkSameDate(_myData.refresh, G.time)) { + static async getData(call: ApiCall, hdid: number) { + + let data = await G.mongodb.cEvent(`yuandan${hdid}`).findOne({uid: call.uid, type: `yuandan${hdid}`}) + + if (!data || !data.refreshTime || !PublicShared.chkSameDate(data.refreshTime, G.time)) { // 刷新每日任务 - _myData = await this.refreTask(call, _myData, hdid) - + data = (await G.mongodb.cEvent(`yuandan${hdid}`).findOneAndUpdate({uid: call.uid, type: `yuandan${hdid}`}, { + $set: { + gameNum: 0, + gift: {}, + exchange: {}, + taskfinish: data?.taskfinish || [], + taskval: await this.getTaskVal(call, hdid), + }, + }, {upsert: true, returnDocument: 'after'})).value } - return _myData - } - - /**初始数据 */ - static async initData(call: ApiCall, hdid: number) { - let _initCon = await this.getCon(call) - let _con = _initCon[hdid] - let _r: christmas = { - type: `christmas${hdid}`, - uid: call.uid, - hdid: hdid, - taskval: await this.getTaskVal(call, hdid), - taskfinish: [], - refresh: G.time, - gamenum: 0, - pt: [], - gj: [], - pay: false, - select: {}, - val: 0, - qiandao: [], - libao: {} - } - return _r - } - - /**设置数据 */ - static async setMyData(uid: string, hdid: number, set: {}) { - await G.mongodb.cEvent(`christmas${hdid}`).updateOne( - {uid: uid, type: `christmas${hdid}`, hdid: hdid}, - set - ) + return data } /**获取所有taskid 及对应的值 */ @@ -94,114 +44,92 @@ export class Yuandanfun { } else { _res[element] = 0 } - - } return _res } - /**刷新每日任务 */ - static async refreTask(call: ApiCall, mydata: christmas, hdid: number) { - let _initCon = await this.getCon(call) - let _con = _initCon[hdid].data.task - if (!_con) return mydata - mydata.taskfinish = [] - mydata.taskval = await this.getTaskVal(call, hdid) - mydata.refresh = G.time - mydata.gamenum = 0 - mydata.libao = {} - await this.setMyData(call.uid, hdid, { - $set: { - refresh: mydata.refresh, - taskfinish: mydata.taskfinish, - taskval: mydata.taskval, - gamenum: mydata.gamenum, - libao: mydata.libao - } - }) - return mydata + /**设置数据 */ + static async setData(uid: string, hdid: number, set: {}) { + await G.mongodb.cEvent(`christmas${hdid}`).updateOne( + {uid: uid, type: `christmas${hdid}`}, + set + ) } - static async payChristmas(payid, call: any) { - let _hd = await HuoDongFun.gethdList(call, 8) - for (let index = 0; index < _hd.length; index++) { - const hdinfo = _hd[index]; - const _hdid = hdinfo.hdid - if (payid == hdinfo.data.zlpayid) { - let _mydata = await Yuandanfun.getMyData(call, _hdid) - if (_mydata.pay) continue - await this.setMyData(call.uid, _hdid, {$set: {pay: true}}) - // let _prize = hdinfo.data.zlpayprize - // await PlayerFun.sendPrize(call, _prize); - } else { - const libaos = hdinfo.data.libao - for (let index = 0; index < Object.keys(libaos).length; index++) { - const lbid = Object.keys(libaos)[index]; - let _tmp = libaos[lbid] - if (_tmp['payid'] != payid) continue - let _mydata = await Yuandanfun.getMyData(call, _hdid) - let _buyNum = _mydata.libao[lbid] || 0 - if (_buyNum >= _tmp["buynum"]) continue - _mydata.libao[lbid] = _buyNum + 1 - this.setMyData(call.uid, _hdid, {$set: {libao: _mydata.libao}}) - let _select = _mydata.select[lbid] || {} - let _prize: atn[] = _tmp["basep"] - for (let key in _select) { - _prize.push(_tmp["dlz"][parseInt(key)][_select[key]]) - } - await PlayerFun.sendPrize(call, _prize); - break - - } - } - } - } + // /**刷新每日任务 */ + // static async refreTask(call: ApiCall, mydata, hdid: number) { + // let _initCon = await this.getCon(call) + // let _con = _initCon[hdid].data.task + // if (!_con) return mydata + // mydata.taskfinish = [] + // mydata.taskval = await this.getTaskVal(call, hdid) + // mydata.refresh = G.time + // mydata.gamenum = 0 + // mydata.libao = {} + // + // (await G.mongodb.cEvent(`yuandan${hdid}`).findOneAndUpdate({uid: call.uid, type: `yuandan${hdid}`}, { + // $set: { + // gameNum: 0, + // gift: {}, + // exchange: {}, + // }, + // }, {upsert: true, returnDocument: 'after'})).value + // + // await this.setMyData(call.uid, hdid, { + // $set: { + // refreshTime: mydata.refreshTime, + // taskfinish: mydata.taskfinish, + // taskval: mydata.taskval, + // gamenum: mydata.gamenum, + // libao: mydata.libao + // } + // }) + // return mydata + // } /**设置任务 */ static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) { - let hdids = await this.gethdids(call) - if (hdids.length <= 0) return // 活动过期,不计数 - let _initCon = await this.getCon(call) + // let hdids = await this.gethdids(call) + // if (hdids.length <= 0) return // 活动过期,不计数 + let _hd = await this.getCon(call) + if (!_hd) return - for (let index = 0; index < hdids.length; index++) { - const hdid = hdids[index]; - // let _mydata = await Christmasfun.getMyData(call, hdid) - let _tasks = _initCon[hdid].data.task + // let _mydata = await Christmasfun.getMyData(call, hdid) + let _tasks = _hd.data.task - let _setData = { - $inc: {}, - $set: {} + let _setData = { + $inc: {}, + $set: {} + } + let isset = 0 + for (let indextask = 0; indextask < Object.keys(_tasks).length; indextask++) { + const ele = Object.keys(_tasks)[indextask]; + // 具体任务配置 + let _taskCon = _tasks[ele] + if (_taskCon.stype != stype) continue + + let _pval = _taskCon.pval + // 不符合任务要求 + if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue + + // 根据需求改写 + val = await alchangeVal(call, _taskCon, val, arg) + + isset = 1 + if (isinc == 1) { // 累加 + _setData["$inc"][`taskval.${ele}`] = val + } else { + _setData["$set"][`taskval.${ele}`] = val } - let isset = 0 - for (let indextask = 0; indextask < Object.keys(_tasks).length; indextask++) { - const ele = Object.keys(_tasks)[indextask]; - // 具体任务配置 - let _taskCon = _tasks[ele] - if (_taskCon.stype != stype) continue + } - let _pval = _taskCon.pval - // 不符合任务要求 - if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue - - // 根据需求改写 - val = await alchangeVal(call, _taskCon, val, arg) - - isset = 1 - if (isinc == 1) { // 累加 - _setData["$inc"][`taskval.${ele}`] = val - } else { - _setData["$set"][`taskval.${ele}`] = val - } - } - - // 设置任务 - if (isset == 1) { - await G.mongodb.collection('event').updateMany( - {uid: call.uid, type: {$regex: "christmas"}, hdid: parseInt(hdid)}, - _setData - ) - } + // 设置任务 + if (isset == 1) { + await G.mongodb.collection('event').updateMany( + {uid: call.uid, type: {$regex: "yuandan"}, hdid: parseInt(_hd.hdid)}, + _setData + ) } } diff --git a/src/module/collection_event.ts b/src/module/collection_event.ts index 3e1418a..5a42bd6 100644 --- a/src/module/collection_event.ts +++ b/src/module/collection_event.ts @@ -23,6 +23,7 @@ import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/P import {ResOpen as ResOpenZhoumolibao} from '../shared/protocols/event/zhoumolibao/PtlOpen'; import {ResOpen as ResOpenPobinglibao} from '../shared/protocols/event/pobinglibao/PtlOpen'; import {ResOpen as ResOpenLeiChongLiBao} from '../shared/protocols/event/leichonglibao/PtlOpen'; +import {ResOpen as ResOpenYuandan} from '../shared/protocols/event/yuandan/PtlOpen'; export type eventType = { shouchong: { @@ -57,10 +58,6 @@ export type eventType = { payForDiamond: { [time: number]: number } - yuandandingzhi: ResOpenZhoumolibao & { refreshTime: number; }; - yuandanduihuan: ResOpenZhoumolibao & { refreshTime: number; }; - yuandandamo: ResOpenZhoumolibao & { refreshTime: number; }; - yuandanzengli: ResOpenZhoumolibao & { refreshTime: number; }; } & { [k: `${number}jijin`]: ResOpenYuedujijin; @@ -72,7 +69,7 @@ export type eventType = { [k: `leijichongzhi${number}`]: Omit; [k: `qiridenglu${number}`]: Pick; [k: `leichonglibao${number}`]: ResOpenLeiChongLiBao & { opentime: number }; - [k: `yuandan${number}`]: christmas; + [k: `yuandan${number}`]: ResOpenYuandan; }; export type CollectionEvent = { diff --git a/src/public/taskclass.ts b/src/public/taskclass.ts index 5bf3f67..4b01c25 100644 --- a/src/public/taskclass.ts +++ b/src/public/taskclass.ts @@ -13,6 +13,7 @@ import {weixiuchangType} from "../shared/protocols/weixiuchang/type"; import {FunWeiXiuChang} from "./weixiuchang"; import {JJCFun} from "./jjc"; import {getGud} from "./gud"; +import {Yuandanfun} from "../api_s2c/event/yuandan/fun"; let _classNameFunc = {} /** @@ -76,6 +77,8 @@ export module manager { YangChengMuBiaofun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg) // 圣诞活动任务计数 Christmasfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg) + // 元旦活动任务计数 + Yuandanfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg) } // 任务数值, 和检测值,看情况需要上层复写 diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index 5aa6964..4bcd355 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -1,11 +1,9 @@ - /** * 元旦达摩领奖 */ export type ReqDMRec = { - id: string + id: string, + prize: { a: string, t: string, n: number } } -export type ResDMRec = { - -} +export type ResDMRec = {} diff --git a/src/shared/protocols/event/yuandan/PtlDZOpen.ts b/src/shared/protocols/event/yuandan/PtlDZOpen.ts deleted file mode 100644 index ef0f7b2..0000000 --- a/src/shared/protocols/event/yuandan/PtlDZOpen.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * 元旦定制 - */ -export type ReqDZOpen = { - -}; - -export type ResDZOpen = { - record:{ - [k: string]: any; - } - buyLog:{ - [k: string]: any; - } -}; \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts b/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts deleted file mode 100644 index ca3afad..0000000 --- a/src/shared/protocols/event/yuandan/PtlExchangeOpen.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 元旦兑换 - */ -export type ReqExchangeOpen = { - -} - -export type ResExchangeOpen = { - record:{ - [k: string]: any; - } -} diff --git a/src/shared/protocols/event/yuandan/PtlOpen.ts b/src/shared/protocols/event/yuandan/PtlOpen.ts index 59e1de9..294e1a5 100644 --- a/src/shared/protocols/event/yuandan/PtlOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlOpen.ts @@ -1,4 +1,3 @@ - /** * 元旦 */ @@ -7,5 +6,5 @@ export type ReqOpen = { } export type ResOpen = { - + [k: string]: any; } diff --git a/src/shared/protocols/event/yuandan/PtlTaskRec.ts b/src/shared/protocols/event/yuandan/PtlTaskRec.ts new file mode 100644 index 0000000..437253b --- /dev/null +++ b/src/shared/protocols/event/yuandan/PtlTaskRec.ts @@ -0,0 +1,10 @@ +/** + * 元旦任务领奖 + */ +export type ReqTaskRec = { + taskid: string +} + +export type ResTaskRec = { + [k: string]: any; +} diff --git a/src/shared/protocols/event/yuandan/PtlZLOpen.ts b/src/shared/protocols/event/yuandan/PtlZLOpen.ts deleted file mode 100644 index f8e1829..0000000 --- a/src/shared/protocols/event/yuandan/PtlZLOpen.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * 元旦赠礼 - */ -export type ReqZLOpen = { - -}; - -export type ResZLOpen = { - record:{ - [k: string]: any; - } -}; \ No newline at end of file diff --git a/src/shared/protocols/event/yuandan/PtlZLRec.ts b/src/shared/protocols/event/yuandan/PtlZLRec.ts index 3152d3a..6e2d21f 100644 --- a/src/shared/protocols/event/yuandan/PtlZLRec.ts +++ b/src/shared/protocols/event/yuandan/PtlZLRec.ts @@ -3,7 +3,8 @@ * 元旦赠礼领奖 */ export type ReqZLRec = { - id: string + id: string, + dlz: string[] } export type ResZLRec = { diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index d0ea1d1..9ef6cbf 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -94,39 +94,39 @@ import { ReqRec as ReqRec_8, ResRec as ResRec_8 } from './event/yangchengmubiao/ import { ReqOpen as ReqOpen_26, ResOpen as ResOpen_26 } from './event/yibaichou/PtlOpen'; import { ReqRec as ReqRec_9, ResRec as ResRec_9 } from './event/yibaichou/PtlRec'; import { ReqRecAll, ResRecAll } from './event/yibaichou/PtlRecAll'; -import { ReqDMRec, ResDMRec } from './event/yuandan/PtlOpen'; +import { ReqDMRec, ResDMRec } from './event/yuandan/PtlDMRec'; import { ReqDZOpen, ResDZOpen } from './event/yuandan/PtlDZOpen'; import { ReqDZRec, ResDZRec } from './event/yuandan/PtlDZRec'; import { ReqExchange, ResExchange } from './event/yuandan/PtlExchange'; import { ReqExchangeOpen, ResExchangeOpen } from './event/yuandan/PtlExchangeOpen'; -import { ReqZLOpen, ResZLOpen } from './event/yuandan/PtlZLOpen'; +import { ReqOpen as ReqOpen_27, ResOpen as ResOpen_27 } from './event/yuandan/PtlOpen'; import { ReqZLRec, ResZLRec } from './event/yuandan/PtlZLRec'; -import { ReqOpen as ReqOpen_27, ResOpen as ResOpen_27 } from './event/yuedujijin/PtlOpen'; +import { ReqOpen as ReqOpen_28, ResOpen as ResOpen_28 } from './event/yuedujijin/PtlOpen'; import { ReqRec as ReqRec_10, ResRec as ResRec_10 } from './event/yuedujijin/PtlRec'; import { ReqBuyLv, ResBuyLv } from './event/zhanling/PtlBuyLv'; -import { ReqOpen as ReqOpen_28, ResOpen as ResOpen_28 } from './event/zhanling/PtlOpen'; +import { ReqOpen as ReqOpen_29, ResOpen as ResOpen_29 } from './event/zhanling/PtlOpen'; import { ReqRecPrize as ReqRecPrize_2, ResRecPrize as ResRecPrize_2 } from './event/zhanling/PtlRecPrize'; import { ReqRecTask, ResRecTask } from './event/zhanling/PtlRecTask'; -import { ReqOpen as ReqOpen_29, ResOpen as ResOpen_29 } from './event/zhoulibao/PtlOpen'; -import { ReqOpen as ReqOpen_30, ResOpen as ResOpen_30 } from './event/zhoumolibao/PtlOpen'; +import { ReqOpen as ReqOpen_30, ResOpen as ResOpen_30 } from './event/zhoulibao/PtlOpen'; +import { ReqOpen as ReqOpen_31, ResOpen as ResOpen_31 } from './event/zhoumolibao/PtlOpen'; import { ReqReceive as ReqReceive_6, ResReceive as ResReceive_6 } from './event/zhoumolibao/PtlReceive'; import { ReqBuy as ReqBuy_3, ResBuy as ResBuy_3 } from './event/zixuanlibao/PtlBuy'; -import { ReqOpen as ReqOpen_31, ResOpen as ResOpen_31 } from './event/zixuanlibao/PtlOpen'; +import { ReqOpen as ReqOpen_32, ResOpen as ResOpen_32 } from './event/zixuanlibao/PtlOpen'; import { ReqhdGetList, ReshdGetList } from './eventlist/PtlhdGetList'; import { ReqApply, ResApply } from './friend/PtlApply'; import { ReqDel, ResDel } from './friend/PtlDel'; import { ReqGift, ResGift } from './friend/PtlGift'; import { ReqList, ResList } from './friend/PtlList'; -import { ReqOpen as ReqOpen_32, ResOpen as ResOpen_32 } from './friend/PtlOpen'; +import { ReqOpen as ReqOpen_33, ResOpen as ResOpen_33 } from './friend/PtlOpen'; import { ReqRespond, ResRespond } from './friend/PtlRespond'; import { ReqRmBlackList, ResRmBlackList } from './friend/PtlRmBlackList'; import { ReqSearch, ResSearch } from './friend/PtlSearch'; import { ReqChallenge, ResChallenge } from './ganbutexun/PtlChallenge'; -import { ReqOpen as ReqOpen_33, ResOpen as ResOpen_33 } from './ganbutexun/PtlOpen'; +import { ReqOpen as ReqOpen_34, ResOpen as ResOpen_34 } from './ganbutexun/PtlOpen'; import { ReqFast, ResFast } from './ganhai/PtlFast'; import { ReqFight as ReqFight_1, ResFight as ResFight_1 } from './ganhai/PtlFight'; import { ReqLog, ResLog } from './ganhai/PtlLog'; -import { ReqOpen as ReqOpen_34, ResOpen as ResOpen_34 } from './ganhai/PtlOpen'; +import { ReqOpen as ReqOpen_35, ResOpen as ResOpen_35 } from './ganhai/PtlOpen'; import { ReqRefresh, ResRefresh } from './ganhai/PtlRefresh'; import { ReqRefreshShip, ResRefreshShip } from './ganhai/PtlRefreshShip'; import { ReqSelect as ReqSelect_1, ResSelect as ResSelect_1 } from './ganhai/PtlSelect'; @@ -148,19 +148,19 @@ import { ReqJx, ResJx } from './gonghui/PtlJx'; import { ReqJxOpen, ResJxOpen } from './gonghui/PtlJxOpen'; import { ReqList as ReqList_1, ResList as ResList_1 } from './gonghui/PtlList'; import { ReqManage, ResManage } from './gonghui/PtlManage'; -import { ReqOpen as ReqOpen_35, ResOpen as ResOpen_35 } from './gonghui/PtlOpen'; +import { ReqOpen as ReqOpen_36, ResOpen as ResOpen_36 } from './gonghui/PtlOpen'; import { ReqTanHe, ResTanHe } from './gonghui/PtlTanHe'; import { ReqTaskOpen, ResTaskOpen } from './gonghui/PtlTaskOpen'; import { ReqTaskReceive, ResTaskReceive } from './gonghui/PtlTaskReceive'; import { ReqUpWz, ResUpWz } from './gonghui/PtlUpWz'; import { ReqLottery as ReqLottery_2, ResLottery as ResLottery_2 } from './gonghuibaozang/PtlLottery'; -import { ReqOpen as ReqOpen_36, ResOpen as ResOpen_36 } from './gonghuibaozang/PtlOpen'; +import { ReqOpen as ReqOpen_37, ResOpen as ResOpen_37 } from './gonghuibaozang/PtlOpen'; import { ReqBuy as ReqBuy_4, ResBuy as ResBuy_4 } from './gonglukuangbiao/PtlBuy'; import { ReqFight as ReqFight_2, ResFight as ResFight_2 } from './gonglukuangbiao/PtlFight'; -import { ReqOpen as ReqOpen_37, ResOpen as ResOpen_37 } from './gonglukuangbiao/PtlOpen'; +import { ReqOpen as ReqOpen_38, ResOpen as ResOpen_38 } from './gonglukuangbiao/PtlOpen'; import { ReqRefresh as ReqRefresh_1, ResRefresh as ResRefresh_1 } from './gonglukuangbiao/PtlRefresh'; import { ReqActive, ResActive } from './gongyu/mingdao/PtlActive'; -import { ReqOpen as ReqOpen_38, ResOpen as ResOpen_38 } from './gongyu/mingdao/PtlOpen'; +import { ReqOpen as ReqOpen_39, ResOpen as ResOpen_39 } from './gongyu/mingdao/PtlOpen'; import { ReqRecPrize as ReqRecPrize_3, ResRecPrize as ResRecPrize_3 } from './gongyu/mingdao/PtlRecPrize'; import { ReqRepair, ResRepair } from './gongyu/mingdao/PtlRepair'; import { ReqReset as ReqReset_1, ResReset as ResReset_1 } from './gongyu/xunlianjihua/PtlReset'; @@ -169,14 +169,14 @@ import { ReqSetSkill, ResSetSkill } from './gongyu/zuozhanjihua/PtlSetSkill'; import { ReqBuyNum as ReqBuyNum_1, ResBuyNum as ResBuyNum_1 } from './hbzb/jfs/PtlBuyNum'; import { ReqFight as ReqFight_3, ResFight as ResFight_3 } from './hbzb/jfs/PtlFight'; import { ReqGetLog as ReqGetLog_1, ResGetLog as ResGetLog_1 } from './hbzb/jfs/PtlGetLog'; -import { ReqOpen as ReqOpen_39, ResOpen as ResOpen_39 } from './hbzb/jfs/PtlOpen'; +import { ReqOpen as ReqOpen_40, ResOpen as ResOpen_40 } from './hbzb/jfs/PtlOpen'; import { ReqRec as ReqRec_11, ResRec as ResRec_11 } from './hbzb/jfs/PtlRec'; import { ReqRefresh as ReqRefresh_2, ResRefresh as ResRefresh_2 } from './hbzb/jfs/PtlRefresh'; import { ReqGetStatus, ResGetStatus } from './hbzb/PtlGetStatus'; import { ReqBuyNum as ReqBuyNum_2, ResBuyNum as ResBuyNum_2 } from './hbzb/zbs/PtlBuyNum'; import { ReqFight as ReqFight_4, ResFight as ResFight_4 } from './hbzb/zbs/PtlFight'; import { ReqGetLog as ReqGetLog_2, ResGetLog as ResGetLog_2 } from './hbzb/zbs/PtlGetLog'; -import { ReqOpen as ReqOpen_40, ResOpen as ResOpen_40 } from './hbzb/zbs/PtlOpen'; +import { ReqOpen as ReqOpen_41, ResOpen as ResOpen_41 } from './hbzb/zbs/PtlOpen'; import { ReqRefresh as ReqRefresh_3, ResRefresh as ResRefresh_3 } from './hbzb/zbs/PtlRefresh'; import { ReqAwake, ResAwake } from './hero/PtlAwake'; import { ReqChangePos, ResChangePos } from './hero/PtlChangePos'; @@ -192,16 +192,16 @@ import { ReqGet as ReqGet_2, ResGet as ResGet_2 } from './hongdian/PtlGet'; import { ReqGetList as ReqGetList_4, ResGetList as ResGetList_4 } from './item/PtlGetList'; import { ReqUse, ResUse } from './item/PtlUse'; import { ReqLottery as ReqLottery_3, ResLottery as ResLottery_3 } from './jiaotang/PtlLottery'; -import { ReqOpen as ReqOpen_41, ResOpen as ResOpen_41 } from './jiaotang/PtlOpen'; +import { ReqOpen as ReqOpen_42, ResOpen as ResOpen_42 } from './jiaotang/PtlOpen'; import { ReqLottery as ReqLottery_4, ResLottery as ResLottery_4 } from './jiuba/PtlLottery'; -import { ReqOpen as ReqOpen_42, ResOpen as ResOpen_42 } from './jiuba/PtlOpen'; +import { ReqOpen as ReqOpen_43, ResOpen as ResOpen_43 } from './jiuba/PtlOpen'; import { ReqBuyFightNum, ResBuyFightNum } from './jjc/PtlBuyFightNum'; import { ReqFight as ReqFight_5, ResFight as ResFight_5 } from './jjc/PtlFight'; import { ReqFightLog, ResFightLog } from './jjc/PtlFightLog'; -import { ReqOpen as ReqOpen_43, ResOpen as ResOpen_43 } from './jjc/PtlOpen'; +import { ReqOpen as ReqOpen_44, ResOpen as ResOpen_44 } from './jjc/PtlOpen'; import { ReqReceive as ReqReceive_7, ResReceive as ResReceive_7 } from './jjc/PtlReceive'; import { ReqRefresh as ReqRefresh_4, ResRefresh as ResRefresh_4 } from './jjc/PtlRefresh'; -import { ReqOpen as ReqOpen_44, ResOpen as ResOpen_44 } from './kaifujingsai/PtlOpen'; +import { ReqOpen as ReqOpen_45, ResOpen as ResOpen_45 } from './kaifujingsai/PtlOpen'; import { ReqReceive as ReqReceive_8, ResReceive as ResReceive_8 } from './kaifujingsai/PtlReceive'; import { ReqApply as ReqApply_2, ResApply as ResApply_2 } from './kbzz/PtlApply'; import { ReqAutoApply, ResAutoApply } from './kbzz/PtlAutoApply'; @@ -209,23 +209,23 @@ import { ReqBuyNum as ReqBuyNum_3, ResBuyNum as ResBuyNum_3 } from './kbzz/PtlBu import { ReqFight as ReqFight_6, ResFight as ResFight_6 } from './kbzz/PtlFight'; import { ReqFightLog as ReqFightLog_1, ResFightLog as ResFightLog_1 } from './kbzz/PtlFightLog'; import { ReqGroupState, ResGroupState } from './kbzz/PtlGroupState'; -import { ReqOpen as ReqOpen_45, ResOpen as ResOpen_45 } from './kbzz/PtlOpen'; +import { ReqOpen as ReqOpen_46, ResOpen as ResOpen_46 } from './kbzz/PtlOpen'; import { ReqRecPrize as ReqRecPrize_4, ResRecPrize as ResRecPrize_4 } from './kbzz/PtlRecPrize'; import { ReqRefresh as ReqRefresh_5, ResRefresh as ResRefresh_5 } from './kbzz/PtlRefresh'; import { ReqAddPkNum, ResAddPkNum } from './kuangdong/PtlAddPkNum'; import { ReqGetPrize, ResGetPrize } from './kuangdong/PtlGetPrize'; import { ReqKdInfo, ResKdInfo } from './kuangdong/PtlKdInfo'; import { ReqLog as ReqLog_1, ResLog as ResLog_1 } from './kuangdong/PtlLog'; -import { ReqOpen as ReqOpen_46, ResOpen as ResOpen_46 } from './kuangdong/PtlOpen'; +import { ReqOpen as ReqOpen_47, ResOpen as ResOpen_47 } from './kuangdong/PtlOpen'; import { ReqYanShi, ResYanShi } from './kuangdong/PtlYanShi'; import { ReqZhanLing, ResZhanLing } from './kuangdong/PtlZhanLing'; -import { ReqOpen as ReqOpen_47, ResOpen as ResOpen_47 } from './lingzhulaixi/PtlOpen'; +import { ReqOpen as ReqOpen_48, ResOpen as ResOpen_48 } from './lingzhulaixi/PtlOpen'; import { ReqPkBoss, ResPkBoss } from './lingzhulaixi/PtlPkBoss'; import { ReqPkRank, ResPkRank } from './lingzhulaixi/PtlPkRank'; import { ReqSaoDang, ResSaoDang } from './lingzhulaixi/PtlSaoDang'; import { ReqBuy as ReqBuy_5, ResBuy as ResBuy_5 } from './meirishilian/PtlBuy'; import { ReqFight as ReqFight_7, ResFight as ResFight_7 } from './meirishilian/PtlFight'; -import { ReqOpen as ReqOpen_48, ResOpen as ResOpen_48 } from './meirishilian/PtlOpen'; +import { ReqOpen as ReqOpen_49, ResOpen as ResOpen_49 } from './meirishilian/PtlOpen'; import { MsgBindUid } from './msg_c2s/MsgBindUid'; import { MsgPay } from './msg_c2s/MsgPay'; import { MsgSync } from './msg_c2s/MsgSync'; @@ -257,7 +257,7 @@ import { MsgTaskChange } from './msg_s2c/MsgTaskChange'; import { MsgXianshilibao } from './msg_s2c/MsgXianshilibao'; import { ReqFight as ReqFight_8, ResFight as ResFight_8 } from './pata/PtlFight'; import { ReqGetPrize as ReqGetPrize_1, ResGetPrize as ResGetPrize_1 } from './pata/PtlGetPrize'; -import { ReqOpen as ReqOpen_49, ResOpen as ResOpen_49 } from './pata/PtlOpen'; +import { ReqOpen as ReqOpen_50, ResOpen as ResOpen_50 } from './pata/PtlOpen'; import { ReqSaoDang as ReqSaoDang_1, ResSaoDang as ResSaoDang_1 } from './pata/PtlSaoDang'; import { ReqGetList as ReqGetList_5, ResGetList as ResGetList_5 } from './pay/PtlGetList'; import { ReqGetList as ReqGetList_6, ResGetList as ResGetList_6 } from './peijian/PtlGetList'; @@ -273,16 +273,16 @@ import { ReqUnLock, ResUnLock } from './peijian/PtlUnLock'; import { ReqWear as ReqWear_1, ResWear as ResWear_1 } from './peijian/PtlWear'; import { ReqDeal, ResDeal } from './peijiancangku/PtlDeal'; import { ReqJump, ResJump } from './peijiancangku/PtlJump'; -import { ReqOpen as ReqOpen_50, ResOpen as ResOpen_50 } from './peijiancangku/PtlOpen'; +import { ReqOpen as ReqOpen_51, ResOpen as ResOpen_51 } from './peijiancangku/PtlOpen'; import { ReqBingo, ResBingo } from './PtlBingo'; import { ReqFightTest, ResFightTest } from './PtlFightTest'; import { ReqSyncBtn, ResSyncBtn } from './PtlSyncBtn'; import { ReqTest, ResTest } from './PtlTest'; import { ReqItemNoEnough, ResItemNoEnough } from './pushgift/PtlItemNoEnough'; -import { ReqOpen as ReqOpen_51, ResOpen as ResOpen_51 } from './pushgift/PtlOpen'; +import { ReqOpen as ReqOpen_52, ResOpen as ResOpen_52 } from './pushgift/PtlOpen'; import { ReqFight as ReqFight_9, ResFight as ResFight_9 } from './qjzzd/PtlFight'; -import { ReqOpen as ReqOpen_52, ResOpen as ResOpen_52 } from './qjzzd/PtlOpen'; -import { ReqOpen as ReqOpen_53, ResOpen as ResOpen_53 } from './rank/PtlOpen'; +import { ReqOpen as ReqOpen_53, ResOpen as ResOpen_53 } from './qjzzd/PtlOpen'; +import { ReqOpen as ReqOpen_54, ResOpen as ResOpen_54 } from './rank/PtlOpen'; import { ReqConcise, ResConcise } from './shiwu/PtlConcise'; import { ReqExtract, ResExtract } from './shiwu/PtlExtract'; import { ReqGetList as ReqGetList_7, ResGetList as ResGetList_7 } from './shiwu/PtlGetList'; @@ -290,20 +290,20 @@ import { ReqLvUp as ReqLvUp_3, ResLvUp as ResLvUp_3 } from './shiwu/PtlLvUp'; import { ReqRecast, ResRecast } from './shiwu/PtlRecast'; import { ReqTakeOff as ReqTakeOff_2, ResTakeOff as ResTakeOff_2 } from './shiwu/PtlTakeOff'; import { ReqWear as ReqWear_2, ResWear as ResWear_2 } from './shiwu/PtlWear'; -import { ReqOpen as ReqOpen_54, ResOpen as ResOpen_54 } from './shootGame/PtlOpen'; +import { ReqOpen as ReqOpen_55, ResOpen as ResOpen_55 } from './shootGame/PtlOpen'; import { ReqRec as ReqRec_13, ResRec as ResRec_13 } from './shootGame/PtlRec'; import { ReqBuy as ReqBuy_6, ResBuy as ResBuy_6 } from './shop/PtlBuy'; -import { ReqOpen as ReqOpen_55, ResOpen as ResOpen_55 } from './shop/PtlOpen'; +import { ReqOpen as ReqOpen_56, ResOpen as ResOpen_56 } from './shop/PtlOpen'; import { ReqRefresh as ReqRefresh_6, ResRefresh as ResRefresh_6 } from './shop/PtlRefresh'; import { ReqGetBoxPrize, ResGetBoxPrize } from './sign/PtlGetBoxPrize'; import { ReqGetPrize as ReqGetPrize_2, ResGetPrize as ResGetPrize_2 } from './sign/PtlGetPrize'; -import { ReqOpen as ReqOpen_56, ResOpen as ResOpen_56 } from './sign/PtlOpen'; +import { ReqOpen as ReqOpen_57, ResOpen as ResOpen_57 } from './sign/PtlOpen'; import { ReqAim, ResAim } from './slzd/PtlAim'; import { ReqBuyNum as ReqBuyNum_4, ResBuyNum as ResBuyNum_4 } from './slzd/PtlBuyNum'; import { ReqFight as ReqFight_10, ResFight as ResFight_10 } from './slzd/PtlFight'; import { ReqFightLog as ReqFightLog_2, ResFightLog as ResFightLog_2 } from './slzd/PtlFightLog'; import { ReqMyRank, ResMyRank } from './slzd/PtlMyRank'; -import { ReqOpen as ReqOpen_57, ResOpen as ResOpen_57 } from './slzd/PtlOpen'; +import { ReqOpen as ReqOpen_58, ResOpen as ResOpen_58 } from './slzd/PtlOpen'; import { ReqOpenFort, ResOpenFort } from './slzd/PtlOpenFort'; import { ReqRec as ReqRec_14, ResRec as ResRec_14 } from './slzd/PtlRec'; import { ReqRefresh as ReqRefresh_7, ResRefresh as ResRefresh_7 } from './slzd/PtlRefresh'; @@ -312,11 +312,11 @@ import { ReqEvent, ResEvent } from './tanxian/PtlEvent'; import { ReqFastGuaJi, ResFastGuaJi } from './tanxian/PtlFastGuaJi'; import { ReqFight as ReqFight_11, ResFight as ResFight_11 } from './tanxian/PtlFight'; import { ReqGuaJi, ResGuaJi } from './tanxian/PtlGuaJi'; -import { ReqOpen as ReqOpen_58, ResOpen as ResOpen_58 } from './tanxian/PtlOpen'; +import { ReqOpen as ReqOpen_59, ResOpen as ResOpen_59 } from './tanxian/PtlOpen'; import { ReqReceive as ReqReceive_9, ResReceive as ResReceive_9 } from './tanxian/PtlReceive'; import { ReqAllFinsh, ResAllFinsh } from './task/PtlAllFinsh'; import { ReqFinsh, ResFinsh } from './task/PtlFinsh'; -import { ReqOpen as ReqOpen_59, ResOpen as ResOpen_59 } from './task/PtlOpen'; +import { ReqOpen as ReqOpen_60, ResOpen as ResOpen_60 } from './task/PtlOpen'; import { ReqCDKEY, ResCDKEY } from './user/PtlCDKEY'; import { ReqChangeInfo, ResChangeInfo } from './user/PtlChangeInfo'; import { ReqChangeName, ResChangeName } from './user/PtlChangeName'; @@ -333,7 +333,7 @@ import { ReqRenownOpen, ResRenownOpen } from './user/PtlRenownOpen'; import { ReqTujian, ResTujian } from './user/PtlTujian'; import { ReqDecompose, ResDecompose } from './weixiuchang/PtlDecompose'; import { ReqExchange as ReqExchange_1, ResExchange as ResExchange_1 } from './weixiuchang/PtlExchange'; -import { ReqOpen as ReqOpen_60, ResOpen as ResOpen_60 } from './weixiuchang/PtlOpen'; +import { ReqOpen as ReqOpen_61, ResOpen as ResOpen_61 } from './weixiuchang/PtlOpen'; import { ReqUpLv, ResUpLv } from './weixiuchang/PtlUpLv'; import { ReqUpStar, ResUpStar } from './weixiuchang/PtlUpStar'; import { ReqAutoBaoMing, ResAutoBaoMing } from './wzry/PtlAutoBaoMing'; @@ -344,7 +344,7 @@ import { ReqDldFight, ResDldFight } from './wzry/PtlDldFight'; import { ReqDldRefre, ResDldRefre } from './wzry/PtlDldRefre'; import { ReqJingCai, ResJingCai } from './wzry/PtlJingCai'; import { ReqJingCaiOpen, ResJingCaiOpen } from './wzry/PtlJingCaiOpen'; -import { ReqOpen as ReqOpen_61, ResOpen as ResOpen_61 } from './wzry/PtlOpen'; +import { ReqOpen as ReqOpen_62, ResOpen as ResOpen_62 } from './wzry/PtlOpen'; import { ReqUpdateFight, ResUpdateFight } from './wzry/PtlUpdateFight'; import { ReqWzzd, ResWzzd } from './wzry/PtlWzzd'; import { ReqZuanShiOpen, ResZuanShiOpen } from './wzry/PtlZuanShiOpen'; @@ -352,7 +352,7 @@ import { ReqAllGet, ResAllGet } from './xstask/PtlAllGet'; import { ReqGet as ReqGet_3, ResGet as ResGet_3 } from './xstask/PtlGet'; import { ReqLvUp as ReqLvUp_4, ResLvUp as ResLvUp_4 } from './xstask/PtlLvUp'; import { ReqOnekeyReceive, ResOnekeyReceive } from './xstask/PtlOnekeyReceive'; -import { ReqOpen as ReqOpen_62, ResOpen as ResOpen_62 } from './xstask/PtlOpen'; +import { ReqOpen as ReqOpen_63, ResOpen as ResOpen_63 } from './xstask/PtlOpen'; import { ReqReceive as ReqReceive_10, ResReceive as ResReceive_10 } from './xstask/PtlReceive'; import { ReqRefresh as ReqRefresh_8, ResRefresh as ResRefresh_8 } from './xstask/PtlRefresh'; import { ReqHandle, ResHandle } from './yongbingzhuzhan/PtlHandle'; @@ -762,17 +762,17 @@ export interface ServiceType { req: ReqExchangeOpen, res: ResExchangeOpen }, - "event/yuandan/ZLOpen": { - req: ReqZLOpen, - res: ResZLOpen + "event/yuandan/Open": { + req: ReqOpen_27, + res: ResOpen_27 }, "event/yuandan/ZLRec": { req: ReqZLRec, res: ResZLRec }, "event/yuedujijin/Open": { - req: ReqOpen_27, - res: ResOpen_27 + req: ReqOpen_28, + res: ResOpen_28 }, "event/yuedujijin/Rec": { req: ReqRec_10, @@ -783,8 +783,8 @@ export interface ServiceType { res: ResBuyLv }, "event/zhanling/Open": { - req: ReqOpen_28, - res: ResOpen_28 + req: ReqOpen_29, + res: ResOpen_29 }, "event/zhanling/RecPrize": { req: ReqRecPrize_2, @@ -795,13 +795,13 @@ export interface ServiceType { res: ResRecTask }, "event/zhoulibao/Open": { - req: ReqOpen_29, - res: ResOpen_29 - }, - "event/zhoumolibao/Open": { req: ReqOpen_30, res: ResOpen_30 }, + "event/zhoumolibao/Open": { + req: ReqOpen_31, + res: ResOpen_31 + }, "event/zhoumolibao/Receive": { req: ReqReceive_6, res: ResReceive_6 @@ -811,8 +811,8 @@ export interface ServiceType { res: ResBuy_3 }, "event/zixuanlibao/Open": { - req: ReqOpen_31, - res: ResOpen_31 + req: ReqOpen_32, + res: ResOpen_32 }, "eventlist/hdGetList": { req: ReqhdGetList, @@ -835,8 +835,8 @@ export interface ServiceType { res: ResList }, "friend/Open": { - req: ReqOpen_32, - res: ResOpen_32 + req: ReqOpen_33, + res: ResOpen_33 }, "friend/Respond": { req: ReqRespond, @@ -855,8 +855,8 @@ export interface ServiceType { res: ResChallenge }, "ganbutexun/Open": { - req: ReqOpen_33, - res: ResOpen_33 + req: ReqOpen_34, + res: ResOpen_34 }, "ganhai/Fast": { req: ReqFast, @@ -871,8 +871,8 @@ export interface ServiceType { res: ResLog }, "ganhai/Open": { - req: ReqOpen_34, - res: ResOpen_34 + req: ReqOpen_35, + res: ResOpen_35 }, "ganhai/Refresh": { req: ReqRefresh, @@ -959,8 +959,8 @@ export interface ServiceType { res: ResManage }, "gonghui/Open": { - req: ReqOpen_35, - res: ResOpen_35 + req: ReqOpen_36, + res: ResOpen_36 }, "gonghui/TanHe": { req: ReqTanHe, @@ -983,8 +983,8 @@ export interface ServiceType { res: ResLottery_2 }, "gonghuibaozang/Open": { - req: ReqOpen_36, - res: ResOpen_36 + req: ReqOpen_37, + res: ResOpen_37 }, "gonglukuangbiao/Buy": { req: ReqBuy_4, @@ -995,8 +995,8 @@ export interface ServiceType { res: ResFight_2 }, "gonglukuangbiao/Open": { - req: ReqOpen_37, - res: ResOpen_37 + req: ReqOpen_38, + res: ResOpen_38 }, "gonglukuangbiao/Refresh": { req: ReqRefresh_1, @@ -1007,8 +1007,8 @@ export interface ServiceType { res: ResActive }, "gongyu/mingdao/Open": { - req: ReqOpen_38, - res: ResOpen_38 + req: ReqOpen_39, + res: ResOpen_39 }, "gongyu/mingdao/RecPrize": { req: ReqRecPrize_3, @@ -1043,8 +1043,8 @@ export interface ServiceType { res: ResGetLog_1 }, "hbzb/jfs/Open": { - req: ReqOpen_39, - res: ResOpen_39 + req: ReqOpen_40, + res: ResOpen_40 }, "hbzb/jfs/Rec": { req: ReqRec_11, @@ -1071,8 +1071,8 @@ export interface ServiceType { res: ResGetLog_2 }, "hbzb/zbs/Open": { - req: ReqOpen_40, - res: ResOpen_40 + req: ReqOpen_41, + res: ResOpen_41 }, "hbzb/zbs/Refresh": { req: ReqRefresh_3, @@ -1135,16 +1135,16 @@ export interface ServiceType { res: ResLottery_3 }, "jiaotang/Open": { - req: ReqOpen_41, - res: ResOpen_41 + req: ReqOpen_42, + res: ResOpen_42 }, "jiuba/Lottery": { req: ReqLottery_4, res: ResLottery_4 }, "jiuba/Open": { - req: ReqOpen_42, - res: ResOpen_42 + req: ReqOpen_43, + res: ResOpen_43 }, "jjc/BuyFightNum": { req: ReqBuyFightNum, @@ -1159,8 +1159,8 @@ export interface ServiceType { res: ResFightLog }, "jjc/Open": { - req: ReqOpen_43, - res: ResOpen_43 + req: ReqOpen_44, + res: ResOpen_44 }, "jjc/Receive": { req: ReqReceive_7, @@ -1171,8 +1171,8 @@ export interface ServiceType { res: ResRefresh_4 }, "kaifujingsai/Open": { - req: ReqOpen_44, - res: ResOpen_44 + req: ReqOpen_45, + res: ResOpen_45 }, "kaifujingsai/Receive": { req: ReqReceive_8, @@ -1203,8 +1203,8 @@ export interface ServiceType { res: ResGroupState }, "kbzz/Open": { - req: ReqOpen_45, - res: ResOpen_45 + req: ReqOpen_46, + res: ResOpen_46 }, "kbzz/RecPrize": { req: ReqRecPrize_4, @@ -1231,8 +1231,8 @@ export interface ServiceType { res: ResLog_1 }, "kuangdong/Open": { - req: ReqOpen_46, - res: ResOpen_46 + req: ReqOpen_47, + res: ResOpen_47 }, "kuangdong/YanShi": { req: ReqYanShi, @@ -1243,8 +1243,8 @@ export interface ServiceType { res: ResZhanLing }, "lingzhulaixi/Open": { - req: ReqOpen_47, - res: ResOpen_47 + req: ReqOpen_48, + res: ResOpen_48 }, "lingzhulaixi/PkBoss": { req: ReqPkBoss, @@ -1267,8 +1267,8 @@ export interface ServiceType { res: ResFight_7 }, "meirishilian/Open": { - req: ReqOpen_48, - res: ResOpen_48 + req: ReqOpen_49, + res: ResOpen_49 }, "pata/Fight": { req: ReqFight_8, @@ -1279,8 +1279,8 @@ export interface ServiceType { res: ResGetPrize_1 }, "pata/Open": { - req: ReqOpen_49, - res: ResOpen_49 + req: ReqOpen_50, + res: ResOpen_50 }, "pata/SaoDang": { req: ReqSaoDang_1, @@ -1343,8 +1343,8 @@ export interface ServiceType { res: ResJump }, "peijiancangku/Open": { - req: ReqOpen_50, - res: ResOpen_50 + req: ReqOpen_51, + res: ResOpen_51 }, "Bingo": { req: ReqBingo, @@ -1367,21 +1367,21 @@ export interface ServiceType { res: ResItemNoEnough }, "pushgift/Open": { - req: ReqOpen_51, - res: ResOpen_51 + req: ReqOpen_52, + res: ResOpen_52 }, "qjzzd/Fight": { req: ReqFight_9, res: ResFight_9 }, "qjzzd/Open": { - req: ReqOpen_52, - res: ResOpen_52 - }, - "rank/Open": { req: ReqOpen_53, res: ResOpen_53 }, + "rank/Open": { + req: ReqOpen_54, + res: ResOpen_54 + }, "shiwu/Concise": { req: ReqConcise, res: ResConcise @@ -1411,8 +1411,8 @@ export interface ServiceType { res: ResWear_2 }, "shootGame/Open": { - req: ReqOpen_54, - res: ResOpen_54 + req: ReqOpen_55, + res: ResOpen_55 }, "shootGame/Rec": { req: ReqRec_13, @@ -1423,8 +1423,8 @@ export interface ServiceType { res: ResBuy_6 }, "shop/Open": { - req: ReqOpen_55, - res: ResOpen_55 + req: ReqOpen_56, + res: ResOpen_56 }, "shop/Refresh": { req: ReqRefresh_6, @@ -1439,8 +1439,8 @@ export interface ServiceType { res: ResGetPrize_2 }, "sign/Open": { - req: ReqOpen_56, - res: ResOpen_56 + req: ReqOpen_57, + res: ResOpen_57 }, "slzd/Aim": { req: ReqAim, @@ -1463,8 +1463,8 @@ export interface ServiceType { res: ResMyRank }, "slzd/Open": { - req: ReqOpen_57, - res: ResOpen_57 + req: ReqOpen_58, + res: ResOpen_58 }, "slzd/OpenFort": { req: ReqOpenFort, @@ -1499,8 +1499,8 @@ export interface ServiceType { res: ResGuaJi }, "tanxian/Open": { - req: ReqOpen_58, - res: ResOpen_58 + req: ReqOpen_59, + res: ResOpen_59 }, "tanxian/Receive": { req: ReqReceive_9, @@ -1515,8 +1515,8 @@ export interface ServiceType { res: ResFinsh }, "task/Open": { - req: ReqOpen_59, - res: ResOpen_59 + req: ReqOpen_60, + res: ResOpen_60 }, "user/CDKEY": { req: ReqCDKEY, @@ -1583,8 +1583,8 @@ export interface ServiceType { res: ResExchange_1 }, "weixiuchang/Open": { - req: ReqOpen_60, - res: ResOpen_60 + req: ReqOpen_61, + res: ResOpen_61 }, "weixiuchang/UpLv": { req: ReqUpLv, @@ -1627,8 +1627,8 @@ export interface ServiceType { res: ResJingCaiOpen }, "wzry/Open": { - req: ReqOpen_61, - res: ResOpen_61 + req: ReqOpen_62, + res: ResOpen_62 }, "wzry/UpdateFight": { req: ReqUpdateFight, @@ -1659,8 +1659,8 @@ export interface ServiceType { res: ResOnekeyReceive }, "xstask/Open": { - req: ReqOpen_62, - res: ResOpen_62 + req: ReqOpen_63, + res: ResOpen_63 }, "xstask/Receive": { req: ReqReceive_10, @@ -2224,7 +2224,7 @@ export const serviceProto: ServiceProto = { }, { "id": 100, - "name": "event/yuandan/ZLOpen", + "name": "event/yuandan/Open", "type": "api" }, { @@ -11508,27 +11508,27 @@ export const serviceProto: ServiceProto = { } ] }, - "event/yuandan/PtlZLOpen/ReqZLOpen": { - "type": "Interface" - }, - "event/yuandan/PtlZLOpen/ResZLOpen": { + "event/yuandan/PtlOpen/ReqOpen": { "type": "Interface", "properties": [ { "id": 0, - "name": "record", + "name": "id", "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } + "type": "String" } } ] }, + "event/yuandan/PtlOpen/ResOpen": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + }, "event/yuandan/PtlZLRec/ReqZLRec": { "type": "Interface", "properties": [ @@ -11538,6 +11538,16 @@ export const serviceProto: ServiceProto = { "type": { "type": "String" } + }, + { + "id": 1, + "name": "dlz", + "type": { + "type": "Array", + "elementType": { + "type": "String" + } + } } ] }, From 9b6d29ddf20eb7be6046fafd5e71263cfa2f82b2 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 14:30:10 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E6=B4=BB=E5=8A=A8,?= =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 4 ++-- src/api_s2c/event/yuandan/{ApiTaskFinish.ts => ApiTaskRec.ts} | 0 src/shared/protocols/event/yuandan/PtlDMRec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/api_s2c/event/yuandan/{ApiTaskFinish.ts => ApiTaskRec.ts} (100%) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index aa64623..859b784 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -12,7 +12,7 @@ export default async function (call: ApiCall) { // 校验当前领取奖励 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 (!prize) return call.errorCode(-2) + if (toPrize && !prize) return call.errorCode(-2) // 取奖励列表,判断是否有可领取奖励 let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) @@ -23,7 +23,7 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - await PlayerFun.sendPrize(call, prize); + await PlayerFun.sendPrize(call, prize || []); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { $inc: {[`gameNum`]: 1}, diff --git a/src/api_s2c/event/yuandan/ApiTaskFinish.ts b/src/api_s2c/event/yuandan/ApiTaskRec.ts similarity index 100% rename from src/api_s2c/event/yuandan/ApiTaskFinish.ts rename to src/api_s2c/event/yuandan/ApiTaskRec.ts diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index 4bcd355..c0a01c1 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -3,7 +3,7 @@ */ export type ReqDMRec = { id: string, - prize: { a: string, t: string, n: number } + prize: { a: string, t: string, n: number } | null } export type ResDMRec = {} From 1e90b96c6cee927008023b5005286937fe12f542 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 15:07:00 +0800 Subject: [PATCH 08/26] huodong json --- src/json/huodong.json5 | 185 +++++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 79 deletions(-) diff --git a/src/json/huodong.json5 b/src/json/huodong.json5 index b004311..c227a78 100644 --- a/src/json/huodong.json5 +++ b/src/json/huodong.json5 @@ -485,12 +485,7 @@ free: false, payId: 'ycmb_5_1', buyNum: 1, - dlz: [ - { - "1": {'a': 'attr', 't': 'rmbmoney', 'n': 60}, - "2": {'a': 'item', 't': '21', 'n': 200} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 60},{'a': 'item', 't': '21', 'n': 200} ] }, { index: 2, @@ -498,12 +493,7 @@ free: false, payId: 'ycmb_5_2', buyNum: 2, - dlz: [ - { - "1":{'a': 'attr', 't': 'rmbmoney', 'n': 300}, - "2":{'a': 'item', 't': '21', 'n': 600} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 300},{'a': 'item', 't': '21', 'n': 600} ] }, { index: 3, @@ -511,12 +501,7 @@ free: false, payId: 'ycmb_5_3', buyNum: 2, - dlz: [ - { - "1":{'a': 'attr', 't': 'rmbmoney', 'n': 680}, - "2":{'a': 'item', 't': '21', 'n': 1500} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 680},{'a': 'item', 't': '21', 'n': 1500} ] }, { index: 4, @@ -524,12 +509,7 @@ free: false, payId: 'ycmb_5_4', buyNum: 2, - dlz: [ - { - "1":{'a': 'attr', 't': 'rmbmoney', 'n': 1280}, - "2":{'a': 'item', 't': '21', 'n': 2500} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 1280},{'a': 'item', 't': '21', 'n': 2500} ] }, { index: 5, @@ -537,12 +517,7 @@ free: false, payId: 'ycmb_5_5', buyNum: 3, - dlz: [ - { - "1":{'a': 'attr', 't': 'rmbmoney', 'n': 3280}, - "2":{'a': 'item', 't': '21', 'n': 6000} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 3280},{'a': 'item', 't': '21', 'n': 6000} ] }, { index: 6, @@ -550,12 +525,7 @@ free: false, payId: 'ycmb_5_6', buyNum: 3, - dlz: [ - { - "1":{'a': 'attr', 't': 'rmbmoney', 'n': 6480}, - "2":{'a': 'item', 't': '21', 'n': 12000} - } - ] + prize: [ {'a': 'attr', 't': 'rmbmoney', 'n': 6480},{'a': 'item', 't': '21', 'n': 12000} ] } ], //任务相关 type 1 每日任务(每天刷新) 2 活动任务(轮数) 3 每日登录 4-一次性任务 任务hdid一定要唯一 @@ -2922,9 +2892,12 @@ free: true, payId: '', buyNum: 1, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 30}], - [ {a: 'attr', t: 'jinbi', n: 50000}, {a: 'item', t: '1', n: 50000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 30}], + dlz: [ + { + "1":{a: 'attr', t: 'jinbi', n: 50000}, + "2":{a: 'item', t: '1', n: 50000} + } ] }, { @@ -2932,43 +2905,69 @@ free: false, payId: 'zixuanlibao6', buyNum: 1, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 60} ], - [ {a: 'item', t: '2', n: 60}, {a: 'item', t: '12', n: 50} ], - [ {a: 'item', t: '27', n: 1500}, {a: 'item', t: '1', n: 100000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 60}], + dlz: [ + { + "1":{a: 'item', t: '2', n: 60}, + "2":{a: 'item', t: '12', n: 50} + }, + { + "1":{a: 'item', t: '27', n: 1500}, + "2":{a: 'item', t: '1', n: 100000} + } ] }, - { + { need: [], free: false, payId: 'zixuanlibao30', buyNum: 2, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 300} ], - [ {a: 'item', t: '2', n: 200}, {a: 'item', t: '12', n: 100} ], - [ {a: 'item', t: '27', n: 7000}, {a: 'item', t: '1', n: 200000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 300}], + dlz: [ + { + "1":{a: 'item', t: '2', n: 200}, + "2":{a: 'item', t: '12', n: 100} + }, + { + "1":{a: 'item', t: '27', n: 7000}, + "2":{a: 'item', t: '1', n: 200000} + } ] }, - { + { need: [], free: false, payId: 'zixuanlibao68', buyNum: 2, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 680} ], - [ {a: 'item', t: '18', n: 100}, {a: 'item', t: '21', n: 200}, {a: 'item', t: '9', n: 1000} ], - [ {a: 'item', t: '27', n: 15000}, {a: 'item', t: '1', n: 300000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 680}], + dlz: [ + { + "1":{a: 'item', t: '18', n: 100}, + "2":{a: 'item', t: '21', n: 200}, + "3":{a: 'item', t: '9', n: 1000} + }, + { + "1":{a: 'item', t: '27', n: 15000}, + "2":{a: 'item', t: '1', n: 300000} + } ] }, - { + { need: [], free: false, payId: 'zixuanlibao128', buyNum: 2, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 1280} ], - [ {a: 'item', t: '18', n: 200}, {a: 'item', t: '9', n: 2000}, {a: 'item', t: '10', n: 200} ], - [ {a: 'item', t: '27', n: 20000}, {a: 'item', t: '1', n: 500000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 1280}], + dlz: [ + { + "1":{a: 'item', t: '18', n: 200}, + "2":{a: 'item', t: '9', n: 2000}, + "3":{a: 'item', t: '10', n: 200} + }, + { + "1":{a: 'item', t: '27', n: 20000}, + "2":{a: 'item', t: '1', n: 500000} + } ] }, { @@ -2976,10 +2975,17 @@ free: false, payId: 'zixuanlibao328', buyNum: 3, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 3280} ], - [ {a: 'item', t: '600', n: 20}, {a: 'item', t: '601', n: 20}, {a: 'item', t: '616', n: 40} ], - [ {a: 'item', t: '27', n: 50000}, {a: 'item', t: '1', n: 700000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 3280}], + dlz: [ + { + "1":{a: 'item', t: '600', n: 20}, + "2":{a: 'item', t: '601', n: 20}, + "3":{a: 'item', t: '616', n: 40} + }, + { + "1":{a: 'item', t: '27', n: 50000}, + "2":{a: 'item', t: '1', n: 700000} + } ] }, { @@ -2987,10 +2993,17 @@ free: false, payId: 'zixuanlibao648', buyNum: 3, - prize: [ - [ {a: 'attr', t: 'rmbmoney', n: 6480} ], - [ {a: 'item', t: '600', n: 40}, {a: 'item', t: '601', n: 40}, {a: 'item', t: '616', n: 80} ], - [ {a: 'item', t: '27', n: 100000}, {a: 'item', t: '1', n: 1000000} ] + prize: [{a: 'attr', t: 'rmbmoney', n: 6480}], + dlz: [ + { + "1":{a: 'item', t: '600', n: 40}, + "2":{a: 'item', t: '601', n: 40}, + "3":{a: 'item', t: '616', n: 80} + }, + { + "1":{a: 'item', t: '27', n: 100000}, + "2":{a: 'item', t: '1', n: 1000000} + } ] } ] @@ -4598,17 +4611,19 @@ "gamefree": 3, //钻石兑换 "duihuan": [ - { need: [{a: 'attr', t: 'rmbmoney', n: 1000}], prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}], buyNum: 2 }, - { need: [{a: 'attr', t: 'rmbmoney', n: 2000}], prize: [{a: 'item', t: '610', n: 2},{a: 'item', t: '2', n: 600},{a: 'item', t: '1', n: 550}], buyNum: 1 }, - { need: [{a: 'attr', t: 'rmbmoney', n: 3000}], prize: [{a: 'item', t: '610', n: 3},{a: 'item', t: '2', n: 700},{a: 'item', t: '1', n: 230}], buyNum: 1 }, - { need: [{a: 'attr', t: 'rmbmoney', n: 4000}], prize: [{a: 'item', t: '610', n: 4},{a: 'item', t: '2', n: 800},{a: 'item', t: '1', n: 690}], buyNum: 3 }, - { need: [{a: 'attr', t: 'rmbmoney', n: 5000}], prize: [{a: 'item', t: '610', n: 5},{a: 'item', t: '2', n: 900},{a: 'item', t: '1', n: 3300}], buyNum: 5 }, - { need: [{a: 'attr', t: 'rmbmoney', n: 6000}], prize: [{a: 'item', t: '610', n: 6},{a: 'item', t: '2', n: 1000},{a: 'item', t: '1', n: 130}], buyNum: 6 } + {id:1, need: [{a: 'attr', t: 'rmbmoney', n: 1000}], prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}], buyNum: 2 }, + {id:2, need: [{a: 'attr', t: 'rmbmoney', n: 2000}], prize: [{a: 'item', t: '610', n: 2},{a: 'item', t: '2', n: 600},{a: 'item', t: '1', n: 550}], buyNum: 1 }, + {id:3, need: [{a: 'attr', t: 'rmbmoney', n: 3000}], prize: [{a: 'item', t: '610', n: 3},{a: 'item', t: '2', n: 700},{a: 'item', t: '1', n: 230}], buyNum: 1 }, + {id:4, need: [{a: 'attr', t: 'rmbmoney', n: 4000}], prize: [{a: 'item', t: '610', n: 4},{a: 'item', t: '2', n: 800},{a: 'item', t: '1', n: 690}], buyNum: 3 }, + {id:5, need: [{a: 'attr', t: 'rmbmoney', n: 5000}], prize: [{a: 'item', t: '610', n: 5},{a: 'item', t: '2', n: 900},{a: 'item', t: '1', n: 3300}], buyNum: 5 }, + {id:6, need: [{a: 'attr', t: 'rmbmoney', n: 6000}], prize: [{a: 'item', t: '610', n: 6},{a: 'item', t: '2', n: 1000},{a: 'item', t: '1', n: 130}], buyNum: 6 } ], //活动礼包 "gift": [ { - "payid": "", + "id": 1, + "free": "true", + "payid": "", "buynum": 1, //固定奖励 "prize": [{"a": "attr", "t":"rmbmoney", "n": 100}], @@ -4622,7 +4637,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_2", + "id": 2, + "free": "false", + "payid": "xnhd_libao_1", "buynum": 2, "prize": [{"a": "attr", "t":"rmbmoney", "n": 120}], "des" : "intr_cszl_des_11", @@ -4638,7 +4655,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_3", + "id": 3, + "free": "false", + "payid": "xnhd_libao_2", "buynum": 2, "prize": [{"a": "attr", "t":"rmbmoney", "n": 300}], "des" : "intr_cszl_des_12", @@ -4658,7 +4677,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_4", + "id": 4, + "free": "false", + "payid": "xnhd_libao_3", "buynum": 5, "prize": [{"a": "attr", "t":"rmbmoney", "n": 680}], "des" : "intr_cszl_des_12", @@ -4678,7 +4699,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_5", + "id": 5, + "free": "false", + "payid": "xnhd_libao_4", "buynum": 9, "prize": [{"a": "attr", "t":"rmbmoney", "n": 1280}], "des" : "intr_cszl_des_13", @@ -4700,7 +4723,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_6", + "id": 6, + "free": "false", + "payid": "xnhd_libao_5", "buynum": 9, "prize": [{"a": "attr", "t":"rmbmoney", "n": 3280}], "des" : "intr_cszl_des_14", @@ -4724,7 +4749,9 @@ ] }, { - "payid": "pay_name_sdhd_libao_7", + "id": 7, + "free": "false", + "payid": "xnhd_libao_6", "buynum": 9, "prize": [{"a": "attr", "t":"rmbmoney", "n": 6480}], "des" : "intr_cszl_des_14", From 72ff17ba0b9221bd911aff3f8826630cc09ff31b Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 15:26:58 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiOpen.ts | 7 +- src/api_s2c/event/yuandan/fun.ts | 40 +- src/shared/protocols/event/yuandan/PtlOpen.ts | 1 - src/shared/protocols/serviceProto.ts | 660 +++++++++--------- 4 files changed, 336 insertions(+), 372 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts index ea6aa7b..d077d62 100644 --- a/src/api_s2c/event/yuandan/ApiOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -7,5 +7,10 @@ import {Yuandanfun} from "./fun"; export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) - call.succ((await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})) || {}) + let payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid) + + call.succ({ + data: await Yuandanfun.getData(call, _hd.hdid), + payLog: await PayFun.getPayLogs(call.uid, payIds) + }) } \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 7c9174d..20a4c68 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -21,8 +21,8 @@ export class Yuandanfun { gameNum: 0, gift: {}, exchange: {}, - taskfinish: data?.taskfinish || [], - taskval: await this.getTaskVal(call, hdid), + taskfinish: [], + taskval: await this.getTaskVal(call), }, }, {upsert: true, returnDocument: 'after'})).value } @@ -30,9 +30,9 @@ export class Yuandanfun { } /**获取所有taskid 及对应的值 */ - static async getTaskVal(call: ApiCall, hdid: number) { + static async getTaskVal(call: ApiCall) { let _initCon = await this.getCon(call) - let _tasks = _initCon[hdid].data.task + let _tasks = _initCon.data.task let _res = {} for (let index = 0; index < Object.keys(_tasks).length; index++) { const element = Object.keys(_tasks)[index]; @@ -56,38 +56,6 @@ export class Yuandanfun { ) } - // /**刷新每日任务 */ - // static async refreTask(call: ApiCall, mydata, hdid: number) { - // let _initCon = await this.getCon(call) - // let _con = _initCon[hdid].data.task - // if (!_con) return mydata - // mydata.taskfinish = [] - // mydata.taskval = await this.getTaskVal(call, hdid) - // mydata.refresh = G.time - // mydata.gamenum = 0 - // mydata.libao = {} - // - // (await G.mongodb.cEvent(`yuandan${hdid}`).findOneAndUpdate({uid: call.uid, type: `yuandan${hdid}`}, { - // $set: { - // gameNum: 0, - // gift: {}, - // exchange: {}, - // }, - // }, {upsert: true, returnDocument: 'after'})).value - // - // await this.setMyData(call.uid, hdid, { - // $set: { - // refreshTime: mydata.refreshTime, - // taskfinish: mydata.taskfinish, - // taskval: mydata.taskval, - // gamenum: mydata.gamenum, - // libao: mydata.libao - // } - // }) - // return mydata - // } - - /**设置任务 */ static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) { // let hdids = await this.gethdids(call) diff --git a/src/shared/protocols/event/yuandan/PtlOpen.ts b/src/shared/protocols/event/yuandan/PtlOpen.ts index 294e1a5..2940c39 100644 --- a/src/shared/protocols/event/yuandan/PtlOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlOpen.ts @@ -2,7 +2,6 @@ * 元旦 */ export type ReqOpen = { - id: string } export type ResOpen = { diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 9ef6cbf..cb14595 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -95,11 +95,10 @@ import { ReqOpen as ReqOpen_26, ResOpen as ResOpen_26 } from './event/yibaichou/ import { ReqRec as ReqRec_9, ResRec as ResRec_9 } from './event/yibaichou/PtlRec'; import { ReqRecAll, ResRecAll } from './event/yibaichou/PtlRecAll'; import { ReqDMRec, ResDMRec } from './event/yuandan/PtlDMRec'; -import { ReqDZOpen, ResDZOpen } from './event/yuandan/PtlDZOpen'; import { ReqDZRec, ResDZRec } from './event/yuandan/PtlDZRec'; import { ReqExchange, ResExchange } from './event/yuandan/PtlExchange'; -import { ReqExchangeOpen, ResExchangeOpen } from './event/yuandan/PtlExchangeOpen'; import { ReqOpen as ReqOpen_27, ResOpen as ResOpen_27 } from './event/yuandan/PtlOpen'; +import { ReqTaskRec as ReqTaskRec_1, ResTaskRec as ResTaskRec_1 } from './event/yuandan/PtlTaskRec'; import { ReqZLRec, ResZLRec } from './event/yuandan/PtlZLRec'; import { ReqOpen as ReqOpen_28, ResOpen as ResOpen_28 } from './event/yuedujijin/PtlOpen'; import { ReqRec as ReqRec_10, ResRec as ResRec_10 } from './event/yuedujijin/PtlRec'; @@ -746,10 +745,6 @@ export interface ServiceType { req: ReqDMRec, res: ResDMRec }, - "event/yuandan/DZOpen": { - req: ReqDZOpen, - res: ResDZOpen - }, "event/yuandan/DZRec": { req: ReqDZRec, res: ResDZRec @@ -758,14 +753,14 @@ export interface ServiceType { req: ReqExchange, res: ResExchange }, - "event/yuandan/ExchangeOpen": { - req: ReqExchangeOpen, - res: ResExchangeOpen - }, "event/yuandan/Open": { req: ReqOpen_27, res: ResOpen_27 }, + "event/yuandan/TaskRec": { + req: ReqTaskRec_1, + res: ResTaskRec_1 + }, "event/yuandan/ZLRec": { req: ReqZLRec, res: ResZLRec @@ -2204,36 +2199,31 @@ export const serviceProto: ServiceProto = { }, { "id": 96, - "name": "event/yuandan/DZOpen", - "type": "api" - }, - { - "id": 97, "name": "event/yuandan/DZRec", "type": "api" }, { - "id": 98, + "id": 97, "name": "event/yuandan/Exchange", "type": "api" }, { - "id": 99, - "name": "event/yuandan/ExchangeOpen", - "type": "api" - }, - { - "id": 100, + "id": 98, "name": "event/yuandan/Open", "type": "api" }, { - "id": 101, + "id": 99, + "name": "event/yuandan/TaskRec", + "type": "api" + }, + { + "id": 100, "name": "event/yuandan/ZLRec", "type": "api" }, { - "id": 102, + "id": 101, "name": "event/yuedujijin/Open", "type": "api", "conf": { @@ -2241,157 +2231,157 @@ export const serviceProto: ServiceProto = { } }, { - "id": 103, + "id": 102, "name": "event/yuedujijin/Rec", "type": "api" }, { - "id": 104, + "id": 103, "name": "event/zhanling/BuyLv", "type": "api" }, { - "id": 105, + "id": 104, "name": "event/zhanling/Open", "type": "api" }, { - "id": 106, + "id": 105, "name": "event/zhanling/RecPrize", "type": "api" }, { - "id": 107, + "id": 106, "name": "event/zhanling/RecTask", "type": "api" }, { - "id": 108, + "id": 107, "name": "event/zhoulibao/Open", "type": "api" }, { - "id": 109, + "id": 108, "name": "event/zhoumolibao/Open", "type": "api" }, { - "id": 110, + "id": 109, "name": "event/zhoumolibao/Receive", "type": "api" }, { - "id": 111, + "id": 110, "name": "event/zixuanlibao/Buy", "type": "api" }, { - "id": 112, + "id": 111, "name": "event/zixuanlibao/Open", "type": "api" }, { - "id": 113, + "id": 112, "name": "eventlist/hdGetList", "type": "api" }, { - "id": 114, + "id": 113, "name": "friend/Apply", "type": "api" }, { - "id": 115, + "id": 114, "name": "friend/Del", "type": "api" }, { - "id": 116, + "id": 115, "name": "friend/Gift", "type": "api" }, { - "id": 117, + "id": 116, "name": "friend/List", "type": "api" }, { - "id": 118, + "id": 117, "name": "friend/Open", "type": "api" }, { - "id": 119, + "id": 118, "name": "friend/Respond", "type": "api" }, { - "id": 120, + "id": 119, "name": "friend/RmBlackList", "type": "api" }, { - "id": 121, + "id": 120, "name": "friend/Search", "type": "api" }, { - "id": 122, + "id": 121, "name": "ganbutexun/Challenge", "type": "api" }, { - "id": 123, + "id": 122, "name": "ganbutexun/Open", "type": "api" }, { - "id": 124, + "id": 123, "name": "ganhai/Fast", "type": "api" }, { - "id": 125, + "id": 124, "name": "ganhai/Fight", "type": "api" }, { - "id": 126, + "id": 125, "name": "ganhai/Log", "type": "api" }, { - "id": 127, + "id": 126, "name": "ganhai/Open", "type": "api" }, { - "id": 128, + "id": 127, "name": "ganhai/Refresh", "type": "api" }, { - "id": 129, + "id": 128, "name": "ganhai/RefreshShip", "type": "api" }, { - "id": 130, + "id": 129, "name": "ganhai/Select", "type": "api" }, { - "id": 131, + "id": 130, "name": "gmapi/Gift", "type": "api" }, { - "id": 132, + "id": 131, "name": "gmapi/Post", "type": "api" }, { - "id": 133, + "id": 132, "name": "gonghui/Apply", "type": "api", "conf": { @@ -2401,7 +2391,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 134, + "id": 133, "name": "gonghui/ApplyAll", "type": "api", "conf": { @@ -2411,7 +2401,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 135, + "id": 134, "name": "gonghui/ApplyList", "type": "api", "conf": { @@ -2421,7 +2411,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 136, + "id": 135, "name": "gonghui/Change", "type": "api", "conf": { @@ -2431,12 +2421,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 137, + "id": 136, "name": "gonghui/Create", "type": "api" }, { - "id": 138, + "id": 137, "name": "gonghui/Dissolve", "type": "api", "conf": { @@ -2446,7 +2436,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 139, + "id": 138, "name": "gonghui/Exit", "type": "api", "conf": { @@ -2456,12 +2446,12 @@ export const serviceProto: ServiceProto = { } }, { - "id": 140, + "id": 139, "name": "gonghui/FbBuyNum", "type": "api" }, { - "id": 141, + "id": 140, "name": "gonghui/FbFight", "type": "api", "conf": { @@ -2471,7 +2461,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 142, + "id": 141, "name": "gonghui/FbOpen", "type": "api", "conf": { @@ -2481,17 +2471,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 143, + "id": 142, "name": "gonghui/GetList", "type": "api" }, { - "id": 144, + "id": 143, "name": "gonghui/Join", "type": "api" }, { - "id": 145, + "id": 144, "name": "gonghui/Jx", "type": "api", "conf": { @@ -2501,7 +2491,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 146, + "id": 145, "name": "gonghui/JxOpen", "type": "api", "conf": { @@ -2511,7 +2501,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 147, + "id": 146, "name": "gonghui/List", "type": "api", "conf": { @@ -2521,7 +2511,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 148, + "id": 147, "name": "gonghui/Manage", "type": "api", "conf": { @@ -2531,7 +2521,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 149, + "id": 148, "name": "gonghui/Open", "type": "api", "conf": { @@ -2541,7 +2531,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 150, + "id": 149, "name": "gonghui/TanHe", "type": "api", "conf": { @@ -2551,7 +2541,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 151, + "id": 150, "name": "gonghui/TaskOpen", "type": "api", "conf": { @@ -2561,7 +2551,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 152, + "id": 151, "name": "gonghui/TaskReceive", "type": "api", "conf": { @@ -2571,7 +2561,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 153, + "id": 152, "name": "gonghui/UpWz", "type": "api", "conf": { @@ -2581,137 +2571,137 @@ export const serviceProto: ServiceProto = { } }, { - "id": 154, + "id": 153, "name": "gonghuibaozang/Lottery", "type": "api" }, { - "id": 155, + "id": 154, "name": "gonghuibaozang/Open", "type": "api" }, { - "id": 156, + "id": 155, "name": "gonglukuangbiao/Buy", "type": "api" }, { - "id": 157, + "id": 156, "name": "gonglukuangbiao/Fight", "type": "api" }, { - "id": 158, + "id": 157, "name": "gonglukuangbiao/Open", "type": "api" }, { - "id": 159, + "id": 158, "name": "gonglukuangbiao/Refresh", "type": "api" }, { - "id": 160, + "id": 159, "name": "gongyu/mingdao/Active", "type": "api" }, { - "id": 161, + "id": 160, "name": "gongyu/mingdao/Open", "type": "api" }, { - "id": 162, + "id": 161, "name": "gongyu/mingdao/RecPrize", "type": "api" }, { - "id": 163, + "id": 162, "name": "gongyu/mingdao/Repair", "type": "api" }, { - "id": 164, + "id": 163, "name": "gongyu/xunlianjihua/Reset", "type": "api" }, { - "id": 165, + "id": 164, "name": "gongyu/xunlianjihua/UpSkill", "type": "api" }, { - "id": 166, + "id": 165, "name": "gongyu/zuozhanjihua/SetSkill", "type": "api" }, { - "id": 167, + "id": 166, "name": "hbzb/jfs/BuyNum", "type": "api" }, { - "id": 168, + "id": 167, "name": "hbzb/jfs/Fight", "type": "api" }, { - "id": 169, + "id": 168, "name": "hbzb/jfs/GetLog", "type": "api" }, { - "id": 170, + "id": 169, "name": "hbzb/jfs/Open", "type": "api" }, { - "id": 171, + "id": 170, "name": "hbzb/jfs/Rec", "type": "api" }, { - "id": 172, + "id": 171, "name": "hbzb/jfs/Refresh", "type": "api" }, { - "id": 173, + "id": 172, "name": "hbzb/GetStatus", "type": "api" }, { - "id": 174, + "id": 173, "name": "hbzb/zbs/BuyNum", "type": "api" }, { - "id": 175, + "id": 174, "name": "hbzb/zbs/Fight", "type": "api" }, { - "id": 176, + "id": 175, "name": "hbzb/zbs/GetLog", "type": "api" }, { - "id": 177, + "id": 176, "name": "hbzb/zbs/Open", "type": "api" }, { - "id": 178, + "id": 177, "name": "hbzb/zbs/Refresh", "type": "api" }, { - "id": 179, + "id": 178, "name": "hero/Awake", "type": "api" }, { - "id": 180, + "id": 179, "name": "hero/ChangePos", "type": "api", "conf": { @@ -2719,17 +2709,17 @@ export const serviceProto: ServiceProto = { } }, { - "id": 181, + "id": 180, "name": "hero/GetList", "type": "api" }, { - "id": 182, + "id": 181, "name": "hero/JinJie", "type": "api" }, { - "id": 183, + "id": 182, "name": "hero/LvUp", "type": "api", "conf": { @@ -2737,32 +2727,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 184, + "id": 183, "name": "hero/Potency", "type": "api" }, { - "id": 185, + "id": 184, "name": "hero/Rec", "type": "api" }, { - "id": 186, + "id": 185, "name": "hero/Reset", "type": "api" }, { - "id": 187, + "id": 186, "name": "hero/Talent", "type": "api" }, { - "id": 188, + "id": 187, "name": "hero/WeaponUp", "type": "api" }, { - "id": 189, + "id": 188, "name": "hongdian/Get", "type": "api", "conf": { @@ -2770,117 +2760,117 @@ export const serviceProto: ServiceProto = { } }, { - "id": 190, + "id": 189, "name": "item/GetList", "type": "api" }, { - "id": 191, + "id": 190, "name": "item/Use", "type": "api" }, { - "id": 192, + "id": 191, "name": "jiaotang/Lottery", "type": "api" }, { - "id": 193, + "id": 192, "name": "jiaotang/Open", "type": "api" }, { - "id": 194, + "id": 193, "name": "jiuba/Lottery", "type": "api" }, { - "id": 195, + "id": 194, "name": "jiuba/Open", "type": "api" }, { - "id": 196, + "id": 195, "name": "jjc/BuyFightNum", "type": "api" }, { - "id": 197, + "id": 196, "name": "jjc/Fight", "type": "api" }, { - "id": 198, + "id": 197, "name": "jjc/FightLog", "type": "api" }, { - "id": 199, + "id": 198, "name": "jjc/Open", "type": "api" }, { - "id": 200, + "id": 199, "name": "jjc/Receive", "type": "api" }, { - "id": 201, + "id": 200, "name": "jjc/Refresh", "type": "api" }, { - "id": 202, + "id": 201, "name": "kaifujingsai/Open", "type": "api" }, { - "id": 203, + "id": 202, "name": "kaifujingsai/Receive", "type": "api" }, { - "id": 204, + "id": 203, "name": "kbzz/Apply", "type": "api" }, { - "id": 205, + "id": 204, "name": "kbzz/AutoApply", "type": "api" }, { - "id": 206, + "id": 205, "name": "kbzz/BuyNum", "type": "api" }, { - "id": 207, + "id": 206, "name": "kbzz/Fight", "type": "api" }, { - "id": 208, + "id": 207, "name": "kbzz/FightLog", "type": "api" }, { - "id": 209, + "id": 208, "name": "kbzz/GroupState", "type": "api" }, { - "id": 210, + "id": 209, "name": "kbzz/Open", "type": "api" }, { - "id": 211, + "id": 210, "name": "kbzz/RecPrize", "type": "api" }, { - "id": 212, + "id": 211, "name": "kbzz/Refresh", "type": "api", "conf": { @@ -2888,287 +2878,287 @@ export const serviceProto: ServiceProto = { } }, { - "id": 213, + "id": 212, "name": "kuangdong/AddPkNum", "type": "api" }, { - "id": 214, + "id": 213, "name": "kuangdong/GetPrize", "type": "api" }, { - "id": 215, + "id": 214, "name": "kuangdong/KdInfo", "type": "api" }, { - "id": 216, + "id": 215, "name": "kuangdong/Log", "type": "api" }, { - "id": 217, + "id": 216, "name": "kuangdong/Open", "type": "api" }, { - "id": 218, + "id": 217, "name": "kuangdong/YanShi", "type": "api" }, { - "id": 219, + "id": 218, "name": "kuangdong/ZhanLing", "type": "api" }, { - "id": 220, + "id": 219, "name": "lingzhulaixi/Open", "type": "api" }, { - "id": 221, + "id": 220, "name": "lingzhulaixi/PkBoss", "type": "api" }, { - "id": 222, + "id": 221, "name": "lingzhulaixi/PkRank", "type": "api" }, { - "id": 223, + "id": 222, "name": "lingzhulaixi/SaoDang", "type": "api" }, { - "id": 224, + "id": 223, "name": "meirishilian/Buy", "type": "api" }, { - "id": 225, + "id": 224, "name": "meirishilian/Fight", "type": "api" }, { - "id": 226, + "id": 225, "name": "meirishilian/Open", "type": "api" }, { - "id": 227, + "id": 226, "name": "msg_c2s/BindUid", "type": "msg" }, { - "id": 228, + "id": 227, "name": "msg_c2s/Pay", "type": "msg" }, { - "id": 229, + "id": 228, "name": "msg_c2s/Sync", "type": "msg" }, { - "id": 230, + "id": 229, "name": "msg_s2c/Chat", "type": "msg" }, { - "id": 231, + "id": 230, "name": "msg_s2c/ChatHelp", "type": "msg" }, { - "id": 232, + "id": 231, "name": "msg_s2c/Collection", "type": "msg" }, { - "id": 233, + "id": 232, "name": "msg_s2c/Email", "type": "msg" }, { - "id": 234, + "id": 233, "name": "msg_s2c/EmailDel", "type": "msg" }, { - "id": 235, + "id": 234, "name": "msg_s2c/EquipChange", "type": "msg" }, { - "id": 236, + "id": 235, "name": "msg_s2c/Friend", "type": "msg" }, { - "id": 237, + "id": 236, "name": "msg_s2c/GhChange", "type": "msg" }, { - "id": 238, + "id": 237, "name": "msg_s2c/GongHuiBaoZang", "type": "msg" }, { - "id": 239, + "id": 238, "name": "msg_s2c/HeroChange", "type": "msg" }, { - "id": 240, + "id": 239, "name": "msg_s2c/HongDianChange", "type": "msg" }, { - "id": 241, + "id": 240, "name": "msg_s2c/ItemChange", "type": "msg" }, { - "id": 242, + "id": 241, "name": "msg_s2c/LoginQueue", "type": "msg" }, { - "id": 243, + "id": 242, "name": "msg_s2c/LshdChange", "type": "msg" }, { - "id": 244, + "id": 243, "name": "msg_s2c/NewDay", "type": "msg" }, { - "id": 245, + "id": 244, "name": "msg_s2c/OtherLogin", "type": "msg" }, { - "id": 246, + "id": 245, "name": "msg_s2c/PayChange", "type": "msg" }, { - "id": 247, + "id": 246, "name": "msg_s2c/PayResult", "type": "msg" }, { - "id": 248, + "id": 247, "name": "msg_s2c/PeijianChange", "type": "msg" }, { - "id": 249, + "id": 248, "name": "msg_s2c/PlayerChange", "type": "msg" }, { - "id": 250, + "id": 249, "name": "msg_s2c/Private", "type": "msg" }, { - "id": 251, + "id": 250, "name": "msg_s2c/PushGiftChange", "type": "msg" }, { - "id": 252, + "id": 251, "name": "msg_s2c/SendGift", "type": "msg" }, { - "id": 253, + "id": 252, "name": "msg_s2c/ShiwuChange", "type": "msg" }, { - "id": 254, + "id": 253, "name": "msg_s2c/TaskChange", "type": "msg" }, { - "id": 255, + "id": 254, "name": "msg_s2c/Xianshilibao", "type": "msg" }, { - "id": 256, + "id": 255, "name": "pata/Fight", "type": "api" }, { - "id": 257, + "id": 256, "name": "pata/GetPrize", "type": "api" }, { - "id": 258, + "id": 257, "name": "pata/Open", "type": "api" }, { - "id": 259, + "id": 258, "name": "pata/SaoDang", "type": "api" }, { - "id": 260, + "id": 259, "name": "pay/GetList", "type": "api" }, { - "id": 261, + "id": 260, "name": "peijian/GetList", "type": "api" }, { - "id": 262, + "id": 261, "name": "peijian/JingLian", "type": "api" }, { - "id": 263, + "id": 262, "name": "peijian/JinJie", "type": "api" }, { - "id": 264, + "id": 263, "name": "peijian/LvUp", "type": "api" }, { - "id": 265, + "id": 264, "name": "peijian/OneKeyLvUp", "type": "api" }, { - "id": 266, + "id": 265, "name": "peijian/OneKeyWear", "type": "api" }, { - "id": 267, + "id": 266, "name": "peijian/Reset", "type": "api" }, { - "id": 268, + "id": 267, "name": "peijian/Rm", "type": "api" }, { - "id": 269, + "id": 268, "name": "peijian/TakeOff", "type": "api", "conf": { @@ -3176,32 +3166,32 @@ export const serviceProto: ServiceProto = { } }, { - "id": 270, + "id": 269, "name": "peijian/UnLock", "type": "api" }, { - "id": 271, + "id": 270, "name": "peijian/Wear", "type": "api" }, { - "id": 272, + "id": 271, "name": "peijiancangku/Deal", "type": "api" }, { - "id": 273, + "id": 272, "name": "peijiancangku/Jump", "type": "api" }, { - "id": 274, + "id": 273, "name": "peijiancangku/Open", "type": "api" }, { - "id": 275, + "id": 274, "name": "Bingo", "type": "api", "conf": { @@ -3209,147 +3199,147 @@ export const serviceProto: ServiceProto = { } }, { - "id": 276, + "id": 275, "name": "FightTest", "type": "api" }, { - "id": 277, + "id": 276, "name": "SyncBtn", "type": "api" }, { - "id": 278, + "id": 277, "name": "Test", "type": "api" }, { - "id": 279, + "id": 278, "name": "pushgift/ItemNoEnough", "type": "api" }, { - "id": 280, + "id": 279, "name": "pushgift/Open", "type": "api" }, { - "id": 281, + "id": 280, "name": "qjzzd/Fight", "type": "api" }, { - "id": 282, + "id": 281, "name": "qjzzd/Open", "type": "api" }, { - "id": 283, + "id": 282, "name": "rank/Open", "type": "api" }, { - "id": 284, + "id": 283, "name": "shiwu/Concise", "type": "api" }, { - "id": 285, + "id": 284, "name": "shiwu/Extract", "type": "api" }, { - "id": 286, + "id": 285, "name": "shiwu/GetList", "type": "api" }, { - "id": 287, + "id": 286, "name": "shiwu/LvUp", "type": "api" }, { - "id": 288, + "id": 287, "name": "shiwu/Recast", "type": "api" }, { - "id": 289, + "id": 288, "name": "shiwu/TakeOff", "type": "api" }, { - "id": 290, + "id": 289, "name": "shiwu/Wear", "type": "api" }, { - "id": 291, + "id": 290, "name": "shootGame/Open", "type": "api" }, { - "id": 292, + "id": 291, "name": "shootGame/Rec", "type": "api" }, { - "id": 293, + "id": 292, "name": "shop/Buy", "type": "api" }, { - "id": 294, + "id": 293, "name": "shop/Open", "type": "api" }, { - "id": 295, + "id": 294, "name": "shop/Refresh", "type": "api" }, { - "id": 296, + "id": 295, "name": "sign/GetBoxPrize", "type": "api" }, { - "id": 297, + "id": 296, "name": "sign/GetPrize", "type": "api" }, { - "id": 298, + "id": 297, "name": "sign/Open", "type": "api" }, { - "id": 299, + "id": 298, "name": "slzd/Aim", "type": "api" }, { - "id": 300, + "id": 299, "name": "slzd/BuyNum", "type": "api" }, { - "id": 301, + "id": 300, "name": "slzd/Fight", "type": "api" }, { - "id": 302, + "id": 301, "name": "slzd/FightLog", "type": "api" }, { - "id": 303, + "id": 302, "name": "slzd/MyRank", "type": "api" }, { - "id": 304, + "id": 303, "name": "slzd/Open", "type": "api", "conf": { @@ -3359,77 +3349,77 @@ export const serviceProto: ServiceProto = { } }, { - "id": 305, + "id": 304, "name": "slzd/OpenFort", "type": "api" }, { - "id": 306, + "id": 305, "name": "slzd/Rec", "type": "api" }, { - "id": 307, + "id": 306, "name": "slzd/Refresh", "type": "api" }, { - "id": 308, + "id": 307, "name": "slzd/Slot", "type": "api" }, { - "id": 309, + "id": 308, "name": "tanxian/Event", "type": "api" }, { - "id": 310, + "id": 309, "name": "tanxian/FastGuaJi", "type": "api" }, { - "id": 311, + "id": 310, "name": "tanxian/Fight", "type": "api" }, { - "id": 312, + "id": 311, "name": "tanxian/GuaJi", "type": "api" }, { - "id": 313, + "id": 312, "name": "tanxian/Open", "type": "api" }, { - "id": 314, + "id": 313, "name": "tanxian/Receive", "type": "api" }, { - "id": 315, + "id": 314, "name": "task/AllFinsh", "type": "api" }, { - "id": 316, + "id": 315, "name": "task/Finsh", "type": "api" }, { - "id": 317, + "id": 316, "name": "task/Open", "type": "api" }, { - "id": 318, + "id": 317, "name": "user/CDKEY", "type": "api" }, { - "id": 319, + "id": 318, "name": "user/ChangeInfo", "type": "api", "conf": { @@ -3437,202 +3427,202 @@ export const serviceProto: ServiceProto = { } }, { - "id": 320, + "id": 319, "name": "user/ChangeName", "type": "api" }, { - "id": 321, + "id": 320, "name": "user/Dot", "type": "api" }, { - "id": 322, + "id": 321, "name": "user/Fight", "type": "api" }, { - "id": 323, + "id": 322, "name": "user/GetInfo", "type": "api" }, { - "id": 324, + "id": 323, "name": "user/InfoOpen", "type": "api" }, { - "id": 325, + "id": 324, "name": "user/Login", "type": "api" }, { - "id": 326, + "id": 325, "name": "user/Ping", "type": "api" }, { - "id": 327, + "id": 326, "name": "user/Renown", "type": "api" }, { - "id": 328, + "id": 327, "name": "user/RenownBuy", "type": "api" }, { - "id": 329, + "id": 328, "name": "user/RenownGetPrize", "type": "api" }, { - "id": 330, + "id": 329, "name": "user/RenownOpen", "type": "api" }, { - "id": 331, + "id": 330, "name": "user/Tujian", "type": "api" }, { - "id": 332, + "id": 331, "name": "weixiuchang/Decompose", "type": "api" }, { - "id": 333, + "id": 332, "name": "weixiuchang/Exchange", "type": "api" }, { - "id": 334, + "id": 333, "name": "weixiuchang/Open", "type": "api" }, { - "id": 335, + "id": 334, "name": "weixiuchang/UpLv", "type": "api" }, { - "id": 336, + "id": 335, "name": "weixiuchang/UpStar", "type": "api" }, { - "id": 337, + "id": 336, "name": "wzry/AutoBaoMing", "type": "api" }, { - "id": 338, + "id": 337, "name": "wzry/BaoMing", "type": "api" }, { - "id": 339, + "id": 338, "name": "wzry/catFightLog", "type": "api" }, { - "id": 340, + "id": 339, "name": "wzry/CatGroup", "type": "api" }, { - "id": 341, + "id": 340, "name": "wzry/DldFight", "type": "api" }, { - "id": 342, + "id": 341, "name": "wzry/DldRefre", "type": "api" }, { - "id": 343, + "id": 342, "name": "wzry/JingCai", "type": "api" }, { - "id": 344, + "id": 343, "name": "wzry/JingCaiOpen", "type": "api" }, { - "id": 345, + "id": 344, "name": "wzry/Open", "type": "api" }, { - "id": 346, + "id": 345, "name": "wzry/UpdateFight", "type": "api" }, { - "id": 347, + "id": 346, "name": "wzry/Wzzd", "type": "api" }, { - "id": 348, + "id": 347, "name": "wzry/ZuanShiOpen", "type": "api" }, { - "id": 349, + "id": 348, "name": "xstask/AllGet", "type": "api" }, { - "id": 350, + "id": 349, "name": "xstask/Get", "type": "api" }, { - "id": 351, + "id": 350, "name": "xstask/LvUp", "type": "api" }, { - "id": 352, + "id": 351, "name": "xstask/OnekeyReceive", "type": "api" }, { - "id": 353, + "id": 352, "name": "xstask/Open", "type": "api" }, { - "id": 354, + "id": 353, "name": "xstask/Receive", "type": "api" }, { - "id": 355, + "id": 354, "name": "xstask/Refresh", "type": "api" }, { - "id": 356, + "id": 355, "name": "yongbingzhuzhan/Handle", "type": "api" }, { - "id": 357, + "id": 356, "name": "zhanqianbushu/ChangePos", "type": "api" }, { - "id": 358, + "id": 357, "name": "zhanqianbushu/Select", "type": "api" }, { - "id": 359, + "id": 358, "name": "zhanqianbushu/Up", "type": "api" } @@ -11417,46 +11407,57 @@ export const serviceProto: ServiceProto = { "type": { "type": "String" } + }, + { + "id": 1, + "name": "prize", + "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" + } + } + ] + } + }, + { + "id": 1, + "type": { + "type": "Literal", + "literal": null + } + } + ] + } } ] }, "event/yuandan/PtlDMRec/ResDMRec": { "type": "Interface" }, - "event/yuandan/PtlDZOpen/ReqDZOpen": { - "type": "Interface" - }, - "event/yuandan/PtlDZOpen/ResDZOpen": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "record", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - }, - { - "id": 1, - "name": "buyLog", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - } - ] - }, "event/yuandan/PtlDZRec/ReqDZRec": { "type": "Interface", "properties": [ @@ -11487,40 +11488,31 @@ export const serviceProto: ServiceProto = { "event/yuandan/PtlExchange/ResExchange": { "type": "Interface" }, - "event/yuandan/PtlExchangeOpen/ReqExchangeOpen": { + "event/yuandan/PtlOpen/ReqOpen": { "type": "Interface" }, - "event/yuandan/PtlExchangeOpen/ResExchangeOpen": { + "event/yuandan/PtlOpen/ResOpen": { "type": "Interface", - "properties": [ - { - "id": 0, - "name": "record", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" } - ] + } }, - "event/yuandan/PtlOpen/ReqOpen": { + "event/yuandan/PtlTaskRec/ReqTaskRec": { "type": "Interface", "properties": [ { "id": 0, - "name": "id", + "name": "taskid", "type": { "type": "String" } } ] }, - "event/yuandan/PtlOpen/ResOpen": { + "event/yuandan/PtlTaskRec/ResTaskRec": { "type": "Interface", "indexSignature": { "keyType": "String", From bfc9ff369c361b97321e7f098870300ac102f2db Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 16:20:59 +0800 Subject: [PATCH 10/26] =?UTF-8?q?fix=E5=85=83=E6=97=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 2 +- .../protocols/event/yuandan/PtlDMRec.ts | 1 - .../protocols/event/yuandan/PtlZLRec.ts | 2 +- src/shared/protocols/serviceProto.ts | 32 ++++++++++++++----- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index 859b784..bcbec2f 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -23,7 +23,7 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - await PlayerFun.sendPrize(call, prize || []); + await PlayerFun.sendPrize(call, prize ? [prize] : []); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { $inc: {[`gameNum`]: 1}, diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index c0a01c1..cd4111e 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -2,7 +2,6 @@ * 元旦达摩领奖 */ export type ReqDMRec = { - id: string, prize: { a: string, t: string, n: number } | null } diff --git a/src/shared/protocols/event/yuandan/PtlZLRec.ts b/src/shared/protocols/event/yuandan/PtlZLRec.ts index 6e2d21f..ef83032 100644 --- a/src/shared/protocols/event/yuandan/PtlZLRec.ts +++ b/src/shared/protocols/event/yuandan/PtlZLRec.ts @@ -4,7 +4,7 @@ */ export type ReqZLRec = { id: string, - dlz: string[] + dlz: { a: string, t: string, n: number }[] } export type ResZLRec = { diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index cb14595..41a4fae 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11403,13 +11403,6 @@ export const serviceProto: ServiceProto = { "properties": [ { "id": 0, - "name": "id", - "type": { - "type": "String" - } - }, - { - "id": 1, "name": "prize", "type": { "type": "Union", @@ -11537,7 +11530,30 @@ export const serviceProto: ServiceProto = { "type": { "type": "Array", "elementType": { - "type": "String" + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "a", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "t", + "type": { + "type": "String" + } + }, + { + "id": 2, + "name": "n", + "type": { + "type": "Number" + } + } + ] } } } From ae0a5c688280d2b0678ffccf630a7c5b87252e03 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 16:33:31 +0800 Subject: [PATCH 11/26] =?UTF-8?q?fix=E5=85=83=E6=97=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiZLRec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index 46f3b47..240a590 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -18,7 +18,14 @@ export default async function (call: ApiCall) { let rec = data?.qiandao?.[call.req.id] if (rec) return call.errorCode(-3) - let prize = [gift.prize, ...gift.dlz.map((v, i) => v[call.req.dlz[i]])] + // 奖励不符合,严格判断 + let dlzList = R.flatten(gift.dlz.map(i => R.values(i))) + call.req.dlz.map(i => { + let item = dlzList.find(v => i.a == v.a && i.t == v.t && i.n == v.n) + if (!item) call.errorCode(-4) + }) + + let prize = [gift.prize, ...call.req.dlz] await PlayerFun.sendPrize(call, prize); From 21994f214ad16247db2baf2b5cfe37607a6e010d Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 16:53:43 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E5=85=83=E6=97=A6fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiZLRec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index 240a590..7adb47c 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -25,7 +25,7 @@ export default async function (call: ApiCall) { if (!item) call.errorCode(-4) }) - let prize = [gift.prize, ...call.req.dlz] + let prize = [...gift.prize, ...call.req.dlz] await PlayerFun.sendPrize(call, prize); From 08d0bed29193bb094620436ecea950d99154e3c7 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 17:33:48 +0800 Subject: [PATCH 13/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 6 ++-- src/api_s2c/event/yuandan/ApiDZRec.ts | 15 +++++++-- src/api_s2c/event/yuandan/ApiExchange.ts | 4 +-- src/api_s2c/event/yuandan/ApiZLRec.ts | 2 +- src/api_s2c/event/yuandan/fun.ts | 4 +-- .../protocols/event/yuandan/PtlDZRec.ts | 1 + src/shared/protocols/serviceProto.ts | 33 +++++++++++++++++++ 7 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index bcbec2f..758a4f6 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -9,12 +9,12 @@ 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(-2) + 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 diff --git a/src/api_s2c/event/yuandan/ApiDZRec.ts b/src/api_s2c/event/yuandan/ApiDZRec.ts index ce3f3f2..a801b42 100644 --- a/src/api_s2c/event/yuandan/ApiDZRec.ts +++ b/src/api_s2c/event/yuandan/ApiDZRec.ts @@ -10,15 +10,24 @@ export default async function (call: ApiCall) { let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id) if (!gift) return call.errorCode(-1) - // 取奖励列表,判断是否有可领取奖励 + // 超出限购次数 let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) let rec = data?.gift?.[call.req.id] if (rec && rec >= gift.buynum) return call.errorCode(-2) - await PlayerFun.sendPrize(call, gift.prize); + // 奖励不符合,严格判断 + let dlzList = R.flatten(gift.dlz.map(i => R.values(i))) + call.req.dlz.map(i => { + let item = dlzList.find(v => i.a == v.a && i.t == v.t && i.n == v.n) + if (!item) call.errorCode(-4) + }) + + let prize = [...gift.prize, ...call.req.dlz] + + await PlayerFun.sendPrize(call, prize); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { - $inc: {[`gift.${gift.id}`]: 1}, + $set: {[`gift.${gift.id}`]: JSON.stringify(prize)}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/ApiExchange.ts b/src/api_s2c/event/yuandan/ApiExchange.ts index a3285db..72bbe41 100644 --- a/src/api_s2c/event/yuandan/ApiExchange.ts +++ b/src/api_s2c/event/yuandan/ApiExchange.ts @@ -5,12 +5,12 @@ import {PlayerFun} from "../../../public/player"; import {HongDianChange} from "../../hongdian/fun"; export default async function (call: ApiCall) { - // 查询活动是否有当前领奖的免费选项 + // 礼包不存在 let _hd = (await HuoDongFun.gethdList(call, 14))[0] let gift = _hd?.data?.duihuan?.find(i => i.id == call.req.id) if (!gift) return call.errorCode(-1) - // 取奖励列表,判断是否有可领取奖励 + // 超出限购次数 let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) let rec = data?.exchange?.[call.req.id] if (rec && rec >= gift?.buyNum) return call.errorCode(-2) diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index 7adb47c..b810694 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -30,7 +30,7 @@ export default async function (call: ApiCall) { await PlayerFun.sendPrize(call, prize); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { - $inc: {[`qiandao.${call.req.id}`]: prize}, + $set: {[`qiandao.${call.req.id}`]: JSON.stringify(prize)}, }, {upsert: true}) call.succ({}) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 20a4c68..f815ece 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -50,8 +50,8 @@ export class Yuandanfun { /**设置数据 */ static async setData(uid: string, hdid: number, set: {}) { - await G.mongodb.cEvent(`christmas${hdid}`).updateOne( - {uid: uid, type: `christmas${hdid}`}, + await G.mongodb.cEvent(`yuandan${hdid}`).updateOne( + {uid: uid, type: `yuandan${hdid}`}, set ) } diff --git a/src/shared/protocols/event/yuandan/PtlDZRec.ts b/src/shared/protocols/event/yuandan/PtlDZRec.ts index 1942987..03db521 100644 --- a/src/shared/protocols/event/yuandan/PtlDZRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDZRec.ts @@ -3,6 +3,7 @@ */ export type ReqDZRec = { id: string + dlz: { a: string, t: string, n: number }[] } export type ResDZRec = { diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 41a4fae..b8e538b 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11460,6 +11460,39 @@ export const serviceProto: ServiceProto = { "type": { "type": "String" } + }, + { + "id": 1, + "name": "dlz", + "type": { + "type": "Array", + "elementType": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "a", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "t", + "type": { + "type": "String" + } + }, + { + "id": 2, + "name": "n", + "type": { + "type": "Number" + } + } + ] + } + } } ] }, From f50f6de93329ab2c1fdc85268f46940dfccde7bb Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 19:49:46 +0800 Subject: [PATCH 14/26] yuandan --- src/api_s2c/event/yuandan/ApiDMRec.ts | 4 +++- src/api_s2c/event/yuandan/ApiDZRec.ts | 4 ++-- src/api_s2c/event/yuandan/ApiZLRec.ts | 4 ++-- src/shared/protocols/event/yuandan/PtlDZRec.ts | 2 +- src/shared/protocols/event/yuandan/PtlZLRec.ts | 2 +- src/shared/protocols/serviceProto.ts | 16 ++++++++++++++-- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index 758a4f6..b0ddea0 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -23,7 +23,9 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - await PlayerFun.sendPrize(call, prize ? [prize] : []); + if (prize){ + await PlayerFun.sendPrize(call, [prize] ); + } await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { $inc: {[`gameNum`]: 1}, diff --git a/src/api_s2c/event/yuandan/ApiDZRec.ts b/src/api_s2c/event/yuandan/ApiDZRec.ts index a801b42..a2dd1b8 100644 --- a/src/api_s2c/event/yuandan/ApiDZRec.ts +++ b/src/api_s2c/event/yuandan/ApiDZRec.ts @@ -27,10 +27,10 @@ export default async function (call: ApiCall) { await PlayerFun.sendPrize(call, prize); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { - $set: {[`gift.${gift.id}`]: JSON.stringify(prize)}, + $set: {[`gift.${gift.id}`]: prize}, }, {upsert: true}) - call.succ({}) + call.succ({[gift.id]: prize}) HongDianChange.sendChangeKey(call.uid, ['yuandan']); } diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index b810694..0a30022 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -30,10 +30,10 @@ export default async function (call: ApiCall) { await PlayerFun.sendPrize(call, prize); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { - $set: {[`qiandao.${call.req.id}`]: JSON.stringify(prize)}, + $set: {[`qiandao.${call.req.id}`]: prize}, }, {upsert: true}) - call.succ({}) + call.succ({[call.req.id]: prize}) HongDianChange.sendChangeKey(call.uid, ['yuandan']); } diff --git a/src/shared/protocols/event/yuandan/PtlDZRec.ts b/src/shared/protocols/event/yuandan/PtlDZRec.ts index 03db521..5d38184 100644 --- a/src/shared/protocols/event/yuandan/PtlDZRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDZRec.ts @@ -7,5 +7,5 @@ export type ReqDZRec = { } export type ResDZRec = { - + [k: string]: any; } diff --git a/src/shared/protocols/event/yuandan/PtlZLRec.ts b/src/shared/protocols/event/yuandan/PtlZLRec.ts index ef83032..a15b7d7 100644 --- a/src/shared/protocols/event/yuandan/PtlZLRec.ts +++ b/src/shared/protocols/event/yuandan/PtlZLRec.ts @@ -8,5 +8,5 @@ export type ReqZLRec = { } export type ResZLRec = { - + [k: string]: any; } diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index b8e538b..9dd6606 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11497,7 +11497,13 @@ export const serviceProto: ServiceProto = { ] }, "event/yuandan/PtlDZRec/ResDZRec": { - "type": "Interface" + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } }, "event/yuandan/PtlExchange/ReqExchange": { "type": "Interface", @@ -11593,7 +11599,13 @@ export const serviceProto: ServiceProto = { ] }, "event/yuandan/PtlZLRec/ResZLRec": { - "type": "Interface" + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } }, "event/yuedujijin/PtlOpen/ReqOpen": { "type": "Interface", From 8503a65c1f9be921cc054c56ff5178a1b599b77a Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 26 Dec 2023 20:04:05 +0800 Subject: [PATCH 15/26] yuandan fun --- src/api_s2c/event/yuandan/fun.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index f815ece..c319a43 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -23,6 +23,7 @@ export class Yuandanfun { exchange: {}, taskfinish: [], taskval: await this.getTaskVal(call), + refreshTime: G.time }, }, {upsert: true, returnDocument: 'after'})).value } @@ -95,7 +96,7 @@ export class Yuandanfun { // 设置任务 if (isset == 1) { await G.mongodb.collection('event').updateMany( - {uid: call.uid, type: {$regex: "yuandan"}, hdid: parseInt(_hd.hdid)}, + {uid: call.uid, type: {$regex: `yuandan${_hd.hdid}`}}, _setData ) } From 944ef41d5d8cd10bdd57731400fc4f747c55b18e Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 09:51:37 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E8=BE=BE=E6=91=A9=E7=8C=AE=E7=A4=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index b0ddea0..6db04dd 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -11,7 +11,7 @@ export default async function (call: ApiCall) { // 奖励不符合 let toPrize = call.req.prize - let prize = _hd.data.game.find(i => i.a == toPrize.a && i.t == toPrize.t && i.n == toPrize.n) + 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) // 扣除免费次数或相应货币 @@ -23,8 +23,8 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - if (prize){ - await PlayerFun.sendPrize(call, [prize] ); + if (prize) { + await PlayerFun.sendPrize(call, [prize]); } await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { From 1cf4784d42220fbbf69c8a353bea43822c856dd7 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 11:02:53 +0800 Subject: [PATCH 17/26] =?UTF-8?q?=E5=85=83=E6=97=A6=E7=BA=A2=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E7=A0=B4=E5=86=B0=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiZLRec.ts | 9 ++- src/api_s2c/hongdian/fun.ts | 25 +++++- src/shared/protocols/event/yuandan/PtlOpen.ts | 11 ++- src/shared/protocols/serviceProto.ts | 78 +++++++++++++++++++ 4 files changed, 118 insertions(+), 5 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiZLRec.ts b/src/api_s2c/event/yuandan/ApiZLRec.ts index 0a30022..4b1340a 100644 --- a/src/api_s2c/event/yuandan/ApiZLRec.ts +++ b/src/api_s2c/event/yuandan/ApiZLRec.ts @@ -4,6 +4,7 @@ import {HuoDongFun} from "../../../public/huodongfun"; import {PlayerFun} from "../../../public/player"; import {HongDianChange} from "../../hongdian/fun"; import {Yuandanfun} from "./fun"; +import {PublicShared} from "../../../shared/public/public"; export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) @@ -18,11 +19,15 @@ export default async function (call: ApiCall) { let rec = data?.qiandao?.[call.req.id] if (rec) return call.errorCode(-3) + if (data && data.qiandaoTime && PublicShared.chkSameDate(data.qiandaoTime, G.time)) { + return call.errorCode(-4) + } + // 奖励不符合,严格判断 let dlzList = R.flatten(gift.dlz.map(i => R.values(i))) call.req.dlz.map(i => { let item = dlzList.find(v => i.a == v.a && i.t == v.t && i.n == v.n) - if (!item) call.errorCode(-4) + if (!item) call.errorCode(-5) }) let prize = [...gift.prize, ...call.req.dlz] @@ -30,7 +35,7 @@ export default async function (call: ApiCall) { await PlayerFun.sendPrize(call, prize); await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { - $set: {[`qiandao.${call.req.id}`]: prize}, + $set: {[`qiandao.${call.req.id}`]: prize, qiandaoTime: G.time}, }, {upsert: true}) call.succ({[call.req.id]: prize}) diff --git a/src/api_s2c/hongdian/fun.ts b/src/api_s2c/hongdian/fun.ts index 215f1f0..af9a11a 100644 --- a/src/api_s2c/hongdian/fun.ts +++ b/src/api_s2c/hongdian/fun.ts @@ -369,6 +369,10 @@ export class HuoDongHongDianFun { // 检测 htype 10 破冰活动红点 ishd = await this.pobinglibao(call, element) } + if (element.htype == 14) { + // 检测 htype 10 破冰活动红点 + ishd = await this.yuandan(call, element) + } // 此活动有红点 if (ishd.show) { @@ -383,7 +387,7 @@ export class HuoDongHongDianFun { /**破冰礼包红点 */ static async pobinglibao(call: ApiCall, _hd: ReqAddHuoDong): Promise { - let gift = _hd?.data?.gift?.find(i => i.id == call.req.id) + let gift = _hd?.data?.gift?.find(i => i.free == true && !i.payId) if (!gift) return {show: false} let payLog = await PayFun.getPayLog(call.uid, gift.payId) @@ -397,6 +401,25 @@ export class HuoDongHongDianFun { return {show: true} } + /**元旦活动红点 */ + static async yuandan(call: ApiCall, _hd: ReqAddHuoDong): Promise { + + let gift = _hd?.data?.gift?.find(i => i.free && !i.payId) + + // 取奖励列表,判断是否有可领取奖励 + let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`}) + + if (gift && !data?.gift?.[gift.id]) return {show: true} + + if (data?.gameNum < _hd.data.gamefree) return {show: true} + + if (!PublicShared.chkSameDate(data.qiandaoTime || 0, G.time)) { + return {show: true} + } + + return {show: false} + } + /**开服狂欢红点 */ static async kfkhHongDian(call: ApiCall) { let _res: hongdianVal = { diff --git a/src/shared/protocols/event/yuandan/PtlOpen.ts b/src/shared/protocols/event/yuandan/PtlOpen.ts index 2940c39..15128e9 100644 --- a/src/shared/protocols/event/yuandan/PtlOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlOpen.ts @@ -1,9 +1,16 @@ /** * 元旦 */ -export type ReqOpen = { -} +export type ReqOpen = {} export type ResOpen = { + qiandao: { [k: string]: any }; + gift: { [k: string]: any }; + taskfinish: string[]; + taskval: { [k: string]: any } + exchange: { [k: string]: any } + gameNum: number + refreshTime: number; + qiandaoTime: number; [k: string]: any; } diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 9dd6606..2ebe2d3 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11525,6 +11525,84 @@ export const serviceProto: ServiceProto = { }, "event/yuandan/PtlOpen/ResOpen": { "type": "Interface", + "properties": [ + { + "id": 0, + "name": "qiandao", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + }, + { + "id": 1, + "name": "gift", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + }, + { + "id": 2, + "name": "taskfinish", + "type": { + "type": "Array", + "elementType": { + "type": "String" + } + } + }, + { + "id": 3, + "name": "taskval", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + }, + { + "id": 4, + "name": "exchange", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Any" + } + } + } + }, + { + "id": 5, + "name": "gameNum", + "type": { + "type": "Number" + } + }, + { + "id": 6, + "name": "refreshTime", + "type": { + "type": "Number" + } + } + ], "indexSignature": { "keyType": "String", "type": { From 34ace42872380161b698712382052094f4afe347 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 11:03:10 +0800 Subject: [PATCH 18/26] proto --- src/shared/protocols/serviceProto.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 2ebe2d3..58d5d16 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11601,6 +11601,13 @@ export const serviceProto: ServiceProto = { "type": { "type": "Number" } + }, + { + "id": 7, + "name": "qiandaoTime", + "type": { + "type": "Number" + } } ], "indexSignature": { From c3fa18c9b1720ee937181b8dd1ffd6d358791fef Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 11:08:42 +0800 Subject: [PATCH 19/26] proto --- src/module/collection_event.ts | 2 +- src/shared/protocols/event/yuandan/PtlOpen.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/module/collection_event.ts b/src/module/collection_event.ts index 5a42bd6..7908bf4 100644 --- a/src/module/collection_event.ts +++ b/src/module/collection_event.ts @@ -23,7 +23,7 @@ import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/P import {ResOpen as ResOpenZhoumolibao} from '../shared/protocols/event/zhoumolibao/PtlOpen'; import {ResOpen as ResOpenPobinglibao} from '../shared/protocols/event/pobinglibao/PtlOpen'; import {ResOpen as ResOpenLeiChongLiBao} from '../shared/protocols/event/leichonglibao/PtlOpen'; -import {ResOpen as ResOpenYuandan} from '../shared/protocols/event/yuandan/PtlOpen'; +import {event as ResOpenYuandan} from '../shared/protocols/event/yuandan/PtlOpen'; export type eventType = { shouchong: { diff --git a/src/shared/protocols/event/yuandan/PtlOpen.ts b/src/shared/protocols/event/yuandan/PtlOpen.ts index 15128e9..ce008bd 100644 --- a/src/shared/protocols/event/yuandan/PtlOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlOpen.ts @@ -4,6 +4,12 @@ export type ReqOpen = {} export type ResOpen = { + data: any + payLog: any + [k: string]: any; +} + +export type event = { qiandao: { [k: string]: any }; gift: { [k: string]: any }; taskfinish: string[]; From d4bd776b489c813739eba6f875daa52f63359c68 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 11:09:00 +0800 Subject: [PATCH 20/26] proto --- src/shared/protocols/serviceProto.ts | 77 ++-------------------------- 1 file changed, 4 insertions(+), 73 deletions(-) diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 58d5d16..f0d7d73 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11528,85 +11528,16 @@ export const serviceProto: ServiceProto = { "properties": [ { "id": 0, - "name": "qiandao", + "name": "data", "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } + "type": "Any" } }, { "id": 1, - "name": "gift", + "name": "payLog", "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - }, - { - "id": 2, - "name": "taskfinish", - "type": { - "type": "Array", - "elementType": { - "type": "String" - } - } - }, - { - "id": 3, - "name": "taskval", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - }, - { - "id": 4, - "name": "exchange", - "type": { - "type": "Interface", - "indexSignature": { - "keyType": "String", - "type": { - "type": "Any" - } - } - } - }, - { - "id": 5, - "name": "gameNum", - "type": { - "type": "Number" - } - }, - { - "id": 6, - "name": "refreshTime", - "type": { - "type": "Number" - } - }, - { - "id": 7, - "name": "qiandaoTime", - "type": { - "type": "Number" + "type": "Any" } } ], From 0df09e0f9ef726672eded53b2a547fb7301d746b Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 16:33:31 +0800 Subject: [PATCH 21/26] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=8E=89=E8=90=BD=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 11 +++----- .../protocols/event/yuandan/PtlDMRec.ts | 2 +- src/shared/protocols/serviceProto.ts | 27 ++----------------- 3 files changed, 7 insertions(+), 33 deletions(-) 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" } }, { From 7c83a8bbe8aa2c4ec4240146b9e52f8e95d965bd Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 16:41:22 +0800 Subject: [PATCH 22/26] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=8E=89=E8=90=BD=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 2 +- src/shared/protocols/event/yuandan/PtlDMRec.ts | 2 +- src/shared/protocols/serviceProto.ts | 5 +++-- src/shared/public/public.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index f62c238..db205dc 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -20,7 +20,7 @@ export default async function (call: ApiCall) { } if (call.req.id) { - let prize = PublicShared.randomDropGroup(call.req.id, 1, _hd.data.game); + let prize = PublicShared.randomDropGroup('1', 1, {'1': _hd.data.game}); await PlayerFun.sendPrize(call, prize); } diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index 0f18459..8de9bbb 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -2,7 +2,7 @@ * 元旦达摩领奖 */ export type ReqDMRec = { - id: string | null + id: 1 | 0 } export type ResDMRec = {} diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 17478cc..a7b174a 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11410,14 +11410,15 @@ export const serviceProto: ServiceProto = { { "id": 0, "type": { - "type": "String" + "type": "Literal", + "literal": 1 } }, { "id": 1, "type": { "type": "Literal", - "literal": null + "literal": 0 } } ] diff --git a/src/shared/public/public.ts b/src/shared/public/public.ts index 02c3aa2..5860b9b 100644 --- a/src/shared/public/public.ts +++ b/src/shared/public/public.ts @@ -73,6 +73,7 @@ export class PublicShared { * 随机掉落组 * @param id 掉落组id * @param num 随机次数 + * @param conf */ static randomDropGroup(id: string | number, num = 1, conf = G.gc.diaoluo): prizeType[] { let prize = []; From 53a2becac537e4a7dadcbdb82bce86de604e5b3e Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 16:53:33 +0800 Subject: [PATCH 23/26] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=8E=89=E8=90=BD=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 5 +++-- src/shared/protocols/event/yuandan/PtlDMRec.ts | 6 +++++- src/shared/protocols/serviceProto.ts | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index db205dc..693d595 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -19,8 +19,9 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } + let prize = [] if (call.req.id) { - let prize = PublicShared.randomDropGroup('1', 1, {'1': _hd.data.game}); + prize = PublicShared.randomDropGroup('1', 1, {'1': _hd.data.game}); await PlayerFun.sendPrize(call, prize); } @@ -28,7 +29,7 @@ export default async function (call: ApiCall) { $inc: {[`gameNum`]: 1}, }, {upsert: true}) - call.succ({}) + call.succ({prize}) HongDianChange.sendChangeKey(call.uid, ['yuandan']); } diff --git a/src/shared/protocols/event/yuandan/PtlDMRec.ts b/src/shared/protocols/event/yuandan/PtlDMRec.ts index 8de9bbb..c77a5e9 100644 --- a/src/shared/protocols/event/yuandan/PtlDMRec.ts +++ b/src/shared/protocols/event/yuandan/PtlDMRec.ts @@ -1,3 +1,5 @@ +import {prizeType} from "../../type"; + /** * 元旦达摩领奖 */ @@ -5,4 +7,6 @@ export type ReqDMRec = { id: 1 | 0 } -export type ResDMRec = {} +export type ResDMRec = { + prize: prizeType[] +} diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index a7b174a..8d28d61 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11427,7 +11427,20 @@ export const serviceProto: ServiceProto = { ] }, "event/yuandan/PtlDMRec/ResDMRec": { - "type": "Interface" + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "prize", + "type": { + "type": "Array", + "elementType": { + "type": "Reference", + "target": "type/prizeType" + } + } + } + ] }, "event/yuandan/PtlDZRec/ReqDZRec": { "type": "Interface", From 837e9b58c846904096eba08cc1d28c345ae4bf40 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 18:50:36 +0800 Subject: [PATCH 24/26] =?UTF-8?q?fix=20=E5=85=83=E6=97=A6=E7=BA=A2?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/fun.ts | 1 + src/api_s2c/hongdian/fun.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index c319a43..8ed1590 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -23,6 +23,7 @@ export class Yuandanfun { exchange: {}, taskfinish: [], taskval: await this.getTaskVal(call), + qiandaoTime: data?.qiandaoTime || 0, refreshTime: G.time }, }, {upsert: true, returnDocument: 'after'})).value diff --git a/src/api_s2c/hongdian/fun.ts b/src/api_s2c/hongdian/fun.ts index af9a11a..ea4623d 100644 --- a/src/api_s2c/hongdian/fun.ts +++ b/src/api_s2c/hongdian/fun.ts @@ -413,7 +413,7 @@ export class HuoDongHongDianFun { if (data?.gameNum < _hd.data.gamefree) return {show: true} - if (!PublicShared.chkSameDate(data.qiandaoTime || 0, G.time)) { + if (!PublicShared.chkSameDate(data?.qiandaoTime || 0, G.time)) { return {show: true} } From add9c7c5623af02d78a8803a23ef7c86862905c1 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 19:49:33 +0800 Subject: [PATCH 25/26] =?UTF-8?q?fix=20=E5=85=83=E6=97=A6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiTaskRec.ts | 3 --- src/api_s2c/event/yuandan/fun.ts | 9 ++++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiTaskRec.ts b/src/api_s2c/event/yuandan/ApiTaskRec.ts index 14dd38d..04e95eb 100644 --- a/src/api_s2c/event/yuandan/ApiTaskRec.ts +++ b/src/api_s2c/event/yuandan/ApiTaskRec.ts @@ -22,10 +22,7 @@ export default async function (call: ApiCall) { return call.error('', { code: -3, message: globalThis.lng.yangchengmubiao_4 }) } _mydata.taskfinish.push(taskid) - let _addval = _con.addval let _setData = {} - _mydata["val"] += _addval - _setData["val"] = _mydata.val _setData["taskfinish"] = _mydata.taskfinish await Yuandanfun.setData(call.uid, _hd.hdid, { $set: _setData }) let _prize = _con.prize diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 8ed1590..23f9037 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -41,7 +41,7 @@ export class Yuandanfun { let _tmp = _tasks[element] _tmp["id"] = element // 每日登录直接完成 - if (element == "1") { + if (_tmp.stype == "128") { _res[element] = 1 } else { _res[element] = 0 @@ -60,8 +60,7 @@ export class Yuandanfun { /**设置任务 */ static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) { - // let hdids = await this.gethdids(call) - // if (hdids.length <= 0) return // 活动过期,不计数 + // 活动过期,不计数 let _hd = await this.getCon(call) if (!_hd) return @@ -96,8 +95,8 @@ export class Yuandanfun { // 设置任务 if (isset == 1) { - await G.mongodb.collection('event').updateMany( - {uid: call.uid, type: {$regex: `yuandan${_hd.hdid}`}}, + await G.mongodb.collection('event').updateOne( + {uid: call.uid, type: `yuandan${_hd.hdid}`}, _setData ) } From 12300703b5133777bb8036586737e262448caf53 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 20:09:59 +0800 Subject: [PATCH 26/26] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=BB=98=E8=B4=B9=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/fun.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 23f9037..785049d 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -2,6 +2,7 @@ import {ApiCall} from 'tsrpc'; import {HuoDongFun} from '../../../public/huodongfun'; import {christmas} from '../../../shared/protocols/event/christmas/PtlOpen'; import {PublicShared} from '../../../shared/public/public'; +import {PayFun} from "../../../public/pay"; export class Yuandanfun { /**配置 */ @@ -27,10 +28,19 @@ export class Yuandanfun { refreshTime: G.time }, }, {upsert: true, returnDocument: 'after'})).value + this.refreshPayLog(call) } return data } + static async refreshPayLog(call: ApiCall) { + let _hd = await this.getCon(call) + let payIds = _hd?.data?.gift?.filter(i=>i.payId).map(i=>i.payId) + PayFun.delPayLog(call.uid, ...payIds.map(i => { + return {payId: i, val: []} + })) + } + /**获取所有taskid 及对应的值 */ static async getTaskVal(call: ApiCall) { let _initCon = await this.getCon(call)