Files
Billiards/scenes/data_bridge/lobby_data.gd
itdominator 93a2be399c refactor: decouple game networking from lobby client
* Replace direct client/server networking references with GameClient/GameServer scenes
* Refactor message bus to support local emission and argument expansion
* Move lobby connection lifecycle handling to message bus events
* Remove multiplayer connection wait helpers and direct lobby client coupling
* Rename Server to ServerNetworking and update lobby client references
* Update scene resources and export configuration
2026-08-09 18:41:18 -05:00

32 lines
674 B
GDScript

class_name LobbyData extends Node
func _init() -> void:
Globals.lobby_data = self
@rpc("authority", "reliable")
func connect_to_game() -> void:
# NOTE: Leave the lobby
MessageBus.emit_local("lobby_close_connection", null)
# NOTE: Join target game server
MessageBus.emit_local(
"game_start_client",
[
Globals.game_data.game_address,
Globals.game_data.game_port
],
true
)
@rpc("authority", "reliable")
func go_back_to_match_screen() -> void:
if multiplayer.is_server(): return
push_warning("Client peer disconnected...")
Globals.game_state.set_game_scene(
"res://scenes/screens/lobby_screen/lobby.tscn"
)