热更新:handler监听热更新

This commit is contained in:
qiaoxin
2021-07-16 11:29:26 +08:00
parent dc15862207
commit fc1b2c080e
65 changed files with 321 additions and 254 deletions

View File

@@ -1,4 +1,4 @@
import { Application, BackendSession, pinus } from "pinus";
import { Application, BackendSession, pinus, HandlerService, } from "pinus";
import { resResult, parseGoodStr, getRandSingleEelm } from "../../../pubUtils/util";
import { STATUS, TASK_FUN_TYPE, SHOP_REFRESH_TYPE } from "../../../consts";
import { gameData } from "../../../pubUtils/data";
@@ -16,6 +16,7 @@ import { RoleModel } from "../../../db/Role";
import { roleLevelup } from "../../../services/normalBattleService";
export default function (app: Application) {
new HandlerService(app, {});
return new ShopHandler(app);
}
@@ -79,7 +80,7 @@ export class ShopHandler {
}
let goods = await addItems(roleId, roleName, sid, taskReward);
if(expItem && expItem.count > 0) {
if (expItem && expItem.count > 0) {
await roleLevelup(roleId, expItem.count, session);
goods.push(expItem);
}