Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make minimal game duration to treat game as ranked configurable, lower default 180 -> 90 #271

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/teiserver/game/libs/match_rating_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Teiserver.Game.MatchRatingLib do
to balance matches. For that use Teiserver.Battle.BalanceLib.
"""

alias Teiserver.{Account, Coordinator, Game, Battle}
alias Teiserver.{Account, Coordinator, Config, Game, Battle,}
alias Teiserver.Data.Types, as: T
alias Teiserver.Repo
alias Teiserver.Battle.{BalanceLib, MatchLib}
Expand Down Expand Up @@ -71,7 +71,7 @@ defmodule Teiserver.Game.MatchRatingLib do
match.team_count < 2 ->
{:error, :not_enough_teams}

match.game_duration < 180 ->
match.game_duration < Config.get_site_config_cache("matchmaking.Time to treat game as ranked") ->
{:error, :too_short}

Map.get(match.tags, "game/modoptions/ranked_game", "1") == "0" ->
Expand Down
10 changes: 10 additions & 0 deletions lib/teiserver/libs/teiserver_configs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ defmodule Teiserver.TeiserverConfigs do
value_label: "Require ready check"
})

add_site_config_type(%{
key: "matchmaking.Time to treat game as ranked",
section: "Matchmaking",
type: "integer",
permissions: ["Server"],
description: "Games shorter than this time in seconds will not be treated as ranked.",
default: 90,
value_label: "Require ready check"
})

add_site_config_type(%{
key: "bots.Flag",
section: "Bots",
Expand Down
Loading