修改匹配的时间

This commit is contained in:
zhl 2021-01-19 14:04:35 +08:00
parent ff12e937b1
commit 054e9307af

View File

@ -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;
}