统一推送格式
This commit is contained in:
@@ -88,7 +88,7 @@ export async function towerBattleEnd(sid: string, roleId: string, serverId: numb
|
||||
if (reward) towerReward = reward;
|
||||
if (towerLv == HANG_UP_CONSTS.ENABLE_LV) {
|
||||
await startHangUp(roleId, roleName);
|
||||
pinus.app.get('channelService').pushMessageByUids('hangUpEnable', {code: 200, data: {enable: true}}, [{uid: roleId, sid}]);
|
||||
pinus.app.get('channelService').pushMessageByUids('hangUpEnable', resResult(STATUS.SUCCESS, {enable: true}), [{uid: roleId, sid}]);
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -292,9 +292,7 @@ function randomPosition(positionStr: string, prePoint: Array<number>, curPoint:
|
||||
function pushEventMsg(sid: string, roleId: string, msg: any ) {
|
||||
let channelService = pinus.app.get('channelService');
|
||||
|
||||
let param = { msg };
|
||||
|
||||
channelService.pushMessageByUids('onSpecialEvent', param, [{
|
||||
channelService.pushMessageByUids('onSpecialEvent', resResult(STATUS.SUCCESS, msg), [{
|
||||
uid: roleId,
|
||||
sid: sid
|
||||
}]);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { BackendSession, FrontendSession, pinus } from "pinus";
|
||||
import { getGamedata } from "../pubUtils/gamedata";
|
||||
import { RoleModel } from "../db/Role";
|
||||
import { resResult } from "../pubUtils/util";
|
||||
import { STATUS } from "../consts";
|
||||
|
||||
// 开启功能
|
||||
export async function switchOnFunc(roleId: string, type: number, param: number, session: (BackendSession|FrontendSession)) {
|
||||
@@ -19,7 +21,7 @@ export async function switchOnFunc(roleId: string, type: number, param: number,
|
||||
|
||||
if(funcs.length > 0) {
|
||||
|
||||
pinus.app.get('channelService').pushMessageByUids('onFuncSwitchOn', {funcs}, [{
|
||||
pinus.app.get('channelService').pushMessageByUids('onFuncSwitchOn', resResult(STATUS.SUCCESS, {funcs}), [{
|
||||
uid: roleId,
|
||||
sid: sid
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user