热更新: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, ChannelService } from "pinus";
import { Application, BackendSession, ChannelService, HandlerService, } from "pinus";
import { resResult, getRandEelm, getResStr, shouldRefresh, sortArrRandom } from "../../../pubUtils/util";
import { STATUS, ROLE_SELECT, FRIEND_DROP_TYPE, FRIEND_RELATION_TYPE, POPULATE_TYPE, BLOCK_OPEATE, CONSUME_TYPE, ITID, HERO_SELECT, EQUIP_SELECT, REDIS_KEY, MSG_SOURCE, MSG_TYPE, TASK_TYPE } from "../../../consts";
import { RoleModel, RoleType } from "../../../db/Role";
@@ -26,6 +26,7 @@ import { checkTaskWithRoles, checkTask, checkActivityTask } from "../../../servi
export default function (app: Application) {
new HandlerService(app, {});
return new FriendHandler(app);
}
@@ -676,9 +677,9 @@ export class FriendHandler {
list.push({
roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job,
skin: curSkin ? curSkin.id : 0, equips: equips.map(cur => {
let curEplace = ePlace.find(ccur => cur.ePlaceId == ccur.id)||new EPlace();
let { lv = 0, refineLv = 0} = curEplace;
return {...cur, lv, refineLv}
let curEplace = ePlace.find(ccur => cur.ePlaceId == ccur.id) || new EPlace();
let { lv = 0, refineLv = 0 } = curEplace;
return { ...cur, lv, refineLv }
}), attributes
});