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

Rename Big Team to Large Team #323

Merged
merged 2 commits into from
Jun 10, 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
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/mapping_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule Teiserver.Game.MappingReport do
search: [
started_after: start_date |> Timex.to_datetime(),
started_before: end_date |> Timex.to_datetime(),
game_type_in: ["Duel", "Small Team", "Big Team"],
game_type_in: ["Duel", "Small Team", "Large Team"],
of_interest: true,
has_winning_team: true
],
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/open_skill_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule Teiserver.Account.OpenSkillReport do
defp apply_defaults(params) do
Map.merge(
%{
"rating_type" => "Big Team",
"rating_type" => "Large Team",
"metric" => "Game Rating",
"last_active" => "7 days",
"uncertainty" => "5"
Expand Down
4 changes: 2 additions & 2 deletions lib/teiserver/account/reports/user_age_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ defmodule Teiserver.Account.UserAgeReport do
type_where =
case params["game_type"] do
"Duel" -> "AND m.game_type = 'Duel'"
"Team" -> "AND m.game_type IN ('Small Team', 'Big Team')"
"Team" -> "AND m.game_type IN ('Small Team', 'Large Team')"
"Small Team" -> "AND m.game_type = 'Small Team'"
"Big Team" -> "AND m.game_type = 'Big Team'"
"Large Team" -> "AND m.game_type = 'Large Team'"
"FFA" -> "AND m.game_type = 'FFA'"
"Raptors" -> "AND m.game_type = 'Raptors'"
"Scavengers" -> "AND m.game_type = 'Scavengers'"
Expand Down
6 changes: 3 additions & 3 deletions lib/teiserver/account/tasks/recalculate_user_cache_task.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule Teiserver.Account.RecacheUserStatsTask do
"Duel" -> do_match_processed_duel(userid)
"FFA" -> do_match_processed_duel(userid)
"Small Team" -> do_match_processed_team_small(userid)
"Big Team" -> do_match_processed_team_big(userid)
"Large Team" -> do_match_processed_team_large(userid)
_ -> :ok
end

Expand Down Expand Up @@ -106,8 +106,8 @@ defmodule Teiserver.Account.RecacheUserStatsTask do
:ok
end

def do_match_processed_team_big(userid) do
do_match_processed_team(userid, "Big Team")
def do_match_processed_team_large(userid) do
do_match_processed_team(userid, "Large Team")
end

def do_match_processed_team_small(userid) do
Expand Down
8 changes: 4 additions & 4 deletions lib/teiserver/battle/libs/match_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Teiserver.Battle.MatchLib do
Enum.empty?(bots) == false -> "Bots"
team_count == 2 and team_size == 1 -> "Duel"
team_count == 2 and team_size <= max_small_team_size -> "Small Team"
team_count == 2 and team_size > max_small_team_size -> "Big Team"
team_count == 2 and team_size > max_small_team_size -> "Large Team"
team_size == 1 -> "FFA"
true -> "Team FFA"
end
Expand All @@ -41,7 +41,7 @@ defmodule Teiserver.Battle.MatchLib do
[
"Duel",
"Small Team",
"Big Team",
"Large Team",
"FFA",
"Team FFA",
"Raptors",
Expand All @@ -54,7 +54,7 @@ defmodule Teiserver.Battle.MatchLib do
[
"Duel",
"Small Team",
"Big Team",
"Large Team",
"FFA",
"Team FFA"
]
Expand Down Expand Up @@ -146,7 +146,7 @@ defmodule Teiserver.Battle.MatchLib do
"Duel" ->
"Duel on #{match.map}"

type when type in ["Small Team", "Big Team"] ->
type when type in ["Small Team", "Large Team"] ->
"#{match.team_size}v#{match.team_size} on #{match.map}"

"FFA" ->
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/battle/schemas/match.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Teiserver.Battle.Match do
field :team_size, :integer
field :passworded, :boolean
field :processed, :boolean, default: false
# Scavengers, Raptors, Bots, Duel, Small Team, Big Team, FFA, Team FFA
# Scavengers, Raptors, Bots, Duel, Small Team, Large Team, FFA, Team FFA
field :game_type, :string

belongs_to :founder, Teiserver.Account.User
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/battle/tasks/breakdown_match_data_task.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule Teiserver.Battle.Tasks.BreakdownMatchDataTask do
%{
duel: get_subset_data(matches, game_type: "Duel"),
small_team: get_subset_data(matches, game_type: "Small Team"),
big_team: get_subset_data(matches, game_type: "Big Team"),
large_team: get_subset_data(matches, game_type: "Large Team"),
ffa: get_subset_data(matches, game_type: "FFA"),
team_ffa: get_subset_data(matches, game_type: "Team FFA"),
scavengers: get_subset_data(matches, game_type: "Scavengers"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Teiserver.Battle.ExportRawMatchMetricsTask do
defp do_output(data, _params) do
data
|> Stream.filter(fn match ->
match.game_type in ["Small Team", "Big Team"]
match.game_type in ["Small Team", "Large Team"]
end)
|> Stream.map(fn match ->
members =
Expand Down
14 changes: 11 additions & 3 deletions lib/teiserver/game/libs/match_rating_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ defmodule Teiserver.Game.MatchRatingLib do
alias Teiserver.Battle.{BalanceLib, MatchLib}
require Logger

@rated_match_types ["Small Team", "Big Team", "Duel", "Team", "FFA", "Team FFA", "Partied Team"]
@rated_match_types [
"Small Team",
"Large Team",
"Duel",
"Team",
"FFA",
"Team FFA",
"Partied Team"
]
# TODO Remove "Team" from here once the split is done

@spec rating_type_list() :: [String.t()]
Expand Down Expand Up @@ -193,7 +201,7 @@ defmodule Teiserver.Game.MatchRatingLib do
rate_result = rate_with_ids([winner_ratings, loser_ratings], as_map: true)

status_lookup =
if match.game_type in ["Small Team", "Big Team"] do
if match.game_type in ["Small Team", "Large Team"] do
match.members
|> Map.new(fn membership ->
{membership.user_id,
Expand Down Expand Up @@ -359,7 +367,7 @@ defmodule Teiserver.Game.MatchRatingLib do
win_result = Map.new(win_result)

status_lookup =
if Enum.member?(["Small Team", "Big Team", "Team FFA"], match.game_type) do
if Enum.member?(["Small Team", "Large Team", "Team FFA"], match.game_type) do
match.members
|> Map.new(fn membership ->
{membership.user_id,
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/libs/test_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
# This is because upon disconnecting, the server does a bunch of DB call for logging
# and telemetry. The disconnection happen when the tcp socket is closed, and by
# that time, the test has ended and the SQL sandbox closed.
ExUnit.Callbacks.on_exit(fn -> Teiserver.Client.disconnect(user.id) end)

Check warning on line 124 in lib/teiserver/libs/test_lib.ex

View workflow job for this annotation

GitHub Actions / Dialyzer

unknown_function

Function ExUnit.Callbacks.on_exit/1 does not exist.
%{socket: socket, user: user, pid: pid}
end

Expand Down Expand Up @@ -622,7 +622,7 @@

Teiserver.Game.get_or_add_rating_type("Duel")
Teiserver.Game.get_or_add_rating_type("Small Team")
Teiserver.Game.get_or_add_rating_type("Big Team")
Teiserver.Game.get_or_add_rating_type("Large Team")
Teiserver.Game.get_or_add_rating_type("FFA")

Teiserver.Telemetry.get_or_add_complex_server_event_type("Server startup")
Expand Down
6 changes: 3 additions & 3 deletions lib/teiserver/logging/tasks/match_graph_logs_task.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Teiserver.Logging.MatchGraphLogsTask do
[
{"Duel", "duel.aggregate.#{key}"},
{"Small Team", "team.aggregate.#{key}"},
{"Big Team", "team.aggregate.#{key}"},
{"Large Team", "team.aggregate.#{key}"},
{"FFA", "ffa.aggregate.#{key}"},
{"Team FFA", "team_ffa.aggregate.#{key}"},
{"Bot", "bots.aggregate.#{key}"},
Expand Down Expand Up @@ -36,7 +36,7 @@ defmodule Teiserver.Logging.MatchGraphLogsTask do
Map.get(l.data["duel"]["aggregate"], key, 0) +
Map.get(l.data["ffa"]["aggregate"], key, 0) +
Map.get(l.data["small_team"]["aggregate"], key, 0) +
Map.get(l.data["big_team"]["aggregate"], key, 0) +
Map.get(l.data["large_team"]["aggregate"], key, 0) +
Map.get(l.data["team_ffa"]["aggregate"], key, 0)

pve =
Expand Down Expand Up @@ -86,7 +86,7 @@ defmodule Teiserver.Logging.MatchGraphLogsTask do
pvp =
Map.get(l.data["duel"]["aggregate"], key, 0) +
Map.get(l.data["ffa"]["aggregate"], key, 0) +
Map.get(l.data["big_team"]["aggregate"], key, 0) +
Map.get(l.data["large_team"]["aggregate"], key, 0) +
Map.get(l.data["team_ffa"]["aggregate"], key, 0)

coop =
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/tasks/persist_server_day_task.ex
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ defmodule Teiserver.Logging.Tasks.PersistServerDayTask do
"Bots" -> :bots
"Duel" -> :duel
"Small Team" -> :small_team
"Big Team" -> :big_team
"Large Team" -> :large_team
"FFA" -> :ffa
"Team FFA" -> :team_ffa
end
Expand Down
8 changes: 4 additions & 4 deletions lib/teiserver_web/controllers/api/spads_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ defmodule TeiserverWeb.API.SpadsController do
actual_type =
case type do
"Team" -> get_team_subtype(lobby)
# Team FFA uses Big Team rating
"TeamFFA" -> "Big Team"
# Team FFA uses Large Team rating
"TeamFFA" -> "Large Team"
v -> v
end

Expand Down Expand Up @@ -229,7 +229,7 @@ defmodule TeiserverWeb.API.SpadsController do
end
end

defp get_team_subtype(nil), do: "Big Team"
defp get_team_subtype(nil), do: "Large Team"

defp get_team_subtype(lobby) do
max_small_team_size = Config.get_site_config_cache("lobby.Small team game limit")
Expand All @@ -251,7 +251,7 @@ defmodule TeiserverWeb.API.SpadsController do

cond do
Enum.count(teams) == 2 and max_team_size <= max_small_team_size -> "Small Team"
true -> "Big Team"
true -> "Large Team"
end
end
end
2 changes: 1 addition & 1 deletion lib/teiserver_web/controllers/report/rating_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule TeiserverWeb.Report.RatingController do
cond do
Enum.count(player_ids) == 2 -> "Duel"
# TODO Should probably get rating based on team size instad
true -> "Big Team"
true -> "Large Team"
end

rating_lookup =
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver_web/live/moderation/report_user/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ defmodule TeiserverWeb.Moderation.ReportUserLive.Index do
|> Enum.map(fn match ->
label =
case match.game_type do
type when type in ["Small Team", "Big Team"] ->
type when type in ["Small Team", "Large Team"] ->
"#{match.team_size} vs #{match.team_size} on #{match.map}"

"FFA" ->
Expand Down
4 changes: 2 additions & 2 deletions lib/teiserver_web/templates/admin/match/search.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
colour: "#AA0000"
},
%{
id: "Big Team",
name: "Big Team",
id: "Large Team",
name: "Large Team",
icon: "fa-solid fa-square",
colour: "#AA0000"
},
Expand Down
6 changes: 3 additions & 3 deletions lib/teiserver_web/templates/admin/user/ratings.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<thead>
<tr>
<th>Game</th>
<%= if @filter in ["Small Team", "Big Team"] do %>
<%= if @filter in ["Small Team", "Large Team"] do %>
<th>Play</th>
<% end %>
<th>Players</th>
Expand All @@ -122,7 +122,7 @@
end

{exit_status, play_percentage} =
if log.match.game_type in ["Small Team", "Big Team"] do
if log.match.game_type in ["Small Team", "Large Team"] do
exit_status =
Teiserver.Battle.MatchLib.calculate_exit_status(
log.match_membership.left_after,
Expand All @@ -142,7 +142,7 @@
<%= if log.match do %>
<td><%= log.match.map %></td>

<%= if @filter in ["Small Team", "Big Team"] do %>
<%= if @filter in ["Small Team", "Large Team"] do %>
<td>
<%= case exit_status do %>
<% :stayed -> %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
:rating_type,
[
"Small Team",
"Big Team",
"Large Team",
"Partied Team",
"Duel",
"FFA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Any",
"Duel",
"Small Team",
"Big Team",
"Large Team",
"FFA",
"Raptors",
"Scavengers",
Expand Down
Loading