diff --git a/lib/teiserver/account/libs/role_lib.ex b/lib/teiserver/account/libs/role_lib.ex index f4679601c..84f2a64ea 100644 --- a/lib/teiserver/account/libs/role_lib.ex +++ b/lib/teiserver/account/libs/role_lib.ex @@ -45,6 +45,12 @@ defmodule Teiserver.Account.RoleLib do icon: "fa-solid fa-check", contains: ~w() }, + %{ + name: "Tournament winner", + colour: "#AA8833", + icon: "fa-solid fa-trophy", + contains: ~w() + }, # Community team %{ @@ -250,7 +256,7 @@ defmodule Teiserver.Account.RoleLib do @spec property_roles :: [String.t()] def property_roles() do - ["Trusted", "BAR+", "Verified", "Streamer"] + ["Trusted", "BAR+", "Verified", "Streamer", "Tournament winner"] end @spec allowed_role_management(String.t()) :: [String.t()] diff --git a/lib/teiserver/data/cache_user.ex b/lib/teiserver/data/cache_user.ex index 0ffcef2b5..6bdd16fd1 100644 --- a/lib/teiserver/data/cache_user.ex +++ b/lib/teiserver/data/cache_user.ex @@ -1311,6 +1311,7 @@ defmodule Teiserver.CacheUser do ingame_hours = rank_time(userid) cond do + has_any_role?(userid, ["Tournament winner"]) -> 7 has_any_role?(userid, ~w(Core Contributor)) -> 6 ingame_hours > 1000 -> 5 ingame_hours > 250 -> 4