diff --git a/godot/bomber/Dockerfile b/godot/bomber/Dockerfile deleted file mode 100644 index 5905a4b..0000000 --- a/godot/bomber/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# MARK: Builder -FROM ghcr.io/rivet-gg/godot-docker/godot:4.2 AS builder -WORKDIR /app -COPY . . -RUN mkdir -p build/linux \ - && godot -v --export-release "Linux/X11" ./build/linux/game.x86_64 --headless - -# MARK: Runner -FROM ubuntu:22.04 -RUN apt update -y \ - && apt install -y expect-dev \ - && rm -rf /var/lib/apt/lists/* \ - && useradd -ms /bin/bash rivet - -COPY --from=builder /app/build/linux/ /app - -# Change to user rivet -USER rivet - -# Unbuffer output so the logs get flushed -CMD ["sh", "-c", "unbuffer /app/game.x86_64 --verbose --headless -- --server | cat"] diff --git a/godot/bomber/rivet.yaml b/godot/bomber/rivet.yaml deleted file mode 100644 index 596e22e..0000000 --- a/godot/bomber/rivet.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# === Rivet Configuration === -# -# - Documentation: https://rivet.gg/learn/godot_ -# - Reference: https://rivet.gg/docs/cloud/api/games/versions/create-game-version -# - More info: https://rivet.gg/docs/general/concepts/version-config -# -# ┌───────────────────────────────────────┐ -# │ This configuration file is empty. │ -# │ Get started at https://rivet.gg/learn │ -# └───────────────────────────────────────┘ - -engine: - godot: - -matchmaker: - max_players: 12 - docker: - dockerfile: "Dockerfile" - ports: - default: - port: 10567 - protocol: "udp" - game_modes: - default: {} diff --git a/godot/bomber/scripts/gamestate.gd b/godot/bomber/scripts/gamestate.gd index ad8ee13..d78ee90 100644 --- a/godot/bomber/scripts/gamestate.gd +++ b/godot/bomber/scripts/gamestate.gd @@ -26,9 +26,6 @@ signal game_error(what) func _ready(): - RivetHelper.start_server.connect(start_server) - RivetHelper.setup_multiplayer() - multiplayer.peer_connected.connect(self._player_connected) multiplayer.peer_disconnected.connect(self._player_disconnected) multiplayer.connected_to_server.connect(self._connected_ok) @@ -40,19 +37,10 @@ func start_server(): print("Starting server on %s" % DEFAULT_PORT) peer = ENetMultiplayerPeer.new() - var error = peer.create_server(DEFAULT_PORT, MAX_PEERS) - RivetHelper._assert(!error, "Could not start server") + peer.create_server(DEFAULT_PORT, MAX_PEERS) multiplayer.set_multiplayer_peer(peer) - var response = await Rivet.matchmaker.lobbies.ready({}) - - if response.result == OK: - RivetHelper.rivet_print("Lobby ready") - else: - RivetHelper.rivet_print("Lobby ready failed") - OS.crash("Lobby ready failed") - # Callback from SceneTree. func _player_connected(id): @@ -125,25 +113,10 @@ func load_world(): func join_game(new_player_name): print("Joining game as %s" % new_player_name) player_name = new_player_name - - var response = await Rivet.matchmaker.lobbies.find({ - "game_modes": ["default"] - }) - - if response.result == OK: - RivetHelper.set_player_token(response.body.player.token) - - var port = response.body.ports.default - print("Connecting to ", port.host) - - peer = ENetMultiplayerPeer.new() - var error = peer.create_client(port.hostname, port.port) - RivetHelper._assert(!error, "Could not start server") - - multiplayer.set_multiplayer_peer(peer) - else: - print("Lobby find failed: ", response) - game_error.emit(response.body) + + peer.create_client("127.0.0.1", DEFAULT_PORT) + + multiplayer.set_multiplayer_peer(peer) func get_player_list(): @@ -160,9 +133,6 @@ func begin_game(): if !multiplayer.is_server(): return - # Tell Rivet that this lobby is closed - await Rivet.matchmaker.lobbies.setClosed({}) - load_world.rpc() var world = get_tree().get_root().get_node("World")