From 168e0a8d2831c4100ad549057d694bc34277c3e0 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 9 Dec 2020 11:16:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/consts/statusCode.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index 5aeb9a414..2e4a573c1 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -112,6 +112,13 @@ export const STATUS = { DUNGEON_REFRESH_TIMES_LACK: { code: 20701, simStr: '购买次数不足' }, DUNGEON_TIMES_LACK: { code: 20701, simStr: '挑战次数不足' }, // 养成相关状态 30000 - 39999 + // 通用 30000 - 30099 + ROLE_INFO_NOT_FOUND: { code: 30000, simStr: '数据表未找到' }, + // 武将养成通用 30100 - 30199 + // 武将合成,升级,升星,升品相关 30200 - 30299 + + // 武将训练,好感度,羁绊,时装相关 30300 - 30399 + // 社交相关状态 40000 - 49999 // 运营模块相关状态 50000 - 59999 // GM后台相关状态 60000 - 69999 From dca5ae3d5f0cfc85c39b6cba7e23751e23896840 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 9 Dec 2020 14:30:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?handleCost=E6=96=B9=E6=B3=95=E5=8E=BB?= =?UTF-8?q?=E6=8E=89channelService=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/role/handler/heroHandler.ts | 2 +- game-server/app/services/rewardService.ts | 9 ++++----- shared/pubUtils/gamedata.ts | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/game-server/app/servers/role/handler/heroHandler.ts b/game-server/app/servers/role/handler/heroHandler.ts index 77dd6205f..b75e32317 100644 --- a/game-server/app/servers/role/handler/heroHandler.ts +++ b/game-server/app/servers/role/handler/heroHandler.ts @@ -20,7 +20,7 @@ export class HeroHandler { let {id, count} = msg; - let result = await handleCost(this.channelService, roleId, sid, [{id, count}] ); + let result = await handleCost(roleId, sid, [{id, count}] ); if(!result) { return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH); } diff --git a/game-server/app/services/rewardService.ts b/game-server/app/services/rewardService.ts index db12d3dcf..baa2108b7 100644 --- a/game-server/app/services/rewardService.ts +++ b/game-server/app/services/rewardService.ts @@ -3,12 +3,11 @@ import { EquipModel } from './../db/Equip'; import { CounterModel } from './../db/Counter'; import { decodeStr, resResult } from '../pubUtils/util'; import { getGoodById } from '../pubUtils/gamedata'; -import Role, { RoleModel } from '../db/Role'; +import { RoleModel } from '../db/Role'; import { setAp } from './actionPointService'; import { ItemModel } from '../db/Item'; -import { ChannelService } from 'pinus'; -import { isRegExp } from 'util'; import { STATUS } from '../consts/statusCode'; +import { pinus } from 'pinus'; export async function handleFixedReward(roleId: string, roleName: string, rewardStr: string, multi: number) { let reward = decodeStr('fixReward', rewardStr); @@ -124,7 +123,7 @@ async function rewardCurrency (roleId: string, dicGood: any, data: {id:number,cn return goods; } -export async function handleCost(channelService: ChannelService, roleId: string, sid: string, goods: Array<{id: number, count: number}>) { +export async function handleCost(roleId: string, sid: string, goods: Array<{id: number, count: number}>) { // 检查道具数量 let role, costGold = 0, costCoin = 0, items = new Array<{id: number, count: number}>(), ids = new Array() ; for(let {id, count} of goods) { @@ -173,7 +172,7 @@ export async function handleCost(channelService: ChannelService, roleId: string, } let uids = [{uid: roleId, sid}]; - channelService.pushMessageByUids('onItemUpdate', resResult(STATUS.SUCCESS, {goods: resultGoods, gold, coin} ), uids); + pinus.app.get('channelService').pushMessageByUids('onItemUpdate', resResult(STATUS.SUCCESS, {goods: resultGoods, gold, coin} ), uids); return true } \ No newline at end of file diff --git a/shared/pubUtils/gamedata.ts b/shared/pubUtils/gamedata.ts index 01ab5ab20..a642d1ecb 100644 --- a/shared/pubUtils/gamedata.ts +++ b/shared/pubUtils/gamedata.ts @@ -129,8 +129,8 @@ function parseHeroSkill() { data.forEach(elem => { if (elem && elem.skillid) { const seidLvUpArr = new Array(); - let skillArr = (elem.seid as string).split('&'); - let lvUpArr = (elem.selv_up as string).split('&'); + let skillArr = (elem.starSeid as string).split('&'); + let lvUpArr = (elem.starSkill as string).split('&'); for(let i = 0;i < skillArr.length;i++){ if(skillArr[i]==="") continue;