干部功能redis直取修复
This commit is contained in:
parent
ec3f954518
commit
99500b7bf4
@ -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.star == 5) md_redPoint_check(call.conn, 'equip_star_5');
|
||||||
|
|
||||||
if (equip.wearaId) {
|
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) {
|
if (hero) {
|
||||||
hero.equip[G.gc.equip[equip.equipId].type] = EquipShared.fmtEquip(equip);
|
hero.equip[G.gc.equip[equip.equipId].type] = EquipShared.fmtEquip(equip);
|
||||||
await HeroFun.changeHeroAttr(call, hero, { equip: hero.equip });
|
await HeroFun.changeHeroAttr(call, hero, { equip: hero.equip });
|
||||||
|
@ -7,7 +7,7 @@ import { EquipShared } from '../../shared/public/equip';
|
|||||||
import kfjsFun from "../../public/kaifujingsai";
|
import kfjsFun from "../../public/kaifujingsai";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqWear, ResWear, ServiceType>) {
|
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) return call.error(globalThis.lng.equip_10);
|
||||||
if (hero.lv < G.gc.herocom.equipOpenLv) return call.error(`英雄${G.gc.herocom.equipOpenLv}级开启`);
|
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";
|
import { ReqAwake, ResAwake } from "../../shared/protocols/hero/PtlAwake";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqAwake, ResAwake>) {
|
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 });
|
if (!hero) return call.error('', { code: -1 });
|
||||||
|
|
||||||
let awake = hero.awake || 0;
|
let awake = hero.awake || 0;
|
||||||
|
@ -11,7 +11,7 @@ import { PublicShared } from "../../shared/public/public";
|
|||||||
|
|
||||||
export default async function (call: ApiCall<ReqJinJie, ResJinJie, ServiceType>) {
|
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 (!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);
|
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>) {
|
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
|
let up = call.req.up || 1
|
||||||
if (!hero) return call.errorCode(-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);
|
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>) {
|
export default async function (call: ApiCall<ReqPotency, ResPotency>) {
|
||||||
if (!G.gc.hero_qianneng[call.req.type]) return call.error(globalThis.lng.hero_14);
|
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 qiannneg = hero.qiannneg || Object.fromEntries(Object.keys(G.gc.hero_qianneng).map(k => [k, 0]));
|
||||||
let nextLv = qiannneg[call.req.type] + 1;
|
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];
|
let typeConf = G.gc.hero_tf[call.req.type];
|
||||||
if (!typeConf) return call.error('', { code: -1 });
|
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 });
|
if (!hero) return call.error('', { code: -2 });
|
||||||
|
|
||||||
let talent = hero.talent || Object.fromEntries(Object.keys(G.gc.hero_tf).map(t => [t, 0]));
|
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';
|
import { PublicShared } from '../../shared/public/public';
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqWeaponUp, ResWeaponUp>) {
|
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];
|
let heroConf = G.gc.hero[hero?.heroId];
|
||||||
|
|
||||||
if (!hero) return call.error(globalThis.lng.hero_1);
|
if (!hero) return call.error(globalThis.lng.hero_1);
|
||||||
|
Loading…
Reference in New Issue
Block a user