添加寻宝数据库和简单的组队接口
This commit is contained in:
@@ -22,7 +22,23 @@ export function battle(session: Session, msg: any, app: Application, cb: (err: E
|
||||
return;
|
||||
}
|
||||
|
||||
let res = dispatch(session.get('roleId'), battleServers);
|
||||
let rid = session.get('roleId');
|
||||
|
||||
if (msg.args && msg.args.length > 0) {
|
||||
for (let arg of msg.args) {
|
||||
if (!arg.route) continue;
|
||||
if (arg.route === 'battle.comBattleHandler.createTeam') {
|
||||
rid = Math.random().toString(36).slice(-8);
|
||||
session.set('teamCode', rid);
|
||||
} else if (arg.route.indexOf('battle.comBattleHandler') !== -1) {
|
||||
if (arg.body.teamCode) {
|
||||
rid = arg.body.teamCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let res = dispatch(rid, battleServers);
|
||||
cb(null, res.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user