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:
@@ -23,8 +23,17 @@ func set_active_player_id(id: int) -> void:
|
||||
|
||||
current_turn_player_id = id
|
||||
|
||||
func reset() -> void:
|
||||
multiplayer_synchronizer = MultiplayerSynchronizer.new()
|
||||
synchronizer_config = SceneReplicationConfig.new()
|
||||
current_turn_player_id = -1
|
||||
|
||||
func init_match():
|
||||
is_multiplayer_active = true
|
||||
multiplayer_synchronizer.name = "multiplayer_synchronizer"
|
||||
multiplayer_synchronizer.replication_config = synchronizer_config
|
||||
multiplayer_synchronizer.root_path = "/root/billiards"
|
||||
|
||||
func init_match() -> void:
|
||||
var match_entry = Dictionary()
|
||||
match_entry.set("type", Globals.game_data.game_mode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user