From f003761bf11128678832610f02ad30911c9dfabc Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Wed, 19 Jun 2024 18:35:51 +0200 Subject: [PATCH] Formatting --- apps/bot_manager/lib/game_socket_handler.ex | 1 + apps/bot_manager/lib/token_fetcher.ex | 2 +- apps/bot_manager/mix.exs | 2 +- config/runtime.exs | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/bot_manager/lib/game_socket_handler.ex b/apps/bot_manager/lib/game_socket_handler.ex index b5c4533ec..3efb75f2f 100644 --- a/apps/bot_manager/lib/game_socket_handler.ex +++ b/apps/bot_manager/lib/game_socket_handler.ex @@ -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 diff --git a/apps/bot_manager/lib/token_fetcher.ex b/apps/bot_manager/lib/token_fetcher.ex index f8eccd6d0..d53da3d4c 100644 --- a/apps/bot_manager/lib/token_fetcher.ex +++ b/apps/bot_manager/lib/token_fetcher.ex @@ -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 = diff --git a/apps/bot_manager/mix.exs b/apps/bot_manager/mix.exs index 8cc6f5cee..2fa317da5 100644 --- a/apps/bot_manager/mix.exs +++ b/apps/bot_manager/mix.exs @@ -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 diff --git a/config/runtime.exs b/config/runtime.exs index da416e592..13b33e3d1 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -401,7 +401,6 @@ config :bot_manager, :end_point_configuration, plug: BotManager.Endpoint, options: [port: bot_manager_port] - ################################### # App configuration: Bot Manager # ###################################