拍卖行:添加实时推送

This commit is contained in:
luying
2021-10-27 14:14:18 +08:00
parent 639f917a75
commit e4d4af4409
8 changed files with 110 additions and 21 deletions

View File

@@ -46,6 +46,16 @@ export async function addRoleToCityChannel(roleId: string, sid: string, cityId:
await addRoleToChannel(roomId, roleId, sid);
}
export async function addRoleToGuildAuctionChannel(roleId: string, sid: string, guildCode: string) {
const roomId = groupRoomId(CHANNEL_PREFIX.GUILD_AUCTION, guildCode);
await addRoleToChannel(roomId, roleId, sid);
}
export async function addRoleToWorldAuctionChannel(roleId: string, sid: string, serverId: number) {
const roomId = groupRoomId(CHANNEL_PREFIX.GUILD_AUCTION, serverId);
await addRoleToChannel(roomId, roleId, sid);
}
async function leaveChannel(roomId: string, roleId: string, sid: string) {
const channelSid = await channelServer(roomId);
await pinus.app.rpc.chat.chatRemote.leaveChannel.toServer(channelSid, roomId, roleId, sid);
@@ -66,6 +76,15 @@ export async function leaveCityChannel(roleId: string, sid: string, cityId: numb
await leaveChannel(roomId, roleId, sid);
}
export async function leaveGuildAuctionChannel(roleId: string, sid: string, guildCode: string) {
const roomId = groupRoomId(CHANNEL_PREFIX.CITY, guildCode);
await leaveChannel(roomId, roleId, sid);
}
export async function leaveWorldAuctionChannel(roleId: string, sid: string, serverId: number) {
const roomId = groupRoomId(CHANNEL_PREFIX.CITY, serverId);
await leaveChannel(roomId, roleId, sid);
}
export async function leaveGuildChannel(roleId: string, sid: string, guildCode: string) {
if (!guildCode) return;
@@ -89,4 +108,16 @@ export async function getCityChannelSid(cityId: number) {
const roomId = groupRoomId(CHANNEL_PREFIX.CITY, cityId);
const channelSid = await channelServer(roomId);
return channelSid;
}
export async function getGuildAuctionChannelSid(guildCpde: string) {
const roomId = groupRoomId(CHANNEL_PREFIX.GUILD_AUCTION, guildCpde);
const channelSid = await channelServer(roomId);
return channelSid;
}
export async function getWorldAuctionChannelSid(serverId: number) {
const roomId = groupRoomId(CHANNEL_PREFIX.CITY, serverId);
const channelSid = await channelServer(roomId);
return channelSid;
}