聊天:系统聊天限制

This commit is contained in:
liangtongchuan
2021-03-07 16:47:49 +08:00
parent 93c00a1572
commit b276b40c7d
3 changed files with 5 additions and 1 deletions
@@ -1,3 +1,4 @@
import { CHANNEL_PREFIX } from './../../../consts/constModules/chatConst';
import {Application, BackendSession} from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { DEFAULT_MSG_PER_PAGE, STATUS } from '../../../consts';
@@ -79,6 +80,7 @@ export class ChatHandler {
*/
async sendGroupMessage(msg: { channel: string, channelId: string, type: number, content: string, targetRoleId: string, targetMsgCode: string }, session: BackendSession) {
const { channel, channelId, type, content, targetRoleId, targetMsgCode } = msg;
if (channel === CHANNEL_PREFIX.SYS) return resResult(STATUS.SYS_CHANNEL_AUTH_NOT_ENOUGH);
const roleId = session.get('roleId');
const roleName = session.get('roleName');
const msgData = await createGroupMsg(roleId, roleName, channel, channelId, type, content, targetRoleId, targetMsgCode);
+2 -1
View File
@@ -113,7 +113,8 @@ describe('聊天测试', function() {
});
it('测试系统频道消息', function(done) {
testGroupMsg(pinusClient, roleInfo, pinusClientT, CHANNEL_PREFIX.SYS, roleInfo.serverId, done);
// TODO: 玩家无法在系统频道发送消息,需要添加系统推送的监听测试
done();
});
it('测试世界频道消息', function(done) {