From 054e9307af40becdf93c1a4c892736a456c0c314 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 19 Jan 2021 14:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=B9=E9=85=8D=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/RankedLobbyRoom.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/rooms/RankedLobbyRoom.ts b/src/rooms/RankedLobbyRoom.ts index 961a1f6..f859256 100644 --- a/src/rooms/RankedLobbyRoom.ts +++ b/src/rooms/RankedLobbyRoom.ts @@ -72,13 +72,21 @@ export class RankedLobbyRoom extends Room { // * connection to the created room // */ // cancelConfirmationAfter = 5000; - maxDiffRatio = 1.2; /** * rank and group cache per-player */ stats: ClientStat[] = []; + rank_mpa = 0.2; + fair_ir = 1.2; + step_ir = 1.3; onCreate(options: any) { + const fc = global.$cfg.get(BaseConst.FORMULA); + this.rank_mpa = fc.get(70028).number / 100; + this.fair_ir = fc.get(70029).number / 100 + 1; + this.step_ir = fc.get(70031).number / 100 + 1; + this.groupAddOneTime = fc.get(70023).number * 1000; + this.maxWaitingTime = (fc.get(70024).number + fc.get(70025).number) * 1000; if (options.maxWaitingTime) { this.maxWaitingTime = options.maxWaitingTime; } @@ -115,7 +123,6 @@ export class RankedLobbyRoom extends Room { * 如果找到的记录, clients已经查过2条, 则也插入一条记录 * 如果找到的记录, clients是1, 则把当前client添加到该记录中, 同时更新rank */ - const fc = global.$cfg.get(BaseConst.FORMULA); if (options.group) { let length = this.stats.length; let groupData; @@ -149,7 +156,7 @@ export class RankedLobbyRoom extends Room { }); } else { groupData.clients.set(client.sessionId, {client, options}); - groupData.rank = (groupData.rank + options.rank) / 2 * (1 + fc.get(70027).number / 100); + groupData.rank = (groupData.rank + options.rank) / 2 * (1 + this.rank_mpa); } } client.send("clients", groupData.clients.size); @@ -199,7 +206,7 @@ export class RankedLobbyRoom extends Room { /** * figure out how to identify the diff ratio that makes sense */ - if (diffRatio > this.maxDiffRatio) { + if (diffRatio > this.step_ir) { currentGroup = this.createGroup(); totalRank = 0; } @@ -262,7 +269,7 @@ export class RankedLobbyRoom extends Room { /** * figure out how to identify the diff ratio that makes sense */ - if (diffRatio > this.maxDiffRatio) { + if (diffRatio > this.fair_ir) { currentGroup = this.createGroup(); totalRank = 0; }