Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AminArria committed Jun 19, 2024
1 parent 2302aa6 commit f003761
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/bot_manager/lib/game_socket_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ defmodule BotManager.GameSocketHandler do
}) do
Logger.info("Connecting bot with client: #{bot_client} to game: #{game_id} in the server: #{arena_host}")
%{token: token, secret: secret} = BotManager.TokenFetcher.get_auth()

if arena_host == "localhost" do
"ws://localhost:4000/play/#{game_id}/#{bot_client}?bot_token=#{token}&bot_secret=#{secret}"
else
Expand Down
2 changes: 1 addition & 1 deletion apps/bot_manager/lib/token_fetcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule BotManager.TokenFetcher do
@impl true
def handle_info(:fetch_token, state) do
gateway_url = Application.get_env(:bot_manager, :gateway_url)
secret = :crypto.strong_rand_bytes(32) |> Base.url_encode64
secret = :crypto.strong_rand_bytes(32) |> Base.url_encode64()
payload = Jason.encode!(%{"bot_secret" => secret})

result =
Expand Down
2 changes: 1 addition & 1 deletion apps/bot_manager/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule BotManager.MixProject do
{:websockex, "~> 0.4.3"},
{:exbase58, "~> 1.0.2"},
{:protobuf, "~> 0.12.0"},
{:finch, "~> 0.13"},
{:finch, "~> 0.13"}
]
end
end
1 change: 0 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ config :bot_manager, :end_point_configuration,
plug: BotManager.Endpoint,
options: [port: bot_manager_port]


###################################
# App configuration: Bot Manager #
###################################
Expand Down

0 comments on commit f003761

Please sign in to comment.