军团活动:粮草先行精度问题

This commit is contained in:
luying
2022-05-26 20:15:10 +08:00
parent 4e24ecd230
commit 1236cd5f99
3 changed files with 9 additions and 6 deletions

View File

@@ -155,10 +155,6 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
case 'guild.guildHandler.createGuild':
case 'guild.guildHandler.setGuildInfo':
{
if(!guildCode) {
guildCode = genCode(6);
msg.guildCode = guildCode;
}
let result = await checkGuildName(guildCode, serverId, msg.name, msg.notice);
if(!result) hasBlockWords = true;
break;
@@ -166,6 +162,11 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
}
}
if(routeRecord.route == 'guild.guildHandler.createGuild') {
let guildCode = genCode(6);
msg.guildCode = guildCode;
}
if(hasBlockWords) return next(new Error('globalFilter'), resResult(STATUS.BLOCK_WORDS));
next(null);

View File

@@ -53,6 +53,7 @@ export function guild(session: Session, msg: any, app: Application, cb: (err: Er
let rid = session.get('roleId');
console.log('#### arg', msg.args);
if (msg.args && msg.args.length > 0) {
for (let arg of msg.args) {
if (!arg.route) continue;

View File

@@ -351,9 +351,10 @@ export class RaceActivityRankParam {
this.code = woodenHorse.guildCode;
this.name = woodenHorse.guildName;
this.durability = woodenHorse.durability;
this.sortDistance = woodenHorse.distance
let distance = woodenHorse.distance > 1000? 1000: woodenHorse.distance;
this.sortDistance = distance;
this.sortTime = woodenHorse.time - woodenHorse.allStartTime;
this.num = Math.floor(woodenHorse.distance);
this.num = Math.floor(distance);
this.time = Math.floor((woodenHorse.time - woodenHorse.allStartTime)/1000)
}