Refactor message bus and lobby networking flow
* Add local message bus emission with optional argument expansion * Improve message type validation and callback dispatch * Simplify lobby match join/disconnect handling * Move lobby server networking toward an overridable `ServerNetworking` base class * Update lobby scene to use the dedicated lobby server script * Remove obsolete window configuration and unused RPC stubs
This commit is contained in:
@@ -56,12 +56,8 @@ func _on_match_list_entry_removed(match_id: String) -> void:
|
||||
match_entry.queue_free()
|
||||
|
||||
func _on_match_list_join_entry(match_id: String) -> void:
|
||||
Globals.lobby_data.match_list_join_entry(match_id)
|
||||
push_warning("Client Joining Match List Entry... ", match_id)
|
||||
|
||||
if Globals.lobby_data.match_pool.has(match_id): return
|
||||
|
||||
_on_match_list_entry_removed(match_id)
|
||||
Globals.lobby_data.match_list_join_entry(match_id)
|
||||
|
||||
func _create_match_entry(match_entry: Dictionary) -> void:
|
||||
var container = MATCH_ENTRY.instantiate()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[ext_resource type="Script" uid="uid://dk7afnf7ol7dy" path="res://scenes/screens/lobby_screen/lobby.gd" id="1_hhiik"]
|
||||
[ext_resource type="PackedScene" uid="uid://rb6av5eg4u0" path="res://scenes/ui_controls/lobby_screen/lobby_ui.tscn" id="2_lqt48"]
|
||||
[ext_resource type="Script" uid="uid://6sfwe1hwgf0g" path="res://scenes/screens/lobby_screen/lobby_rpc.gd" id="3_rurl6"]
|
||||
[ext_resource type="Script" uid="uid://bvqtgf3vbsoj4" path="res://scripts/server_networking.gd" id="4_glu7g"]
|
||||
[ext_resource type="Script" uid="uid://crbm3v4td6du6" path="res://scenes/screens/lobby_screen/lobby_server.gd" id="4_glu7g"]
|
||||
|
||||
[node name="lobby_screen" type="Control"]
|
||||
layout_mode = 3
|
||||
|
||||
19
scenes/screens/lobby_screen/lobby_server.gd
Normal file
19
scenes/screens/lobby_screen/lobby_server.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
class_name Lobbyserver extends ServerNetworking
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func server_client_connected(id: int) -> void:
|
||||
Globals.lobby_data.server_client_connected(id)
|
||||
|
||||
func server_client_disconnected(id: int) -> void:
|
||||
# NOTE: Wait for clients to fully disconnect...
|
||||
var timer = get_tree().create_timer(1)
|
||||
await timer.timeout
|
||||
|
||||
Globals.lobby_data.server_client_disconnected(id)
|
||||
1
scenes/screens/lobby_screen/lobby_server.gd.uid
Normal file
1
scenes/screens/lobby_screen/lobby_server.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://crbm3v4td6du6
|
||||
Reference in New Issue
Block a user