军团活动:排行榜&军功上报
This commit is contained in:
@@ -42,6 +42,35 @@ export function battle(session: Session, msg: any, app: Application, cb: (err: E
|
||||
cb(null, res.id);
|
||||
}
|
||||
|
||||
|
||||
export function guild(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) {
|
||||
let guildServers = app.getServersByType('guild');
|
||||
|
||||
if(!guildServers || guildServers.length === 0) {
|
||||
cb(new Error('can not find guild servers.'));
|
||||
return;
|
||||
}
|
||||
|
||||
let rid = session.get('roleId');
|
||||
|
||||
if (msg.args && msg.args.length > 0) {
|
||||
for (let arg of msg.args) {
|
||||
if (!arg.route) continue;
|
||||
|
||||
if (['guild.gateActivityHandler.checkBattle', // 军团活动蛮夷入侵路由,按军团路由
|
||||
'guild.gateActivityHandler.action',
|
||||
'guild.gateActivityHandler.hitGate',
|
||||
'guild.gateActivityHandler.battleEnd'
|
||||
].indexOf(arg.route) !== -1) {
|
||||
rid = session.get('guildCode');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let res = dispatch(rid, guildServers);
|
||||
cb(null, res.id);
|
||||
}
|
||||
|
||||
export function gm(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) {
|
||||
let gmServers = app.getServersByType('gm');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user