Files
Billiards/game_client.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

36 lines
849 B
GDScript

class_name GameClient extends ClientNetworking
func _ready() -> void:
setup_signals()
func setup_signals() -> void:
MessageBus.subscribe("game_start_client", _start_client)
MessageBus.subscribe("game_wait_for_connection", _wait_for_connection)
MessageBus.subscribe("game_close_connection", _wait_close_connection)
func _start_client(address: String = "127.0.0.1", port: int = 8080) -> void:
if peer: return
start_client(address, port)
func client_connected_to_server() -> void:
push_warning("Connected to server!")
func close_connection() -> void:
if not peer: return
push_warning("Disconnected from, server...")
unset_client()
func client_disconnected_from_server() -> void:
push_warning("Disconnected from, server...")
func client_connection_failed_to_server() -> void:
push_warning("Connection failed!")
unset_client()