From cb78e2256f0d6b54857735c0e4cdc216ac52be73 Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 15 Oct 2021 11:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=AD=82=E5=95=86=E5=BA=97=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/servers/role/handler/shopHandler.ts | 16 ++++++++-------- game-server/app/services/auctionService.ts | 3 --- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/game-server/app/servers/role/handler/shopHandler.ts b/game-server/app/servers/role/handler/shopHandler.ts index 62869460e..649368ddc 100644 --- a/game-server/app/servers/role/handler/shopHandler.ts +++ b/game-server/app/servers/role/handler/shopHandler.ts @@ -1,6 +1,6 @@ import { Application, BackendSession } from "pinus"; import { gameData } from "../../../pubUtils/data"; -import { resResult } from "../../../pubUtils/util"; +import { parseGoodStr, resResult } from "../../../pubUtils/util"; import { STATUS, GUILD_STRUCTURE, ITID, CONSUME_TYPE, HERO_QUALITY_TYPE, HERO_GROW_MAX } from "../../../consts"; import { DicShopListModel } from "../../../db/DicShopList"; import { UserShopModel } from "../../../db/UserShop"; @@ -10,6 +10,7 @@ import { SHOP } from "../../../pubUtils/dicParam"; import { getHonourObject } from "../../../pubUtils/itemUtils"; import { HeroModel } from "../../../db/Hero"; import { getShopListById } from "../../../services/shopService"; +import { RewardInter } from "../../../pubUtils/interface"; export default function(app: Application) { return new ShopHandler(app); @@ -122,18 +123,17 @@ export class ShopHandler { let costResult = await handleCost(roleId, sid, cost); if(!costResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH); - let honour = 0; + let reward: RewardInter[] = []; switch (dicGoods.quality) { case HERO_QUALITY_TYPE.BLUE: - honour = SHOP.HERO_SOUL_BULE * count; break; + reward = parseGoodStr(SHOP.HERO_SOUL_BULE); break; case HERO_QUALITY_TYPE.PURPLE: - honour = SHOP.HERO_SOUL_PURPLE * count; break; + reward = parseGoodStr(SHOP.HERO_SOUL_PURPLE); break; case HERO_QUALITY_TYPE.GOLD: - honour = SHOP.HERO_SOUL_GOLDEN * count; break; + reward = parseGoodStr(SHOP.HERO_SOUL_GOLDEN); break; } - // 增加功勋 - let reward = getHonourObject(honour); - let goods = await addItems(roleId, roleName, sid, [reward]); + // 增加货币 + let goods = await addItems(roleId, roleName, sid, reward.map(cur => { return {id: cur.id, count: cur.count * count} })); return resResult(STATUS.SUCCESS, { goodsId, count, diff --git a/game-server/app/services/auctionService.ts b/game-server/app/services/auctionService.ts index a61de7d78..effc8df03 100644 --- a/game-server/app/services/auctionService.ts +++ b/game-server/app/services/auctionService.ts @@ -12,7 +12,6 @@ import { participants } from './guildActivityService'; import { Member } from '../domain/battleField/guildActivity'; import * as dicParam from '../pubUtils/dicParam'; import { RewardInter } from '../pubUtils/interface'; -import { errlogger } from '../util/logger'; import { pushCurrentTime } from './chatService'; // ! 获取底价,假数据 @@ -161,8 +160,6 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo maxPrice, curPrice: basePrice, } }); - errlogger.error(`******genAuction begin ${begin} end ${end}`); - errlogger.error(`******genAuction ${JSON.stringify(lotsData)}`); const lots = await LotModel.createRecs(lotsData); const dividendCode = genCode(DIVIDEND_CODE_LEN); const dividendData: DividendParam = {