后台添加推送奇遇事件功能

This commit is contained in:
luying
2020-10-19 17:31:45 +08:00
parent 99e50c9c36
commit 0da6b7c169
10 changed files with 227 additions and 9 deletions

View File

@@ -24,4 +24,16 @@ export function battle(session: Session, msg: any, app: Application, cb: (err: E
let res = dispatch(session.get('roleId'), battleServers);
cb(null, res.id);
}
export function gm(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) {
let gmServers = app.getServersByType('gm');
if(!gmServers || gmServers.length === 0) {
cb(new Error('can not find gm servers.'));
return;
}
let res = dispatch(session.get('roleId'), gmServers);
cb(null, res.id);
}