内存同步数据版的共斗框架
This commit is contained in:
@@ -12,4 +12,16 @@ export function chat(session: Session, msg: any, app: Application, cb: (err: Err
|
||||
|
||||
let res = dispatch(session.get('rid'), chatServers);
|
||||
cb(null, res.id);
|
||||
}
|
||||
|
||||
export function battle(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) {
|
||||
let battleServers = app.getServersByType('battle');
|
||||
|
||||
if(!battleServers || battleServers.length === 0) {
|
||||
cb(new Error('can not find battle servers.'));
|
||||
return;
|
||||
}
|
||||
|
||||
let res = dispatch(session.get('rid'), battleServers);
|
||||
cb(null, res.id);
|
||||
}
|
||||
Reference in New Issue
Block a user