聊天:玩家在军团频道发消息的测试
This commit is contained in:
@@ -115,6 +115,7 @@ export class EntryHandler {
|
||||
if(guild) {
|
||||
addRoleToGuildChannel(role.roleId, self.app.get('serverId'), userGuild.guildCode);
|
||||
role['guildAuth'] = userGuild.auth;
|
||||
role['guildCode'] = userGuild.guildCode;
|
||||
let {lv: guildLv, memberCnt} = guild;
|
||||
let dicGuild = gameData.centerBase.get(guildLv);
|
||||
if(dicGuild && memberCnt >= dicGuild.peopleNum) {
|
||||
|
||||
@@ -151,17 +151,17 @@ async function addRoleToChannel(roomId: string, roleId: string, sid: string) {
|
||||
}
|
||||
|
||||
export async function addRoleToSysChannel(roleId: string, sid: string, serverId: number) {
|
||||
const roomId = groupRoomId('sys', `${serverId}`);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.SYS, `${serverId}`);
|
||||
await addRoleToChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
export async function addRoleToWorldChannel(roleId: string, sid: string, serverId: number) {
|
||||
const roomId = groupRoomId('new_world', `${serverId}`);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.WORLD, `${serverId}`);
|
||||
await addRoleToChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
export async function addRoleToGuildChannel(roleId: string, sid: string, guildCode: string) {
|
||||
const roomId = groupRoomId('new_guild', guildCode);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.GUILD, guildCode);
|
||||
await addRoleToChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
@@ -171,19 +171,19 @@ async function leaveChannel(roomId: string, roleId: string, sid: string) {
|
||||
}
|
||||
|
||||
export async function leaveSysChannel(roleId: string, sid: string, serverId: number) {
|
||||
const roomId = groupRoomId('sys', `${serverId}`);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.SYS, `${serverId}`);
|
||||
await leaveChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
export async function leaveWorldChannel(roleId: string, sid: string, serverId: number) {
|
||||
const roomId = groupRoomId('new_world', `${serverId}`);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.WORLD, `${serverId}`);
|
||||
await leaveChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
export async function leaveGuildChannel(roleId: string, sid: string) {
|
||||
const { guildCode } = await RoleModel.findByRoleId(roleId, 'guildCode');
|
||||
if (!guildCode) return;
|
||||
const roomId = groupRoomId('new_guild', guildCode);
|
||||
const roomId = groupRoomId(CHANNEL_PREFIX.GUILD, guildCode);
|
||||
await leaveChannel(roomId, roleId, sid);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,4 +266,8 @@ describe('聊天测试', function() {
|
||||
it('测试世界频道消息', function(done) {
|
||||
testGroupMsg(pinusClient, roleInfo, pinusClientT, CHANNEL_PREFIX.WORLD, roleInfo.serverId, done);
|
||||
});
|
||||
|
||||
it('测试军团频道消息', function(done) {
|
||||
testGroupMsg(pinusClient, roleInfo, pinusClientT, CHANNEL_PREFIX.GUILD, roleInfo.guildCode, done);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user