Skip to content

Commit

Permalink
Read client config and add it to configuration map before sending it …
Browse files Browse the repository at this point in the history
…to client
  • Loading branch information
Nico-Sanchez committed May 14, 2024
1 parent aebb3c1 commit 4ceeb71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/arena/lib/arena/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ defmodule Arena.Configuration do
config = Jason.decode!(config_json, [{:keys, :atoms}])
skills = parse_skills_config(config.skills)
characters = parse_characters_config(config.characters, skills)
%{config | skills: skills, characters: characters}
client_config = get_client_config()
%{config | skills: skills, characters: characters, client_config: client_config}
end

defp get_client_config() do
{:ok, config_json} =
Application.app_dir(:arena, "priv/client_config.json")
|> File.read()

Jason.decode!(config_json, [{:keys, :atoms}])
end

defp parse_skills_config(skills_config) do
Expand Down

0 comments on commit 4ceeb71

Please sign in to comment.