feat(聊天): 战区频道

This commit is contained in:
luying
2023-03-18 18:05:09 +08:00
parent e52c7b5241
commit 2d8abaaaff
5 changed files with 47 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
import { pinus } from "pinus";
import { uniq } from "underscore";
import { GVG_SERVER_TYPE, SERVER_GROUP_FUN_TYPE } from "../consts";
import { ServerGroupModel } from "../db/ServerGroup";
import { ServerlistModel } from "../db/Serverlist";
@@ -27,6 +28,12 @@ export async function setServerGroup() {
}
export async function getAllGroupOfServer(serverId: number) {
let gvgGroupId = await getGVGGroupIdOfServer(serverId);
let pvpGroupId = await getPVPGroupIdOfServer(serverId);
return uniq([gvgGroupId, pvpGroupId]);
}
// GVG相关查询本小区所在战区
export async function getGVGGroupIdOfServer(serverId: number) {
return await getGroupIdOfServer(serverId, SERVER_GROUP_FUN_TYPE.GVG);