diff --git a/src/api_s2c/ApiBingo.ts b/src/api_s2c/ApiBingo.ts index 70a8a14..52c00a0 100644 --- a/src/api_s2c/ApiBingo.ts +++ b/src/api_s2c/ApiBingo.ts @@ -1,10 +1,10 @@ -import {ApiCall} from "tsrpc"; -import {HeroFun} from '../public/hero'; -import {PlayerFun} from '../public/player'; -import {defaultUserAppend, UserFun} from '../public/user'; -import {ReqBingo, ResBingo} from "../shared/protocols/PtlBingo"; -import {ReqEmail} from "../monopoly/protocols/PtlEmail"; -import {EmailFun} from "../public/email"; +import { ApiCall } from "tsrpc"; +import { HeroFun } from '../public/hero'; +import { PlayerFun } from '../public/player'; +import { defaultUserAppend, UserFun } from '../public/user'; +import { ReqBingo, ResBingo } from "../shared/protocols/PtlBingo"; +import { ReqEmail } from "../monopoly/protocols/PtlEmail"; +import { EmailFun } from "../public/email"; export default async function (call: ApiCall) { // TODO @@ -72,37 +72,37 @@ export default async function (call: ApiCall) { if (!G.gc.item[shell[1]]) return call.error(`道具id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); - await PlayerFun.addItem(call, [{a: 'item', t: shell[1], n: parseInt(shell[2])}]); + await PlayerFun.addItem(call, [{ a: 'item', t: shell[1], n: parseInt(shell[2]) }]); } else if (shell[0] == 'hero') { if (!G.gc.hero[shell[1]]) return call.error(`英雄id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); - await PlayerFun.addHero(call, [{a: 'item', t: shell[1], n: parseInt(shell[2])}]); + await PlayerFun.addHero(call, [{ a: 'item', t: shell[1], n: parseInt(shell[2]) }]); } else if (shell[0] == 'equip') { if (!G.gc.equip[shell[1]]) return call.error(`装备id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); - await PlayerFun.addEquip(call, [{a: 'equip', t: shell[1], n: parseInt(shell[2])}]); + await PlayerFun.addEquip(call, [{ a: 'equip', t: shell[1], n: parseInt(shell[2]) }]); } else if (shell[0] == 'shiwu') { if (!G.gc.shiwu[shell[1]]) return call.error(`饰物id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); if (isNaN(parseInt(shell[3]))) return call.error(`请输入正确的品质`); - await PlayerFun.addShiwu(call, [{a: 'shiwu', t: shell[1], n: parseInt(shell[2]), colour: parseInt(shell[3])}]); + await PlayerFun.addShiwu(call, [{ a: 'shiwu', t: shell[1], n: parseInt(shell[2]), colour: parseInt(shell[3]) }]); } else if (shell[0] == 'peijian') { if (!G.gc.peijian[shell[1]]) return call.error(`配件id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); - await PlayerFun.addPeijian(call, [{a: 'peijian', t: shell[1], n: parseInt(shell[2])}]); + await PlayerFun.addPeijian(call, [{ a: 'peijian', t: shell[1], n: parseInt(shell[2]) }]); } else if (shell[0] == 'attr') { if (G.gc.attr[shell[1]] == undefined) return call.error(`道具id不存在:${shell[1]}`); if (isNaN(parseInt(shell[2]))) return call.error(`请输入正确的数量`); - await PlayerFun.addAttr(call, [{a: 'attr', t: shell[1], n: parseInt(shell[2])}]); + await PlayerFun.addAttr(call, [{ a: 'attr', t: shell[1], n: parseInt(shell[2]) }]); } else if (shell.length == 2) { @@ -141,6 +141,9 @@ export default async function (call: ApiCall) { } if (shell[3]) emailMsg.prize = JSON.parse(shell[3]) EmailFun.addEmail(emailMsg); + } else if (shell[0] == "heroskin") { + PlayerFun.sendPrize(call, [{ a: "heroskin", "t": shell[1], n: 1 }]); } + call.succ('succ'); } \ No newline at end of file