Compare commits
6 Commits
934097ec16
...
99500b7bf4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
99500b7bf4 | ||
![]() |
ec3f954518 | ||
![]() |
87466c68ad | ||
![]() |
5150032d20 | ||
![]() |
a550711bbb | ||
![]() |
8d3b2178fc |
@ -57,7 +57,7 @@ export default async function (call: ApiCall<ReqStarUp, ResStarUp, ServiceType>)
|
||||
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 });
|
||||
|
@ -7,7 +7,7 @@ import { EquipShared } from '../../shared/public/equip';
|
||||
import kfjsFun from "../../public/kaifujingsai";
|
||||
|
||||
export default async function (call: ApiCall<ReqWear, ResWear, ServiceType>) {
|
||||
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}级开启`);
|
||||
|
@ -4,7 +4,7 @@ import { PlayerFun } from '../../public/player';
|
||||
import { ReqAwake, ResAwake } from "../../shared/protocols/hero/PtlAwake";
|
||||
|
||||
export default async function (call: ApiCall<ReqAwake, ResAwake>) {
|
||||
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;
|
||||
|
@ -9,7 +9,7 @@ import {HeroFun} from "../../public/hero";
|
||||
export const maxPosNum = 6;
|
||||
|
||||
export default async function (call: ApiCall<ReqChangePos, ResChangePos>) {
|
||||
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);
|
||||
|
@ -11,7 +11,7 @@ import { PublicShared } from "../../shared/public/public";
|
||||
|
||||
export default async function (call: ApiCall<ReqJinJie, ResJinJie, ServiceType>) {
|
||||
|
||||
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);
|
||||
|
@ -11,7 +11,7 @@ import kfjsFun from "../../public/kaifujingsai";
|
||||
|
||||
export default async function (call: ApiCall<ReqLvUp, ResLvUp, ServiceType>) {
|
||||
|
||||
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);
|
||||
|
@ -6,7 +6,7 @@ import { ReqPotency, ResPotency } from "../../shared/protocols/hero/PtlPotency";
|
||||
export default async function (call: ApiCall<ReqPotency, ResPotency>) {
|
||||
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;
|
||||
|
||||
|
@ -6,7 +6,7 @@ export default async function (call: ApiCall<ReqTalent, ResTalent>) {
|
||||
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]));
|
||||
|
@ -5,7 +5,8 @@ import { ReqWeaponUp, ResWeaponUp } from "../../shared/protocols/hero/PtlWeaponU
|
||||
import { PublicShared } from '../../shared/public/public';
|
||||
|
||||
export default async function (call: ApiCall<ReqWeaponUp, ResWeaponUp>) {
|
||||
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);
|
||||
|
@ -1,24 +1,24 @@
|
||||
import { ApiCall } from "tsrpc";
|
||||
import { KuangDongfun } from "../../public/kuangdong";
|
||||
import { PlayerFun } from "../../public/player";
|
||||
import { ReqYanShi, ResYanShi } from "../../shared/protocols/kuangdong/PtlYanShi";
|
||||
import {ApiCall} from "tsrpc";
|
||||
import {KuangDongfun} from "../../public/kuangdong";
|
||||
import {PlayerFun} from "../../public/player";
|
||||
import {ReqYanShi, ResYanShi} from "../../shared/protocols/kuangdong/PtlYanShi";
|
||||
|
||||
export default async function (call: ApiCall<ReqYanShi, ResYanShi>) {
|
||||
let hdid = call.req.hdid
|
||||
let kdInfo = await KuangDongfun.getKaiCaiInfo(hdid)
|
||||
|
||||
if (!kdInfo) {
|
||||
return call.error('', { code: -1, message: globalThis.lng.kudangdong_1 })
|
||||
return call.error('', {code: -1, message: globalThis.lng.kudangdong_1})
|
||||
}
|
||||
|
||||
// 不是自己占领的
|
||||
if (kdInfo.uid != call.uid) {
|
||||
return call.error('', { code: -2, message: globalThis.lng.kudangdong_8 })
|
||||
return call.error('', {code: -2, message: globalThis.lng.kudangdong_8})
|
||||
}
|
||||
|
||||
// 已经延时
|
||||
if (kdInfo.yanshi != 0) {
|
||||
return call.error('', { code: -2, message: globalThis.lng.kudangdong_10 })
|
||||
return call.error('', {code: -2, message: globalThis.lng.kudangdong_10})
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
@ -30,7 +30,13 @@ export default async function (call: ApiCall<ReqYanShi, ResYanShi>) {
|
||||
_need && await PlayerFun.cutNeed(call, _need);
|
||||
|
||||
kdInfo.yanshi = 8 * 3600
|
||||
await KuangDongfun.setminingZhanLing(call.uid, hdid, { $set: { yanshi: kdInfo.yanshi } })
|
||||
|
||||
// 如果调用这个方法,会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}});
|
||||
|
||||
kdInfo._id = kdInfo._id.toString()
|
||||
let changeData = {
|
||||
kdinfo: kdInfo
|
||||
|
@ -905,6 +905,78 @@
|
||||
"front": {},
|
||||
"currency": "CNY"
|
||||
},
|
||||
"lv15": {
|
||||
"id": "lv15",
|
||||
"money": 0.5,
|
||||
"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": 10
|
||||
}
|
||||
],
|
||||
"firstPayPrize": [],
|
||||
"name": "pay_name_lv25",
|
||||
"undefined": "等级推送礼包25",
|
||||
"time": -1,
|
||||
"buys": 1,
|
||||
"needVip": 0,
|
||||
"front": {},
|
||||
"currency": "CNY"
|
||||
},
|
||||
"lv30": {
|
||||
"id": "lv30",
|
||||
"money": 6,
|
||||
|
@ -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 },
|
||||
|
@ -81,7 +81,6 @@ export class KuangDongfun {
|
||||
upsert: true
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**获取所有矿洞信息 */
|
||||
|
Loading…
Reference in New Issue
Block a user