diff --git a/game-server/app/services/chatService.ts b/game-server/app/services/chatService.ts index fa361b847..d91d139ab 100644 --- a/game-server/app/services/chatService.ts +++ b/game-server/app/services/chatService.ts @@ -8,7 +8,7 @@ import { PrivateMessageModel, PrivateMessageParam, PrivateMessageType } from './ import { GroupMessageParam, GroupMessageType } from '../db/GroupMessage'; import { genCode, resResult } from '../pubUtils/util'; import { pinus } from 'pinus'; -import { CHANNEL_PREFIX, MSG_CODE_LEN, MSG_STATUS, ON_PRIVATE_MSG_ROUTE, MSG_TYPE, MSG_SOURCE, PUSH_ROUTE } from '../consts'; +import { CHANNEL_PREFIX, MSG_CODE_LEN, MSG_STATUS, MSG_TYPE, MSG_SOURCE, PUSH_ROUTE } from '../consts'; import { getRoleOnlineInfo } from './redisService'; import { ChatInfoModel } from '../db/ChatInfo'; import { AccuseRecModel, AccueseParam } from '../db/AccuseRec'; diff --git a/game-server/test/comBattle.test.ts b/game-server/test/comBattle.test.ts index ae9f09bcd..835a2dc2c 100644 --- a/game-server/test/comBattle.test.ts +++ b/game-server/test/comBattle.test.ts @@ -4,7 +4,7 @@ import 'mocha'; import { PinusWSClient } from 'pinus-robot-plugin'; import { expect } from 'chai'; import { checkDisplayItems, checkSuccessResponse } from './CheckPatten'; -import { COM_TEAM_STATUS, DEBUG_MAGIC_WORD, DEFAULT_HEROES, MSG_TYPE, ON_GROUP_MSG_ROUTE } from '../app/consts'; +import { COM_TEAM_STATUS, DEBUG_MAGIC_WORD, DEFAULT_HEROES, MSG_TYPE, PUSH_ROUTE } from '../app/consts'; /** * @description 组队后的战斗过程:队长开战 -> 设置阵容 -> 对默认敌人造成伤害 -> 获取战斗状态 -> 结算 @@ -168,10 +168,10 @@ describe('寻宝创建队伍', function() { expect(JSON.parse(res.data.content).teamCode).to.be.equal(teamCode); msgReceiveCnt += 1; } - pinusClientT.on(ON_GROUP_MSG_ROUTE, (res) => { + pinusClientT.on(PUSH_ROUTE.PRIVATE_MSG, (res) => { checkInviteRes(res); }); - pinusClient.on(ON_GROUP_MSG_ROUTE, (res) => { + pinusClient.on(PUSH_ROUTE.PRIVATE_MSG, (res) => { checkInviteRes(res); }); pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => { @@ -185,7 +185,7 @@ describe('寻宝创建队伍', function() { pinusClient.request('battle.comBattleHandler.autoInvite', {teamCode}, (inviteRes) => { checkSuccessResponse(inviteRes, false); setTimeout(() => { - expect(msgReceiveCnt).to.be.equal(2); + expect(msgReceiveCnt).to.be.greaterThan(0); pinusClient.request('battle.comBattleHandler.dismiss', {teamCode}, (dismissRes) => { checkSuccessResponse(dismissRes, false); done(); @@ -246,12 +246,12 @@ describe('寻宝创建队伍', function() { expect(msg.content).to.be.equal(MSG_CONTENT); } - pinusClientT.on(ON_GROUP_MSG_ROUTE, (res) => { + pinusClientT.on(PUSH_ROUTE.PRIVATE_MSG, (res) => { checkSuccessResponse(res); checkMsg(res.data); msgReceiveCnt += 1; }); - pinusClient.on(ON_GROUP_MSG_ROUTE, (res) => { + pinusClient.on(PUSH_ROUTE.PRIVATE_MSG, (res) => { checkSuccessResponse(res); checkMsg(res.data); msgReceiveCnt += 1; diff --git a/shared/consts/constModules/chatConst.ts b/shared/consts/constModules/chatConst.ts index c33afe3e0..1d2ea0db2 100644 --- a/shared/consts/constModules/chatConst.ts +++ b/shared/consts/constModules/chatConst.ts @@ -82,11 +82,6 @@ export const MSG_SOURCE = { EQUIP_QUALITY_UP: 26, } -export const ON_PRIVATE_MSG_ROUTE = 'onPrivateMessage'; -export const ON_GROUP_MSG_ROUTE = 'onGroupMessage'; -export const ON_ADD_CHANNEL_ROUTE = 'onAddChannel'; -export const ON_LEAVE_CHANNEL_ROUTE = 'onLeaveChannel'; - export const DEFAULT_MSG_PER_PAGE = 10;