From cd99c1b44427cfa23bd1b48812b92121f081f728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Sanchez?= Date: Tue, 26 Nov 2024 11:32:11 -0300 Subject: [PATCH 1/4] Reorganize obstacles with less vertices, connect shapes and set new bridges' gaps (#991) * Reorganize obstacles with less vertices, connect shapes and set new bridges' gaps * Update obstacles layout due to changes in frontend (#993) * Upgrade arena version --- apps/arena/mix.exs | 2 +- priv/repo/seeds.exs | 916 ++++++-------------------------------------- 2 files changed, 124 insertions(+), 794 deletions(-) diff --git a/apps/arena/mix.exs b/apps/arena/mix.exs index 1bb7ea51b..58a35b1c3 100644 --- a/apps/arena/mix.exs +++ b/apps/arena/mix.exs @@ -4,7 +4,7 @@ defmodule Arena.MixProject do def project do [ app: :arena, - version: "0.9.1", + version: "0.10.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 5e2ff93a1..3aff70dbd 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -4024,316 +4024,6 @@ merliot_map_config = %{ %{x: 910, y: 2182} ] }, - %{ - name: "Inner Square Bottom Left", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -1423, y: -329}, - %{x: -1331, y: -237}, - %{x: -781, y: -779}, - %{x: -834, y: -840} - ] - }, - %{ - name: "Inner Square Bottom Right", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 418, y: -1340}, - %{x: 314, y: -1256}, - %{x: 904, y: -744}, - %{x: 962, y: -796} - ] - }, - %{ - name: "Inner Square Top Right", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 782, y: 878}, - %{x: 846, y: 938}, - %{x: 1411, y: 382}, - %{x: 1291, y: 292} - ] - }, - %{ - name: "Inner Square Top Left", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -757, y: 814}, - %{x: -817, y: 882}, - %{x: -269, y: 1434}, - %{x: -179, y: 1353} - ] - }, - %{ - name: "External Square Left 1", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -5189, y: 3405}, - %{x: -5342, y: 3405}, - %{x: -5399, y: 5178}, - %{x: -5245, y: 5178} - ] - }, - %{ - name: "External Square Left 2", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -5211, y: -2170}, - %{x: -5403, y: -2191}, - %{x: -5369, y: -891}, - %{x: -5232, y: -891} - ] - }, - %{ - name: "External Square Left 3", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -5416, y: -2598}, - %{x: -5206, y: -2598}, - %{x: -5245, y: -3276}, - %{x: -5402, y: -3285} - ] - }, - %{ - name: "External Square Top 1", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -3397, y: 5295}, - %{x: -3397, y: 5443}, - %{x: -2729, y: 5495}, - %{x: -2719, y: 5285} - ] - }, - %{ - name: "External Square Top 2", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -2312, y: 5295}, - %{x: -2298, y: 5491}, - %{x: -1024, y: 5510}, - %{x: -1014, y: 5367} - ] - }, - %{ - name: "External Square Top 3", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 3371, y: 5174}, - %{x: 3376, y: 5314}, - %{x: 5157, y: 5304}, - %{x: 5157, y: 5159} - ] - }, - %{ - name: "External Square Right 1", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 5201, y: 3296}, - %{x: 5334, y: 3296}, - %{x: 5372, y: 2661}, - %{x: 5182, y: 2642} - ] - }, - %{ - name: "External Square Right 2", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 5173, y: 2208}, - %{x: 5365, y: 2201}, - %{x: 5337, y: 928}, - %{x: 5188, y: 928} - ] - }, - %{ - name: "External Square Right 3", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 5149, y: -3411}, - %{x: 5282, y: -3411}, - %{x: 5262, y: -5172}, - %{x: 5119, y: -5182} - ] - }, - %{ - name: "External Square Bottom 1", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 2596, y: -5361}, - %{x: 2591, y: -5181}, - %{x: 3245, y: -5207}, - %{x: 3245, y: -5341} - ] - }, - %{ - name: "External Square Bottom 2", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 892, y: -5309}, - %{x: 892, y: -5157}, - %{x: 2156, y: -5178}, - %{x: 2156, y: -5367} - ] - }, - %{ - name: "External Square Bottom 3", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -5191, y: -5278}, - %{x: -5191, y: -5135}, - %{x: -3423, y: -5143}, - %{x: -3423, y: -5274} - ] - }, - %{ - name: "Bottom Left Rock", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -4746, y: -6453}, - %{x: -4647, y: -6005}, - %{x: -4189, y: -5744}, - %{x: -3696, y: -5487}, - %{x: -3340, y: -5690}, - %{x: -3621, y: -6261}, - %{x: -3720, y: -6530}, - %{x: -4130, y: -6592} - ] - }, %{ name: "Bottom Mid Rock", position: %{ @@ -4366,9 +4056,9 @@ merliot_map_config = %{ base_status: "", statuses_cycle: %{}, vertices: [ - %{x: 6530, y: -4611}, - %{x: 5717, y: -3593}, - %{x: 6721, y: -3586} + %{x: 5571, y: -3342}, + %{x: 6721, y: -3586}, + %{x: 6530, y: -4611} ] }, %{ @@ -4402,11 +4092,11 @@ merliot_map_config = %{ base_status: "", statuses_cycle: %{}, vertices: [ - %{x: 3841, y: 6589}, + %{x: 3691, y: 6589}, %{x: 4221, y: 6589}, %{x: 4641, y: 6069}, %{x: 3751, y: 5499}, - %{x: 3621, y: 6089} + %{x: 3236, y: 5565} ] }, %{ @@ -4444,10 +4134,8 @@ merliot_map_config = %{ vertices: [ %{x: -6458, y: 4619}, %{x: -5866, y: 4027}, - %{x: -5648, y: 3592}, - %{x: -6057, y: 3427}, - %{x: -6579, y: 3488}, - %{x: -6596, y: 4036} + %{x: -5648, y: 3000}, + %{x: -6596, y: 3000} ] }, %{ @@ -4470,25 +4158,6 @@ merliot_map_config = %{ %{x: -6478, y: -2320} ] }, - %{ - name: "Left Rock and Tree", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", - type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -3936, y: -945}, - %{x: -3669, y: -1696}, - %{x: -3877, y: -1854}, - %{x: -4381, y: -1380}, - %{x: -4421, y: -1064} - ] - }, %{ name: "Bottom Rock and Tree", position: %{ @@ -4509,126 +4178,52 @@ merliot_map_config = %{ ] }, %{ - name: "Right Rock and Tree", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "TopLeft - RockTreeBush - Rock", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 4381, y: 1029}, - %{x: 3891, y: 849}, - %{x: 3581, y: 1559}, - %{x: 3931, y: 1789}, - %{x: 4341, y: 1359} - ] + radius: 250, + shape: "circle", + position: %{x: -1283, y: 3909}, + vertices: [] }, %{ - name: "Top Rock and Tree", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "TopLeft - RockTreeBush - Tree", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -1272, y: 4082}, - %{x: -1122, y: 3652}, - %{x: -1819, y: 3323}, - %{x: -2051, y: 3507}, - %{x: -1694, y: 3912} - ] + radius: 250, + shape: "circle", + position: %{x: -1679, y: 3690}, + vertices: [] }, %{ - name: "Bottom Left Trees", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "MidBottomLeft - TreeBush - Trees", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -2066, y: -2729}, - %{x: -1560, y: -2873}, - %{x: -1141, y: -3229}, - %{x: -1160, y: -3523}, - %{x: -1610, y: -3661}, - %{x: -1948, y: -3555}, - %{x: -2142, y: -3086} - ] + radius: 550, + shape: "circle", + position: %{x: -1759, y: -3426}, + vertices: [] }, %{ - name: "Bottom Right Trees", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "MidBottomRight - TreeBush - Trees", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 2906, y: -1665}, - %{x: 3090, y: -1726}, - %{x: 3379, y: -1591}, - %{x: 3668, y: -1480}, - %{x: 3668, y: -712}, - %{x: 3336, y: -681}, - %{x: 3040, y: -1081} - ] + radius: 500, + shape: "circle", + position: %{x: 3424, y: -1564}, + vertices: [] }, %{ - name: "Top Right Trees", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "MidTopRight - TreeBush - Trees", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: 994, y: 3303}, - %{x: 1035, y: 3588}, - %{x: 1781, y: 3646}, - %{x: 2131, y: 3035}, - %{x: 1965, y: 2802}, - %{x: 1596, y: 2864}, - %{x: 1291, y: 3107} - ] + radius: 500, + shape: "circle", + position: %{x: 1873, y: 3276}, + vertices: [] }, %{ - name: "Top Left Trees", - position: %{ - x: 0.0, - y: 0.0 - }, - radius: 0.0, - shape: "polygon", + name: "MidTopLeft - TreeBush - Trees", type: "static", - base_status: "", - statuses_cycle: %{}, - vertices: [ - %{x: -3064, y: 1962}, - %{x: -2784, y: 1930}, - %{x: -2728, y: 1339}, - %{x: -2912, y: 788}, - %{x: -3200, y: 709}, - %{x: -3408, y: 1100}, - %{x: -3464, y: 1580} - ] + radius: 400, + shape: "circle", + position: %{x: -3200, y: 1300}, + vertices: [] }, %{ name: "Left Top Water 1", @@ -4644,10 +4239,8 @@ merliot_map_config = %{ vertices: [ %{x: -4360, y: 2759}, %{x: -3871, y: 2734}, - %{x: -3896, y: 2402}, - %{x: -3896, y: 1995}, - %{x: -4593, y: 2012}, - %{x: -4444, y: 2410} + %{x: -3896, y: 1900}, + %{x: -4900, y: 1800} ] }, %{ @@ -4662,11 +4255,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -4894, y: 1998}, - %{x: -3216, y: 2003}, - %{x: -3569, y: 1139}, - %{x: -4555, y: 1139}, - %{x: -4937, y: 1643} + %{x: -3871, y: 2734}, + %{x: -3167, y: 3087}, + %{x: -2743, y: 2204}, + %{x: -3896, y: 1900} ] }, %{ @@ -4681,11 +4273,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -4541, y: 1134}, - %{x: -3569, y: 1141}, - %{x: -3526, y: 672}, - %{x: -3900, y: 643}, - %{x: -4345, y: 597} + %{x: -4900, y: 1800}, + %{x: -3216, y: 2150}, + %{x: -3569, y: 1139}, + %{x: -4555, y: 1139} ] }, %{ @@ -4700,10 +4291,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -4345, y: 597}, - %{x: -3900, y: 643}, - %{x: -4058, y: 339}, - %{x: -4255, y: 314} + %{x: -4555, y: 1139}, + %{x: -3569, y: 1139}, + %{x: -3500, y: 500}, + %{x: -4345, y: 400} ] }, %{ @@ -4718,8 +4309,8 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -3117, y: -2805}, - %{x: -2539, y: -2621}, + %{x: -3117, y: -2705}, + %{x: -2539, y: -2550}, %{x: -1953, y: -3549}, %{x: -2872, y: -3743} ] @@ -4736,10 +4327,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -2854, y: -3751}, + %{x: -2872, y: -3743}, %{x: -1953, y: -3549}, - %{x: -1674, y: -4649}, - %{x: -2944, y: -4636} + %{x: -1788, y: -4935}, + %{x: -3029, y: -4477} ] }, %{ @@ -4757,7 +4348,7 @@ merliot_map_config = %{ %{x: -1953, y: -3549}, %{x: -837, y: -3421}, %{x: -532, y: -4091}, - %{x: -1674, y: -4649} + %{x: -1788, y: -4935} ] }, %{ @@ -4774,7 +4365,7 @@ merliot_map_config = %{ vertices: [ %{x: -6430, y: 3520}, %{x: -5150, y: 3016}, - %{x: -5365, y: 2132}, + %{x: -5600, y: 2132}, %{x: -6439, y: 2505} ] }, @@ -4790,10 +4381,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: 2254, y: 5881}, %{x: 2496, y: 6558}, %{x: 3691, y: 6546}, - %{x: 3376, y: 5862} + %{x: 3236, y: 5565}, + %{x: 2209, y: 6059} ] }, %{ @@ -4808,12 +4399,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -3340, y: -5690}, - %{x: -3225, y: -5524}, - %{x: -2132, y: -5561}, + %{x: -3168, y: -5127}, + %{x: -2062, y: -5648}, %{x: -2530, y: -6395}, - %{x: -3665, y: -6404}, - %{x: -3621, y: -6261} + %{x: -3665, y: -6404} ] }, %{ @@ -4828,10 +4417,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: 5717, y: -3593}, - %{x: 5889, y: -2323}, + %{x: 6046, y: -2263}, %{x: 6579, y: -2499}, - %{x: 6534, y: -3543} + %{x: 6534, y: -3543}, + %{x: 5571, y: -3342} ] }, %{ @@ -4870,24 +4459,6 @@ merliot_map_config = %{ %{x: 808, y: -3648} ] }, - %{ - name: "Top Mid Water 1", - radius: 0.0, - shape: "polygon", - type: :lake, - base_status: nil, - statuses_cycle: %{}, - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: -3200, y: 2970}, - %{x: -1950, y: 3392}, - %{x: -1689, y: 2797}, - %{x: -2855, y: 2262} - ] - }, %{ name: "Top Mid Water 2", radius: 0.0, @@ -4900,10 +4471,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: -1950, y: 3392}, - %{x: -181, y: 3983}, - %{x: 140, y: 3279}, - %{x: -1689, y: 2797} + %{x: -2438, y: 3333}, + %{x: -50, y: 4148}, + %{x: 250, y: 3280}, + %{x: -2076, y: 2509} ] }, %{ @@ -4990,10 +4561,27 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: 2965, y: -3062}, %{x: 2653, y: -2438}, %{x: 3633, y: -1502}, - %{x: 4596, y: -2699} + %{x: 4470, y: -2860}, + %{x: 2792, y: -3186} + ] + }, + %{ + name: "Bottom Right Water 1 prima", + radius: 0.0, + shape: "polygon", + type: :lake, + base_status: nil, + statuses_cycle: %{}, + position: %{ + x: 0.0, + y: 0.0 + }, + vertices: [ + %{x: 3633, y: -1502}, + %{x: 4896, y: -2963}, + %{x: 4470, y: -2860} ] }, %{ @@ -5028,8 +4616,8 @@ merliot_map_config = %{ vertices: [ %{x: 3630, y: -1498}, %{x: 4629, y: -1281}, - %{x: 5611, y: -2263}, - %{x: 4596, y: -2699} + %{x: 5371, y: -1881}, + %{x: 4896, y: -2963} ] }, %{ @@ -5062,10 +4650,10 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ + %{x: 565, y: 4300}, + %{x: 1455, y: 4700}, %{x: 1717, y: 3634}, - %{x: 991, y: 3634}, - %{x: 902, y: 4408}, - %{x: 1455, y: 4845} + %{x: 808, y: 3500} ] }, %{ @@ -5080,334 +4668,76 @@ merliot_map_config = %{ y: 0.0 }, vertices: [ - %{x: 1717, y: 3634}, - %{x: 1455, y: 4845}, - %{x: 2092, y: 5603}, - %{x: 3003, y: 5182}, - %{x: 2762, y: 4031} + %{x: 1455, y: 4700}, + %{x: 1802, y: 5366}, + %{x: 3000, y: 4737}, + %{x: 2762, y: 4031}, + %{x: 1717, y: 3634} ] } ], bushes: [ %{ - name: "Bottom Left A1", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: -6370, y: -5029}, - %{x: -5550, y: -5029}, - %{x: -5430, y: -5659}, - %{x: -6370, y: -5669} - ] - }, - %{ - name: "Bottom Left A2", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: -6370, y: -5669}, - %{x: -5114, y: -5649}, - %{x: -5107, y: -6427}, - %{x: -6349, y: -6434} - ] - }, - %{ - name: "Bottom Left A3", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: -5107, y: -6427}, - %{x: -5100, y: -6072}, - %{x: -4643, y: -6072}, - %{x: -4643, y: -6441} - ] - }, - %{ - name: "Bottom Mid A1", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: -2583, y: -6420}, - %{x: -2354, y: -5906}, - %{x: -1411, y: -5953}, - %{x: -1471, y: -6487} - ] - }, - %{ - name: "Bottom Mid A2", - radius: 1000, - shape: "polygon", - position: %{x: 0, y: 0}, - vertices: [ - %{x: -2220, y: -6063}, - %{x: -2219, y: -5587}, - %{x: -1774, y: -5566}, - %{x: -1774, y: -6089} - ] - }, - %{ - name: "Bottom Mid B1", - radius: 1800, - shape: "circle", - position: %{x: 1570, y: -7248}, - vertices: [] - }, - %{ - name: "Bottom Mid B2", - radius: 500, - shape: "circle", - position: %{x: 310, y: -6110}, - vertices: [] - }, - %{ - name: "Bottom Mid B3", - radius: 500, - shape: "circle", - position: %{x: 2712, y: -6114}, - vertices: [] - }, - %{ - name: "Bottom Mid C1", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: 4970, y: -6462}, - %{x: 4963, y: -6040}, - %{x: 6658, y: -6040}, - %{x: 6665, y: -6442} - ] - }, - %{ - name: "Bottom Mid C2", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: 5485, y: -6023}, - %{x: 5485, y: -5673}, - %{x: 6650, y: -5673}, - %{x: 6663, y: -6040} - ] - }, - %{ - name: "Bottom Mid C3", - radius: 0.0, - shape: "polygon", - position: %{ - x: 0.0, - y: 0.0 - }, - vertices: [ - %{x: 6000, y: -5614}, - %{x: 6000, y: -5275}, - %{x: 6628, y: -5275}, - %{x: 6656, y: -5599} - ] - }, - %{ - name: "Mid Left A1", - radius: 1800, - shape: "circle", - position: %{x: -6940, y: -1239}, - vertices: [] - }, - %{ - name: "Mid Left A2", - radius: 700, - shape: "circle", - position: %{x: -6020, y: -2129}, - vertices: [] - }, - %{ - name: "Mid Left A3", - radius: 700, - shape: "circle", - position: %{x: -6000, y: -439}, - vertices: [] - }, - %{ - name: "Mid Left B1", - radius: 500, - shape: "circle", - position: %{x: -6360, y: 2020}, - vertices: [] - }, - %{ - name: "Mid Left B2", - radius: 500, - shape: "circle", - position: %{x: -5810, y: 2220}, - vertices: [] - }, - %{ - name: "Top Left B1", + name: "Top Left Corner", radius: 1000, shape: "circle", position: %{x: -6390, y: 6550}, vertices: [] }, %{ - name: "Top Mid A1", - radius: 1700, - shape: "circle", - position: %{x: -1480, y: 6970}, - vertices: [] - }, - %{ - name: "Top Mid A2", - radius: 700, - shape: "circle", - position: %{x: 1859, y: 6110}, - vertices: [] - }, - %{ - name: "Top Right A1", - radius: 1700, - shape: "circle", - position: %{x: 7369, y: 6680}, - vertices: [] - }, - %{ - name: "Mid Right A1", - radius: 700, - shape: "circle", - position: %{x: 6653, y: 2360}, - vertices: [] - }, - %{ - name: "Mid Right A2", - radius: 700, - shape: "circle", - position: %{x: 6486, y: 655}, - vertices: [] - }, - %{ - name: "Mid Right A3", - radius: 700, - shape: "circle", - position: %{x: 6300, y: 2007}, - vertices: [] - }, - %{ - name: "Mid Right B1", - radius: 0, - shape: "polygon", - position: %{x: 0.0, y: 0.0}, - vertices: [ - %{x: 6085, y: -1374}, - %{x: 6596, y: -1374}, - %{x: 6497, y: -2222}, - %{x: 5911, y: -2222} - ] - }, - %{ - name: "Mid Right B2", - radius: 300, - shape: "circle", - position: %{x: 5626, y: -1885}, - vertices: [] - }, - %{ - name: "Mid Top A1", + name: "Top Right Corner", radius: 1000, shape: "circle", - position: %{x: 3799, y: 3810}, + position: %{x: 6390, y: 6550}, vertices: [] }, %{ - name: "Mid Top A2", - radius: 0, - shape: "polygon", - position: %{x: 0.0, y: 0.0}, - vertices: [ - %{x: -2010, y: 4592}, - %{x: -421, y: 4368}, - %{x: -504, y: 3850}, - %{x: -2110, y: 4132} - ] - }, - %{ - name: "Mid Top A3", - radius: 700, + name: "Bottom Left Corner", + radius: 1000, shape: "circle", - position: %{x: -3800, y: 3690}, + position: %{x: -6390, y: -6550}, vertices: [] }, %{ - name: "Mid Bottom A1", - radius: 850, + name: "Bottom Right Corner", + radius: 1000, shape: "circle", - position: %{x: -1570, y: -2879}, + position: %{x: 6390, y: -6550}, vertices: [] }, %{ - name: "Mid Bottom B1", - radius: 850, + name: "TopLeft - RockTreeBush - Bush", + radius: 250, shape: "circle", - position: %{x: -1570, y: -2879}, + position: %{x: -1610, y: 3994}, vertices: [] }, %{ - name: "Mid Bottom C1", - radius: 1000, + name: "MidBottomLeft - TreeBush - Bush", + radius: 800, shape: "circle", - position: %{x: 1529, y: -3639}, + position: %{x: -1759, y: -3426}, vertices: [] }, %{ - name: "Mid Bottom A4", - radius: 0.0, - shape: "polygon", - position: %{x: 0.0, y: 0.0}, - vertices: [ - %{x: 2480, y: -1523}, - %{x: 3445, y: -1518}, - %{x: 3445, y: -2205}, - %{x: 2489, y: -2242} - ] - }, - %{ - name: "Mid Top A1", - radius: 1000, + name: "MidBottomRight - TreeBush - Bush", + radius: 750, shape: "circle", - position: %{x: 4229, y: 1160}, + position: %{x: 3350, y: -1634}, vertices: [] }, %{ - name: "Mid Top B1", - radius: 950, + name: "MidTopLeft - TreeBush - Bush", + radius: 650, shape: "circle", - position: %{x: -3110, y: 1220}, + position: %{x: -3200, y: 1300}, vertices: [] }, %{ - name: "Mid Top C1", - radius: 900, + name: "MidTopRight - TreeBush - Bush", + radius: 700, shape: "circle", - position: %{x: 1819, y: 3130}, + position: %{x: 1873, y: 3276}, vertices: [] } ], From 413e90b9ea746493a93cd6558c19bc604c121b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Villegas?= <67444519+tvillegas98@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:55:28 -0300 Subject: [PATCH 2/4] [GH-917] - Deathmatch mode (#980) * feat: enable deathmatch matchmaking * feat: add end game check for deathmatch * feat: add deathmatch logic into the game updater * feat: show deathmatch mode in the browser * fix: input when respawning was not working * fix: win condition * fix: battle royale was broken * fix: add mising parameter in pair mode matchmaking * feat: increase deathmatch game time * feat: send the game mode to the client * fix: players were not respawning * chore: requested changes * fix: typo in deathmatch * feat: centralize bot names * fix: another wrong check and fix player positions * chore: mix format * chore: increase arena version * chore: update arena version again --- apps/arena/lib/arena/application.ex | 1 + apps/arena/lib/arena/game/player.ex | 8 + apps/arena/lib/arena/game_socket_handler.ex | 11 ++ apps/arena/lib/arena/game_updater.ex | 87 +++++++++- apps/arena/lib/arena/matchmaking.ex | 1 + .../lib/arena/matchmaking/deathmatch_mode.ex | 139 ++++++++++++++++ .../lib/arena/matchmaking/game_launcher.ex | 23 +-- apps/arena/lib/arena/matchmaking/pair_mode.ex | 23 +-- .../lib/arena/matchmaking/quick_game_mode.ex | 24 +-- .../lib/arena/serialization/messages.pb.ex | 144 +++++++++-------- apps/arena/lib/arena/utils.ex | 24 +++ apps/arena/mix.exs | 2 +- .../serialization/messages.pb.ex | 149 +++++++++-------- apps/bot_manager/lib/protobuf/messages.pb.ex | 144 +++++++++-------- .../assets/js/protobuf/messages_pb.js | 43 ++++- .../lib/game_client/protobuf/messages.pb.ex | 144 +++++++++-------- .../controllers/page_html/home.html.heex | 1 + .../lib/gateway/serialization/gateway.pb.ex | 150 +++++++++--------- apps/serialization/messages.proto | 8 + 19 files changed, 719 insertions(+), 407 deletions(-) create mode 100644 apps/arena/lib/arena/matchmaking/deathmatch_mode.ex diff --git a/apps/arena/lib/arena/application.ex b/apps/arena/lib/arena/application.ex index f9091f16d..31847a66c 100644 --- a/apps/arena/lib/arena/application.ex +++ b/apps/arena/lib/arena/application.ex @@ -17,6 +17,7 @@ defmodule Arena.Application do Arena.Matchmaking.GameLauncher, Arena.Matchmaking.PairMode, Arena.Matchmaking.QuickGameMode, + Arena.Matchmaking.DeathmatchMode, Arena.GameBountiesFetcher, Arena.GameTracker, Arena.Authentication.GatewaySigner, diff --git a/apps/arena/lib/arena/game/player.ex b/apps/arena/lib/arena/game/player.ex index a33f2fa34..2e0181240 100644 --- a/apps/arena/lib/arena/game/player.ex +++ b/apps/arena/lib/arena/game/player.ex @@ -451,6 +451,14 @@ defmodule Arena.Game.Player do end) end + def respawn_player(player, position) do + aditional_info = player.aditional_info |> Map.put(:health, player.aditional_info.base_health) + + player + |> Map.put(:aditional_info, aditional_info) + |> Map.put(:position, position) + end + #################### # Internal helpers # #################### diff --git a/apps/arena/lib/arena/game_socket_handler.ex b/apps/arena/lib/arena/game_socket_handler.ex index 45c8b43e0..847773f84 100644 --- a/apps/arena/lib/arena/game_socket_handler.ex +++ b/apps/arena/lib/arena/game_socket_handler.ex @@ -116,6 +116,17 @@ defmodule Arena.GameSocketHandler do end end + def websocket_info({:respawn_player, player_id}, state) do + state = + if state.player_id == player_id do + state |> Map.put(:enable, true) |> Map.put(:player_alive, true) + else + state + end + + {:ok, state} + end + @impl true def websocket_info({:block_actions, player_id, value}, state) do if state.player_id == player_id do diff --git a/apps/arena/lib/arena/game_updater.ex b/apps/arena/lib/arena/game_updater.ex index 5b876b725..2743991ba 100644 --- a/apps/arena/lib/arena/game_updater.ex +++ b/apps/arena/lib/arena/game_updater.ex @@ -267,6 +267,9 @@ defmodule Arena.GameUpdater do |> activate_trap_mechanics() # Obstacles |> handle_obstacles_transitions() + # Deathmatch + |> add_players_to_respawn_queue(state.game_config) + |> respawn_players(state.game_config) {:ok, state_diff} = diff(state.last_broadcasted_game_state, game_state) @@ -308,7 +311,12 @@ defmodule Arena.GameUpdater do Process.send_after(self(), :match_timeout, state.game_config.game.match_timeout_ms) send(self(), :natural_healing) - send(self(), {:end_game_check, Map.keys(state.game_state.players)}) + + if state.game_config.game.game_mode != :DEATHMATCH do + send(self(), {:end_game_check, Map.keys(state.game_state.players)}) + else + Process.send_after(self(), :deathmatch_end_game_check, state.game_config.game.match_duration) + end unless state.game_config.game.bots_enabled do toggle_bots(self()) @@ -317,6 +325,36 @@ defmodule Arena.GameUpdater do {:noreply, put_in(state, [:game_state, :status], :RUNNING)} end + def handle_info(:deathmatch_end_game_check, state) do + players = + state.game_state.players + |> Enum.map(fn {player_id, player} -> + %{kills: kills} = GameTracker.get_player_result(player_id) + {player_id, player, kills} + end) + |> Enum.sort_by(fn {_player_id, _player, kills} -> kills end, :desc) + + {winner_id, winner, _kills} = Enum.at(players, 0) + + state = + state + |> put_in([:game_state, :status], :ENDED) + |> update_in([:game_state], fn game_state -> + players + |> Enum.reduce(game_state, fn {player_id, _player, _kills}, game_state_acc -> + put_player_position(game_state_acc, player_id) + end) + end) + + PubSub.broadcast(Arena.PubSub, state.game_state.game_id, :end_game_state) + broadcast_game_ended(winner, state.game_state) + GameTracker.finish_tracking(self(), winner_id) + + Process.send_after(self(), :game_ended, state.game_config.game.shutdown_game_wait_ms) + + {:noreply, state} + end + def handle_info({:end_game_check, last_players_ids}, state) do case check_game_ended(state.game_state.players, last_players_ids) do {:ongoing, players_ids} -> @@ -741,6 +779,10 @@ defmodule Arena.GameUpdater do PubSub.broadcast(Arena.PubSub, state.game_id, {:game_finished, encoded_state}) end + defp broadcast_player_respawn(game_id, player_id) do + PubSub.broadcast(Arena.PubSub, game_id, {:respawn_player, player_id}) + end + defp complete_entities(nil, _), do: [] defp complete_entities(entities, category) do @@ -795,7 +837,7 @@ defmodule Arena.GameUpdater do |> Map.put(:square_wall, config.map.square_wall) |> Map.put(:zone, %{ radius: config.map.radius - 5000, - should_start?: config.game.zone_enabled, + should_start?: if(config.game.game_mode == :DEATHMATCH, do: false, else: config.game.zone_enabled), started: false, enabled: false, shrinking: false, @@ -810,6 +852,7 @@ defmodule Arena.GameUpdater do ) |> Map.put(:positions, %{}) |> Map.put(:traps, %{}) + |> Map.put(:respawn_queue, %{}) {game, _} = Enum.reduce(clients, {new_game, config.map.initial_positions}, fn {client_id, character_name, player_name, @@ -1873,6 +1916,46 @@ defmodule Arena.GameUpdater do end end + defp add_players_to_respawn_queue(game_state, %{game: %{game_mode: :DEATHMATCH}} = game_config) do + now = DateTime.utc_now() |> DateTime.to_unix(:millisecond) + + respawn_queue = + Enum.reduce(game_state.players, game_state.respawn_queue, fn {player_id, player}, respawn_queue -> + if Map.has_key?(respawn_queue, player_id) || Player.alive?(player) do + respawn_queue + else + Map.put(respawn_queue, player_id, now + game_config.game.respawn_time) + end + end) + + Map.put(game_state, :respawn_queue, respawn_queue) + end + + defp add_players_to_respawn_queue(game_state, _game_config), do: game_state + + defp respawn_players(game_state, %{game: %{game_mode: :DEATHMATCH}} = game_config) do + now = DateTime.utc_now() |> DateTime.to_unix(:millisecond) + + players_to_respawn = + game_state.respawn_queue + |> Enum.filter(fn {_player_id, time} -> + time < now + end) + + {game_state, respawn_queue} = + Enum.reduce(players_to_respawn, {game_state, game_state.respawn_queue}, fn {player_id, _time}, + {game_state, respawn_queue} -> + new_position = Enum.random(game_config.map.initial_positions) + player = Map.get(game_state.players, player_id) |> Player.respawn_player(new_position) + broadcast_player_respawn(game_state.game_id, player_id) + {put_in(game_state, [:players, player_id], player), Map.delete(respawn_queue, player_id)} + end) + + Map.put(game_state, :respawn_queue, respawn_queue) + end + + defp respawn_players(game_state, _game_config), do: game_state + ########################## # End Helpers ########################## diff --git a/apps/arena/lib/arena/matchmaking.ex b/apps/arena/lib/arena/matchmaking.ex index 013ebba15..7a84c22fe 100644 --- a/apps/arena/lib/arena/matchmaking.ex +++ b/apps/arena/lib/arena/matchmaking.ex @@ -6,5 +6,6 @@ defmodule Arena.Matchmaking do def get_queue("battle-royale"), do: Arena.Matchmaking.GameLauncher def get_queue("pair"), do: Arena.Matchmaking.PairMode def get_queue("quick-game"), do: Arena.Matchmaking.QuickGameMode + def get_queue("deathmatch"), do: Arena.Matchmaking.DeathmatchMode def get_queue(:undefined), do: Arena.Matchmaking.GameLauncher end diff --git a/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex b/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex new file mode 100644 index 000000000..91f7dd4ac --- /dev/null +++ b/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex @@ -0,0 +1,139 @@ +defmodule Arena.Matchmaking.DeathmatchMode do + @moduledoc false + alias Arena.Utils + alias Ecto.UUID + + use GenServer + + # 3 Mins + # TODO: add this to the configurator https://github.com/lambdaclass/mirra_backend/issues/985 + @match_duration 180_000 + @respawn_time 5000 + + # Time to wait to start game with any amount of clients + @start_timeout_ms 4_000 + + # API + def start_link(_) do + GenServer.start_link(__MODULE__, [], name: __MODULE__) + end + + def join(client_id, character_name, player_name) do + GenServer.call(__MODULE__, {:join, client_id, character_name, player_name}) + end + + def leave(client_id) do + GenServer.call(__MODULE__, {:leave, client_id}) + end + + # Callbacks + @impl true + def init(_) do + Process.send_after(self(), :launch_game?, 300) + {:ok, %{clients: [], batch_start_at: 0}} + end + + @impl true + def handle_call({:join, client_id, character_name, player_name}, {from_pid, _}, %{clients: clients} = state) do + batch_start_at = maybe_make_batch_start_at(state.clients, state.batch_start_at) + + {:reply, :ok, + %{ + state + | batch_start_at: batch_start_at, + clients: clients ++ [{client_id, character_name, player_name, from_pid}] + }} + end + + def handle_call({:leave, client_id}, _, state) do + clients = Enum.reject(state.clients, fn {id, _, _, _} -> id == client_id end) + {:reply, :ok, %{state | clients: clients}} + end + + @impl true + def handle_info(:launch_game?, %{clients: clients} = state) do + Process.send_after(self(), :launch_game?, 300) + diff = System.monotonic_time(:millisecond) - state.batch_start_at + + if length(clients) >= Application.get_env(:arena, :players_needed_in_match) or + (diff >= @start_timeout_ms and length(clients) > 0) do + send(self(), :start_game) + end + + {:noreply, state} + end + + def handle_info(:start_game, state) do + {game_clients, remaining_clients} = Enum.split(state.clients, Application.get_env(:arena, :players_needed_in_match)) + create_game_for_clients(game_clients) + + {:noreply, %{state | clients: remaining_clients}} + end + + def handle_info({:spawn_bot_for_player, bot_client, game_id}, state) do + spawn(fn -> + Finch.build(:get, Utils.get_bot_connection_url(game_id, bot_client)) + |> Finch.request(Arena.Finch) + end) + + {:noreply, state} + end + + defp maybe_make_batch_start_at([], _) do + System.monotonic_time(:millisecond) + end + + defp maybe_make_batch_start_at([_ | _], batch_start_at) do + batch_start_at + end + + defp spawn_bot_for_player(bot_clients, game_id) do + Enum.each(bot_clients, fn {bot_client, _, _, _} -> + send(self(), {:spawn_bot_for_player, bot_client, game_id}) + end) + end + + defp get_bot_clients(missing_clients) do + characters = + Arena.Configuration.get_game_config() + |> Map.get(:characters) + |> Enum.filter(fn character -> character.active end) + + Enum.map(1..missing_clients//1, fn i -> + client_id = UUID.generate() + + {client_id, Enum.random(characters).name, Enum.at(Arena.Utils.bot_names(), i), nil} + end) + end + + # Receives a list of clients. + # Fills the given list with bots clients, creates a game and tells every client to join that game. + defp create_game_for_clients(clients, game_params \\ %{}) do + # We spawn bots only if there is one player + bot_clients = + case Enum.count(clients) do + 1 -> get_bot_clients(Application.get_env(:arena, :players_needed_in_match) - Enum.count(clients)) + _ -> [] + end + + {:ok, game_pid} = + GenServer.start(Arena.GameUpdater, %{ + clients: clients, + bot_clients: bot_clients, + game_params: + game_params + |> Map.put(:game_mode, :DEATHMATCH) + |> Map.put(:match_duration, @match_duration) + |> Map.put(:respawn_time, @respawn_time) + }) + + game_id = game_pid |> :erlang.term_to_binary() |> Base58.encode() + + spawn_bot_for_player(bot_clients, game_id) + + Enum.each(clients, fn {_client_id, _character_name, _player_name, from_pid} -> + Process.send(from_pid, {:join_game, game_id}, []) + Process.send(from_pid, :leave_waiting_game, []) + end) + end +end diff --git a/apps/arena/lib/arena/matchmaking/game_launcher.ex b/apps/arena/lib/arena/matchmaking/game_launcher.ex index e536f47d5..052b2c336 100644 --- a/apps/arena/lib/arena/matchmaking/game_launcher.ex +++ b/apps/arena/lib/arena/matchmaking/game_launcher.ex @@ -8,25 +8,6 @@ defmodule Arena.Matchmaking.GameLauncher do # Time to wait to start game with any amount of clients @start_timeout_ms 4_000 - @bot_names [ - "TheBlackSwordman", - "SlashJava", - "SteelBallRun", - "Jeff", - "Messi", - "Stone Ocean", - "Jeepers Creepers", - "Bob", - "El javo", - "Alberso", - "Thomas", - "Timmy", - "Pablito", - "Nicolino", - "Cangrejo", - "Mansito" - ] - # API def start_link(_) do GenServer.start_link(__MODULE__, [], name: __MODULE__) @@ -116,7 +97,7 @@ defmodule Arena.Matchmaking.GameLauncher do Enum.map(1..missing_clients//1, fn i -> client_id = UUID.generate() - {client_id, Enum.random(characters).name, Enum.at(@bot_names, i), nil} + {client_id, Enum.random(characters).name, Enum.at(Arena.Utils.bot_names(), i), nil} end) end @@ -134,7 +115,7 @@ defmodule Arena.Matchmaking.GameLauncher do GenServer.start(Arena.GameUpdater, %{ clients: clients, bot_clients: bot_clients, - game_params: game_params + game_params: game_params |> Map.put(:game_mode, :BATTLE) }) game_id = game_pid |> :erlang.term_to_binary() |> Base58.encode() diff --git a/apps/arena/lib/arena/matchmaking/pair_mode.ex b/apps/arena/lib/arena/matchmaking/pair_mode.ex index fc33786bd..6d83da787 100644 --- a/apps/arena/lib/arena/matchmaking/pair_mode.ex +++ b/apps/arena/lib/arena/matchmaking/pair_mode.ex @@ -7,25 +7,6 @@ defmodule Arena.Matchmaking.PairMode do # Time to wait to start game with any amount of clients @start_timeout_ms 10_000 - # The available names for bots to enter a match, we should change this in the future - @bot_names [ - "TheBlackSwordman", - "SlashJava", - "SteelBallRun", - "Jeff", - "Messi", - "Stone Ocean", - "Jeepers Creepers", - "Bob", - "El javo", - "Alberso", - "Thomas", - "Timmy", - "Pablito", - "Nicolino", - "Cangrejo", - "Mansito" - ] # API def start_link(_) do @@ -110,7 +91,7 @@ defmodule Arena.Matchmaking.PairMode do Enum.map(1..missing_clients//1, fn i -> client_id = UUID.generate() - {client_id, Enum.random(characters).name, Enum.at(@bot_names, i), nil} + {client_id, Enum.random(characters).name, Enum.at(Arena.Utils.bot_names(), i), nil} end) end @@ -134,7 +115,7 @@ defmodule Arena.Matchmaking.PairMode do GenServer.start(Arena.GameUpdater, %{ clients: clients, bot_clients: bot_clients, - game_params: game_params + game_params: game_params |> Map.put(:game_mode, :PAIR) }) game_id = game_pid |> :erlang.term_to_binary() |> Base58.encode() diff --git a/apps/arena/lib/arena/matchmaking/quick_game_mode.ex b/apps/arena/lib/arena/matchmaking/quick_game_mode.ex index 7a35a0b4f..7ed4309a8 100644 --- a/apps/arena/lib/arena/matchmaking/quick_game_mode.ex +++ b/apps/arena/lib/arena/matchmaking/quick_game_mode.ex @@ -5,26 +5,6 @@ defmodule Arena.Matchmaking.QuickGameMode do use GenServer - # The available names for bots to enter a match, we should change this in the future - @bot_names [ - "TheBlackSwordman", - "SlashJava", - "SteelBallRun", - "Jeff", - "Messi", - "Stone Ocean", - "Jeepers Creepers", - "Bob", - "El javo", - "Alberso", - "Thomas", - "Timmy", - "Pablito", - "Nicolino", - "Cangrejo", - "Mansito" - ] - # API def start_link(_) do GenServer.start_link(__MODULE__, [], name: __MODULE__) @@ -80,7 +60,7 @@ defmodule Arena.Matchmaking.QuickGameMode do Enum.map(1..missing_clients//1, fn i -> client_id = UUID.generate() - {client_id, Enum.random(characters).name, Enum.at(@bot_names, i), nil} + {client_id, Enum.random(characters).name, Enum.at(Arena.Utils.bot_names(), i), nil} end) end @@ -101,7 +81,7 @@ defmodule Arena.Matchmaking.QuickGameMode do GenServer.start(Arena.GameUpdater, %{ clients: clients, bot_clients: bot_clients, - game_params: game_params + game_params: game_params |> Map.put(:game_mode, :QUICK_GAME) }) game_id = game_pid |> :erlang.term_to_binary() |> Base58.encode() diff --git a/apps/arena/lib/arena/serialization/messages.pb.ex b/apps/arena/lib/arena/serialization/messages.pb.ex index cde9be837..ce9a5097f 100644 --- a/apps/arena/lib/arena/serialization/messages.pb.ex +++ b/apps/arena/lib/arena/serialization/messages.pb.ex @@ -1,7 +1,18 @@ +defmodule Arena.Serialization.GameMode do + @moduledoc false + + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + + field(:BATTLE, 0) + field(:DEATHMATCH, 1) + field(:PAIR, 2) + field(:QUICK_GAME, 3) +end + defmodule Arena.Serialization.GameStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PREPARING, 0) field(:RUNNING, 1) @@ -12,7 +23,7 @@ end defmodule Arena.Serialization.ProjectileStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PROJECTILE_STATUS_UNDEFINED, 0) field(:ACTIVE, 1) @@ -23,7 +34,7 @@ end defmodule Arena.Serialization.CrateStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:CRATE_STATUS_UNDEFINED, 0) field(:FINE, 1) @@ -33,7 +44,7 @@ end defmodule Arena.Serialization.PowerUpstatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:AVAILABLE, 0) field(:TAKEN, 1) @@ -43,7 +54,7 @@ end defmodule Arena.Serialization.PlayerActionType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:MOVING, 0) field(:STARTING_SKILL_1, 1) @@ -56,7 +67,7 @@ end defmodule Arena.Serialization.TrapStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PENDING, 0) field(:PREPARED, 1) @@ -67,7 +78,7 @@ end defmodule Arena.Serialization.PoolStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:WAITING, 0) field(:READY, 1) @@ -76,7 +87,7 @@ end defmodule Arena.Serialization.Direction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -85,7 +96,7 @@ end defmodule Arena.Serialization.Position do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -94,7 +105,7 @@ end defmodule Arena.Serialization.ListPositionPB do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:positions, 1, repeated: true, type: Arena.Serialization.Position) end @@ -102,7 +113,7 @@ end defmodule Arena.Serialization.LobbyEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -115,25 +126,25 @@ end defmodule Arena.Serialization.LeaveLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.LeftLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.JoinedLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.GameEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -152,7 +163,7 @@ end defmodule Arena.Serialization.BountySelected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty, 1, type: Arena.Serialization.BountyInfo) end @@ -160,7 +171,7 @@ end defmodule Arena.Serialization.GameFinished.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -169,7 +180,7 @@ end defmodule Arena.Serialization.GameFinished do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:winner, 1, type: Arena.Serialization.Entity) @@ -183,7 +194,7 @@ end defmodule Arena.Serialization.GameJoined do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:player_id, 1, type: :uint64, json_name: "playerId") field(:config, 2, type: Arena.Serialization.Configuration) @@ -193,7 +204,7 @@ end defmodule Arena.Serialization.Configuration do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game, 1, type: Arena.Serialization.ConfigGame) field(:map, 2, type: Arena.Serialization.ConfigMap) @@ -204,17 +215,18 @@ end defmodule Arena.Serialization.ConfigGame do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tick_rate_ms, 1, type: :float, json_name: "tickRateMs") field(:bounty_pick_time_ms, 2, type: :float, json_name: "bountyPickTimeMs") field(:start_game_time_ms, 3, type: :float, json_name: "startGameTimeMs") + field(:game_mode, 4, type: Arena.Serialization.GameMode, json_name: "gameMode", enum: true) end defmodule Arena.Serialization.ConfigMap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:name, 2, type: :string) @@ -223,7 +235,7 @@ end defmodule Arena.Serialization.ConfigCharacter.SkillsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: Arena.Serialization.ConfigSkill) @@ -232,7 +244,7 @@ end defmodule Arena.Serialization.ConfigCharacter do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:active, 2, type: :bool) @@ -253,7 +265,7 @@ end defmodule Arena.Serialization.ClientConfig do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:server_update, 1, type: Arena.Serialization.ConfigServerUpdate, json_name: "serverUpdate") end @@ -261,7 +273,7 @@ end defmodule Arena.Serialization.ConfigServerUpdate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:timestamp_difference_samples_to_check_warning, 1, type: :uint64, @@ -282,7 +294,7 @@ end defmodule Arena.Serialization.ConfigSkill do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:cooldown_ms, 2, type: :uint64, json_name: "cooldownMs") @@ -299,7 +311,7 @@ end defmodule Arena.Serialization.GameState.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -308,7 +320,7 @@ end defmodule Arena.Serialization.GameState.ProjectilesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -317,7 +329,7 @@ end defmodule Arena.Serialization.GameState.PlayerTimestampsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :int64) @@ -326,7 +338,7 @@ end defmodule Arena.Serialization.GameState.DamageTakenEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -335,7 +347,7 @@ end defmodule Arena.Serialization.GameState.DamageDoneEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -344,7 +356,7 @@ end defmodule Arena.Serialization.GameState.PowerUpsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -353,7 +365,7 @@ end defmodule Arena.Serialization.GameState.ItemsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -362,7 +374,7 @@ end defmodule Arena.Serialization.GameState.ObstaclesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -371,7 +383,7 @@ end defmodule Arena.Serialization.GameState.PoolsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -380,7 +392,7 @@ end defmodule Arena.Serialization.GameState.CratesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -389,7 +401,7 @@ end defmodule Arena.Serialization.GameState.BushesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -398,7 +410,7 @@ end defmodule Arena.Serialization.GameState.TrapsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: Arena.Serialization.Entity) @@ -407,7 +419,7 @@ end defmodule Arena.Serialization.GameState do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game_id, 1, type: :string, json_name: "gameId") field(:players, 2, repeated: true, type: Arena.Serialization.GameState.PlayersEntry, map: true) @@ -470,7 +482,7 @@ end defmodule Arena.Serialization.Entity do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:aditional_info, 0) @@ -499,7 +511,7 @@ end defmodule Arena.Serialization.Player.CooldownsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: :uint64) @@ -508,7 +520,7 @@ end defmodule Arena.Serialization.Player do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) field(:kill_count, 2, proto3_optional: true, type: :uint64, json_name: "killCount") @@ -544,7 +556,7 @@ end defmodule Arena.Serialization.Effect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:duration_ms, 2, type: :uint32, json_name: "durationMs") @@ -554,7 +566,7 @@ end defmodule Arena.Serialization.Item do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 2, proto3_optional: true, type: :string) end @@ -562,7 +574,7 @@ end defmodule Arena.Serialization.Projectile do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:damage, 1, proto3_optional: true, type: :uint64) field(:owner_id, 2, proto3_optional: true, type: :uint64, json_name: "ownerId") @@ -573,7 +585,7 @@ end defmodule Arena.Serialization.Obstacle do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:color, 1, proto3_optional: true, type: :string) field(:collisionable, 2, proto3_optional: true, type: :bool) @@ -584,7 +596,7 @@ end defmodule Arena.Serialization.PowerUp do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: Arena.Serialization.PowerUpstatus, enum: true) @@ -593,7 +605,7 @@ end defmodule Arena.Serialization.Crate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) @@ -609,7 +621,7 @@ end defmodule Arena.Serialization.Pool do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: Arena.Serialization.PoolStatus, enum: true) @@ -620,13 +632,13 @@ end defmodule Arena.Serialization.Bush do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.Trap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:name, 2, type: :string) @@ -636,7 +648,7 @@ end defmodule Arena.Serialization.PlayerAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:action, 1, type: Arena.Serialization.PlayerActionType, enum: true) field(:duration, 2, type: :uint64) @@ -647,7 +659,7 @@ end defmodule Arena.Serialization.Move do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:direction, 1, type: Arena.Serialization.Direction) end @@ -655,7 +667,7 @@ end defmodule Arena.Serialization.Attack do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill, 1, type: :string) field(:parameters, 2, type: Arena.Serialization.AttackParameters) @@ -664,7 +676,7 @@ end defmodule Arena.Serialization.AttackParameters do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target, 1, type: Arena.Serialization.Direction) end @@ -672,7 +684,7 @@ end defmodule Arena.Serialization.UseItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:item, 1, type: :uint64) end @@ -680,7 +692,7 @@ end defmodule Arena.Serialization.SelectBounty do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty_quest_id, 1, type: :string, json_name: "bountyQuestId") end @@ -688,19 +700,19 @@ end defmodule Arena.Serialization.ToggleZone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.ToggleBots do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Arena.Serialization.ChangeTickrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tickrate, 1, type: :int64) end @@ -708,7 +720,7 @@ end defmodule Arena.Serialization.GameAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:action_type, 0) @@ -737,7 +749,7 @@ end defmodule Arena.Serialization.Zone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:enabled, 2, type: :bool) @@ -748,7 +760,7 @@ end defmodule Arena.Serialization.KillEntry do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:killer_id, 1, type: :uint64, json_name: "killerId") field(:victim_id, 2, type: :uint64, json_name: "victimId") @@ -757,7 +769,7 @@ end defmodule Arena.Serialization.BountyInfo do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:description, 2, type: :string) @@ -768,7 +780,7 @@ end defmodule Arena.Serialization.CurrencyReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: :string) field(:amount, 2, type: :int64) diff --git a/apps/arena/lib/arena/utils.ex b/apps/arena/lib/arena/utils.ex index dc79d56f3..5a5bae17f 100644 --- a/apps/arena/lib/arena/utils.ex +++ b/apps/arena/lib/arena/utils.ex @@ -4,6 +4,26 @@ defmodule Arena.Utils do It contains utility functions like math functions. """ + # The available names for bots to enter a match, we should change this in the future + @bot_names [ + "TheBlackSwordman", + "SlashJava", + "SteelBallRun", + "Jeff", + "Messi", + "Stone Ocean", + "Jeepers Creepers", + "Bob", + "El javo", + "Alberso", + "Thomas", + "Timmy", + "Pablito", + "Nicolino", + "Cangrejo", + "Mansito" + ] + def normalize(%{x: 0, y: 0}) do %{x: 0, y: 0} end @@ -30,6 +50,10 @@ defmodule Arena.Utils do "#{protocol}#{bot_manager_host}/join/#{server_url}/#{game_id}/#{bot_client}" end + def bot_names() do + @bot_names + end + defp get_correct_protocol("localhost" <> _host), do: "http://" defp get_correct_protocol(_host), do: "https://" end diff --git a/apps/arena/mix.exs b/apps/arena/mix.exs index 58a35b1c3..427def626 100644 --- a/apps/arena/mix.exs +++ b/apps/arena/mix.exs @@ -4,7 +4,7 @@ defmodule Arena.MixProject do def project do [ app: :arena, - version: "0.10.1", + version: "0.11.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/arena_load_test/lib/arena_load_test/serialization/messages.pb.ex b/apps/arena_load_test/lib/arena_load_test/serialization/messages.pb.ex index ab4a654fd..b53fbca4c 100644 --- a/apps/arena_load_test/lib/arena_load_test/serialization/messages.pb.ex +++ b/apps/arena_load_test/lib/arena_load_test/serialization/messages.pb.ex @@ -1,7 +1,18 @@ +defmodule ArenaLoadTest.Serialization.GameMode do + @moduledoc false + + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + + field(:BATTLE, 0) + field(:DEATHMATCH, 1) + field(:PAIR, 2) + field(:QUICK_GAME, 3) +end + defmodule ArenaLoadTest.Serialization.GameStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PREPARING, 0) field(:RUNNING, 1) @@ -12,7 +23,7 @@ end defmodule ArenaLoadTest.Serialization.ProjectileStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PROJECTILE_STATUS_UNDEFINED, 0) field(:ACTIVE, 1) @@ -23,7 +34,7 @@ end defmodule ArenaLoadTest.Serialization.CrateStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:CRATE_STATUS_UNDEFINED, 0) field(:FINE, 1) @@ -33,7 +44,7 @@ end defmodule ArenaLoadTest.Serialization.PowerUpstatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:AVAILABLE, 0) field(:TAKEN, 1) @@ -43,7 +54,7 @@ end defmodule ArenaLoadTest.Serialization.PlayerActionType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:MOVING, 0) field(:STARTING_SKILL_1, 1) @@ -56,7 +67,7 @@ end defmodule ArenaLoadTest.Serialization.TrapStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PENDING, 0) field(:PREPARED, 1) @@ -67,7 +78,7 @@ end defmodule ArenaLoadTest.Serialization.PoolStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:WAITING, 0) field(:READY, 1) @@ -76,7 +87,7 @@ end defmodule ArenaLoadTest.Serialization.Direction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -85,7 +96,7 @@ end defmodule ArenaLoadTest.Serialization.Position do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -94,7 +105,7 @@ end defmodule ArenaLoadTest.Serialization.ListPositionPB do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:positions, 1, repeated: true, type: ArenaLoadTest.Serialization.Position) end @@ -102,7 +113,7 @@ end defmodule ArenaLoadTest.Serialization.LobbyEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -115,25 +126,25 @@ end defmodule ArenaLoadTest.Serialization.LeaveLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.LeftLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.JoinedLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.GameEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -157,7 +168,7 @@ end defmodule ArenaLoadTest.Serialization.BountySelected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty, 1, type: ArenaLoadTest.Serialization.BountyInfo) end @@ -165,7 +176,7 @@ end defmodule ArenaLoadTest.Serialization.GameFinished.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -174,7 +185,7 @@ end defmodule ArenaLoadTest.Serialization.GameFinished do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:winner, 1, type: ArenaLoadTest.Serialization.Entity) @@ -188,7 +199,7 @@ end defmodule ArenaLoadTest.Serialization.GameJoined do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:player_id, 1, type: :uint64, json_name: "playerId") field(:config, 2, type: ArenaLoadTest.Serialization.Configuration) @@ -198,7 +209,7 @@ end defmodule ArenaLoadTest.Serialization.Configuration do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game, 1, type: ArenaLoadTest.Serialization.ConfigGame) field(:map, 2, type: ArenaLoadTest.Serialization.ConfigMap) @@ -213,17 +224,23 @@ end defmodule ArenaLoadTest.Serialization.ConfigGame do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tick_rate_ms, 1, type: :float, json_name: "tickRateMs") field(:bounty_pick_time_ms, 2, type: :float, json_name: "bountyPickTimeMs") field(:start_game_time_ms, 3, type: :float, json_name: "startGameTimeMs") + + field(:game_mode, 4, + type: ArenaLoadTest.Serialization.GameMode, + json_name: "gameMode", + enum: true + ) end defmodule ArenaLoadTest.Serialization.ConfigMap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:name, 2, type: :string) @@ -232,7 +249,7 @@ end defmodule ArenaLoadTest.Serialization.ConfigCharacter.SkillsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: ArenaLoadTest.Serialization.ConfigSkill) @@ -241,7 +258,7 @@ end defmodule ArenaLoadTest.Serialization.ConfigCharacter do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:active, 2, type: :bool) @@ -262,7 +279,7 @@ end defmodule ArenaLoadTest.Serialization.ClientConfig do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:server_update, 1, type: ArenaLoadTest.Serialization.ConfigServerUpdate, @@ -273,7 +290,7 @@ end defmodule ArenaLoadTest.Serialization.ConfigServerUpdate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:timestamp_difference_samples_to_check_warning, 1, type: :uint64, @@ -294,7 +311,7 @@ end defmodule ArenaLoadTest.Serialization.ConfigSkill do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:cooldown_ms, 2, type: :uint64, json_name: "cooldownMs") @@ -311,7 +328,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -320,7 +337,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.ProjectilesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -329,7 +346,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.PlayerTimestampsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :int64) @@ -338,7 +355,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.DamageTakenEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -347,7 +364,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.DamageDoneEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -356,7 +373,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.PowerUpsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -365,7 +382,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.ItemsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -374,7 +391,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.ObstaclesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -383,7 +400,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.PoolsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -392,7 +409,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.CratesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -401,7 +418,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.BushesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -410,7 +427,7 @@ end defmodule ArenaLoadTest.Serialization.GameState.TrapsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: ArenaLoadTest.Serialization.Entity) @@ -419,7 +436,7 @@ end defmodule ArenaLoadTest.Serialization.GameState do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game_id, 1, type: :string, json_name: "gameId") @@ -512,7 +529,7 @@ end defmodule ArenaLoadTest.Serialization.Entity do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:aditional_info, 0) @@ -541,7 +558,7 @@ end defmodule ArenaLoadTest.Serialization.Player.CooldownsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: :uint64) @@ -550,7 +567,7 @@ end defmodule ArenaLoadTest.Serialization.Player do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) field(:kill_count, 2, proto3_optional: true, type: :uint64, json_name: "killCount") @@ -592,7 +609,7 @@ end defmodule ArenaLoadTest.Serialization.Effect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:duration_ms, 2, type: :uint32, json_name: "durationMs") @@ -602,7 +619,7 @@ end defmodule ArenaLoadTest.Serialization.Item do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 2, proto3_optional: true, type: :string) end @@ -610,7 +627,7 @@ end defmodule ArenaLoadTest.Serialization.Projectile do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:damage, 1, proto3_optional: true, type: :uint64) field(:owner_id, 2, proto3_optional: true, type: :uint64, json_name: "ownerId") @@ -621,7 +638,7 @@ end defmodule ArenaLoadTest.Serialization.Obstacle do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:color, 1, proto3_optional: true, type: :string) field(:collisionable, 2, proto3_optional: true, type: :bool) @@ -632,7 +649,7 @@ end defmodule ArenaLoadTest.Serialization.PowerUp do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: ArenaLoadTest.Serialization.PowerUpstatus, enum: true) @@ -641,7 +658,7 @@ end defmodule ArenaLoadTest.Serialization.Crate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) @@ -657,7 +674,7 @@ end defmodule ArenaLoadTest.Serialization.Pool do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: ArenaLoadTest.Serialization.PoolStatus, enum: true) @@ -668,13 +685,13 @@ end defmodule ArenaLoadTest.Serialization.Bush do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.Trap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:name, 2, type: :string) @@ -684,7 +701,7 @@ end defmodule ArenaLoadTest.Serialization.PlayerAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:action, 1, type: ArenaLoadTest.Serialization.PlayerActionType, enum: true) field(:duration, 2, type: :uint64) @@ -695,7 +712,7 @@ end defmodule ArenaLoadTest.Serialization.Move do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:direction, 1, type: ArenaLoadTest.Serialization.Direction) end @@ -703,7 +720,7 @@ end defmodule ArenaLoadTest.Serialization.Attack do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill, 1, type: :string) field(:parameters, 2, type: ArenaLoadTest.Serialization.AttackParameters) @@ -712,7 +729,7 @@ end defmodule ArenaLoadTest.Serialization.AttackParameters do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target, 1, type: ArenaLoadTest.Serialization.Direction) end @@ -720,7 +737,7 @@ end defmodule ArenaLoadTest.Serialization.UseItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:item, 1, type: :uint64) end @@ -728,7 +745,7 @@ end defmodule ArenaLoadTest.Serialization.SelectBounty do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty_quest_id, 1, type: :string, json_name: "bountyQuestId") end @@ -736,19 +753,19 @@ end defmodule ArenaLoadTest.Serialization.ToggleZone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.ToggleBots do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule ArenaLoadTest.Serialization.ChangeTickrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tickrate, 1, type: :int64) end @@ -756,7 +773,7 @@ end defmodule ArenaLoadTest.Serialization.GameAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:action_type, 0) @@ -794,7 +811,7 @@ end defmodule ArenaLoadTest.Serialization.Zone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:enabled, 2, type: :bool) @@ -805,7 +822,7 @@ end defmodule ArenaLoadTest.Serialization.KillEntry do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:killer_id, 1, type: :uint64, json_name: "killerId") field(:victim_id, 2, type: :uint64, json_name: "victimId") @@ -814,7 +831,7 @@ end defmodule ArenaLoadTest.Serialization.BountyInfo do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:description, 2, type: :string) @@ -825,7 +842,7 @@ end defmodule ArenaLoadTest.Serialization.CurrencyReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: :string) field(:amount, 2, type: :int64) diff --git a/apps/bot_manager/lib/protobuf/messages.pb.ex b/apps/bot_manager/lib/protobuf/messages.pb.ex index 26773cf2c..9eddf0420 100644 --- a/apps/bot_manager/lib/protobuf/messages.pb.ex +++ b/apps/bot_manager/lib/protobuf/messages.pb.ex @@ -1,7 +1,18 @@ +defmodule BotManager.Protobuf.GameMode do + @moduledoc false + + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + + field(:BATTLE, 0) + field(:DEATHMATCH, 1) + field(:PAIR, 2) + field(:QUICK_GAME, 3) +end + defmodule BotManager.Protobuf.GameStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PREPARING, 0) field(:RUNNING, 1) @@ -12,7 +23,7 @@ end defmodule BotManager.Protobuf.ProjectileStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PROJECTILE_STATUS_UNDEFINED, 0) field(:ACTIVE, 1) @@ -23,7 +34,7 @@ end defmodule BotManager.Protobuf.CrateStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:CRATE_STATUS_UNDEFINED, 0) field(:FINE, 1) @@ -33,7 +44,7 @@ end defmodule BotManager.Protobuf.PowerUpstatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:AVAILABLE, 0) field(:TAKEN, 1) @@ -43,7 +54,7 @@ end defmodule BotManager.Protobuf.PlayerActionType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:MOVING, 0) field(:STARTING_SKILL_1, 1) @@ -56,7 +67,7 @@ end defmodule BotManager.Protobuf.TrapStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PENDING, 0) field(:PREPARED, 1) @@ -67,7 +78,7 @@ end defmodule BotManager.Protobuf.PoolStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:WAITING, 0) field(:READY, 1) @@ -76,7 +87,7 @@ end defmodule BotManager.Protobuf.Direction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -85,7 +96,7 @@ end defmodule BotManager.Protobuf.Position do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -94,7 +105,7 @@ end defmodule BotManager.Protobuf.ListPositionPB do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:positions, 1, repeated: true, type: BotManager.Protobuf.Position) end @@ -102,7 +113,7 @@ end defmodule BotManager.Protobuf.LobbyEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -115,25 +126,25 @@ end defmodule BotManager.Protobuf.LeaveLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.LeftLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.JoinedLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.GameEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -152,7 +163,7 @@ end defmodule BotManager.Protobuf.BountySelected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty, 1, type: BotManager.Protobuf.BountyInfo) end @@ -160,7 +171,7 @@ end defmodule BotManager.Protobuf.GameFinished.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -169,7 +180,7 @@ end defmodule BotManager.Protobuf.GameFinished do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:winner, 1, type: BotManager.Protobuf.Entity) @@ -183,7 +194,7 @@ end defmodule BotManager.Protobuf.GameJoined do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:player_id, 1, type: :uint64, json_name: "playerId") field(:config, 2, type: BotManager.Protobuf.Configuration) @@ -193,7 +204,7 @@ end defmodule BotManager.Protobuf.Configuration do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game, 1, type: BotManager.Protobuf.ConfigGame) field(:map, 2, type: BotManager.Protobuf.ConfigMap) @@ -204,17 +215,18 @@ end defmodule BotManager.Protobuf.ConfigGame do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tick_rate_ms, 1, type: :float, json_name: "tickRateMs") field(:bounty_pick_time_ms, 2, type: :float, json_name: "bountyPickTimeMs") field(:start_game_time_ms, 3, type: :float, json_name: "startGameTimeMs") + field(:game_mode, 4, type: BotManager.Protobuf.GameMode, json_name: "gameMode", enum: true) end defmodule BotManager.Protobuf.ConfigMap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:name, 2, type: :string) @@ -223,7 +235,7 @@ end defmodule BotManager.Protobuf.ConfigCharacter.SkillsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: BotManager.Protobuf.ConfigSkill) @@ -232,7 +244,7 @@ end defmodule BotManager.Protobuf.ConfigCharacter do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:active, 2, type: :bool) @@ -253,7 +265,7 @@ end defmodule BotManager.Protobuf.ClientConfig do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:server_update, 1, type: BotManager.Protobuf.ConfigServerUpdate, json_name: "serverUpdate") end @@ -261,7 +273,7 @@ end defmodule BotManager.Protobuf.ConfigServerUpdate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:timestamp_difference_samples_to_check_warning, 1, type: :uint64, @@ -282,7 +294,7 @@ end defmodule BotManager.Protobuf.ConfigSkill do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:cooldown_ms, 2, type: :uint64, json_name: "cooldownMs") @@ -299,7 +311,7 @@ end defmodule BotManager.Protobuf.GameState.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -308,7 +320,7 @@ end defmodule BotManager.Protobuf.GameState.ProjectilesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -317,7 +329,7 @@ end defmodule BotManager.Protobuf.GameState.PlayerTimestampsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :int64) @@ -326,7 +338,7 @@ end defmodule BotManager.Protobuf.GameState.DamageTakenEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -335,7 +347,7 @@ end defmodule BotManager.Protobuf.GameState.DamageDoneEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -344,7 +356,7 @@ end defmodule BotManager.Protobuf.GameState.PowerUpsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -353,7 +365,7 @@ end defmodule BotManager.Protobuf.GameState.ItemsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -362,7 +374,7 @@ end defmodule BotManager.Protobuf.GameState.ObstaclesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -371,7 +383,7 @@ end defmodule BotManager.Protobuf.GameState.PoolsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -380,7 +392,7 @@ end defmodule BotManager.Protobuf.GameState.CratesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -389,7 +401,7 @@ end defmodule BotManager.Protobuf.GameState.BushesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -398,7 +410,7 @@ end defmodule BotManager.Protobuf.GameState.TrapsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: BotManager.Protobuf.Entity) @@ -407,7 +419,7 @@ end defmodule BotManager.Protobuf.GameState do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game_id, 1, type: :string, json_name: "gameId") field(:players, 2, repeated: true, type: BotManager.Protobuf.GameState.PlayersEntry, map: true) @@ -470,7 +482,7 @@ end defmodule BotManager.Protobuf.Entity do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:aditional_info, 0) @@ -499,7 +511,7 @@ end defmodule BotManager.Protobuf.Player.CooldownsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: :uint64) @@ -508,7 +520,7 @@ end defmodule BotManager.Protobuf.Player do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) field(:kill_count, 2, proto3_optional: true, type: :uint64, json_name: "killCount") @@ -544,7 +556,7 @@ end defmodule BotManager.Protobuf.Effect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:duration_ms, 2, type: :uint32, json_name: "durationMs") @@ -554,7 +566,7 @@ end defmodule BotManager.Protobuf.Item do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 2, proto3_optional: true, type: :string) end @@ -562,7 +574,7 @@ end defmodule BotManager.Protobuf.Projectile do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:damage, 1, proto3_optional: true, type: :uint64) field(:owner_id, 2, proto3_optional: true, type: :uint64, json_name: "ownerId") @@ -573,7 +585,7 @@ end defmodule BotManager.Protobuf.Obstacle do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:color, 1, proto3_optional: true, type: :string) field(:collisionable, 2, proto3_optional: true, type: :bool) @@ -584,7 +596,7 @@ end defmodule BotManager.Protobuf.PowerUp do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: BotManager.Protobuf.PowerUpstatus, enum: true) @@ -593,7 +605,7 @@ end defmodule BotManager.Protobuf.Crate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) @@ -609,7 +621,7 @@ end defmodule BotManager.Protobuf.Pool do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: BotManager.Protobuf.PoolStatus, enum: true) @@ -620,13 +632,13 @@ end defmodule BotManager.Protobuf.Bush do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.Trap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:name, 2, type: :string) @@ -636,7 +648,7 @@ end defmodule BotManager.Protobuf.PlayerAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:action, 1, type: BotManager.Protobuf.PlayerActionType, enum: true) field(:duration, 2, type: :uint64) @@ -647,7 +659,7 @@ end defmodule BotManager.Protobuf.Move do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:direction, 1, type: BotManager.Protobuf.Direction) end @@ -655,7 +667,7 @@ end defmodule BotManager.Protobuf.Attack do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill, 1, type: :string) field(:parameters, 2, type: BotManager.Protobuf.AttackParameters) @@ -664,7 +676,7 @@ end defmodule BotManager.Protobuf.AttackParameters do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target, 1, type: BotManager.Protobuf.Direction) end @@ -672,7 +684,7 @@ end defmodule BotManager.Protobuf.UseItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:item, 1, type: :uint64) end @@ -680,7 +692,7 @@ end defmodule BotManager.Protobuf.SelectBounty do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty_quest_id, 1, type: :string, json_name: "bountyQuestId") end @@ -688,19 +700,19 @@ end defmodule BotManager.Protobuf.ToggleZone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.ToggleBots do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule BotManager.Protobuf.ChangeTickrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tickrate, 1, type: :int64) end @@ -708,7 +720,7 @@ end defmodule BotManager.Protobuf.GameAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:action_type, 0) @@ -737,7 +749,7 @@ end defmodule BotManager.Protobuf.Zone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:enabled, 2, type: :bool) @@ -748,7 +760,7 @@ end defmodule BotManager.Protobuf.KillEntry do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:killer_id, 1, type: :uint64, json_name: "killerId") field(:victim_id, 2, type: :uint64, json_name: "victimId") @@ -757,7 +769,7 @@ end defmodule BotManager.Protobuf.BountyInfo do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:description, 2, type: :string) @@ -768,7 +780,7 @@ end defmodule BotManager.Protobuf.CurrencyReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: :string) field(:amount, 2, type: :int64) diff --git a/apps/game_client/assets/js/protobuf/messages_pb.js b/apps/game_client/assets/js/protobuf/messages_pb.js index 3bb44d878..c7d869b8e 100644 --- a/apps/game_client/assets/js/protobuf/messages_pb.js +++ b/apps/game_client/assets/js/protobuf/messages_pb.js @@ -47,6 +47,7 @@ goog.exportSymbol('proto.GameEvent', null, global); goog.exportSymbol('proto.GameEvent.EventCase', null, global); goog.exportSymbol('proto.GameFinished', null, global); goog.exportSymbol('proto.GameJoined', null, global); +goog.exportSymbol('proto.GameMode', null, global); goog.exportSymbol('proto.GameState', null, global); goog.exportSymbol('proto.GameStatus', null, global); goog.exportSymbol('proto.Item', null, global); @@ -3495,7 +3496,8 @@ proto.ConfigGame.toObject = function(includeInstance, msg) { var f, obj = { tickRateMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), bountyPickTimeMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0), - startGameTimeMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0) + startGameTimeMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), + gameMode: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { @@ -3544,6 +3546,10 @@ proto.ConfigGame.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {number} */ (reader.readFloat()); msg.setStartGameTimeMs(value); break; + case 4: + var value = /** @type {!proto.GameMode} */ (reader.readEnum()); + msg.setGameMode(value); + break; default: reader.skipField(); break; @@ -3594,6 +3600,13 @@ proto.ConfigGame.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getGameMode(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } }; @@ -3651,6 +3664,24 @@ proto.ConfigGame.prototype.setStartGameTimeMs = function(value) { }; +/** + * optional GameMode game_mode = 4; + * @return {!proto.GameMode} + */ +proto.ConfigGame.prototype.getGameMode = function() { + return /** @type {!proto.GameMode} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.GameMode} value + * @return {!proto.ConfigGame} returns this + */ +proto.ConfigGame.prototype.setGameMode = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + @@ -12355,6 +12386,16 @@ proto.CurrencyReward.prototype.setAmount = function(value) { }; +/** + * @enum {number} + */ +proto.GameMode = { + BATTLE: 0, + DEATHMATCH: 1, + PAIR: 2, + QUICK_GAME: 3 +}; + /** * @enum {number} */ diff --git a/apps/game_client/lib/game_client/protobuf/messages.pb.ex b/apps/game_client/lib/game_client/protobuf/messages.pb.ex index 5fc21af4c..e9b3ef553 100644 --- a/apps/game_client/lib/game_client/protobuf/messages.pb.ex +++ b/apps/game_client/lib/game_client/protobuf/messages.pb.ex @@ -1,7 +1,18 @@ +defmodule GameClient.Protobuf.GameMode do + @moduledoc false + + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + + field(:BATTLE, 0) + field(:DEATHMATCH, 1) + field(:PAIR, 2) + field(:QUICK_GAME, 3) +end + defmodule GameClient.Protobuf.GameStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PREPARING, 0) field(:RUNNING, 1) @@ -12,7 +23,7 @@ end defmodule GameClient.Protobuf.ProjectileStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PROJECTILE_STATUS_UNDEFINED, 0) field(:ACTIVE, 1) @@ -23,7 +34,7 @@ end defmodule GameClient.Protobuf.CrateStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:CRATE_STATUS_UNDEFINED, 0) field(:FINE, 1) @@ -33,7 +44,7 @@ end defmodule GameClient.Protobuf.PowerUpstatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:AVAILABLE, 0) field(:TAKEN, 1) @@ -43,7 +54,7 @@ end defmodule GameClient.Protobuf.PlayerActionType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:MOVING, 0) field(:STARTING_SKILL_1, 1) @@ -56,7 +67,7 @@ end defmodule GameClient.Protobuf.TrapStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:PENDING, 0) field(:PREPARED, 1) @@ -67,7 +78,7 @@ end defmodule GameClient.Protobuf.PoolStatus do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:WAITING, 0) field(:READY, 1) @@ -76,7 +87,7 @@ end defmodule GameClient.Protobuf.Direction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -85,7 +96,7 @@ end defmodule GameClient.Protobuf.Position do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:x, 1, proto3_optional: true, type: :float) field(:y, 2, proto3_optional: true, type: :float) @@ -94,7 +105,7 @@ end defmodule GameClient.Protobuf.ListPositionPB do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:positions, 1, repeated: true, type: GameClient.Protobuf.Position) end @@ -102,7 +113,7 @@ end defmodule GameClient.Protobuf.LobbyEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -115,25 +126,25 @@ end defmodule GameClient.Protobuf.LeaveLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.LeftLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.JoinedLobby do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.GameEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:event, 0) @@ -152,7 +163,7 @@ end defmodule GameClient.Protobuf.BountySelected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty, 1, type: GameClient.Protobuf.BountyInfo) end @@ -160,7 +171,7 @@ end defmodule GameClient.Protobuf.GameFinished.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -169,7 +180,7 @@ end defmodule GameClient.Protobuf.GameFinished do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:winner, 1, type: GameClient.Protobuf.Entity) @@ -183,7 +194,7 @@ end defmodule GameClient.Protobuf.GameJoined do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:player_id, 1, type: :uint64, json_name: "playerId") field(:config, 2, type: GameClient.Protobuf.Configuration) @@ -193,7 +204,7 @@ end defmodule GameClient.Protobuf.Configuration do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game, 1, type: GameClient.Protobuf.ConfigGame) field(:map, 2, type: GameClient.Protobuf.ConfigMap) @@ -204,17 +215,18 @@ end defmodule GameClient.Protobuf.ConfigGame do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tick_rate_ms, 1, type: :float, json_name: "tickRateMs") field(:bounty_pick_time_ms, 2, type: :float, json_name: "bountyPickTimeMs") field(:start_game_time_ms, 3, type: :float, json_name: "startGameTimeMs") + field(:game_mode, 4, type: GameClient.Protobuf.GameMode, json_name: "gameMode", enum: true) end defmodule GameClient.Protobuf.ConfigMap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:name, 2, type: :string) @@ -223,7 +235,7 @@ end defmodule GameClient.Protobuf.ConfigCharacter.SkillsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: GameClient.Protobuf.ConfigSkill) @@ -232,7 +244,7 @@ end defmodule GameClient.Protobuf.ConfigCharacter do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:active, 2, type: :bool) @@ -253,7 +265,7 @@ end defmodule GameClient.Protobuf.ClientConfig do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:server_update, 1, type: GameClient.Protobuf.ConfigServerUpdate, json_name: "serverUpdate") end @@ -261,7 +273,7 @@ end defmodule GameClient.Protobuf.ConfigServerUpdate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:timestamp_difference_samples_to_check_warning, 1, type: :uint64, @@ -282,7 +294,7 @@ end defmodule GameClient.Protobuf.ConfigSkill do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:cooldown_ms, 2, type: :uint64, json_name: "cooldownMs") @@ -299,7 +311,7 @@ end defmodule GameClient.Protobuf.GameState.PlayersEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -308,7 +320,7 @@ end defmodule GameClient.Protobuf.GameState.ProjectilesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -317,7 +329,7 @@ end defmodule GameClient.Protobuf.GameState.PlayerTimestampsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :int64) @@ -326,7 +338,7 @@ end defmodule GameClient.Protobuf.GameState.DamageTakenEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -335,7 +347,7 @@ end defmodule GameClient.Protobuf.GameState.DamageDoneEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: :uint64) @@ -344,7 +356,7 @@ end defmodule GameClient.Protobuf.GameState.PowerUpsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -353,7 +365,7 @@ end defmodule GameClient.Protobuf.GameState.ItemsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -362,7 +374,7 @@ end defmodule GameClient.Protobuf.GameState.ObstaclesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -371,7 +383,7 @@ end defmodule GameClient.Protobuf.GameState.PoolsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -380,7 +392,7 @@ end defmodule GameClient.Protobuf.GameState.CratesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -389,7 +401,7 @@ end defmodule GameClient.Protobuf.GameState.BushesEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -398,7 +410,7 @@ end defmodule GameClient.Protobuf.GameState.TrapsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :uint64) field(:value, 2, type: GameClient.Protobuf.Entity) @@ -407,7 +419,7 @@ end defmodule GameClient.Protobuf.GameState do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:game_id, 1, type: :string, json_name: "gameId") field(:players, 2, repeated: true, type: GameClient.Protobuf.GameState.PlayersEntry, map: true) @@ -470,7 +482,7 @@ end defmodule GameClient.Protobuf.Entity do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:aditional_info, 0) @@ -499,7 +511,7 @@ end defmodule GameClient.Protobuf.Player.CooldownsEntry do @moduledoc false - use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:key, 1, type: :string) field(:value, 2, type: :uint64) @@ -508,7 +520,7 @@ end defmodule GameClient.Protobuf.Player do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) field(:kill_count, 2, proto3_optional: true, type: :uint64, json_name: "killCount") @@ -544,7 +556,7 @@ end defmodule GameClient.Protobuf.Effect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:duration_ms, 2, type: :uint32, json_name: "durationMs") @@ -554,7 +566,7 @@ end defmodule GameClient.Protobuf.Item do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 2, proto3_optional: true, type: :string) end @@ -562,7 +574,7 @@ end defmodule GameClient.Protobuf.Projectile do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:damage, 1, proto3_optional: true, type: :uint64) field(:owner_id, 2, proto3_optional: true, type: :uint64, json_name: "ownerId") @@ -573,7 +585,7 @@ end defmodule GameClient.Protobuf.Obstacle do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:color, 1, proto3_optional: true, type: :string) field(:collisionable, 2, proto3_optional: true, type: :bool) @@ -584,7 +596,7 @@ end defmodule GameClient.Protobuf.PowerUp do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: GameClient.Protobuf.PowerUpstatus, enum: true) @@ -593,7 +605,7 @@ end defmodule GameClient.Protobuf.Crate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:health, 1, proto3_optional: true, type: :uint64) @@ -609,7 +621,7 @@ end defmodule GameClient.Protobuf.Pool do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:status, 2, type: GameClient.Protobuf.PoolStatus, enum: true) @@ -620,13 +632,13 @@ end defmodule GameClient.Protobuf.Bush do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.Trap do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:owner_id, 1, type: :uint64, json_name: "ownerId") field(:name, 2, type: :string) @@ -636,7 +648,7 @@ end defmodule GameClient.Protobuf.PlayerAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:action, 1, type: GameClient.Protobuf.PlayerActionType, enum: true) field(:duration, 2, type: :uint64) @@ -647,7 +659,7 @@ end defmodule GameClient.Protobuf.Move do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:direction, 1, type: GameClient.Protobuf.Direction) end @@ -655,7 +667,7 @@ end defmodule GameClient.Protobuf.Attack do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill, 1, type: :string) field(:parameters, 2, type: GameClient.Protobuf.AttackParameters) @@ -664,7 +676,7 @@ end defmodule GameClient.Protobuf.AttackParameters do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target, 1, type: GameClient.Protobuf.Direction) end @@ -672,7 +684,7 @@ end defmodule GameClient.Protobuf.UseItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:item, 1, type: :uint64) end @@ -680,7 +692,7 @@ end defmodule GameClient.Protobuf.SelectBounty do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:bounty_quest_id, 1, type: :string, json_name: "bountyQuestId") end @@ -688,19 +700,19 @@ end defmodule GameClient.Protobuf.ToggleZone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.ToggleBots do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule GameClient.Protobuf.ChangeTickrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:tickrate, 1, type: :int64) end @@ -708,7 +720,7 @@ end defmodule GameClient.Protobuf.GameAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:action_type, 0) @@ -737,7 +749,7 @@ end defmodule GameClient.Protobuf.Zone do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:radius, 1, type: :float) field(:enabled, 2, type: :bool) @@ -748,7 +760,7 @@ end defmodule GameClient.Protobuf.KillEntry do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:killer_id, 1, type: :uint64, json_name: "killerId") field(:victim_id, 2, type: :uint64, json_name: "victimId") @@ -757,7 +769,7 @@ end defmodule GameClient.Protobuf.BountyInfo do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:description, 2, type: :string) @@ -768,7 +780,7 @@ end defmodule GameClient.Protobuf.CurrencyReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: :string) field(:amount, 2, type: :int64) diff --git a/apps/game_client/lib/game_client_web/controllers/page_html/home.html.heex b/apps/game_client/lib/game_client_web/controllers/page_html/home.html.heex index 2fc9caf59..9dcd94527 100644 --- a/apps/game_client/lib/game_client_web/controllers/page_html/home.html.heex +++ b/apps/game_client/lib/game_client_web/controllers/page_html/home.html.heex @@ -5,6 +5,7 @@ <.button type="submit" name="game_mode" value="battle-royale">Play Battle Royal <.button type="submit" name="game_mode" value="pair">Play Pair <.button type="submit" name="game_mode" value="quick-game">Quick Game + <.button type="submit" name="game_mode" value="deathmatch">Deathmatch

Logged in as user_id: <%= @current_user_id %>

diff --git a/apps/gateway/lib/gateway/serialization/gateway.pb.ex b/apps/gateway/lib/gateway/serialization/gateway.pb.ex index ce2513534..8af57a62e 100644 --- a/apps/gateway/lib/gateway/serialization/gateway.pb.ex +++ b/apps/gateway/lib/gateway/serialization/gateway.pb.ex @@ -1,7 +1,7 @@ defmodule Gateway.Serialization.SkillActionType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:ANIMATION_START, 0) field(:EFFECT_TRIGGER, 1) @@ -12,7 +12,7 @@ end defmodule Gateway.Serialization.Stat do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:HEALTH, 0) field(:ENERGY, 1) @@ -25,7 +25,7 @@ end defmodule Gateway.Serialization.WebSocketRequest do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:request_type, 0) @@ -127,7 +127,7 @@ end defmodule Gateway.Serialization.GetUser do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -135,7 +135,7 @@ end defmodule Gateway.Serialization.GetUserByUsername do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:username, 1, type: :string) end @@ -143,7 +143,7 @@ end defmodule Gateway.Serialization.CreateUser do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:username, 1, type: :string) end @@ -151,7 +151,7 @@ end defmodule Gateway.Serialization.GetCampaigns do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -159,7 +159,7 @@ end defmodule Gateway.Serialization.GetCampaign do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:campaign_id, 2, type: :string, json_name: "campaignId") @@ -168,7 +168,7 @@ end defmodule Gateway.Serialization.GetLevel do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:level_id, 2, type: :string, json_name: "levelId") @@ -177,7 +177,7 @@ end defmodule Gateway.Serialization.FightLevel do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:level_id, 2, type: :string, json_name: "levelId") @@ -186,7 +186,7 @@ end defmodule Gateway.Serialization.SelectUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:unit_id, 2, type: :string, json_name: "unitId") @@ -196,7 +196,7 @@ end defmodule Gateway.Serialization.UnselectUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:unit_id, 2, type: :string, json_name: "unitId") @@ -205,7 +205,7 @@ end defmodule Gateway.Serialization.LevelUpUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:unit_id, 2, type: :string, json_name: "unitId") @@ -214,7 +214,7 @@ end defmodule Gateway.Serialization.TierUpUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:unit_id, 2, type: :string, json_name: "unitId") @@ -223,7 +223,7 @@ end defmodule Gateway.Serialization.FuseUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:unit_id, 2, type: :string, json_name: "unitId") @@ -233,7 +233,7 @@ end defmodule Gateway.Serialization.EquipItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:item_id, 2, type: :string, json_name: "itemId") @@ -243,7 +243,7 @@ end defmodule Gateway.Serialization.UnequipItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:item_id, 2, type: :string, json_name: "itemId") @@ -252,7 +252,7 @@ end defmodule Gateway.Serialization.GetItem do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:item_id, 2, type: :string, json_name: "itemId") @@ -261,7 +261,7 @@ end defmodule Gateway.Serialization.FuseItems do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:item_ids, 2, repeated: true, type: :string, json_name: "itemIds") @@ -270,7 +270,7 @@ end defmodule Gateway.Serialization.GetKalineAfkRewards do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -278,7 +278,7 @@ end defmodule Gateway.Serialization.ClaimKalineAfkRewards do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -286,7 +286,7 @@ end defmodule Gateway.Serialization.GetBoxes do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -294,7 +294,7 @@ end defmodule Gateway.Serialization.GetBox do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:box_id, 1, type: :string, json_name: "boxId") end @@ -302,7 +302,7 @@ end defmodule Gateway.Serialization.Summon do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:box_id, 2, type: :string, json_name: "boxId") @@ -311,7 +311,7 @@ end defmodule Gateway.Serialization.GetUserSuperCampaignProgresses do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -319,7 +319,7 @@ end defmodule Gateway.Serialization.LevelUpKalineTree do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -327,7 +327,7 @@ end defmodule Gateway.Serialization.ClaimDungeonAfkRewards do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -335,7 +335,7 @@ end defmodule Gateway.Serialization.LevelUpDungeonSettlement do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") end @@ -343,7 +343,7 @@ end defmodule Gateway.Serialization.PurchaseDungeonUpgrade do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:upgrade_id, 2, type: :string, json_name: "upgradeId") @@ -352,7 +352,7 @@ end defmodule Gateway.Serialization.WebSocketResponse do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:response_type, 0) @@ -403,7 +403,7 @@ end defmodule Gateway.Serialization.User do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:username, 2, type: :string) @@ -429,7 +429,7 @@ end defmodule Gateway.Serialization.KalineTreeLevel do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:level, 2, type: :uint64) @@ -447,7 +447,7 @@ end defmodule Gateway.Serialization.DungeonSettlementLevel do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:level, 2, type: :uint64) @@ -472,7 +472,7 @@ end defmodule Gateway.Serialization.SuperCampaignProgresses do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:super_campaign_progresses, 1, repeated: true, @@ -484,7 +484,7 @@ end defmodule Gateway.Serialization.SuperCampaignProgress do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user_id, 1, type: :string, json_name: "userId") field(:campaign_id, 2, type: :string, json_name: "campaignId") @@ -495,7 +495,7 @@ end defmodule Gateway.Serialization.AfkRewardRate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:kaline_tree_level_id, 1, type: :string, json_name: "kalineTreeLevelId") field(:currency, 2, type: Gateway.Serialization.Currency) @@ -505,7 +505,7 @@ end defmodule Gateway.Serialization.UserCurrency do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: Gateway.Serialization.Currency) field(:amount, 2, type: :uint32) @@ -514,7 +514,7 @@ end defmodule Gateway.Serialization.Currency do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) end @@ -522,7 +522,7 @@ end defmodule Gateway.Serialization.Unit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:level, 2, type: :uint32) @@ -539,7 +539,7 @@ end defmodule Gateway.Serialization.Units do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:units, 1, repeated: true, type: Gateway.Serialization.Unit) end @@ -547,7 +547,7 @@ end defmodule Gateway.Serialization.UnitAndCurrencies do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:unit, 1, type: Gateway.Serialization.Unit) @@ -561,7 +561,7 @@ end defmodule Gateway.Serialization.Character do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:active, 1, type: :bool) field(:name, 2, type: :string) @@ -572,7 +572,7 @@ end defmodule Gateway.Serialization.Item do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:level, 2, type: :uint32) @@ -584,7 +584,7 @@ end defmodule Gateway.Serialization.ItemTemplate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:name, 2, type: :string) @@ -605,7 +605,7 @@ end defmodule Gateway.Serialization.ItemModifier do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:attribute, 1, type: :string) field(:value, 2, type: :float) @@ -615,7 +615,7 @@ end defmodule Gateway.Serialization.Campaigns do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:campaigns, 1, repeated: true, type: Gateway.Serialization.Campaign) end @@ -623,7 +623,7 @@ end defmodule Gateway.Serialization.Campaign do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:super_campaign_name, 2, type: :string, json_name: "superCampaignName") @@ -634,7 +634,7 @@ end defmodule Gateway.Serialization.Level do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:campaign_id, 2, type: :string, json_name: "campaignId") @@ -661,7 +661,7 @@ end defmodule Gateway.Serialization.CurrencyReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: Gateway.Serialization.Currency) field(:amount, 3, type: :uint64) @@ -670,7 +670,7 @@ end defmodule Gateway.Serialization.AfkRewards do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:afk_rewards, 1, repeated: true, @@ -682,7 +682,7 @@ end defmodule Gateway.Serialization.AfkReward do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: Gateway.Serialization.Currency) field(:amount, 2, type: :uint64) @@ -691,7 +691,7 @@ end defmodule Gateway.Serialization.Error do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:reason, 1, type: :string) end @@ -699,7 +699,7 @@ end defmodule Gateway.Serialization.Boxes do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:boxes, 1, repeated: true, type: Gateway.Serialization.Box) end @@ -707,7 +707,7 @@ end defmodule Gateway.Serialization.Box do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:name, 2, type: :string) @@ -726,7 +726,7 @@ end defmodule Gateway.Serialization.RankWeights do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:rank, 1, type: :int32) field(:weight, 2, type: :int32) @@ -735,7 +735,7 @@ end defmodule Gateway.Serialization.CurrencyCost do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:currency, 1, type: Gateway.Serialization.Currency) field(:amount, 2, type: :int32) @@ -744,7 +744,7 @@ end defmodule Gateway.Serialization.UserAndUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:user, 1, type: Gateway.Serialization.User) field(:unit, 2, type: Gateway.Serialization.Unit) @@ -753,7 +753,7 @@ end defmodule Gateway.Serialization.Unlock do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:upgrade, 2, type: Gateway.Serialization.Upgrade) @@ -762,7 +762,7 @@ end defmodule Gateway.Serialization.Upgrade do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:name, 1, type: :string) field(:description, 2, type: :string) @@ -774,7 +774,7 @@ end defmodule Gateway.Serialization.Buff do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:attribute, 1, type: :string) field(:value, 2, type: :float) @@ -784,7 +784,7 @@ end defmodule Gateway.Serialization.BattleResult do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:initial_state, 1, type: Gateway.Serialization.State, json_name: "initialState") field(:steps, 2, repeated: true, type: Gateway.Serialization.Step) @@ -794,7 +794,7 @@ end defmodule Gateway.Serialization.State do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:units, 1, repeated: true, type: Gateway.Serialization.BattleUnit) end @@ -802,7 +802,7 @@ end defmodule Gateway.Serialization.BattleUnit do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:id, 1, type: :string) field(:health, 2, type: :int32) @@ -814,7 +814,7 @@ end defmodule Gateway.Serialization.Step do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:step_number, 1, type: :int32, json_name: "stepNumber") field(:actions, 2, repeated: true, type: Gateway.Serialization.Action) @@ -823,7 +823,7 @@ end defmodule Gateway.Serialization.Action do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" oneof(:action_type, 0) @@ -876,7 +876,7 @@ end defmodule Gateway.Serialization.StatAffected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:stat, 1, type: Gateway.Serialization.Stat, enum: true) field(:amount, 2, type: :float) @@ -885,7 +885,7 @@ end defmodule Gateway.Serialization.SkillAction do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:caster_id, 1, type: :string, json_name: "casterId") field(:target_ids, 2, repeated: true, type: :string, json_name: "targetIds") @@ -901,7 +901,7 @@ end defmodule Gateway.Serialization.ExecutionReceived do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target_id, 1, type: :string, json_name: "targetId") field(:stat_affected, 2, type: Gateway.Serialization.StatAffected, json_name: "statAffected") @@ -910,7 +910,7 @@ end defmodule Gateway.Serialization.ModifierReceived do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill_id, 1, type: :string, json_name: "skillId") field(:target_id, 2, type: :string, json_name: "targetId") @@ -921,7 +921,7 @@ end defmodule Gateway.Serialization.TagReceived do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill_id, 1, type: :string, json_name: "skillId") field(:target_id, 2, type: :string, json_name: "targetId") @@ -931,7 +931,7 @@ end defmodule Gateway.Serialization.ModifierExpired do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill_id, 1, type: :string, json_name: "skillId") field(:target_id, 2, type: :string, json_name: "targetId") @@ -942,7 +942,7 @@ end defmodule Gateway.Serialization.TagExpired do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:skill_id, 1, type: :string, json_name: "skillId") field(:target_id, 2, type: :string, json_name: "targetId") @@ -952,7 +952,7 @@ end defmodule Gateway.Serialization.Death do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:unit_id, 1, type: :string, json_name: "unitId") end @@ -960,7 +960,7 @@ end defmodule Gateway.Serialization.EnergyRegen do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target_id, 1, type: :string, json_name: "targetId") field(:skill_id, 2, type: :string, json_name: "skillId") @@ -970,7 +970,7 @@ end defmodule Gateway.Serialization.StatOverride do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" field(:target_id, 1, type: :string, json_name: "targetId") field(:stat_affected, 2, type: Gateway.Serialization.StatAffected, json_name: "statAffected") diff --git a/apps/serialization/messages.proto b/apps/serialization/messages.proto index 1704a9a89..966fc70f3 100644 --- a/apps/serialization/messages.proto +++ b/apps/serialization/messages.proto @@ -69,10 +69,18 @@ message Configuration { ClientConfig client_config = 4; } +enum GameMode{ + BATTLE = 0; + DEATHMATCH = 1; + PAIR = 2; + QUICK_GAME = 3; +} + message ConfigGame { float tick_rate_ms = 1; float bounty_pick_time_ms = 2; float start_game_time_ms = 3; + GameMode game_mode = 4; } message ConfigMap { From b48ba481f2976b28c38268d504a5c99f5799a387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Sanchez?= Date: Thu, 28 Nov 2024 17:37:34 -0300 Subject: [PATCH 3/4] Unblock player action inputs when dash/leap are finished (#995) Co-authored-by: Manuel Camejo --- apps/arena/lib/arena/game/player.ex | 8 +++++++- apps/arena/lib/arena/game_updater.ex | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/arena/lib/arena/game/player.ex b/apps/arena/lib/arena/game/player.ex index 2e0181240..e836124e0 100644 --- a/apps/arena/lib/arena/game/player.ex +++ b/apps/arena/lib/arena/game/player.ex @@ -235,7 +235,13 @@ defmodule Arena.Game.Player do end execution_duration = calculate_duration(skill, player.position, skill_direction, auto_aim?) - Process.send_after(self(), {:block_actions, player.id, false}, execution_duration) + + # For dash and leaps, we rely the unblock action message to their stop action callbacks + is_dash_or_leap? = Enum.any?(skill.mechanics, fn mechanic -> mechanic.type in ["leap", "dash"] end) + + unless is_dash_or_leap? do + Process.send_after(self(), {:block_actions, player.id, false}, execution_duration) + end if skill.block_movement do send(self(), {:block_movement, player.id, true}) diff --git a/apps/arena/lib/arena/game_updater.ex b/apps/arena/lib/arena/game_updater.ex index 2743991ba..a4305fa53 100644 --- a/apps/arena/lib/arena/game_updater.ex +++ b/apps/arena/lib/arena/game_updater.ex @@ -409,6 +409,9 @@ defmodule Arena.GameUpdater do Map.get(state.game_state.players, player_id) |> Player.reset_forced_movement(previous_speed) + # Dash finished, we unblock the actions. + broadcast_player_block_actions(state.game_state.game_id, player_id, false) + state = put_in(state, [:game_state, :players, player_id], player) {:noreply, state} end @@ -422,6 +425,9 @@ defmodule Arena.GameUpdater do put_in(state.game_state, [:players, player_id], player) |> Skill.do_mechanic(player, on_arrival_mechanic, %{skill_direction: player.direction}) + # Leap finished, we unblock the actions. + broadcast_player_block_actions(state.game_state.game_id, player_id, false) + {:noreply, %{state | game_state: game_state}} end From 6a699ce9eaec1673e3f9a3530f709f23dc4f3f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Sanchez?= Date: Mon, 2 Dec 2024 10:58:07 -0300 Subject: [PATCH 4/4] Add tool versions file (#996) --- .tool-versions | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .tool-versions diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 000000000..dd6a91b29 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +elixir 1.16.3-otp-26 +erlang 26.2.5.5