Skip to content

Commit

Permalink
Merge branch 'main' into handle-diff-game-updates-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinesco committed Sep 3, 2024
2 parents fad6e0b + 8e3bb97 commit a649be0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[STAGING-BRAZIL] Deploy to Brazil Arena Staging"
name: "[TESTING-BRAZIL] Deploy to Brazil Arena Testing AWS"
on:
workflow_dispatch:

Expand All @@ -7,8 +7,8 @@ jobs:
name: Build and deploy to Brazil staging
runs-on: ubuntu-latest
environment:
name: staging-brazil
url: https://arena-brazil-staging.championsofmirra.com/
name: testing-brazil
url: https://arena-brazil-testing-aws.championsofmirra.com/

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
MIX_ENV: ${{ vars.MIX_ENV }}
RELEASE: arena
PHX_SERVER: ${{ vars.PHX_SERVER }}
PHX_HOST: ${{ vars.HOST }}
PHX_HOST: ${{ vars.AWS_HOST }}
PORT: ${{ vars.ARENA_PORT }}
GATEWAY_URL: ${{ vars.GATEWAY_URL }}
BOT_MANAGER_PORT: ${{ vars.BOT_MANAGER_PORT }}
Expand All @@ -52,8 +52,8 @@ jobs:
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
DBUS_SESSION_BUS_ADDRESS: ${{ vars.DBUS_SESSION_BUS_ADDRESS }}
XDG_RUNTIME_DIR: ${{ vars.XDG_RUNTIME_DIR }}
DBUS_SESSION_BUS_ADDRESS: ${{ vars.DBUS_SESSION_BUS_ADDRESS_AWS }}
XDG_RUNTIME_DIR: ${{ vars.XDG_RUNTIME_DIR_AWS }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
set -ex
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "[LEGACY-LATITUDE-STAGING-BRAZIL] Deploy to Brazil Arena Staging"
name: "[STAGING-CHILE] Deploy to Chile Arena Staging"
on:
workflow_dispatch:

jobs:
build-deploy:
name: Build and deploy to Brazil staging
name: Build and deploy to Chile Staging
runs-on: ubuntu-latest
environment:
name: staging-brazil
url: https://legacy-arena-brazil-staging.championsofmirra.com/
name: staging-chile
url: https://arena-chile-staging.championsofmirra.com/

steps:
- uses: actions/checkout@v4
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/arena-chile-testing-2-deploy.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: "[TESTING-CHILE-1] Deploy to Chile Latitude Arena Testing"
name: "[TESTING-CHILE] Deploy to Chile Arena Testing Latitude"
on:
workflow_dispatch:

jobs:
build-deploy:
name: Build and deploy to Chile-1 Testing
name: Build and deploy to Chile Testing
runs-on: ubuntu-latest
environment:
name: testing-chile
url: https://arena-chile-testing.championsofmirra.com/

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 11 additions & 1 deletion apps/arena/lib/arena/game/obstacle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,24 @@ defmodule Arena.Game.Obstacle do

now = DateTime.utc_now() |> DateTime.to_unix(:millisecond)

time_until_transition_ms = next_status_params.time_until_transition_ms

random_ms =
Enum.random(
Integer.floor_div(-time_until_transition_ms, 2)..Integer.floor_div(
time_until_transition_ms,
2
)
)

obstacle =
update_in(obstacle, [:aditional_info], fn aditional_info ->
aditional_info
|> Map.put(:next_status, next_status_params.next_status)
|> Map.put(:status, obstacle.aditional_info.next_status)
|> Map.put(:collisionable, next_status_params.make_obstacle_collisionable)
|> Map.put(:collide_with_projectiles, next_status_params.make_obstacle_collisionable)
|> Map.put(:time_until_transition_start, now + next_status_params.time_until_transition_ms)
|> Map.put(:time_until_transition_start, now + time_until_transition_ms + random_ms)
end)

Enum.reduce(next_status_params.on_activation_mechanics, game_state, fn mechanic, game_state ->
Expand Down
2 changes: 1 addition & 1 deletion apps/arena/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Arena.MixProject do
def project do
[
app: :arena,
version: "0.5.1",
version: "0.6.1",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ defmodule ConfiguratorWeb.MapConfigurationController do
|> Map.update("obstacles", "", &parse_json/1)
|> Map.update("bushes", "", &parse_json/1)
|> Map.update("pools", "", &parse_json/1)
|> Map.update("crates", "", &parse_json/1)
end

defp parse_json(""), do: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ defmodule ConfiguratorWeb.MapConfigurationControllerTest do
obstacles: "",
bushes: "",
pools: "",
crates: "",
active: true
}
@update_attrs %{
Expand All @@ -21,9 +22,19 @@ defmodule ConfiguratorWeb.MapConfigurationControllerTest do
obstacles: "",
bushes: "",
pools: "",
crates: "",
active: false
}
@invalid_attrs %{name: nil, radius: nil, initial_positions: nil, obstacles: nil, bushes: nil, pools: nil, active: nil}
@invalid_attrs %{
name: nil,
radius: nil,
initial_positions: nil,
obstacles: nil,
bushes: nil,
pools: nil,
crates: nil,
active: nil
}

describe "index" do
test "lists all map_configurations", %{conn: conn} do
Expand Down

0 comments on commit a649be0

Please sign in to comment.