refactor: improve multiplayer connection lifecycle
* Move client/server connection handling into game-specific networking classes * Add multiplayer data reset for disconnected clients * Clean up invalid MessageBus listeners after disconnects * Persist lobby host address and port in game data * Standardize the default server port to 8080 * Increase server address input length to support valid addresses * Remove obsolete connection and match initialization logic from base networking
This commit is contained in:
@@ -28,7 +28,11 @@ func _on_home_bttn_pressed() -> void:
|
||||
)
|
||||
|
||||
func _on_host_connect_bttn_pressed() -> void:
|
||||
client.start_client(host_address_input.text, int(host_port_range.value))
|
||||
Globals.game_data.game_address = host_address_input.text
|
||||
Globals.game_data.game_port = int(host_port_range.value)
|
||||
client.start_client(
|
||||
Globals.game_data.game_address, Globals.game_data.game_port
|
||||
)
|
||||
|
||||
func _on_host_disconnect_bttn_pressed() -> void:
|
||||
match_create_vbox.visible = false
|
||||
|
||||
Reference in New Issue
Block a user