寻宝助战匹配简单机器人

This commit is contained in:
liangtongchuan
2020-11-27 23:27:35 +08:00
parent 369c831846
commit 3e499de1bc
8 changed files with 159 additions and 23 deletions

View File

@@ -27,7 +27,7 @@ export function battle(session: Session, msg: any, app: Application, cb: (err: E
if (msg.args && msg.args.length > 0) {
for (let arg of msg.args) {
if (!arg.route) continue;
if (arg.route === 'battle.comBattleHandler.createTeam') {
if (['battle.comBattleHandler.createTeam', 'battle.comBattleHandler.searchTeam'].indexOf(arg.route) !== -1) {
rid = Math.random().toString(36).slice(-8);
session.set('teamCode', rid);
} else if (arg.route.indexOf('battle.comBattleHandler') !== -1) {