From a5c1e37e5171fd7922013bbb6ec7259befbef236 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sat, 7 Sep 2024 01:51:01 -0700 Subject: [PATCH 1/7] chore: update module list (#155) --- modules/achievements/README.md | 4 ---- modules/achievements/module.json | 14 ----------- modules/auth_email/module.json | 3 ++- modules/auth_email_link/module.json | 3 ++- modules/eos/README.md | 3 --- modules/eos/module.json | 15 ------------ modules/idem/README.md | 6 ----- modules/idem/module.json | 16 ------------- modules/identities/module.json | 3 ++- modules/matchmaker/README.md | 4 ---- modules/matchmaker/module.json | 14 ----------- modules/rivet/module.json | 3 ++- modules/steam/README.md | 4 ---- modules/steam/module.json | 15 ------------ modules/twitch/README.md | 4 ---- modules/twitch/module.json | 15 ------------ modules/uploads/module.json | 2 +- tests/basic/backend.json | 18 --------------- tests/basic/deno.lock | 36 ++++++++++++++++++++++++++++- 19 files changed, 44 insertions(+), 138 deletions(-) delete mode 100644 modules/achievements/README.md delete mode 100644 modules/achievements/module.json delete mode 100644 modules/eos/README.md delete mode 100644 modules/eos/module.json delete mode 100644 modules/idem/README.md delete mode 100644 modules/idem/module.json delete mode 100644 modules/matchmaker/README.md delete mode 100644 modules/matchmaker/module.json delete mode 100644 modules/steam/README.md delete mode 100644 modules/steam/module.json delete mode 100644 modules/twitch/README.md delete mode 100644 modules/twitch/module.json diff --git a/modules/achievements/README.md b/modules/achievements/README.md deleted file mode 100644 index cf408f57..00000000 --- a/modules/achievements/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Achievements - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) - diff --git a/modules/achievements/module.json b/modules/achievements/module.json deleted file mode 100644 index adbe171c..00000000 --- a/modules/achievements/module.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Achievements", - "description": "Unlock and track user achievements. (Coming late-2024)", - "icon": "medal", - "tags": [ - "competitive" - ], - "authors": [ - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/auth_email/module.json b/modules/auth_email/module.json index 9464a9b3..5580f0a7 100644 --- a/modules/auth_email/module.json +++ b/modules/auth_email/module.json @@ -5,7 +5,8 @@ "tags": [ "core", "auth", - "user" + "user", + "internal" ], "authors": [ "rivet-gg", diff --git a/modules/auth_email_link/module.json b/modules/auth_email_link/module.json index 0e0dded1..881cf28d 100644 --- a/modules/auth_email_link/module.json +++ b/modules/auth_email_link/module.json @@ -5,7 +5,8 @@ "tags": [ "core", "auth", - "user" + "user", + "internal" ], "authors": [ "rivet-gg", diff --git a/modules/eos/README.md b/modules/eos/README.md deleted file mode 100644 index a69a101b..00000000 --- a/modules/eos/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Epic Online Services - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) diff --git a/modules/eos/module.json b/modules/eos/module.json deleted file mode 100644 index 42f25366..00000000 --- a/modules/eos/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Epic Online Services", - "description": "Epic Online Services (EOS) is a cross-platform SDK that provides essential online services such as authentication, friends, matchmaking, and more for games.", - "icon": "e", - "tags": [ - "platform", - "integration" - ], - "authors": [ - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/idem/README.md b/modules/idem/README.md deleted file mode 100644 index 168d0118..00000000 --- a/modules/idem/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Idem - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) - -See [IDEM](https://www.idem.gg/) for more details. - diff --git a/modules/idem/module.json b/modules/idem/module.json deleted file mode 100644 index 2a12fe9b..00000000 --- a/modules/idem/module.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "IDEM", - "description": "Matchmaking for multi-player games – as an API. Be sure your game's matchmaking will be loved by players.", - "icon": "i", - "tags": [ - "service", - "integration" - ], - "authors": [ - "idem-matchmaking", - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/identities/module.json b/modules/identities/module.json index cfd2d22c..66a4bf4f 100644 --- a/modules/identities/module.json +++ b/modules/identities/module.json @@ -5,7 +5,8 @@ "tags": [ "core", "user", - "auth" + "auth", + "internal" ], "authors": [ "rivet-gg", diff --git a/modules/matchmaker/README.md b/modules/matchmaker/README.md deleted file mode 100644 index 1c054d2b..00000000 --- a/modules/matchmaker/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Matchmaker - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) - diff --git a/modules/matchmaker/module.json b/modules/matchmaker/module.json deleted file mode 100644 index 9505bfdd..00000000 --- a/modules/matchmaker/module.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Matchmaker", - "description": "Ticket-based matchmaking that balances skill, latency, and more. (Coming mid-2024)", - "icon": "chess-knight", - "tags": [ - "multiplayer" - ], - "authors": [ - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/rivet/module.json b/modules/rivet/module.json index e5a7ed4c..921dc737 100644 --- a/modules/rivet/module.json +++ b/modules/rivet/module.json @@ -5,7 +5,8 @@ "icon": "r", "tags": [ "core", - "infra" + "infra", + "internal" ], "authors": [ "NathanFlurry", diff --git a/modules/steam/README.md b/modules/steam/README.md deleted file mode 100644 index 1a7d31b8..00000000 --- a/modules/steam/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Steam - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) - diff --git a/modules/steam/module.json b/modules/steam/module.json deleted file mode 100644 index 7cc17228..00000000 --- a/modules/steam/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Steam", - "description": "Integrate with Steam accounts", - "icon": "steam", - "tags": [ - "platform", - "integration" - ], - "authors": [ - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/twitch/README.md b/modules/twitch/README.md deleted file mode 100644 index 09db2c9d..00000000 --- a/modules/twitch/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Twitch - -[Get Early Access](https://b8v8449klvp.typeform.com/to/kpcSBpuP) - diff --git a/modules/twitch/module.json b/modules/twitch/module.json deleted file mode 100644 index d4f1fcca..00000000 --- a/modules/twitch/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Twitch", - "description": "Integrate your game with drops", - "icon": "twitch", - "tags": [ - "platform", - "integration" - ], - "authors": [ - "rivet-gg" - ], - "status": "coming_soon", - "scripts": {}, - "errors": {} -} diff --git a/modules/uploads/module.json b/modules/uploads/module.json index 4993795b..a8c0f041 100644 --- a/modules/uploads/module.json +++ b/modules/uploads/module.json @@ -77,7 +77,7 @@ }, "too_many_chunks": { "name": "Possibility Of Too Many Chunks", - "description": "AWS S3 has a limit on the number of parts that can be uploaded in a\nmultipart upload. This limit is 10,000 parts. If the number of chunks\nrequired to upload the maximum multipart upload size exceeds this limit,\nany operation will preemptively throw this error.\n", + "description": "AWS S3 has a limit on the number of parts that can be uploaded in a multipart upload. This limit is 10,000 parts. If the number of chunks required to upload the maximum multipart upload size exceeds this limit, any operation will preemptively throw this error.", "internal": false }, "multipart_upload_completion_fail": { diff --git a/tests/basic/backend.json b/tests/basic/backend.json index 6a6547bb..72bf5577 100644 --- a/tests/basic/backend.json +++ b/tests/basic/backend.json @@ -7,9 +7,6 @@ } }, "modules": { - "achievements": { - "registry": "local" - }, "analytics": { "registry": "local" }, @@ -70,9 +67,6 @@ } } }, - "matchmaker": { - "registry": "local" - }, "parties": { "registry": "local" }, @@ -106,18 +100,6 @@ "discord_activity": { "registry": "local" }, - "eos": { - "registry": "local" - }, - "steam": { - "registry": "local" - }, - "idem": { - "registry": "local" - }, - "twitch": { - "registry": "local" - }, "auth_oauth": { "registry": "local" } diff --git a/tests/basic/deno.lock b/tests/basic/deno.lock index 5af0b04c..969c62be 100644 --- a/tests/basic/deno.lock +++ b/tests/basic/deno.lock @@ -9,6 +9,7 @@ "npm:@types/node": "npm:@types/node@18.16.19", "npm:drizzle-orm@0.33.0": "npm:drizzle-orm@0.33.0_pg@8.12.0", "npm:pg@8.11.3": "npm:pg@8.11.3", + "npm:pg@8.12.0": "npm:pg@8.12.0", "npm:pg@^8.11.3": "npm:pg@8.12.0", "npm:tsup": "npm:tsup@8.2.4_typescript@5.5.4_esbuild@0.23.1", "npm:typescript": "npm:typescript@5.5.4", @@ -1166,11 +1167,42 @@ "https://deno.land/std@0.222.1/encoding/base64url.ts": "ef40e0f18315ab539f17cebcc32839779e018d86dea9df39d94d302f342a1713", "https://deno.land/std@0.222.1/encoding/hex.ts": "6270f25e5d85f99fcf315278670ba012b04b7c94b67715b53f30d03249687c07", "https://deno.land/std@0.222.1/fmt/colors.ts": "d239d84620b921ea520125d778947881f62c50e78deef2657073840b8af9559a", + "https://deno.land/std@0.224.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", "https://deno.land/std@0.224.0/assert/assert.ts": "09d30564c09de846855b7b071e62b5974b001bb72a4b797958fe0660e7849834", + "https://deno.land/std@0.224.0/assert/assert_almost_equals.ts": "9e416114322012c9a21fa68e187637ce2d7df25bcbdbfd957cd639e65d3cf293", + "https://deno.land/std@0.224.0/assert/assert_array_includes.ts": "14c5094471bc8e4a7895fc6aa5a184300d8a1879606574cb1cd715ef36a4a3c7", + "https://deno.land/std@0.224.0/assert/assert_equals.ts": "3bbca947d85b9d374a108687b1a8ba3785a7850436b5a8930d81f34a32cb8c74", + "https://deno.land/std@0.224.0/assert/assert_exists.ts": "43420cf7f956748ae6ed1230646567b3593cb7a36c5a5327269279c870c5ddfd", + "https://deno.land/std@0.224.0/assert/assert_false.ts": "3e9be8e33275db00d952e9acb0cd29481a44fa0a4af6d37239ff58d79e8edeff", + "https://deno.land/std@0.224.0/assert/assert_greater.ts": "5e57b201fd51b64ced36c828e3dfd773412c1a6120c1a5a99066c9b261974e46", + "https://deno.land/std@0.224.0/assert/assert_greater_or_equal.ts": "9870030f997a08361b6f63400273c2fb1856f5db86c0c3852aab2a002e425c5b", + "https://deno.land/std@0.224.0/assert/assert_instance_of.ts": "e22343c1fdcacfaea8f37784ad782683ec1cf599ae9b1b618954e9c22f376f2c", + "https://deno.land/std@0.224.0/assert/assert_is_error.ts": "f856b3bc978a7aa6a601f3fec6603491ab6255118afa6baa84b04426dd3cc491", + "https://deno.land/std@0.224.0/assert/assert_less.ts": "60b61e13a1982865a72726a5fa86c24fad7eb27c3c08b13883fb68882b307f68", + "https://deno.land/std@0.224.0/assert/assert_less_or_equal.ts": "d2c84e17faba4afe085e6c9123a63395accf4f9e00150db899c46e67420e0ec3", + "https://deno.land/std@0.224.0/assert/assert_match.ts": "ace1710dd3b2811c391946954234b5da910c5665aed817943d086d4d4871a8b7", + "https://deno.land/std@0.224.0/assert/assert_not_equals.ts": "78d45dd46133d76ce624b2c6c09392f6110f0df9b73f911d20208a68dee2ef29", + "https://deno.land/std@0.224.0/assert/assert_not_instance_of.ts": "3434a669b4d20cdcc5359779301a0588f941ffdc2ad68803c31eabdb4890cf7a", + "https://deno.land/std@0.224.0/assert/assert_not_match.ts": "df30417240aa2d35b1ea44df7e541991348a063d9ee823430e0b58079a72242a", + "https://deno.land/std@0.224.0/assert/assert_not_strict_equals.ts": "37f73880bd672709373d6dc2c5f148691119bed161f3020fff3548a0496f71b8", + "https://deno.land/std@0.224.0/assert/assert_object_match.ts": "411450fd194fdaabc0089ae68f916b545a49d7b7e6d0026e84a54c9e7eed2693", + "https://deno.land/std@0.224.0/assert/assert_rejects.ts": "4bee1d6d565a5b623146a14668da8f9eb1f026a4f338bbf92b37e43e0aa53c31", + "https://deno.land/std@0.224.0/assert/assert_strict_equals.ts": "b4f45f0fd2e54d9029171876bd0b42dd9ed0efd8f853ab92a3f50127acfa54f5", + "https://deno.land/std@0.224.0/assert/assert_string_includes.ts": "496b9ecad84deab72c8718735373feb6cdaa071eb91a98206f6f3cb4285e71b8", + "https://deno.land/std@0.224.0/assert/assert_throws.ts": "c6508b2879d465898dab2798009299867e67c570d7d34c90a2d235e4553906eb", "https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917", + "https://deno.land/std@0.224.0/assert/equal.ts": "bddf07bb5fc718e10bb72d5dc2c36c1ce5a8bdd3b647069b6319e07af181ac47", + "https://deno.land/std@0.224.0/assert/fail.ts": "0eba674ffb47dff083f02ced76d5130460bff1a9a68c6514ebe0cdea4abadb68", + "https://deno.land/std@0.224.0/assert/mod.ts": "48b8cb8a619ea0b7958ad7ee9376500fe902284bb36f0e32c598c3dc34cbd6f3", + "https://deno.land/std@0.224.0/assert/unimplemented.ts": "8c55a5793e9147b4f1ef68cd66496b7d5ba7a9e7ca30c6da070c1a58da723d73", + "https://deno.land/std@0.224.0/assert/unreachable.ts": "5ae3dbf63ef988615b93eb08d395dda771c96546565f9e521ed86f6510c29e19", "https://deno.land/std@0.224.0/collections/_utils.ts": "b2ec8ada31b5a72ebb1d99774b849b4c09fe4b3a38d07794bd010bd218a16e0b", "https://deno.land/std@0.224.0/collections/deep_merge.ts": "04f8d2a6cfa15c7580e788689bcb5e162512b9ccb18bab1241824b432a78551e", "https://deno.land/std@0.224.0/crypto/timing_safe_equal.ts": "bc3622b5aec05e2d8b735bf60633425c34333c06cfb6c4a9f102e4a0f3931ced", + "https://deno.land/std@0.224.0/fmt/colors.ts": "508563c0659dd7198ba4bbf87e97f654af3c34eb56ba790260f252ad8012e1c5", + "https://deno.land/std@0.224.0/internal/diff.ts": "6234a4b493ebe65dc67a18a0eb97ef683626a1166a1906232ce186ae9f65f4e6", + "https://deno.land/std@0.224.0/internal/format.ts": "0a98ee226fd3d43450245b1844b47003419d34d210fa989900861c79820d21c2", + "https://deno.land/std@0.224.0/internal/mod.ts": "534125398c8e7426183e12dc255bb635d94e06d0f93c60a297723abe69d3b22e", "https://deno.land/x/argontwo@0.2.0/mod.ts": "076395861fc86d5b475ed49ecf10a35df47db55a506469da054a92969d7cdf66", "https://deno.land/x/argontwo@0.2.0/wasm/mod.ts": "588486da70ccd43760b71fb3d236ff37d1790d3419cbb764c35fc05a550a2881", "https://deno.land/x/argontwo@0.2.0/wasm/wasm.js": "c5fdbe828b5984d9a434247ca2cf6cd44e8f7560490813cdd92be785ec57d3fa", @@ -2501,6 +2533,8 @@ "https://esm.sh/v135/strnum@1.0.5/denonext/strnum.mjs": "1ffef4adec2f74139e36a2bfed8381880541396fe1c315779fb22e081b17468b", "https://esm.sh/v135/tslib@2.6.2/denonext/tslib.mjs": "29782bcd3139f77ec063dc5a9385c0fff4a8d0a23b6765c73d9edeb169a04bf1", "https://esm.sh/v135/tslib@2.6.3/denonext/tslib.mjs": "0834c22e9fbf95f6a5659cc2017543f7d41aa880f24ab84cb11d24e6bee99303", - "https://esm.sh/v135/uuid@9.0.1/denonext/uuid.mjs": "7d7d3aa57fa136e2540886654c416d9da10d8cfebe408bae47fd47070f0bfb2a" + "https://esm.sh/v135/uuid@9.0.1/denonext/uuid.mjs": "7d7d3aa57fa136e2540886654c416d9da10d8cfebe408bae47fd47070f0bfb2a", + "https://esm.sh/zod-validation-error@3.3.0": "d8825ca67952b6adff6b35026dc465f9638d4923dbd54fe9e8e81fbfddca9630", + "https://esm.sh/zod@3.23.8": "728819c1f651800179a5a80daf24b3e54b2ddea87828bd10e63875a604bcb94e" } } From a97095bc3d865be8783c1b53027313448f8495a2 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:24:26 -0700 Subject: [PATCH 2/7] fix(lobbies): make list_regions public (#159) --- modules/lobbies/module.json | 2 +- tests/basic/deno.lock | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/lobbies/module.json b/modules/lobbies/module.json index 97c4d7af..f9721252 100644 --- a/modules/lobbies/module.json +++ b/modules/lobbies/module.json @@ -65,7 +65,7 @@ "list_regions": { "name": "List Regions", "description": "List available regions.", - "public": false + "public": true }, "fetch_lobby_manager_state": { "name": "Fetch Lobby Manager State", diff --git a/tests/basic/deno.lock b/tests/basic/deno.lock index 969c62be..6214b960 100644 --- a/tests/basic/deno.lock +++ b/tests/basic/deno.lock @@ -2534,6 +2534,8 @@ "https://esm.sh/v135/tslib@2.6.2/denonext/tslib.mjs": "29782bcd3139f77ec063dc5a9385c0fff4a8d0a23b6765c73d9edeb169a04bf1", "https://esm.sh/v135/tslib@2.6.3/denonext/tslib.mjs": "0834c22e9fbf95f6a5659cc2017543f7d41aa880f24ab84cb11d24e6bee99303", "https://esm.sh/v135/uuid@9.0.1/denonext/uuid.mjs": "7d7d3aa57fa136e2540886654c416d9da10d8cfebe408bae47fd47070f0bfb2a", + "https://esm.sh/v135/zod-validation-error@3.3.0/denonext/zod-validation-error.mjs": "4efabd593e1430c31a044f79d299a62120946a3e701159b29922b50f3223c186", + "https://esm.sh/v135/zod@3.23.8/denonext/zod.mjs": "b3707b03ddc01aab11b740436ab23c0fcc8d15fed072be20085c1fd611016b61", "https://esm.sh/zod-validation-error@3.3.0": "d8825ca67952b6adff6b35026dc465f9638d4923dbd54fe9e8e81fbfddca9630", "https://esm.sh/zod@3.23.8": "728819c1f651800179a5a80daf24b3e54b2ddea87828bd10e63875a604bcb94e" } From 88c0be5bc15abb195acfe160aa695445de3a47e3 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:27:24 -0700 Subject: [PATCH 3/7] chore(lobbies): upgrade multiplayer manager sdk addon (#160) --- .../sdk_addons/godot/multiplayer_manager.gd | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd b/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd index b2e76614..1bbdb785 100644 --- a/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd +++ b/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd @@ -1,5 +1,5 @@ extends Node -class_name BackendMultiplayerManager +class_name RivetMultiplayerManager enum Transport { ENET, WEB_SOCKET } @@ -79,7 +79,7 @@ var _player_token = null func setup_multiplayer(): # Validate only initialized once if _multiplayer_setup: - BackendLogger.warning("setup_multiplayer already called") + RivetLogger.warning("setup_multiplayer already called") return _multiplayer_setup = true @@ -111,14 +111,14 @@ func setup_multiplayer(): if OS.has_environment("LOBBY_ID"): _lobby_id = OS.get_environment("LOBBY_ID") else: - BackendLogger.warning("Missing lobby ID") + RivetLogger.warning("Missing lobby ID") if OS.has_environment("LOBBY_TOKEN"): _lobby_token = OS.get_environment("LOBBY_TOKEN") # Start server if transport == Transport.ENET: - BackendLogger.log("Starting ENet server: %s:%s" % [_server_hostname, _server_port]) + RivetLogger.log("Starting ENet server: %s:%s" % [_server_hostname, _server_port]) peer = ENetMultiplayerPeer.new() peer.set_bind_ip(_server_hostname) @@ -126,14 +126,14 @@ func setup_multiplayer(): # TODO: crash if create server fails multiplayer.set_multiplayer_peer(peer) elif transport == Transport.WEB_SOCKET: - BackendLogger.log("Starting WebSocket server: %s:%s" % [_server_hostname, _server_port]) + RivetLogger.log("Starting WebSocket server: %s:%s" % [_server_hostname, _server_port]) peer = WebSocketMultiplayerPeer.new() peer.create_server(_server_port, _server_hostname) # TODO: crash if create server fails multiplayer.set_multiplayer_peer(peer) else: - BackendLogger.error("Unsupported transport: %s" % transport) + RivetLogger.error("Unsupported transport: %s" % transport) OS.crash("Unsupported transport") # Notify lobby ready @@ -142,24 +142,24 @@ func setup_multiplayer(): } if _lobby_token != null: request["lobbyToken"] = _lobby_token - var response = await Backend.lobbies.set_lobby_ready(request).async() + var response = await Rivet.lobbies.set_lobby_ready(request).async() if response.is_ok(): - BackendLogger.log("Lobby ready") + RivetLogger.log("Lobby ready") else: - BackendLogger.warning("Lobby ready failed failed: %s" % response.body) + RivetLogger.warning("Lobby ready failed failed: %s" % response.body) OS.crash("Lobby ready failed") return ## Connect to a lobby returned from the backend. func connect_to_lobby(lobby, player): if !_multiplayer_setup: - BackendLogger.error("setup_multiplayer needs to be called in _ready") + RivetLogger.error("setup_multiplayer needs to be called in _ready") return if is_server: - BackendLogger.warning("Cannot called set_player_token on server") + RivetLogger.warning("Cannot called set_player_token on server") return - BackendLogger.log("Connecting to lobby: %s %s" % [lobby, player]) + RivetLogger.log("Connecting to lobby: %s %s" % [lobby, player]) # Save token _player_token = player.token @@ -179,12 +179,12 @@ func connect_to_lobby(lobby, player): hostname = backend_port.hostname port = backend_port.port else: - BackendLogger.error("Unsupported lobby backend: %s" % lobby.backend) + RivetLogger.error("Unsupported lobby backend: %s" % lobby.backend) return # Start server if transport == Transport.ENET: - BackendLogger.log("Connecting to ENet server: %s:%s" % [hostname, port]) + RivetLogger.log("Connecting to ENet server: %s:%s" % [hostname, port]) peer = ENetMultiplayerPeer.new() peer.create_client(hostname, port) @@ -197,17 +197,17 @@ func connect_to_lobby(lobby, player): ws_protocol = "ws" var url = "%s://%s:%s" % [ws_protocol, hostname, port] - BackendLogger.log("Connecting to WebSocket server: %s" % url) + RivetLogger.log("Connecting to WebSocket server: %s" % url) peer = WebSocketMultiplayerPeer.new() peer.create_client(url) multiplayer.set_multiplayer_peer(peer) else: - BackendLogger.error("Unsupported transport: %s" % transport) + RivetLogger.error("Unsupported transport: %s" % transport) # MARK: Peers func _on_peer_connected(id): - BackendLogger.log('Peer connected: %s' % id) + RivetLogger.log('Peer connected: %s' % id) if is_server: client_connected.emit(id) @@ -215,14 +215,14 @@ func _on_peer_connected(id): server_connected.emit() func _on_peer_disconnected(id): - BackendLogger.log('Peer disconnected: %s' % id) + RivetLogger.log('Peer disconnected: %s' % id) if is_server: # Remove player from lobby var player_token = _player_tokens.get(id) if player_token != null: _player_tokens.erase(id) - BackendLogger.log("Removing player %s" % player_token) + RivetLogger.log("Removing player %s" % player_token) var request = { "lobbyId": _lobby_id, @@ -230,11 +230,11 @@ func _on_peer_disconnected(id): } if _lobby_token != null: request["lobbyToken"] = _lobby_token - var response = await Backend.lobbies.set_player_disconnected(request).async() + var response = await Rivet.lobbies.set_player_disconnected(request).async() if response.is_error(): - BackendLogger.warning("Player disconnect failed for %id: %s" % [id, response.body]) + RivetLogger.warning("Player disconnect failed for %id: %s" % [id, response.body]) else: - BackendLogger.warning("Player disconnected without player token: %s" % id) + RivetLogger.warning("Player disconnected without player token: %s" % id) return # Signal @@ -243,13 +243,13 @@ func _on_peer_disconnected(id): server_disconnected.emit() func _on_connected_to_server(): - BackendLogger.log('Connected to server') + RivetLogger.log('Connected to server') func _on_connection_failed(): - BackendLogger.log('Connection failed') + RivetLogger.log('Connection failed') func _on_server_disconnected(): - BackendLogger.log('Server disconnected') + RivetLogger.log('Server disconnected') # MARK: Authentication func _auth_callback(id: int, buf: PackedByteArray): @@ -259,12 +259,12 @@ func _auth_callback(id: int, buf: PackedByteArray): json.parse(buf.get_string_from_utf8()) var data = json.get_data() - BackendLogger.log("Player authenticating %s: %s" % [id, data]) + RivetLogger.log("Player authenticating %s: %s" % [id, data]) # Check token var player_token = data["player_token"] if player_token == null: - BackendLogger.warning("Player token not provided in auth for %s" % id) + RivetLogger.warning("Player token not provided in auth for %s" % id) _scene_multiplayer.disconnect_peer(id) return @@ -278,13 +278,13 @@ func _auth_callback(id: int, buf: PackedByteArray): } if _lobby_token != null: request["lobbyToken"] = _lobby_token - var response = await Backend.lobbies.set_player_connected(request).async() + var response = await Rivet.lobbies.set_player_connected(request).async() if response.is_ok(): - BackendLogger.log("Player authenticated for %s" % id) + RivetLogger.log("Player authenticated for %s" % id) _scene_multiplayer.complete_auth(id) else: # Player will be cleaned up on disconnect handler - BackendLogger.warning("Player authentiation failed for %s: %s" % [id, response.body]) + RivetLogger.warning("Player authentiation failed for %s: %s" % [id, response.body]) _scene_multiplayer.disconnect_peer(id) else: # Server does not need to auth with client @@ -294,7 +294,7 @@ func _on_peer_authenticating(id): #if is_server: #return - BackendLogger.log("Authenticating with server") + RivetLogger.log("Authenticating with server") var body = JSON.stringify({ "player_token": _player_token }) (multiplayer as SceneMultiplayer).send_auth(id, body.to_utf8_buffer()) @@ -303,6 +303,6 @@ func _on_peer_authentication_failed(id): #if !is_server: #return - BackendLogger.warning("Client authentication failed %s" % id) + RivetLogger.warning("Client authentication failed %s" % id) multiplayer.set_multiplayer_peer(null) From 330f63e1de89904a7a7354c5efd262596ec3132e Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:30:26 -0700 Subject: [PATCH 4/7] chore(lobbies): fix tests with stricter validation (#162) --- modules/lobbies/scripts/list.ts | 8 ++++++-- modules/lobbies/tests/e2e.ts | 2 +- modules/tokens/scripts/create.ts | 4 ++-- modules/tokens/scripts/extend.ts | 4 ++-- modules/tokens/scripts/revoke.ts | 2 +- modules/tokens/tests/validate.ts | 5 +++-- modules/tokens/utils/types.ts | 15 +++++++++++++-- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/modules/lobbies/scripts/list.ts b/modules/lobbies/scripts/list.ts index a10d6c2c..8c9b5e07 100644 --- a/modules/lobbies/scripts/list.ts +++ b/modules/lobbies/scripts/list.ts @@ -19,6 +19,10 @@ interface LobbyListEntry { id: string; version: string; tags: Record; + createdAt: string; + players: number; + maxPlayers: number; + maxPlayersDirect: number; } export async function run( @@ -46,11 +50,11 @@ export async function run( id: lobby.id, version: lobby.version, tags: lobby.tags, - createdAt: lobby.createdAt, + createdAt: new Date(lobby.createdAt).toISOString(), players: lobby.players, maxPlayers: lobby.maxPlayers, maxPlayersDirect: lobby.maxPlayersDirect, - })); + } satisfies LobbyListEntry)); return { lobbies: lobbyList }; } diff --git a/modules/lobbies/tests/e2e.ts b/modules/lobbies/tests/e2e.ts index d4d48e76..2b4076e3 100644 --- a/modules/lobbies/tests/e2e.ts +++ b/modules/lobbies/tests/e2e.ts @@ -82,7 +82,7 @@ test("lobby tags", async (ctx: TestContext) => { { version: VERSION, region: REGION, - tags: { gameMode: "a", region: "atl" }, + tags: { gameMode: "a" }, players: [{}], maxPlayers: 8, maxPlayersDirect: 8, diff --git a/modules/tokens/scripts/create.ts b/modules/tokens/scripts/create.ts index 6e5c2779..95075b25 100644 --- a/modules/tokens/scripts/create.ts +++ b/modules/tokens/scripts/create.ts @@ -1,5 +1,5 @@ import { ScriptContext, Database, Query } from "../module.gen.ts"; -import { TokenWithSecret, tokenFromRow } from "../utils/types.ts"; +import { TokenWithSecret, tokenFromRow, tokenWithSecretFromRow } from "../utils/types.ts"; export interface Request { type: string; @@ -28,7 +28,7 @@ export async function run( .returning(); return { - token: tokenFromRow(rows[0]!), + token: tokenWithSecretFromRow(rows[0]!), }; } diff --git a/modules/tokens/scripts/extend.ts b/modules/tokens/scripts/extend.ts index 14efcd2f..f7687a34 100644 --- a/modules/tokens/scripts/extend.ts +++ b/modules/tokens/scripts/extend.ts @@ -1,5 +1,5 @@ import { ScriptContext, Query, Database } from "../module.gen.ts"; -import { tokenFromRow, TokenWithSecret } from "../utils/types.ts"; +import { tokenFromRow, TokenWithSecret, tokenWithSecretFromRow } from "../utils/types.ts"; export interface Request { token: string; @@ -27,6 +27,6 @@ export async function run( // Return the updated token return { - token: tokenFromRow(rows[0]!), + token: tokenWithSecretFromRow(rows[0]!), }; } diff --git a/modules/tokens/scripts/revoke.ts b/modules/tokens/scripts/revoke.ts index 36e68727..90da5308 100644 --- a/modules/tokens/scripts/revoke.ts +++ b/modules/tokens/scripts/revoke.ts @@ -5,7 +5,7 @@ export interface Request { } export interface Response { - updates: { [key: string]: TokenUpdate }; + updates: Record; } export enum TokenUpdate { diff --git a/modules/tokens/tests/validate.ts b/modules/tokens/tests/validate.ts index cbcecbe6..0720061c 100644 --- a/modules/tokens/tests/validate.ts +++ b/modules/tokens/tests/validate.ts @@ -3,7 +3,8 @@ import { assertEquals, assertGreater, assertRejects, -} from "https://deno.land/std@0.217.0/assert/mod.ts"; +} from "jsr:@std/assert"; +import { omit } from "jsr:@std/collections"; test( "validate token not found", @@ -95,7 +96,7 @@ test( ...validateResAfterWait.token, expireAt: null, }, { - ...token, + ...omit(token, ["token"]), expireAt: null, }); }, diff --git a/modules/tokens/utils/types.ts b/modules/tokens/utils/types.ts index 49e025a4..f2785cf8 100644 --- a/modules/tokens/utils/types.ts +++ b/modules/tokens/utils/types.ts @@ -15,11 +15,22 @@ export interface TokenWithSecret extends Token { export function tokenFromRow( row: typeof Database.tokens.$inferSelect -): TokenWithSecret { +): Token { return { - ...row, + id: row.id, + type: row.type, + meta: row.meta, createdAt: row.createdAt.toISOString(), expireAt: row.expireAt?.toISOString() ?? null, revokedAt: row.revokedAt?.toISOString() ?? null, }; } + +export function tokenWithSecretFromRow( + row: typeof Database.tokens.$inferSelect +): TokenWithSecret { + return { + ...tokenFromRow(row), + token: row.token, + }; +} From f37cfdfde7199108458c60f68881665e2f56aca0 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:33:27 -0700 Subject: [PATCH 5/7] chore(tests): move backend.json -> rivet.json (#163) --- tests/basic/deno.lock | 15 ++++++++++++++ tests/basic/{backend.json => rivet.json} | 0 tests/basic/rivet.yaml | 26 ------------------------ tests/basic/server/src/index.ts | 2 +- 4 files changed, 16 insertions(+), 27 deletions(-) rename tests/basic/{backend.json => rivet.json} (100%) delete mode 100644 tests/basic/rivet.yaml diff --git a/tests/basic/deno.lock b/tests/basic/deno.lock index 6214b960..ca997679 100644 --- a/tests/basic/deno.lock +++ b/tests/basic/deno.lock @@ -4,7 +4,10 @@ "specifiers": { "jsr:@blackberry/bcrypt@0.15.3": "jsr:@blackberry/bcrypt@0.15.3", "jsr:@denosaurs/lz4@0.1.4": "jsr:@denosaurs/lz4@0.1.4", + "jsr:@std/assert": "jsr:@std/assert@1.0.5", + "jsr:@std/collections": "jsr:@std/collections@1.0.6", "jsr:@std/encoding@0.221": "jsr:@std/encoding@0.221.0", + "jsr:@std/internal@^1.0.3": "jsr:@std/internal@1.0.3", "npm:@prisma/adapter-pg@^5.12.0": "npm:@prisma/adapter-pg@5.18.0_pg@8.12.0", "npm:@types/node": "npm:@types/node@18.16.19", "npm:drizzle-orm@0.33.0": "npm:drizzle-orm@0.33.0_pg@8.12.0", @@ -27,8 +30,20 @@ "@denosaurs/lz4@0.1.4": { "integrity": "ad5d556c02eb01fe1e0f2e953d7be066a14870afe149b1aed1ced019460f6aa1" }, + "@std/assert@1.0.5": { + "integrity": "e37da8e4033490ce613eec4ac1d78dba1faf5b02a3f6c573a28f15365b9b440f", + "dependencies": [ + "jsr:@std/internal@^1.0.3" + ] + }, + "@std/collections@1.0.6": { + "integrity": "60ad252af7df0594e6455f697920a37cd523ad66469fefcc9735e362826ac01d" + }, "@std/encoding@0.221.0": { "integrity": "d1dd76ef0dc5d14088411e6dc1dede53bf8308c95d1537df1214c97137208e45" + }, + "@std/internal@1.0.3": { + "integrity": "208e9b94a3d5649bd880e9ca38b885ab7651ab5b5303a56ed25de4755fb7b11e" } }, "npm": { diff --git a/tests/basic/backend.json b/tests/basic/rivet.json similarity index 100% rename from tests/basic/backend.json rename to tests/basic/rivet.json diff --git a/tests/basic/rivet.yaml b/tests/basic/rivet.yaml deleted file mode 100644 index 9038aafd..00000000 --- a/tests/basic/rivet.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# yaml-language-server: $schema=https://rivet.gg/rivet.schema.json - -# ┌───────────────────────────────────────────────────────┐ -# │ │ -# │ This configuration file is empty. │ -# │ │ -# │ Get started: https://rivet.gg/learn/custom │ -# │ Reference: https://rivet.gg/docs/general/config │ -# │ │ -# └───────────────────────────────────────────────────────┘ - -engine: - html5: {} - -matchmaker: - max_players: 128 - tier: basic-1d8 - game_modes: - default: {} - docker: - dockerfile: server.Dockerfile - ports: - default: - port: 8080 - protocol: https - diff --git a/tests/basic/server/src/index.ts b/tests/basic/server/src/index.ts index fc61ddb7..1d24acd6 100644 --- a/tests/basic/server/src/index.ts +++ b/tests/basic/server/src/index.ts @@ -59,7 +59,7 @@ let gameConfig = { interface GameState { lobbyConfig: any; lobbyTags: any; - scores: { [id: number]: number }; + scores: Record; } const gameState: GameState = { From 20878ff1a24bf8fd50286bcd937d6b7c836df013 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:36:28 -0700 Subject: [PATCH 6/7] chore(sandbox): update to new rivet.json schema (#164) --- sandbox/client/index.html | 4 +- sandbox/deno.lock | 261 +++++++++++++++++++ sandbox/game_server/src/index.ts | 2 +- sandbox/{backend.dev.json => rivet.dev.json} | 2 +- sandbox/{backend.json => rivet.json} | 0 sandbox/scripts/fetch_state.ts | 4 +- sandbox/scripts/gen_sdk.ts | 72 ----- sandbox/scripts/reset_state.ts | 4 +- sandbox/scripts/run_local_backend.sh | 2 +- 9 files changed, 270 insertions(+), 81 deletions(-) create mode 100644 sandbox/deno.lock rename sandbox/{backend.dev.json => rivet.dev.json} (90%) rename sandbox/{backend.json => rivet.json} (100%) delete mode 100755 sandbox/scripts/gen_sdk.ts diff --git a/sandbox/client/index.html b/sandbox/client/index.html index f6a89ded..accb30c7 100644 --- a/sandbox/client/index.html +++ b/sandbox/client/index.html @@ -3,10 +3,10 @@ - OpenGB E2E Test + Rivet Modules E2E Test -

OpenGB E2E Test

+

Rivet Modules E2E Test

diff --git a/sandbox/deno.lock b/sandbox/deno.lock new file mode 100644 index 00000000..43be2988 --- /dev/null +++ b/sandbox/deno.lock @@ -0,0 +1,261 @@ +{ + "version": "3", + "packages": { + "specifiers": { + "jsr:@std/assert": "jsr:@std/assert@1.0.5", + "jsr:@std/collections": "jsr:@std/collections@1.0.6", + "jsr:@std/internal@^1.0.3": "jsr:@std/internal@1.0.3", + "npm:drizzle-orm@0.33.0": "npm:drizzle-orm@0.33.0_pg@8.12.0", + "npm:pg@8.12.0": "npm:pg@8.12.0" + }, + "jsr": { + "@std/assert@1.0.5": { + "integrity": "e37da8e4033490ce613eec4ac1d78dba1faf5b02a3f6c573a28f15365b9b440f", + "dependencies": [ + "jsr:@std/internal@^1.0.3" + ] + }, + "@std/collections@1.0.6": { + "integrity": "60ad252af7df0594e6455f697920a37cd523ad66469fefcc9735e362826ac01d" + }, + "@std/internal@1.0.3": { + "integrity": "208e9b94a3d5649bd880e9ca38b885ab7651ab5b5303a56ed25de4755fb7b11e" + } + }, + "npm": { + "drizzle-orm@0.33.0_pg@8.12.0": { + "integrity": "sha512-SHy72R2Rdkz0LEq0PSG/IdvnT3nGiWuRk+2tXZQ90GVq/XQhpCzu/EFT3V2rox+w8MlkBQxifF8pCStNYnERfA==", + "dependencies": { + "pg": "pg@8.12.0" + } + }, + "pg-cloudflare@1.1.1": { + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "dependencies": {} + }, + "pg-connection-string@2.6.4": { + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "dependencies": {} + }, + "pg-int8@1.0.1": { + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dependencies": {} + }, + "pg-pool@3.6.2_pg@8.12.0": { + "integrity": "sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==", + "dependencies": { + "pg": "pg@8.12.0" + } + }, + "pg-protocol@1.6.1": { + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==", + "dependencies": {} + }, + "pg-types@2.2.0": { + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "pg-int8@1.0.1", + "postgres-array": "postgres-array@2.0.0", + "postgres-bytea": "postgres-bytea@1.0.0", + "postgres-date": "postgres-date@1.0.7", + "postgres-interval": "postgres-interval@1.2.0" + } + }, + "pg@8.12.0": { + "integrity": "sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==", + "dependencies": { + "pg-cloudflare": "pg-cloudflare@1.1.1", + "pg-connection-string": "pg-connection-string@2.6.4", + "pg-pool": "pg-pool@3.6.2_pg@8.12.0", + "pg-protocol": "pg-protocol@1.6.1", + "pg-types": "pg-types@2.2.0", + "pgpass": "pgpass@1.0.5" + } + }, + "pgpass@1.0.5": { + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "dependencies": { + "split2": "split2@4.2.0" + } + }, + "postgres-array@2.0.0": { + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "dependencies": {} + }, + "postgres-bytea@1.0.0": { + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "dependencies": {} + }, + "postgres-date@1.0.7": { + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "dependencies": {} + }, + "postgres-interval@1.2.0": { + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "xtend@4.0.2" + } + }, + "split2@4.2.0": { + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dependencies": {} + }, + "xtend@4.0.2": { + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dependencies": {} + } + } + }, + "remote": { + "https://deno.land/std@0.208.0/assert/_constants.ts": "8a9da298c26750b28b326b297316cdde860bc237533b07e1337c021379e6b2a9", + "https://deno.land/std@0.208.0/assert/_diff.ts": "58e1461cc61d8eb1eacbf2a010932bf6a05b79344b02ca38095f9b805795dc48", + "https://deno.land/std@0.208.0/assert/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7", + "https://deno.land/std@0.208.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", + "https://deno.land/std@0.208.0/assert/assert_almost_equals.ts": "e15ca1f34d0d5e0afae63b3f5d975cbd18335a132e42b0c747d282f62ad2cd6c", + "https://deno.land/std@0.208.0/assert/assert_array_includes.ts": "6856d7f2c3544bc6e62fb4646dfefa3d1df5ff14744d1bca19f0cbaf3b0d66c9", + "https://deno.land/std@0.208.0/assert/assert_equals.ts": "d8ec8a22447fbaf2fc9d7c3ed2e66790fdb74beae3e482855d75782218d68227", + "https://deno.land/std@0.208.0/assert/assert_exists.ts": "407cb6b9fb23a835cd8d5ad804e2e2edbbbf3870e322d53f79e1c7a512e2efd7", + "https://deno.land/std@0.208.0/assert/assert_false.ts": "0ccbcaae910f52c857192ff16ea08bda40fdc79de80846c206bfc061e8c851c6", + "https://deno.land/std@0.208.0/assert/assert_greater.ts": "ae2158a2d19313bf675bf7251d31c6dc52973edb12ac64ac8fc7064152af3e63", + "https://deno.land/std@0.208.0/assert/assert_greater_or_equal.ts": "1439da5ebbe20855446cac50097ac78b9742abe8e9a43e7de1ce1426d556e89c", + "https://deno.land/std@0.208.0/assert/assert_instance_of.ts": "3aedb3d8186e120812d2b3a5dea66a6e42bf8c57a8bd927645770bd21eea554c", + "https://deno.land/std@0.208.0/assert/assert_is_error.ts": "c21113094a51a296ffaf036767d616a78a2ae5f9f7bbd464cd0197476498b94b", + "https://deno.land/std@0.208.0/assert/assert_less.ts": "aec695db57db42ec3e2b62e97e1e93db0063f5a6ec133326cc290ff4b71b47e4", + "https://deno.land/std@0.208.0/assert/assert_less_or_equal.ts": "5fa8b6a3ffa20fd0a05032fe7257bf985d207b85685fdbcd23651b70f928c848", + "https://deno.land/std@0.208.0/assert/assert_match.ts": "c4083f80600bc190309903c95e397a7c9257ff8b5ae5c7ef91e834704e672e9b", + "https://deno.land/std@0.208.0/assert/assert_not_equals.ts": "9f1acab95bd1f5fc9a1b17b8027d894509a745d91bac1718fdab51dc76831754", + "https://deno.land/std@0.208.0/assert/assert_not_instance_of.ts": "0c14d3dfd9ab7a5276ed8ed0b18c703d79a3d106102077ec437bfe7ed912bd22", + "https://deno.land/std@0.208.0/assert/assert_not_match.ts": "3796a5b0c57a1ce6c1c57883dd4286be13a26f715ea662318ab43a8491a13ab0", + "https://deno.land/std@0.208.0/assert/assert_not_strict_equals.ts": "4cdef83df17488df555c8aac1f7f5ec2b84ad161b6d0645ccdbcc17654e80c99", + "https://deno.land/std@0.208.0/assert/assert_object_match.ts": "d8fc2867cfd92eeacf9cea621e10336b666de1874a6767b5ec48988838370b54", + "https://deno.land/std@0.208.0/assert/assert_rejects.ts": "45c59724de2701e3b1f67c391d6c71c392363635aad3f68a1b3408f9efca0057", + "https://deno.land/std@0.208.0/assert/assert_strict_equals.ts": "b1f538a7ea5f8348aeca261d4f9ca603127c665e0f2bbfeb91fa272787c87265", + "https://deno.land/std@0.208.0/assert/assert_string_includes.ts": "b821d39ebf5cb0200a348863c86d8c4c4b398e02012ce74ad15666fc4b631b0c", + "https://deno.land/std@0.208.0/assert/assert_throws.ts": "63784e951475cb7bdfd59878cd25a0931e18f6dc32a6077c454b2cd94f4f4bcd", + "https://deno.land/std@0.208.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", + "https://deno.land/std@0.208.0/assert/equal.ts": "9f1a46d5993966d2596c44e5858eec821859b45f783a5ee2f7a695dfc12d8ece", + "https://deno.land/std@0.208.0/assert/fail.ts": "c36353d7ae6e1f7933d45f8ea51e358c8c4b67d7e7502028598fe1fea062e278", + "https://deno.land/std@0.208.0/assert/mod.ts": "37c49a26aae2b254bbe25723434dc28cd7532e444cf0b481a97c045d110ec085", + "https://deno.land/std@0.208.0/assert/unimplemented.ts": "d56fbeecb1f108331a380f72e3e010a1f161baa6956fd0f7cf3e095ae1a4c75a", + "https://deno.land/std@0.208.0/assert/unreachable.ts": "4600dc0baf7d9c15a7f7d234f00c23bca8f3eba8b140286aaca7aa998cf9a536", + "https://deno.land/std@0.208.0/fmt/colors.ts": "34b3f77432925eb72cf0bfb351616949746768620b8e5ead66da532f93d10ba2", + "https://deno.land/std@0.214.0/async/delay.ts": "8e1d18fe8b28ff95885e2bc54eccec1713f57f756053576d8228e6ca110793ad", + "https://deno.land/std@0.217.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", + "https://deno.land/std@0.217.0/assert/_diff.ts": "dcc63d94ca289aec80644030cf88ccbf7acaa6fbd7b0f22add93616b36593840", + "https://deno.land/std@0.217.0/assert/_format.ts": "0ba808961bf678437fb486b56405b6fefad2cf87b5809667c781ddee8c32aff4", + "https://deno.land/std@0.217.0/assert/assert.ts": "bec068b2fccdd434c138a555b19a2c2393b71dfaada02b7d568a01541e67cdc5", + "https://deno.land/std@0.217.0/assert/assert_almost_equals.ts": "8b96b7385cc117668b0720115eb6ee73d04c9bcb2f5d2344d674918c9113688f", + "https://deno.land/std@0.217.0/assert/assert_array_includes.ts": "1688d76317fd45b7e93ef9e2765f112fdf2b7c9821016cdfb380b9445374aed1", + "https://deno.land/std@0.217.0/assert/assert_equals.ts": "4497c56fe7d2993b0d447926702802fc0becb44e319079e8eca39b482ee01b4e", + "https://deno.land/std@0.217.0/assert/assert_exists.ts": "24a7bf965e634f909242cd09fbaf38bde6b791128ece08e33ab08586a7cc55c9", + "https://deno.land/std@0.217.0/assert/assert_false.ts": "6f382568e5128c0f855e5f7dbda8624c1ed9af4fcc33ef4a9afeeedcdce99769", + "https://deno.land/std@0.217.0/assert/assert_greater.ts": "4945cf5729f1a38874d7e589e0fe5cc5cd5abe5573ca2ddca9d3791aa891856c", + "https://deno.land/std@0.217.0/assert/assert_greater_or_equal.ts": "573ed8823283b8d94b7443eb69a849a3c369a8eb9666b2d1db50c33763a5d219", + "https://deno.land/std@0.217.0/assert/assert_instance_of.ts": "72dc1faff1e248692d873c89382fa1579dd7b53b56d52f37f9874a75b11ba444", + "https://deno.land/std@0.217.0/assert/assert_is_error.ts": "6596f2b5ba89ba2fe9b074f75e9318cda97a2381e59d476812e30077fbdb6ed2", + "https://deno.land/std@0.217.0/assert/assert_less.ts": "2b4b3fe7910f65f7be52212f19c3977ecb8ba5b2d6d0a296c83cde42920bb005", + "https://deno.land/std@0.217.0/assert/assert_less_or_equal.ts": "b93d212fe669fbde959e35b3437ac9a4468f2e6b77377e7b6ea2cfdd825d38a0", + "https://deno.land/std@0.217.0/assert/assert_match.ts": "ec2d9680ed3e7b9746ec57ec923a17eef6d476202f339ad91d22277d7f1d16e1", + "https://deno.land/std@0.217.0/assert/assert_not_equals.ts": "ac86413ab70ffb14fdfc41740ba579a983fe355ba0ce4a9ab685e6b8e7f6a250", + "https://deno.land/std@0.217.0/assert/assert_not_instance_of.ts": "8f720d92d83775c40b2542a8d76c60c2d4aeddaf8713c8d11df8984af2604931", + "https://deno.land/std@0.217.0/assert/assert_not_match.ts": "b4b7c77f146963e2b673c1ce4846473703409eb93f5ab0eb60f6e6f8aeffe39f", + "https://deno.land/std@0.217.0/assert/assert_not_strict_equals.ts": "da0b8ab60a45d5a9371088378e5313f624799470c3b54c76e8b8abeec40a77be", + "https://deno.land/std@0.217.0/assert/assert_object_match.ts": "e85e5eef62a56ce364c3afdd27978ccab979288a3e772e6855c270a7b118fa49", + "https://deno.land/std@0.217.0/assert/assert_rejects.ts": "e9e0c8d9c3e164c7ac962c37b3be50577c5a2010db107ed272c4c1afb1269f54", + "https://deno.land/std@0.217.0/assert/assert_strict_equals.ts": "0425a98f70badccb151644c902384c12771a93e65f8ff610244b8147b03a2366", + "https://deno.land/std@0.217.0/assert/assert_string_includes.ts": "dfb072a890167146f8e5bdd6fde887ce4657098e9f71f12716ef37f35fb6f4a7", + "https://deno.land/std@0.217.0/assert/assert_throws.ts": "edddd86b39606c342164b49ad88dd39a26e72a26655e07545d172f164b617fa7", + "https://deno.land/std@0.217.0/assert/assertion_error.ts": "9f689a101ee586c4ce92f52fa7ddd362e86434ffdf1f848e45987dc7689976b8", + "https://deno.land/std@0.217.0/assert/equal.ts": "fae5e8a52a11d3ac694bbe1a53e13a7969e3f60791262312e91a3e741ae519e2", + "https://deno.land/std@0.217.0/assert/fail.ts": "f310e51992bac8e54f5fd8e44d098638434b2edb802383690e0d7a9be1979f1c", + "https://deno.land/std@0.217.0/assert/mod.ts": "325df8c0683ad83a873b9691aa66b812d6275fc9fec0b2d180ac68a2c5efed3b", + "https://deno.land/std@0.217.0/assert/unimplemented.ts": "47ca67d1c6dc53abd0bd729b71a31e0825fc452dbcd4fde4ca06789d5644e7fd", + "https://deno.land/std@0.217.0/assert/unreachable.ts": "38cfecb95d8b06906022d2f9474794fca4161a994f83354fd079cac9032b5145", + "https://deno.land/std@0.217.0/collections/_utils.ts": "fc59674548a4dd9f5c3cc4f99f9c264aa521a52c1a4ff56b0263713e57e79206", + "https://deno.land/std@0.217.0/collections/aggregate_groups.ts": "c63a57a16e87537ee71df1174a111e2c4cd05f0d4be83db701c8740e81bd157c", + "https://deno.land/std@0.217.0/collections/associate_by.ts": "8c09c6a66769480f3181bd7b582796aed85fa71e2595c1b3d73684b9caae33b1", + "https://deno.land/std@0.217.0/collections/associate_with.ts": "5cbbdb53ffb0160338b86d7c3ba6e0b343c66d5104ccff4430dd766c603ea3d4", + "https://deno.land/std@0.217.0/collections/chunk.ts": "e6e533d6ae047f2082892831d463426f79cdd0d3f09ce298317a8469abf8467e", + "https://deno.land/std@0.217.0/collections/deep_merge.ts": "04f8d2a6cfa15c7580e788689bcb5e162512b9ccb18bab1241824b432a78551e", + "https://deno.land/std@0.217.0/collections/distinct.ts": "42d81633e4ccd5ea89118cb08f875bbfc683ac6620df2fa60f3d07270b177f4d", + "https://deno.land/std@0.217.0/collections/distinct_by.ts": "e895705decb0ce88b31c6679fd4e2bd08ac6d47cde7d00bf2016e3c2bac565a7", + "https://deno.land/std@0.217.0/collections/drop_last_while.ts": "4bfb91818d0165b172843bfd41a8b988e566b23a29e038794ca832118de150bf", + "https://deno.land/std@0.217.0/collections/drop_while.ts": "cf15d7f83ece2828e1fe04bbe04b646801d11be9c259a0f47c1b0ac2aa7dabdf", + "https://deno.land/std@0.217.0/collections/filter_entries.ts": "12202e99001695fcf541ec0191e9762fe7290ba4597df762d3a0c6e611a1aafe", + "https://deno.land/std@0.217.0/collections/filter_keys.ts": "bf8eaae2769e6ddd34f23ba1912f7feda2b6f374253c07a6630e9a2e384ba611", + "https://deno.land/std@0.217.0/collections/filter_values.ts": "ad8fae5751977598f8c794d65f0d42c9f9e47a7d774cf82b2449cd78ff4f729a", + "https://deno.land/std@0.217.0/collections/find_single.ts": "d2f69dd19d85c85d0f82ffff18517076795fe8a4a960b75f33b00655e070d6f7", + "https://deno.land/std@0.217.0/collections/first_not_nullish_of.ts": "cc5581ace9b896c83b9c002dc90a2f7b4c5dcddc319d78542287479dd348c300", + "https://deno.land/std@0.217.0/collections/includes_value.ts": "c5755ad1ac0b95cdc60ca794ada0e65e85ecad96729a9f6cd715516b77497564", + "https://deno.land/std@0.217.0/collections/intersect.ts": "9a4427ce81bd0982f4e6e65c51da99648b09f89ed0e4950fcf89fc7052336e60", + "https://deno.land/std@0.217.0/collections/join_to_string.ts": "6f3441958aeb382e8e35be527e5ff5e6f6346e83ac4c17fe3f9fa293eff0f18e", + "https://deno.land/std@0.217.0/collections/map_entries.ts": "45b8bf3f197ee24abe2e078213a4cf2f4e187ad130649fff34e13b1a03ede478", + "https://deno.land/std@0.217.0/collections/map_keys.ts": "2fd91963117d2376ea6dbbe473d77c20ede79b72437ed0dac36161b1af62f058", + "https://deno.land/std@0.217.0/collections/map_not_nullish.ts": "f519f74db550afcf6c6e2486382cb4dc6b0465e4234b6acca26910d118e7dd55", + "https://deno.land/std@0.217.0/collections/map_values.ts": "91d6ece4b4dc4b94abc378f51e0e309e7f7f18b2ce4c335dab673a31ebd17c75", + "https://deno.land/std@0.217.0/collections/max_by.ts": "a601c296d54349097d5b424bc86c84010ab22733b622b480e2ad65927063d7bb", + "https://deno.land/std@0.217.0/collections/max_of.ts": "a56297ed49ee42eb948d348451c9158c9f7b8e4e1fc0259829e945924893ca07", + "https://deno.land/std@0.217.0/collections/max_with.ts": "ea4838b17246166991ed033c52b43f04be957168c12bdb193b0f8ffdd046a6d0", + "https://deno.land/std@0.217.0/collections/min_by.ts": "79477d359b5882acf670179ba18ac619b63bb01f8a681d067f9fb318f3367dfe", + "https://deno.land/std@0.217.0/collections/min_of.ts": "a80b6881494f505fe42c160317225c99a69bf393419563063ac2dd258cffd9b2", + "https://deno.land/std@0.217.0/collections/min_with.ts": "94e011b9f0329be593527975c5f511b02010c4f42a50098297cb5012a418ac76", + "https://deno.land/std@0.217.0/collections/mod.ts": "f498e896cea2898577430cdee944a77b4a062028074464441cddebfe51670454", + "https://deno.land/std@0.217.0/collections/partition.ts": "22689dc4834bbcaa06f9ac204ac5502ab0f7087d7fca26bad50319c12434d099", + "https://deno.land/std@0.217.0/collections/partition_entries.ts": "4112ef54d8f1b24a281a432d1d55e183c260139da9153a8449021884ff2bd675", + "https://deno.land/std@0.217.0/collections/permutations.ts": "976f444c0fe52f764ad473d2dbcfbc5a97a3066aebed2f809e084c548dcf7f19", + "https://deno.land/std@0.217.0/collections/reduce_groups.ts": "59a375aec7dfacdf1f22c39e618fbbfbfb50ed36e338b1c57c704beadaeef2a7", + "https://deno.land/std@0.217.0/collections/running_reduce.ts": "b8b4b5bf0b3d61db8fc0993b9e7e630fba299e360c463ebb0d3ce7e12a65abeb", + "https://deno.land/std@0.217.0/collections/sample.ts": "bdf721d86a6eb3d27ae419aea92a2f24a3de19772b24aad831064e8a0ff7ecd1", + "https://deno.land/std@0.217.0/collections/sliding_windows.ts": "254402e0603a94063a90e5561c48435c2fb278b8915e801632b8deebdd731219", + "https://deno.land/std@0.217.0/collections/sort_by.ts": "c84b51b70e9698313c021d11531a1eb07ddda0f423b7778e3cda24663c8b0eaa", + "https://deno.land/std@0.217.0/collections/sum_of.ts": "a7617a77c2501a54dedf50bc4211ca6c06c9678eee00c31a63e187cc8f0b3b97", + "https://deno.land/std@0.217.0/collections/take_last_while.ts": "d6e05d89e17c4e59015aff3b8e2b08a9d72314c77363590c0db2775f43cbf47b", + "https://deno.land/std@0.217.0/collections/take_while.ts": "b281c439e5195bc1e8a7f75aa538b4a920aeae9b29a45f0df468b4f48434506d", + "https://deno.land/std@0.217.0/collections/union.ts": "7eaec5f85dbf115e14695a740ce43b0463f6202ee2b10408b31efa7b4eeb1968", + "https://deno.land/std@0.217.0/collections/unzip.ts": "7dbe500a7b283a4ad6000316f98e0f590f084be103b3ea2e0519a7e3d98a38b2", + "https://deno.land/std@0.217.0/collections/without_all.ts": "c85ec7c536037385d1b99f9820ccb0e05eea385422e74132c8c081f4dcb353e5", + "https://deno.land/std@0.217.0/collections/zip.ts": "5320938b447da8a8ed4811d6248829886c7ddd088e1653cfce6e59d0abb73692", + "https://deno.land/std@0.217.0/fmt/colors.ts": "d239d84620b921ea520125d778947881f62c50e78deef2657073840b8af9559a", + "https://deno.land/std@0.224.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", + "https://deno.land/std@0.224.0/assert/assert.ts": "09d30564c09de846855b7b071e62b5974b001bb72a4b797958fe0660e7849834", + "https://deno.land/std@0.224.0/assert/assert_almost_equals.ts": "9e416114322012c9a21fa68e187637ce2d7df25bcbdbfd957cd639e65d3cf293", + "https://deno.land/std@0.224.0/assert/assert_array_includes.ts": "14c5094471bc8e4a7895fc6aa5a184300d8a1879606574cb1cd715ef36a4a3c7", + "https://deno.land/std@0.224.0/assert/assert_equals.ts": "3bbca947d85b9d374a108687b1a8ba3785a7850436b5a8930d81f34a32cb8c74", + "https://deno.land/std@0.224.0/assert/assert_exists.ts": "43420cf7f956748ae6ed1230646567b3593cb7a36c5a5327269279c870c5ddfd", + "https://deno.land/std@0.224.0/assert/assert_false.ts": "3e9be8e33275db00d952e9acb0cd29481a44fa0a4af6d37239ff58d79e8edeff", + "https://deno.land/std@0.224.0/assert/assert_greater.ts": "5e57b201fd51b64ced36c828e3dfd773412c1a6120c1a5a99066c9b261974e46", + "https://deno.land/std@0.224.0/assert/assert_greater_or_equal.ts": "9870030f997a08361b6f63400273c2fb1856f5db86c0c3852aab2a002e425c5b", + "https://deno.land/std@0.224.0/assert/assert_instance_of.ts": "e22343c1fdcacfaea8f37784ad782683ec1cf599ae9b1b618954e9c22f376f2c", + "https://deno.land/std@0.224.0/assert/assert_is_error.ts": "f856b3bc978a7aa6a601f3fec6603491ab6255118afa6baa84b04426dd3cc491", + "https://deno.land/std@0.224.0/assert/assert_less.ts": "60b61e13a1982865a72726a5fa86c24fad7eb27c3c08b13883fb68882b307f68", + "https://deno.land/std@0.224.0/assert/assert_less_or_equal.ts": "d2c84e17faba4afe085e6c9123a63395accf4f9e00150db899c46e67420e0ec3", + "https://deno.land/std@0.224.0/assert/assert_match.ts": "ace1710dd3b2811c391946954234b5da910c5665aed817943d086d4d4871a8b7", + "https://deno.land/std@0.224.0/assert/assert_not_equals.ts": "78d45dd46133d76ce624b2c6c09392f6110f0df9b73f911d20208a68dee2ef29", + "https://deno.land/std@0.224.0/assert/assert_not_instance_of.ts": "3434a669b4d20cdcc5359779301a0588f941ffdc2ad68803c31eabdb4890cf7a", + "https://deno.land/std@0.224.0/assert/assert_not_match.ts": "df30417240aa2d35b1ea44df7e541991348a063d9ee823430e0b58079a72242a", + "https://deno.land/std@0.224.0/assert/assert_not_strict_equals.ts": "37f73880bd672709373d6dc2c5f148691119bed161f3020fff3548a0496f71b8", + "https://deno.land/std@0.224.0/assert/assert_object_match.ts": "411450fd194fdaabc0089ae68f916b545a49d7b7e6d0026e84a54c9e7eed2693", + "https://deno.land/std@0.224.0/assert/assert_rejects.ts": "4bee1d6d565a5b623146a14668da8f9eb1f026a4f338bbf92b37e43e0aa53c31", + "https://deno.land/std@0.224.0/assert/assert_strict_equals.ts": "b4f45f0fd2e54d9029171876bd0b42dd9ed0efd8f853ab92a3f50127acfa54f5", + "https://deno.land/std@0.224.0/assert/assert_string_includes.ts": "496b9ecad84deab72c8718735373feb6cdaa071eb91a98206f6f3cb4285e71b8", + "https://deno.land/std@0.224.0/assert/assert_throws.ts": "c6508b2879d465898dab2798009299867e67c570d7d34c90a2d235e4553906eb", + "https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917", + "https://deno.land/std@0.224.0/assert/equal.ts": "bddf07bb5fc718e10bb72d5dc2c36c1ce5a8bdd3b647069b6319e07af181ac47", + "https://deno.land/std@0.224.0/assert/fail.ts": "0eba674ffb47dff083f02ced76d5130460bff1a9a68c6514ebe0cdea4abadb68", + "https://deno.land/std@0.224.0/assert/mod.ts": "48b8cb8a619ea0b7958ad7ee9376500fe902284bb36f0e32c598c3dc34cbd6f3", + "https://deno.land/std@0.224.0/assert/unimplemented.ts": "8c55a5793e9147b4f1ef68cd66496b7d5ba7a9e7ca30c6da070c1a58da723d73", + "https://deno.land/std@0.224.0/assert/unreachable.ts": "5ae3dbf63ef988615b93eb08d395dda771c96546565f9e521ed86f6510c29e19", + "https://deno.land/std@0.224.0/collections/_utils.ts": "b2ec8ada31b5a72ebb1d99774b849b4c09fe4b3a38d07794bd010bd218a16e0b", + "https://deno.land/std@0.224.0/collections/deep_merge.ts": "04f8d2a6cfa15c7580e788689bcb5e162512b9ccb18bab1241824b432a78551e", + "https://deno.land/std@0.224.0/fmt/colors.ts": "508563c0659dd7198ba4bbf87e97f654af3c34eb56ba790260f252ad8012e1c5", + "https://deno.land/std@0.224.0/internal/diff.ts": "6234a4b493ebe65dc67a18a0eb97ef683626a1166a1906232ce186ae9f65f4e6", + "https://deno.land/std@0.224.0/internal/format.ts": "0a98ee226fd3d43450245b1844b47003419d34d210fa989900861c79820d21c2", + "https://deno.land/std@0.224.0/internal/mod.ts": "534125398c8e7426183e12dc255bb635d94e06d0f93c60a297723abe69d3b22e", + "https://esm.sh/nanoevents@9.0.0": "29ccd1d8839f2d7dd8d28ad9ec5d18723a7dbf966bf29179063442b1e88b3a4f", + "https://esm.sh/v135/nanoevents@9.0.0/denonext/nanoevents.mjs": "666c9d584019a64758bd3071e561051747454da64299ac06b79ede7210fe5e85", + "https://esm.sh/v135/zod-validation-error@3.3.0/denonext/zod-validation-error.mjs": "4efabd593e1430c31a044f79d299a62120946a3e701159b29922b50f3223c186", + "https://esm.sh/v135/zod@3.23.8/denonext/zod.mjs": "b3707b03ddc01aab11b740436ab23c0fcc8d15fed072be20085c1fd611016b61", + "https://esm.sh/zod-validation-error@3.3.0": "d8825ca67952b6adff6b35026dc465f9638d4923dbd54fe9e8e81fbfddca9630", + "https://esm.sh/zod@3.23.8": "728819c1f651800179a5a80daf24b3e54b2ddea87828bd10e63875a604bcb94e" + } +} diff --git a/sandbox/game_server/src/index.ts b/sandbox/game_server/src/index.ts index 02e405f1..1d79dcce 100644 --- a/sandbox/game_server/src/index.ts +++ b/sandbox/game_server/src/index.ts @@ -59,7 +59,7 @@ let gameConfig = { interface GameState { lobbyConfig: any; lobbyTags: any; - scores: { [id: number]: number }; + scores: Record; } const gameState: GameState = { diff --git a/sandbox/backend.dev.json b/sandbox/rivet.dev.json similarity index 90% rename from sandbox/backend.dev.json rename to sandbox/rivet.dev.json index 7506b238..3755ddf8 100644 --- a/sandbox/backend.dev.json +++ b/sandbox/rivet.dev.json @@ -1,5 +1,5 @@ { - "extends": "./backend.json", + "extends": "./rivet.json", "modules": { "lobbies": { "registry": "local", diff --git a/sandbox/backend.json b/sandbox/rivet.json similarity index 100% rename from sandbox/backend.json rename to sandbox/rivet.json diff --git a/sandbox/scripts/fetch_state.ts b/sandbox/scripts/fetch_state.ts index 7872b789..b251a471 100755 --- a/sandbox/scripts/fetch_state.ts +++ b/sandbox/scripts/fetch_state.ts @@ -1,8 +1,8 @@ #!/usr/bin/env -S deno run -A -const origin = Deno.env.get("OPENGB_ORIGIN"); +const endpoint = Deno.env.get("BACKEND_ENDPOINT"); -const res = await fetch(`${origin}/modules/lobbies/scripts/fetch_lobby_manager_state/call`, { +const res = await fetch(`${endpoint}/modules/lobbies/scripts/fetch_lobby_manager_state/call`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/sandbox/scripts/gen_sdk.ts b/sandbox/scripts/gen_sdk.ts deleted file mode 100755 index d9f9df57..00000000 --- a/sandbox/scripts/gen_sdk.ts +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env -S deno run -A - -// import * as esbuild from "https://deno.land/x/esbuild@v0.20.2/mod.js"; -// import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@^0.10.3"; -// import { generate } from "https://deno.land/x/dts_generate@v1.4.0/mod.ts"; -// import { build } from 'https://esm.sh/tsup' -import "npm:typescript"; -import { build } from "npm:tsup"; -import { resolve } from "https://deno.land/std@0.208.0/path/resolve.ts"; - -const entryPath = resolve(Deno.cwd(), "./sdk/src/index.ts"); -const outDir = resolve(Deno.cwd(), "./client/dist/"); - -const genOutput = await new Deno.Command( - "opengb", - { - args: ["sdk", "generate", "typescript"], - stdout: "inherit", - stderr: "inherit", - }, -).output(); -if (!genOutput.success) throw new Error("gen failed"); - -Deno.chdir(resolve(Deno.cwd(), "sdk")); - -await new Deno.Command("npm", { args: ["install"], stdout: "inherit", stderr: "inherit" }).output(); - -await new Deno.Command("npm", { args: ["run", "build"], stdout: "inherit", stderr: "inherit" }).output(); - -await build({ - entry: { sdk: entryPath }, - outDir, - sourcemap: true, - dts: true, - target: "es2022", - format: "esm", -}); - -// TODO: Do we need to polyfill anything to target es6? -// const result = await esbuild.build({ -// entryPoints: ['./sdk/src/index.ts'], -// outfile, -// platform: "browser", -// format: "esm", -// target: 'es2022', -// sourcemap: true, -// plugins: denoPlugins(), -// bundle: true, -// }); -// -// console.log('Build complete:', result); -// -// // Generate .d.ts file -// // const dtsResult = await generate({ -// // entries: ['./src/main.ts'], -// // output: outfile.replace('.js', '.d.ts'), -// // }); -// -// const output = await new Deno.Command( -// "tsc", -// { -// args: ["--project", "sdk/tsconfig.json", "--outFile", dtsOutFile], -// // args: ["--emitDeclarationOnly", "--declaration", "--declarationMap", "--project", "sdk/tsconfig.json", "--outFile", dtsOutFile], -// stdout: "inherit", -// stderr: "inherit", -// } -// ).output(); -// if (!output.success) throw new Error("tsc failed"); -// -// console.log('Declaration file generated'); -// -// esbuild.stop(); \ No newline at end of file diff --git a/sandbox/scripts/reset_state.ts b/sandbox/scripts/reset_state.ts index 52736b87..11700b5f 100755 --- a/sandbox/scripts/reset_state.ts +++ b/sandbox/scripts/reset_state.ts @@ -1,8 +1,8 @@ #!/usr/bin/env -S deno run -A -const origin = Deno.env.get("OPENGB_ORIGIN"); +const endpoint = Deno.env.get("BACKEND_ENDPOINT"); -const res = await fetch(`${origin}/modules/lobbies/scripts/reset_lobby_manager_state/call`, { +const res = await fetch(`${endpoint}/modules/lobbies/scripts/reset_lobby_manager_state/call`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/sandbox/scripts/run_local_backend.sh b/sandbox/scripts/run_local_backend.sh index 00b20f4d..a34884ab 100755 --- a/sandbox/scripts/run_local_backend.sh +++ b/sandbox/scripts/run_local_backend.sh @@ -1,3 +1,3 @@ #!/bin/sh -opengb dev --project backend.dev.json +rivet dev --project rivet.dev.json From 47deee24d4d72980cc6a2088dec4d6c285aa1ed4 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Sep 2024 21:39:51 -0700 Subject: [PATCH 7/7] chore(lobbies): remove crash on invalid transport (#165) --- modules/lobbies/sdk_addons/godot/multiplayer_manager.gd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd b/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd index 1bbdb785..6b9670a0 100644 --- a/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd +++ b/modules/lobbies/sdk_addons/godot/multiplayer_manager.gd @@ -134,7 +134,7 @@ func setup_multiplayer(): multiplayer.set_multiplayer_peer(peer) else: RivetLogger.error("Unsupported transport: %s" % transport) - OS.crash("Unsupported transport") + return # Notify lobby ready var request = { @@ -146,8 +146,11 @@ func setup_multiplayer(): if response.is_ok(): RivetLogger.log("Lobby ready") else: - RivetLogger.warning("Lobby ready failed failed: %s" % response.body) + RivetLogger.error("Lobby ready failed failed: %s" % response.body) + + # Crash the server so Rivet stops waiting for the server to start OS.crash("Lobby ready failed") + return ## Connect to a lobby returned from the backend.