满足条件开启功能推送,详细功能校验暂缺

This commit is contained in:
luying
2020-11-26 19:29:28 +08:00
parent f2e288f25d
commit 1f05043b4b
14 changed files with 158 additions and 44 deletions
@@ -1,10 +1,10 @@
import { Application, ChannelService, FrontendSession, RemoterClass } from 'pinus';
export default function (app: Application) {
return new EventBattleRemote(app);
return new BattleRemote(app);
}
export class EventBattleRemote {
export class BattleRemote {
constructor(private app: Application) {
this.app = app;
@@ -21,9 +21,9 @@ export class EventBattleRemote {
* @param {boolean} flag channel parameter
*
*/
public async add(uid: string, sid: string, flag: boolean) {
let name = uid;
console.log('EventBattleRemote add: ', name, flag);
public async add(uid: string, sid: string, serverId: number, flag: boolean) {
let name = `server-${serverId}`;
console.log('BattleRemote add: ', name, flag);
let channel = this.channelService.getChannel(name, flag);
if (!!channel && !this.get(name, false).includes(uid)) {
if (!!channel) {
@@ -61,8 +61,8 @@ export class EventBattleRemote {
* @param {String} sid server id
*
*/
public async kick(uid: string, sid: string) {
let name = uid;
public async kick(uid: string, sid: string, serverId: number) {
let name = `server-${serverId}`;
let channel = this.channelService.getChannel(name, false);
// leave channel
if (!!channel) {