From a550711bbbe0780a56940c0635cbc89a86cc6aaf Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 21:15:42 +0800 Subject: [PATCH 1/7] cehua json --- src/json/pay.json | 72 +++++++++++++++++++++++++++++++++++++ src/json/xianshilibao.json5 | 2 ++ 2 files changed, 74 insertions(+) diff --git a/src/json/pay.json b/src/json/pay.json index cf69fd2..adac64c 100644 --- a/src/json/pay.json +++ b/src/json/pay.json @@ -905,6 +905,78 @@ "front": {}, "currency": "CNY" }, + "lv15": { + "id": "lv15", + "money": 1, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 10 + } + ], + "prize": [ + { + "a": "attr", + "t": "rmbmoney", + "n": 10 + }, + { + "a": "hero", + "t": "4005", + "n": 1 + }, + { + "a": "item", + "t": "12", + "n": 100 + } + ], + "firstPayPrize": [], + "name": "pay_name_lv15", + "undefined": "等级推送礼包15", + "time": -1, + "buys": 1, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, + "lv25": { + "id": "lv25", + "money": 30, + "payExp": [ + { + "a": "attr", + "t": "payExp", + "n": 300 + } + ], + "prize": [ + { + "a": "attr", + "t": "rmbmoney", + "n": 600 + }, + { + "a": "item", + "t": "1", + "n": 5000000 + }, + { + "a": "item", + "t": "4", + "n": 100 + } + ], + "firstPayPrize": [], + "name": "pay_name_lv25", + "undefined": "等级推送礼包25", + "time": -1, + "buys": 1, + "needVip": 0, + "front": {}, + "currency": "CNY" + }, "lv30": { "id": "lv30", "money": 6, diff --git a/src/json/xianshilibao.json5 b/src/json/xianshilibao.json5 index b6d644f..ec5afc3 100644 --- a/src/json/xianshilibao.json5 +++ b/src/json/xianshilibao.json5 @@ -1,4 +1,6 @@ { + lv15: { payId: 'lv15', time: 3600, scale: 3000}, + lv25: { payId: 'lv25', time: 3600, scale: 3000}, lv31: { payId: 'lv30', time: 3600, scale: 3300}, lv45: { payId: 'lv40', time: 3600, scale: 3300 }, lv50: { payId: 'lv55', time: 3600, scale: 2000 }, From 5150032d2094a6b5addd87a1bd2b9a9f27e274fc Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 22:31:48 +0800 Subject: [PATCH 2/7] cehua json --- src/json/pay.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json/pay.json b/src/json/pay.json index adac64c..a638cb7 100644 --- a/src/json/pay.json +++ b/src/json/pay.json @@ -907,7 +907,7 @@ }, "lv15": { "id": "lv15", - "money": 1, + "money": 0.5, "payExp": [ { "a": "attr", @@ -965,7 +965,7 @@ { "a": "item", "t": "4", - "n": 100 + "n": 10 } ], "firstPayPrize": [], From ec3f9545182845822cfc7f94a33bb9f8e69a8b19 Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 22:41:20 +0800 Subject: [PATCH 3/7] fix bug --- src/api_s2c/hero/ApiChangePos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_s2c/hero/ApiChangePos.ts b/src/api_s2c/hero/ApiChangePos.ts index 62f1300..e1cf832 100644 --- a/src/api_s2c/hero/ApiChangePos.ts +++ b/src/api_s2c/hero/ApiChangePos.ts @@ -9,7 +9,7 @@ import {HeroFun} from "../../public/hero"; export const maxPosNum = 6; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) if (!hero) return call.error(globalThis.lng.hero_1); let heroPos = Object.assign({}, call.conn.heroPos); From 77159cc7e315f8ac29501908d5f6b39d7c90e0a6 Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 22:48:45 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=B9=B2=E9=83=A8=E5=8A=9F=E8=83=BDredis?= =?UTF-8?q?=E7=9B=B4=E5=8F=96=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/equip/ApiStarUp.ts | 2 +- src/api_s2c/equip/ApiWear.ts | 2 +- src/api_s2c/hero/ApiAwake.ts | 2 +- src/api_s2c/hero/ApiJinJie.ts | 2 +- src/api_s2c/hero/ApiLvUp.ts | 2 +- src/api_s2c/hero/ApiPotency.ts | 2 +- src/api_s2c/hero/ApiTalent.ts | 2 +- src/api_s2c/hero/ApiWeaponUp.ts | 3 ++- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/api_s2c/equip/ApiStarUp.ts b/src/api_s2c/equip/ApiStarUp.ts index 360c950..360a245 100644 --- a/src/api_s2c/equip/ApiStarUp.ts +++ b/src/api_s2c/equip/ApiStarUp.ts @@ -57,7 +57,7 @@ export default async function (call: ApiCall) if (equip.star == 5) md_redPoint_check(call.conn, 'equip_star_5'); if (equip.wearaId) { - let hero = await G.redis.get('hero', call.conn.uid, equip.wearaId); + let hero = await HeroFun.getHero(call, equip.wearaId) if (hero) { hero.equip[G.gc.equip[equip.equipId].type] = EquipShared.fmtEquip(equip); await HeroFun.changeHeroAttr(call, hero, { equip: hero.equip }); diff --git a/src/api_s2c/equip/ApiWear.ts b/src/api_s2c/equip/ApiWear.ts index d2db0a1..edea5c0 100644 --- a/src/api_s2c/equip/ApiWear.ts +++ b/src/api_s2c/equip/ApiWear.ts @@ -7,7 +7,7 @@ import { EquipShared } from '../../shared/public/equip'; import kfjsFun from "../../public/kaifujingsai"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.conn.uid, call.req.heroId); + let hero = await HeroFun.getHero(call, call.req.heroId) if (!hero) return call.error(globalThis.lng.equip_10); if (hero.lv < G.gc.herocom.equipOpenLv) return call.error(`英雄${G.gc.herocom.equipOpenLv}级开启`); diff --git a/src/api_s2c/hero/ApiAwake.ts b/src/api_s2c/hero/ApiAwake.ts index d691fc7..a4bd0c8 100644 --- a/src/api_s2c/hero/ApiAwake.ts +++ b/src/api_s2c/hero/ApiAwake.ts @@ -4,7 +4,7 @@ import { PlayerFun } from '../../public/player'; import { ReqAwake, ResAwake } from "../../shared/protocols/hero/PtlAwake"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) if (!hero) return call.error('', { code: -1 }); let awake = hero.awake || 0; diff --git a/src/api_s2c/hero/ApiJinJie.ts b/src/api_s2c/hero/ApiJinJie.ts index c9c51c3..47b8cd3 100644 --- a/src/api_s2c/hero/ApiJinJie.ts +++ b/src/api_s2c/hero/ApiJinJie.ts @@ -11,7 +11,7 @@ import { PublicShared } from "../../shared/public/public"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) if (!hero) return call.error(globalThis.lng.hero_1); if (G.gc.herogrow[G.gc.hero[hero.heroId].jjup] == undefined) return call.error(globalThis.lng.hero_6); diff --git a/src/api_s2c/hero/ApiLvUp.ts b/src/api_s2c/hero/ApiLvUp.ts index b7d312d..6e52ad4 100644 --- a/src/api_s2c/hero/ApiLvUp.ts +++ b/src/api_s2c/hero/ApiLvUp.ts @@ -11,7 +11,7 @@ import kfjsFun from "../../public/kaifujingsai"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) let up = call.req.up || 1 if (!hero) return call.errorCode(-1); if (hero.lv >= call.conn.gud.lv * 3 || hero.lv + up > call.conn.gud.lv * 3) return call.errorCode(-2); diff --git a/src/api_s2c/hero/ApiPotency.ts b/src/api_s2c/hero/ApiPotency.ts index b17157f..4ee9586 100644 --- a/src/api_s2c/hero/ApiPotency.ts +++ b/src/api_s2c/hero/ApiPotency.ts @@ -6,7 +6,7 @@ import { ReqPotency, ResPotency } from "../../shared/protocols/hero/PtlPotency"; export default async function (call: ApiCall) { if (!G.gc.hero_qianneng[call.req.type]) return call.error(globalThis.lng.hero_14); - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) let qiannneg = hero.qiannneg || Object.fromEntries(Object.keys(G.gc.hero_qianneng).map(k => [k, 0])); let nextLv = qiannneg[call.req.type] + 1; diff --git a/src/api_s2c/hero/ApiTalent.ts b/src/api_s2c/hero/ApiTalent.ts index af1a9f1..d6f6e93 100644 --- a/src/api_s2c/hero/ApiTalent.ts +++ b/src/api_s2c/hero/ApiTalent.ts @@ -6,7 +6,7 @@ export default async function (call: ApiCall) { let typeConf = G.gc.hero_tf[call.req.type]; if (!typeConf) return call.error('', { code: -1 }); - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) if (!hero) return call.error('', { code: -2 }); let talent = hero.talent || Object.fromEntries(Object.keys(G.gc.hero_tf).map(t => [t, 0])); diff --git a/src/api_s2c/hero/ApiWeaponUp.ts b/src/api_s2c/hero/ApiWeaponUp.ts index ee43e58..63aa4a0 100644 --- a/src/api_s2c/hero/ApiWeaponUp.ts +++ b/src/api_s2c/hero/ApiWeaponUp.ts @@ -5,7 +5,8 @@ import { ReqWeaponUp, ResWeaponUp } from "../../shared/protocols/hero/PtlWeaponU import { PublicShared } from '../../shared/public/public'; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) + let heroConf = G.gc.hero[hero?.heroId]; if (!hero) return call.error(globalThis.lng.hero_1); From 99500b7bf4ff936e3f1da507d6a1289d5f805c07 Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 22:48:45 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=B9=B2=E9=83=A8=E5=8A=9F=E8=83=BDredis?= =?UTF-8?q?=E7=9B=B4=E5=8F=96=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/equip/ApiStarUp.ts | 2 +- src/api_s2c/equip/ApiWear.ts | 2 +- src/api_s2c/hero/ApiAwake.ts | 2 +- src/api_s2c/hero/ApiJinJie.ts | 2 +- src/api_s2c/hero/ApiLvUp.ts | 2 +- src/api_s2c/hero/ApiPotency.ts | 2 +- src/api_s2c/hero/ApiTalent.ts | 2 +- src/api_s2c/hero/ApiWeaponUp.ts | 3 ++- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/api_s2c/equip/ApiStarUp.ts b/src/api_s2c/equip/ApiStarUp.ts index 360c950..360a245 100644 --- a/src/api_s2c/equip/ApiStarUp.ts +++ b/src/api_s2c/equip/ApiStarUp.ts @@ -57,7 +57,7 @@ export default async function (call: ApiCall) if (equip.star == 5) md_redPoint_check(call.conn, 'equip_star_5'); if (equip.wearaId) { - let hero = await G.redis.get('hero', call.conn.uid, equip.wearaId); + let hero = await HeroFun.getHero(call, equip.wearaId) if (hero) { hero.equip[G.gc.equip[equip.equipId].type] = EquipShared.fmtEquip(equip); await HeroFun.changeHeroAttr(call, hero, { equip: hero.equip }); diff --git a/src/api_s2c/equip/ApiWear.ts b/src/api_s2c/equip/ApiWear.ts index d2db0a1..edea5c0 100644 --- a/src/api_s2c/equip/ApiWear.ts +++ b/src/api_s2c/equip/ApiWear.ts @@ -7,7 +7,7 @@ import { EquipShared } from '../../shared/public/equip'; import kfjsFun from "../../public/kaifujingsai"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.conn.uid, call.req.heroId); + let hero = await HeroFun.getHero(call, call.req.heroId) if (!hero) return call.error(globalThis.lng.equip_10); if (hero.lv < G.gc.herocom.equipOpenLv) return call.error(`英雄${G.gc.herocom.equipOpenLv}级开启`); diff --git a/src/api_s2c/hero/ApiAwake.ts b/src/api_s2c/hero/ApiAwake.ts index d691fc7..a4bd0c8 100644 --- a/src/api_s2c/hero/ApiAwake.ts +++ b/src/api_s2c/hero/ApiAwake.ts @@ -4,7 +4,7 @@ import { PlayerFun } from '../../public/player'; import { ReqAwake, ResAwake } from "../../shared/protocols/hero/PtlAwake"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) if (!hero) return call.error('', { code: -1 }); let awake = hero.awake || 0; diff --git a/src/api_s2c/hero/ApiJinJie.ts b/src/api_s2c/hero/ApiJinJie.ts index c9c51c3..47b8cd3 100644 --- a/src/api_s2c/hero/ApiJinJie.ts +++ b/src/api_s2c/hero/ApiJinJie.ts @@ -11,7 +11,7 @@ import { PublicShared } from "../../shared/public/public"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) if (!hero) return call.error(globalThis.lng.hero_1); if (G.gc.herogrow[G.gc.hero[hero.heroId].jjup] == undefined) return call.error(globalThis.lng.hero_6); diff --git a/src/api_s2c/hero/ApiLvUp.ts b/src/api_s2c/hero/ApiLvUp.ts index b7d312d..6e52ad4 100644 --- a/src/api_s2c/hero/ApiLvUp.ts +++ b/src/api_s2c/hero/ApiLvUp.ts @@ -11,7 +11,7 @@ import kfjsFun from "../../public/kaifujingsai"; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) let up = call.req.up || 1 if (!hero) return call.errorCode(-1); if (hero.lv >= call.conn.gud.lv * 3 || hero.lv + up > call.conn.gud.lv * 3) return call.errorCode(-2); diff --git a/src/api_s2c/hero/ApiPotency.ts b/src/api_s2c/hero/ApiPotency.ts index b17157f..4ee9586 100644 --- a/src/api_s2c/hero/ApiPotency.ts +++ b/src/api_s2c/hero/ApiPotency.ts @@ -6,7 +6,7 @@ import { ReqPotency, ResPotency } from "../../shared/protocols/hero/PtlPotency"; export default async function (call: ApiCall) { if (!G.gc.hero_qianneng[call.req.type]) return call.error(globalThis.lng.hero_14); - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) let qiannneg = hero.qiannneg || Object.fromEntries(Object.keys(G.gc.hero_qianneng).map(k => [k, 0])); let nextLv = qiannneg[call.req.type] + 1; diff --git a/src/api_s2c/hero/ApiTalent.ts b/src/api_s2c/hero/ApiTalent.ts index af1a9f1..d6f6e93 100644 --- a/src/api_s2c/hero/ApiTalent.ts +++ b/src/api_s2c/hero/ApiTalent.ts @@ -6,7 +6,7 @@ export default async function (call: ApiCall) { let typeConf = G.gc.hero_tf[call.req.type]; if (!typeConf) return call.error('', { code: -1 }); - let hero = await G.redis.get('hero', call.uid, call.req._id); + let hero = await HeroFun.getHero(call, call.req._id) if (!hero) return call.error('', { code: -2 }); let talent = hero.talent || Object.fromEntries(Object.keys(G.gc.hero_tf).map(t => [t, 0])); diff --git a/src/api_s2c/hero/ApiWeaponUp.ts b/src/api_s2c/hero/ApiWeaponUp.ts index ee43e58..63aa4a0 100644 --- a/src/api_s2c/hero/ApiWeaponUp.ts +++ b/src/api_s2c/hero/ApiWeaponUp.ts @@ -5,7 +5,8 @@ import { ReqWeaponUp, ResWeaponUp } from "../../shared/protocols/hero/PtlWeaponU import { PublicShared } from '../../shared/public/public'; export default async function (call: ApiCall) { - let hero = await G.redis.get('hero', call.uid, call.req.id); + let hero = await HeroFun.getHero(call, call.req.id) + let heroConf = G.gc.hero[hero?.heroId]; if (!hero) return call.error(globalThis.lng.hero_1); From 64f333908d837858bab0bbac9dbc1b8e8b98b8ab Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 22:58:48 +0800 Subject: [PATCH 6/7] bugfix --- src/api_s2c/kuangdong/ApiYanShi.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/kuangdong/ApiYanShi.ts b/src/api_s2c/kuangdong/ApiYanShi.ts index b19effd..16a8736 100644 --- a/src/api_s2c/kuangdong/ApiYanShi.ts +++ b/src/api_s2c/kuangdong/ApiYanShi.ts @@ -5,7 +5,14 @@ import {ReqYanShi, ResYanShi} from "../../shared/protocols/kuangdong/PtlYanShi"; export default async function (call: ApiCall) { let hdid = call.req.hdid - let kdInfo = await KuangDongfun.getKaiCaiInfo(hdid) + let con = await KuangDongfun.getCon(hdid) + + let kdInfo + if (con.public_map == 1){ + kdInfo = await KuangDongfun.getKaiCaiInfo(hdid) + }else { + kdInfo = await KuangDongfun.getKaiCaiInfo(hdid, call.uid) + } if (!kdInfo) { return call.error('', {code: -1, message: globalThis.lng.kudangdong_1}) From 2bbfb55704f2dd920b0b36ff21ddb670f4c601ae Mon Sep 17 00:00:00 2001 From: dy Date: Sat, 16 Dec 2023 11:15:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9F=BF=E6=B4=9E?= =?UTF-8?q?=E5=BB=B6=E6=97=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/kuangdong/ApiYanShi.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/kuangdong/ApiYanShi.ts b/src/api_s2c/kuangdong/ApiYanShi.ts index 16a8736..ac0be05 100644 --- a/src/api_s2c/kuangdong/ApiYanShi.ts +++ b/src/api_s2c/kuangdong/ApiYanShi.ts @@ -14,7 +14,7 @@ export default async function (call: ApiCall) { kdInfo = await KuangDongfun.getKaiCaiInfo(hdid, call.uid) } - if (!kdInfo) { + if (!kdInfo || !con) { return call.error('', {code: -1, message: globalThis.lng.kudangdong_1}) } @@ -37,12 +37,15 @@ export default async function (call: ApiCall) { _need && await PlayerFun.cutNeed(call, _need); kdInfo.yanshi = 8 * 3600 + if (!kdInfo.ctime) kdInfo.ctime = G.time + if (!kdInfo.etime) kdInfo.etime = G.time + if (!kdInfo.kdtype) kdInfo.kdtype = con.type // 如果调用这个方法,会upsert,在没有查到数据的情况下, // 会插入空数据,全服玩家的查询列表接口都会报错 // await KuangDongfun.setminingZhanLing(call.uid, hdid, { $set: { yanshi: kdInfo.yanshi } }) await G.mongodb.collection('kuangdong').updateOne({uid: call.uid, hdid: hdid}, - {$set: {yanshi: kdInfo.yanshi}}); + {$set: kdInfo}); kdInfo._id = kdInfo._id.toString() let changeData = {