From 8e89d1eea8e8183334a43d29fec7418b0c298b66 Mon Sep 17 00:00:00 2001 From: Lexon <44340857+L-e-x-o-n@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:33:44 +0200 Subject: [PATCH] Team split fixes and cleanup (#352) * Team split fixes and cleanup --- .../account/exports/player_count_export.ex | 2 +- .../account/reports/growth_report.ex | 8 +++ .../account/reports/week_on_week_report.ex | 18 +++---- .../tasks/recalculate_user_cache_task.ex | 49 +++++++++++-------- .../battle/tasks/battle_daily_cleanup_task.ex | 2 +- lib/teiserver/coordinator/consul_server.ex | 2 +- lib/teiserver/data/matchmaking.ex | 2 +- .../game/exports/match_datatable_export.ex | 2 +- .../game/exports/match_ratings_export.ex | 4 +- .../game/exports/player_ratings_export.ex | 2 +- .../game/exports/rating_logs_export.ex | 2 +- .../lobby/libs/lobby_restrictions.ex | 2 +- .../logging/lib/server_day_log_lib.ex | 10 ++-- .../logging/tasks/match_graph_logs_task.ex | 5 +- .../logging/tasks/persist_match_month_task.ex | 15 +++--- .../logging/tasks/persist_server_day_task.ex | 3 ++ .../controllers/battle/match_controller.ex | 4 +- .../live/battles/lobbies/show.ex | 2 +- .../live/battles/match/ratings.ex | 4 +- lib/teiserver_web/live/tournament/show.ex | 2 +- .../match_log/day_metrics_list.html.heex | 6 ++- .../match_log/month_metrics_list.html.heex | 6 ++- .../logging/match_log/tab_details.html.heex | 18 +++++-- .../match_log/tab_month_details.html.heex | 18 +++++-- .../server_log/tab_month_details.html.heex | 46 ----------------- .../report/exports/match_datatable.html.heex | 3 +- .../report/exports/match_ratings.html.heex | 3 +- .../report/exports/player_ratings.html.heex | 3 +- .../report/exports/rating_logs.html.heex | 3 +- .../templates/report/report/review.html.heex | 12 +++-- 30 files changed, 133 insertions(+), 125 deletions(-) diff --git a/lib/teiserver/account/exports/player_count_export.ex b/lib/teiserver/account/exports/player_count_export.ex index 5019b370d..b9070c911 100644 --- a/lib/teiserver/account/exports/player_count_export.ex +++ b/lib/teiserver/account/exports/player_count_export.ex @@ -4,7 +4,7 @@ defmodule Teiserver.Account.PlayerCountExport do Teiserver.Game.MatchRatingsExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "" }) """ diff --git a/lib/teiserver/account/reports/growth_report.ex b/lib/teiserver/account/reports/growth_report.ex index 91a69f8a1..c63c3a053 100644 --- a/lib/teiserver/account/reports/growth_report.ex +++ b/lib/teiserver/account/reports/growth_report.ex @@ -106,6 +106,14 @@ defmodule Teiserver.Account.GrowthReport do name: "Team games", paths: [~w"matches counts team"] }, + %{ + name: "Small Team games", + paths: [~w"matches counts small_team"] + }, + %{ + name: "Large Team games", + paths: [~w"matches counts large_team"] + }, %{ name: "FFA games", paths: [~w"matches counts ffa"] diff --git a/lib/teiserver/account/reports/week_on_week_report.ex b/lib/teiserver/account/reports/week_on_week_report.ex index f57b70e76..96b0ce04c 100644 --- a/lib/teiserver/account/reports/week_on_week_report.ex +++ b/lib/teiserver/account/reports/week_on_week_report.ex @@ -43,7 +43,7 @@ defmodule Teiserver.Account.WeekOnWeekReport do previous_key = {week - 1, weekday} previous_value = data_map[previous_key] - if previous_value do + if previous_value not in [nil, 0] do delta = NumberHelper.percent(this_value / previous_value) - 100 {key, delta} @@ -80,7 +80,7 @@ defmodule Teiserver.Account.WeekOnWeekReport do previous_key = key - 1 previous_value = week_data[previous_key] - if previous_value do + if previous_value not in [nil, 0] do delta = NumberHelper.percent(this_value / previous_value) - 100 {key, delta} @@ -118,16 +118,16 @@ defmodule Teiserver.Account.WeekOnWeekReport do }) end - defp get_metric(data, "Unique users"), do: data["aggregates"]["stats"]["unique_users"] - defp get_metric(data, "Unique players"), do: data["aggregates"]["stats"]["unique_players"] + defp get_metric(data, "Unique users"), do: data["aggregates"]["stats"]["unique_users"] || 0 + defp get_metric(data, "Unique players"), do: data["aggregates"]["stats"]["unique_players"] || 0 defp get_metric(data, "Peak users"), - do: data["aggregates"]["stats"]["peak_user_counts"]["total"] + do: data["aggregates"]["stats"]["peak_user_counts"]["total"] || 0 defp get_metric(data, "Peak players"), - do: data["aggregates"]["stats"]["peak_user_counts"]["player"] + do: data["aggregates"]["stats"]["peak_user_counts"]["player"] || 0 - defp get_metric(data, "Total time"), do: data["aggregates"]["minutes"]["total"] - defp get_metric(data, "Play time"), do: data["aggregates"]["minutes"]["player"] - defp get_metric(data, "Registrations"), do: data["aggregates"]["stats"]["accounts_created"] + defp get_metric(data, "Total time"), do: data["aggregates"]["minutes"]["total"] || 0 + defp get_metric(data, "Play time"), do: data["aggregates"]["minutes"]["player"] || 0 + defp get_metric(data, "Registrations"), do: data["aggregates"]["stats"]["accounts_created"] || 0 end diff --git a/lib/teiserver/account/tasks/recalculate_user_cache_task.ex b/lib/teiserver/account/tasks/recalculate_user_cache_task.ex index 05ac0826c..eb52c643a 100644 --- a/lib/teiserver/account/tasks/recalculate_user_cache_task.ex +++ b/lib/teiserver/account/tasks/recalculate_user_cache_task.ex @@ -151,31 +151,37 @@ defmodule Teiserver.Account.RecacheUserStatsTask do {k, Enum.count(v)} end) + team_type = + team_subtype + |> String.downcase() + |> String.replace(" ", "_") + total = Enum.count(logs) if total > 0 do winrate = win_count / total Account.update_user_stat(userid, %{ - "exit_status.team.count" => total, - "exit_status.team.stayed" => ((statuses[:stayed] || 0) / total) |> percent(1), - "exit_status.team.early" => ((statuses[:early] || 0) / total) |> percent(1), - "exit_status.team.abandoned" => ((statuses[:abandoned] || 0) / total) |> percent(1), - "exit_status.team.noshow" => ((statuses[:noshow] || 0) / total) |> percent(1), - "recent_count.team" => total, - "win_count.team" => win_count, - "loss_count.team" => loss_count, - "win_rate.team" => winrate |> percent(1) + "exit_status.#{team_type}.count" => total, + "exit_status.#{team_type}.stayed" => ((statuses[:stayed] || 0) / total) |> percent(1), + "exit_status.#{team_type}.early" => ((statuses[:early] || 0) / total) |> percent(1), + "exit_status.#{team_type}.abandoned" => + ((statuses[:abandoned] || 0) / total) |> percent(1), + "exit_status.#{team_type}.noshow" => ((statuses[:noshow] || 0) / total) |> percent(1), + "recent_count.#{team_type}" => total, + "win_count.#{team_type}" => win_count, + "loss_count.#{team_type}" => loss_count, + "win_rate.#{team_type}" => winrate |> percent(1) }) end # For team we also look at their really recent games as that's where we'd expect # smurfs to be most active right now - do_match_processed_team_recent(userid, logs) + do_match_processed_team_recent(userid, logs, team_type) :ok end - def do_match_processed_team_recent(userid, logs) do + def do_match_processed_team_recent(userid, logs, team_type) do # Filter down to just the recent ones rather than re-running the query timestamp_after = Timex.now() |> Timex.shift(days: -@match_cache_recent_days) @@ -214,16 +220,19 @@ defmodule Teiserver.Account.RecacheUserStatsTask do winrate = win_count / total Account.update_user_stat(userid, %{ - "exit_status.team_recent.count" => total, - "exit_status.team_recent.stayed" => ((statuses[:stayed] || 0) / total) |> percent(1), - "exit_status.team_recent.early" => ((statuses[:early] || 0) / total) |> percent(1), - "exit_status.team_recent.abandoned" => + "exit_status.#{team_type}_recent.count" => total, + "exit_status.#{team_type}_recent.stayed" => + ((statuses[:stayed] || 0) / total) |> percent(1), + "exit_status.#{team_type}_recent.early" => + ((statuses[:early] || 0) / total) |> percent(1), + "exit_status.#{team_type}_recent.abandoned" => ((statuses[:abandoned] || 0) / total) |> percent(1), - "exit_status.team_recent.noshow" => ((statuses[:noshow] || 0) / total) |> percent(1), - "recent_count.team_recent" => total, - "win_count.team_recent" => win_count, - "loss_count.team_recent" => loss_count, - "win_rate.team_recent" => winrate |> percent(1) + "exit_status.#{team_type}_recent.noshow" => + ((statuses[:noshow] || 0) / total) |> percent(1), + "recent_count.#{team_type}_recent" => total, + "win_count.#{team_type}_recent" => win_count, + "loss_count.#{team_type}_recent" => loss_count, + "win_rate.#{team_type}_recent" => winrate |> percent(1) }) end diff --git a/lib/teiserver/battle/tasks/battle_daily_cleanup_task.ex b/lib/teiserver/battle/tasks/battle_daily_cleanup_task.ex index a05c66d44..4dc056810 100644 --- a/lib/teiserver/battle/tasks/battle_daily_cleanup_task.ex +++ b/lib/teiserver/battle/tasks/battle_daily_cleanup_task.ex @@ -71,7 +71,7 @@ defmodule Teiserver.Battle.Tasks.CleanupTask do # Battle.list_matches( # search: [ # inserted_before: Timex.shift(Timex.now(), days: -battle_match_rated_days), - # game_type_in: ["Team", "Duel", "FFA", "Team FFA"] + # game_type_in: ["Small Team", "Large Team", "Duel", "FFA", "Team FFA"] # ], # search: [:id], # limit: :infinity diff --git a/lib/teiserver/coordinator/consul_server.ex b/lib/teiserver/coordinator/consul_server.ex index e126a1bc9..41bbf1315 100644 --- a/lib/teiserver/coordinator/consul_server.ex +++ b/lib/teiserver/coordinator/consul_server.ex @@ -1110,7 +1110,7 @@ defmodule Teiserver.Coordinator.ConsulServer do if Enum.count(player_numbers) != Enum.count(players) do players |> Enum.map(fn c -> - {-c.team_number, BalanceLib.get_user_rating_value(c.userid, "Team"), c} + {-c.team_number, BalanceLib.get_user_rating_value(c.userid, "Large Team"), c} end) |> Enum.sort() |> Enum.reverse() diff --git a/lib/teiserver/data/matchmaking.ex b/lib/teiserver/data/matchmaking.ex index 7c38bd211..eb67f1edf 100644 --- a/lib/teiserver/data/matchmaking.ex +++ b/lib/teiserver/data/matchmaking.ex @@ -308,7 +308,7 @@ defmodule Teiserver.Data.Matchmaking do cond do queue.settings["rating_type"] != nil -> queue.settings["rating_type"] queue.team_size == 1 -> "Duel" - true -> "Team" + true -> "Large Team" end BalanceLib.get_user_rating_value(userid, rating_type) diff --git a/lib/teiserver/game/exports/match_datatable_export.ex b/lib/teiserver/game/exports/match_datatable_export.ex index d607ee5f8..cfd3b66ac 100644 --- a/lib/teiserver/game/exports/match_datatable_export.ex +++ b/lib/teiserver/game/exports/match_datatable_export.ex @@ -4,7 +4,7 @@ defmodule Teiserver.Game.MatchDataTableExport do Teiserver.Game.MatchDataTableExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "" }) diff --git a/lib/teiserver/game/exports/match_ratings_export.ex b/lib/teiserver/game/exports/match_ratings_export.ex index 64199dcfb..b89b03cf1 100644 --- a/lib/teiserver/game/exports/match_ratings_export.ex +++ b/lib/teiserver/game/exports/match_ratings_export.ex @@ -4,14 +4,14 @@ defmodule Teiserver.Game.MatchRatingsExport do Teiserver.Game.MatchRatingsExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "" }) Teiserver.Game.MatchRatingsExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "2023-06-02" }) """ diff --git a/lib/teiserver/game/exports/player_ratings_export.ex b/lib/teiserver/game/exports/player_ratings_export.ex index fde6266b4..fc595dbdf 100644 --- a/lib/teiserver/game/exports/player_ratings_export.ex +++ b/lib/teiserver/game/exports/player_ratings_export.ex @@ -4,7 +4,7 @@ defmodule Teiserver.Game.PlayerRatingsExport do Teiserver.Game.PlayerRatingsExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "" }) diff --git a/lib/teiserver/game/exports/rating_logs_export.ex b/lib/teiserver/game/exports/rating_logs_export.ex index 99d39bf06..3aaa4849c 100644 --- a/lib/teiserver/game/exports/rating_logs_export.ex +++ b/lib/teiserver/game/exports/rating_logs_export.ex @@ -4,7 +4,7 @@ defmodule Teiserver.Game.RatingLogsExport do Teiserver.Game.RatingLogsExport.show_form(nil, %{ "date_preset" => "All time", "end_date" => "", - "rating_type" => "Team", + "rating_type" => "Large Team", "start_date" => "" }) diff --git a/lib/teiserver/lobby/libs/lobby_restrictions.ex b/lib/teiserver/lobby/libs/lobby_restrictions.ex index 92240799f..44bf3e4ff 100644 --- a/lib/teiserver/lobby/libs/lobby_restrictions.ex +++ b/lib/teiserver/lobby/libs/lobby_restrictions.ex @@ -154,7 +154,7 @@ defmodule Teiserver.Lobby.LobbyRestrictions do Determining the rating type is slightly different for lobby restrictions compared to rating a match. When rating a match we want to use the number of players and team count in the match. But with the lobby, we want to use the target team size/count defined by the dropdowns in the lobby. - So if there are two players in the lobby, but the team size dropdown is 8, we want to use the "Team" rating. + So if there are two players in the lobby, but the team size dropdown is 8, we want to use the "Large Team" rating. """ @spec check_rating_to_play(any(), any()) :: :ok | {:error, iodata()} def check_rating_to_play(user_id, consul_state) do diff --git a/lib/teiserver/logging/lib/server_day_log_lib.ex b/lib/teiserver/logging/lib/server_day_log_lib.ex index f4f053719..8c68a35ac 100644 --- a/lib/teiserver/logging/lib/server_day_log_lib.ex +++ b/lib/teiserver/logging/lib/server_day_log_lib.ex @@ -110,17 +110,17 @@ defmodule Teiserver.Logging.ServerDayLogLib do end # Given an existing segment and a batch of logs, calculate the segment and add them together - defp extend_segment(existing, {%{data: data} = _server_log, %{data: activity} = _activity_log}) do + defp extend_segment(existing, %{data: data} = _server_log) do %{ # Used to make calculating the end of day stats easier, this will not appear in the final result tmp_reduction: %{ battles: existing.tmp_reduction.battles + get_in(data, ~w(aggregates stats battles)), unique_users: - existing.tmp_reduction.unique_users ++ - Map.keys(activity["total"]), + existing.tmp_reduction.unique_users || + 0 + get_in(data, ~w(aggregates stats unique_users)), unique_players: - existing.tmp_reduction.unique_players ++ - Map.keys(activity["player"]), + existing.tmp_reduction.unique_players || + 0 + get_in(data, ~w(aggregates stats unique_players)), accounts_created: existing.tmp_reduction.accounts_created + get_in(data, ~w(aggregates stats accounts_created)), diff --git a/lib/teiserver/logging/tasks/match_graph_logs_task.ex b/lib/teiserver/logging/tasks/match_graph_logs_task.ex index 91abfc019..adbe8b71b 100644 --- a/lib/teiserver/logging/tasks/match_graph_logs_task.ex +++ b/lib/teiserver/logging/tasks/match_graph_logs_task.ex @@ -5,8 +5,8 @@ defmodule Teiserver.Logging.MatchGraphLogsTask do def perform(logs, "split", key) do [ {"Duel", "duel.aggregate.#{key}"}, - {"Small Team", "team.aggregate.#{key}"}, - {"Large Team", "team.aggregate.#{key}"}, + {"Small Team", "small_team.aggregate.#{key}"}, + {"Large Team", "large_team.aggregate.#{key}"}, {"FFA", "ffa.aggregate.#{key}"}, {"Team FFA", "team_ffa.aggregate.#{key}"}, {"Bot", "bots.aggregate.#{key}"}, @@ -87,6 +87,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["large_team"]["aggregate"], key, 0) + + Map.get(l.data["small_team"]["aggregate"], key, 0) + Map.get(l.data["team_ffa"]["aggregate"], key, 0) coop = diff --git a/lib/teiserver/logging/tasks/persist_match_month_task.ex b/lib/teiserver/logging/tasks/persist_match_month_task.ex index 642b56f72..928e08a27 100644 --- a/lib/teiserver/logging/tasks/persist_match_month_task.ex +++ b/lib/teiserver/logging/tasks/persist_match_month_task.ex @@ -3,7 +3,7 @@ defmodule Teiserver.Logging.Tasks.PersistMatchMonthTask do alias Teiserver.Logging import Ecto.Query, warn: false - @sections ~w(bots duel ffa raptors scavengers team totals) + @sections ~w(bots duel ffa raptors scavengers team small_team large_team totals) # [] List means 1 day segments # %{} Dict means total for the month of that key @@ -148,16 +148,17 @@ defmodule Teiserver.Logging.Tasks.PersistMatchMonthTask do defp extend_sub_section(existing, data) do %{ aggregate: %{ - total_count: existing.aggregate.total_count + data["aggregate"]["total_count"], + total_count: existing.aggregate.total_count + (data["aggregate"]["total_count"] || 0), total_duration_seconds: - existing.aggregate.total_duration_seconds + data["aggregate"]["total_duration_seconds"], + existing.aggregate.total_duration_seconds + + (data["aggregate"]["total_duration_seconds"] || 0), weighted_count: existing.aggregate.weighted_count + (data["aggregate"]["weighted_count"] || 0) }, - duration: sum_maps(existing.duration, data["duration"]), - maps: sum_maps(existing.maps, data["maps"]), - matches_per_hour: sum_maps(existing.matches_per_hour, data["matches_per_hour"]), - team_sizes: sum_maps(existing.team_sizes, data["team_sizes"]) + duration: sum_maps(existing.duration, data["duration"] || 0), + maps: sum_maps(existing.maps, data["maps"] || 0), + matches_per_hour: sum_maps(existing.matches_per_hour, data["matches_per_hour"] || 0), + team_sizes: sum_maps(existing.team_sizes, data["team_sizes"] || 0) } end diff --git a/lib/teiserver/logging/tasks/persist_server_day_task.ex b/lib/teiserver/logging/tasks/persist_server_day_task.ex index 4605db19a..2afaf4bb0 100644 --- a/lib/teiserver/logging/tasks/persist_server_day_task.ex +++ b/lib/teiserver/logging/tasks/persist_server_day_task.ex @@ -488,6 +488,8 @@ defmodule Teiserver.Logging.Tasks.PersistServerDayTask do bots: 0, duel: 0, team: 0, + small_team: 0, + large_team: 0, ffa: 0, team_ffa: 0, passworded: 0 @@ -562,6 +564,7 @@ defmodule Teiserver.Logging.Tasks.PersistServerDayTask do "Raptors" -> :raptors "Bots" -> :bots "Duel" -> :duel + "Team" -> :team "Small Team" -> :small_team "Large Team" -> :large_team "FFA" -> :ffa diff --git a/lib/teiserver_web/controllers/battle/match_controller.ex b/lib/teiserver_web/controllers/battle/match_controller.ex index 3943aad30..aac17f22b 100644 --- a/lib/teiserver_web/controllers/battle/match_controller.ex +++ b/lib/teiserver_web/controllers/battle/match_controller.ex @@ -88,7 +88,7 @@ defmodule TeiserverWeb.Battle.MatchController do def ratings(conn, params) do user = conn.assigns.current_user - filter = params["filter"] || "Team" + filter = params["filter"] || "Large Team" filter_type_id = MatchRatingLib.rating_type_name_lookup()[filter] || 1 ratings = @@ -144,7 +144,7 @@ defmodule TeiserverWeb.Battle.MatchController do def ratings_graph(conn, params) do user = conn.assigns.current_user - filter = params["filter"] || "Team" + filter = params["filter"] || "Large Team" filter_type_id = MatchRatingLib.rating_type_name_lookup()[filter] || 1 ratings = diff --git a/lib/teiserver_web/live/battles/lobbies/show.ex b/lib/teiserver_web/live/battles/lobbies/show.ex index b4d4f2443..efe53347c 100644 --- a/lib/teiserver_web/live/battles/lobbies/show.ex +++ b/lib/teiserver_web/live/battles/lobbies/show.ex @@ -141,7 +141,7 @@ defmodule TeiserverWeb.Battle.LobbyLive.Show do ratings = users |> Map.new(fn {userid, _} -> - {userid, BalanceLib.get_user_rating_value_uncertainty_pair(userid, "Team")} + {userid, BalanceLib.get_user_rating_value_uncertainty_pair(userid, "Large Team")} end) {users, clients, ratings, parties, stats} diff --git a/lib/teiserver_web/live/battles/match/ratings.ex b/lib/teiserver_web/live/battles/match/ratings.ex index 5e583cf90..58ac0408c 100644 --- a/lib/teiserver_web/live/battles/match/ratings.ex +++ b/lib/teiserver_web/live/battles/match/ratings.ex @@ -24,7 +24,7 @@ defmodule TeiserverWeb.Battle.MatchLive.Ratings do |> assign(:view_colour, Battle.MatchLib.colours()) |> assign(:game_types, game_types) |> assign(:user_ratings, user_ratings) - |> assign(:rating_type, Map.get(params, "rating_type", "Team")) + |> assign(:rating_type, Map.get(params, "rating_type", "Large Team")) |> assign(:rating_type_list, MatchRatingLib.rating_type_list()) |> assign(:rating_type_id_lookup, MatchRatingLib.rating_type_id_lookup()) |> add_breadcrumb(name: "Matches", url: "/battle/matches") @@ -39,7 +39,7 @@ defmodule TeiserverWeb.Battle.MatchLive.Ratings do def handle_params(params, _url, socket) do socket = socket - |> assign(:rating_type, Map.get(params, "rating_type", "Team")) + |> assign(:rating_type, Map.get(params, "rating_type", "Large Team")) |> update_match_list() {:noreply, socket} diff --git a/lib/teiserver_web/live/tournament/show.ex b/lib/teiserver_web/live/tournament/show.ex index 7e0e80ea5..437b72e03 100644 --- a/lib/teiserver_web/live/tournament/show.ex +++ b/lib/teiserver_web/live/tournament/show.ex @@ -139,7 +139,7 @@ defmodule TeiserverWeb.TournamentLive.Show do ratings = users |> Map.new(fn {userid, _} -> - {userid, BalanceLib.get_user_rating_value_uncertainty_pair(userid, "Team")} + {userid, BalanceLib.get_user_rating_value_uncertainty_pair(userid, "Large Team")} end) {users, clients, ratings, parties, stats} diff --git a/lib/teiserver_web/templates/logging/match_log/day_metrics_list.html.heex b/lib/teiserver_web/templates/logging/match_log/day_metrics_list.html.heex index 8bb4f66b7..f17e20fd3 100644 --- a/lib/teiserver_web/templates/logging/match_log/day_metrics_list.html.heex +++ b/lib/teiserver_web/templates/logging/match_log/day_metrics_list.html.heex @@ -38,7 +38,8 @@ Weighted Total Duel - Team + Small Team + LargeTeam FFA Team FFA Scav @@ -58,7 +59,8 @@ <%= format_number(log.data["totals"]["aggregate"]["weighted_count"]) %> <%= format_number(log.data["duel"]["aggregate"]["total_count"]) %> - <%= format_number(log.data["team"]["aggregate"]["total_count"]) %> + <%= format_number(log.data["small_team"]["aggregate"]["total_count"]) %> + <%= format_number(log.data["large_team"]["aggregate"]["total_count"]) %> <%= format_number(log.data["ffa"]["aggregate"]["total_count"]) %> <%= format_number(log.data["team_ffa"]["aggregate"]["total_count"]) %> <%= format_number(log.data["scavengers"]["aggregate"]["total_count"]) %> diff --git a/lib/teiserver_web/templates/logging/match_log/month_metrics_list.html.heex b/lib/teiserver_web/templates/logging/match_log/month_metrics_list.html.heex index 7697dad70..fd722d619 100644 --- a/lib/teiserver_web/templates/logging/match_log/month_metrics_list.html.heex +++ b/lib/teiserver_web/templates/logging/match_log/month_metrics_list.html.heex @@ -39,7 +39,8 @@ Weighted total Duel - Team + Small Team + Large Team FFA Scav Chic @@ -59,7 +60,8 @@ <%= format_number(log.data["totals"]["aggregate"]["weighted_count"]) %> <%= format_number(log.data["duel"]["aggregate"]["total_count"]) %> - <%= format_number(log.data["team"]["aggregate"]["total_count"]) %> + <%= format_number(log.data["small_team"]["aggregate"]["total_count"]) %> + <%= format_number(log.data["large_team"]["aggregate"]["total_count"]) %> <%= format_number(log.data["ffa"]["aggregate"]["total_count"]) %> <%= format_number(log.data["scavengers"]["aggregate"]["total_count"]) %> <%= format_number(log.data["raptors"]["aggregate"]["total_count"]) %> diff --git a/lib/teiserver_web/templates/logging/match_log/tab_details.html.heex b/lib/teiserver_web/templates/logging/match_log/tab_details.html.heex index 778a30055..f0db4b940 100644 --- a/lib/teiserver_web/templates/logging/match_log/tab_details.html.heex +++ b/lib/teiserver_web/templates/logging/match_log/tab_details.html.heex @@ -19,8 +19,13 @@ ) %> <%= central_component("detail_line", - label: "Team", - value: format_number(@data["team"]["aggregate"]["total_count"]) + label: "Small Team", + value: format_number(@data["small_team"]["aggregate"]["total_count"]) + ) %> + + <%= central_component("detail_line", + label: "Large Team", + value: format_number(@data["large_team"]["aggregate"]["total_count"]) ) %> <%= central_component("detail_line", @@ -59,8 +64,13 @@ ) %> <%= central_component("detail_line", - label: "Team", - value: format_number(@data["team"]["aggregate"]["weighted_count"]) + label: "Small Team", + value: format_number(@data["small_team"]["aggregate"]["weighted_count"]) + ) %> + + <%= central_component("detail_line", + label: "Large Team", + value: format_number(@data["large_team"]["aggregate"]["weighted_count"]) ) %> <%= central_component("detail_line", diff --git a/lib/teiserver_web/templates/logging/match_log/tab_month_details.html.heex b/lib/teiserver_web/templates/logging/match_log/tab_month_details.html.heex index 20d2862be..c188e4390 100644 --- a/lib/teiserver_web/templates/logging/match_log/tab_month_details.html.heex +++ b/lib/teiserver_web/templates/logging/match_log/tab_month_details.html.heex @@ -19,8 +19,13 @@ ) %> <%= central_component("detail_line", - label: "Team", - value: format_number(@data["team"]["aggregate"]["total_count"]) + label: "Small Team", + value: format_number(@data["small_team"]["aggregate"]["total_count"]) + ) %> + + <%= central_component("detail_line", + label: "Large Team", + value: format_number(@data["large_team"]["aggregate"]["total_count"]) ) %> <%= central_component("detail_line", @@ -59,8 +64,13 @@ ) %> <%= central_component("detail_line", - label: "Team", - value: format_number(@data["team"]["aggregate"]["weighted_count"]) + label: "Small Team", + value: format_number(@data["small_team"]["aggregate"]["weighted_count"]) + ) %> + + <%= central_component("detail_line", + label: "Large Team", + value: format_number(@data["large_team"]["aggregate"]["weighted_count"]) ) %> <%= central_component("detail_line", diff --git a/lib/teiserver_web/templates/logging/server_log/tab_month_details.html.heex b/lib/teiserver_web/templates/logging/server_log/tab_month_details.html.heex index 1ddbed3e5..083f4a087 100644 --- a/lib/teiserver_web/templates/logging/server_log/tab_month_details.html.heex +++ b/lib/teiserver_web/templates/logging/server_log/tab_month_details.html.heex @@ -57,50 +57,4 @@ value: represent_minutes(@data["aggregates"]["minutes"]["total"]) ) %> -
- <% event_keys = (@data["events"]["combined"] || %{}) |> Map.keys() |> Enum.sort() %> - -

Events

- - - - - - - - - - - <%= for key <- event_keys do %> - - - - - - - <% end %> - -
EventAuthUnauthCombined
<%= key %><%= @data["events"]["client"][key] %><%= @data["events"]["unauth"][key] %><%= @data["events"]["combined"][key] %>
-
-
-

Server Events

- <% event_keys = (@data["aggregates"]["events"]["server"] || %{}) |> Map.keys() |> Enum.sort() %> - - - - - - - - - - <%= for key <- event_keys do %> - - - - - <% end %> - -
EventCount
<%= key %><%= format_number(@data["aggregates"]["events"]["server"][key] || 0) %>
-
diff --git a/lib/teiserver_web/templates/report/exports/match_datatable.html.heex b/lib/teiserver_web/templates/report/exports/match_datatable.html.heex index e8affd28d..d45f46275 100644 --- a/lib/teiserver_web/templates/report/exports/match_datatable.html.heex +++ b/lib/teiserver_web/templates/report/exports/match_datatable.html.heex @@ -44,7 +44,8 @@ [ "All", "Duel", - "Team", + "Small Team", + "Large Team", "FFA", "Team FFA" ], diff --git a/lib/teiserver_web/templates/report/exports/match_ratings.html.heex b/lib/teiserver_web/templates/report/exports/match_ratings.html.heex index f7df80e77..c0c2572a0 100644 --- a/lib/teiserver_web/templates/report/exports/match_ratings.html.heex +++ b/lib/teiserver_web/templates/report/exports/match_ratings.html.heex @@ -44,7 +44,8 @@ [ "All", "Duel", - "Team", + "Small Team", + "Large Team", "FFA", "Team FFA" ], diff --git a/lib/teiserver_web/templates/report/exports/player_ratings.html.heex b/lib/teiserver_web/templates/report/exports/player_ratings.html.heex index faaf19e91..23123597f 100644 --- a/lib/teiserver_web/templates/report/exports/player_ratings.html.heex +++ b/lib/teiserver_web/templates/report/exports/player_ratings.html.heex @@ -44,7 +44,8 @@ [ "All", "Duel", - "Team", + "Small Team", + "Large Team", "FFA", "Team FFA" ], diff --git a/lib/teiserver_web/templates/report/exports/rating_logs.html.heex b/lib/teiserver_web/templates/report/exports/rating_logs.html.heex index 8ce46ab99..df938746d 100644 --- a/lib/teiserver_web/templates/report/exports/rating_logs.html.heex +++ b/lib/teiserver_web/templates/report/exports/rating_logs.html.heex @@ -44,7 +44,8 @@ [ "All", "Duel", - "Team", + "Small Team", + "Large Team", "FFA", "Team FFA" ], diff --git a/lib/teiserver_web/templates/report/report/review.html.heex b/lib/teiserver_web/templates/report/report/review.html.heex index 312466f1a..ed6df4ebd 100644 --- a/lib/teiserver_web/templates/report/report/review.html.heex +++ b/lib/teiserver_web/templates/report/report/review.html.heex @@ -177,8 +177,10 @@ show_compare = @data.past_server["aggregates"]["stats"]["unique_users"] != 0 %> label: "Peak total users", value: percent( - @data.server["aggregates"]["stats"]["peak_users"] / - @data.past_server["aggregates"]["stats"]["peak_users"] + @data.server["aggregates"]["stats"]["peak_user_counts"]["total"] / + @data.past_server["aggregates"]["stats"]["peak_user_counts"][ + "total" + ] ), append: "%" ) %> @@ -208,8 +210,10 @@ show_compare = @data.past_server["aggregates"]["stats"]["unique_users"] != 0 %> label: "Peak players", value: percent( - @data.server["aggregates"]["stats"]["peak_players"] / - @data.past_server["aggregates"]["stats"]["peak_players"] + @data.server["aggregates"]["stats"]["peak_user_counts"]["players"] / + @data.past_server["aggregates"]["stats"]["peak_user_counts"][ + "players" + ] ), append: "%" ) %>