server: sending connected client names instead of count on every (dis)connect
This commit is contained in:
@@ -23,7 +23,7 @@ func _on_create_lobby_button_pressed() -> void:
|
||||
client.create_lobby(name_input.text.strip_edges())
|
||||
|
||||
func _on_connect_button_pressed() -> void:
|
||||
client.connect_to_server($MarginContainer/VBoxContainer/URLInput.text)
|
||||
client.connect_to_server($MarginContainer/VBoxContainer/ServerInputs/URLInput.text)
|
||||
|
||||
func _on_join_lobby_button_pressed() -> void:
|
||||
client.join_lobby(lobby_code_input.text.strip_edges(), name_input.text.strip_edges())
|
||||
@@ -54,7 +54,7 @@ func _on_web_client_tcp_connected_to_lobby(lobby_id: String) -> void:
|
||||
func _on_web_client_tcp_disconnected_from_lobby() -> void:
|
||||
_write_line("You disconnected from the lobby")
|
||||
|
||||
func _on_web_client_tcp_client_joined_lobby(client_name: String) -> void:
|
||||
func _on_web_client_tcp_client_joined_lobby(client_name: String, currently_connected_client_names: Array) -> void:
|
||||
_write_line("{client_name} joined the lobby{you}".format({
|
||||
"client_name": client_name,
|
||||
"you": " (that's you!)" if client_name == name_input.text.strip_edges() else ""
|
||||
@@ -66,7 +66,7 @@ func _on_web_client_tcp_received_chat_message(client_name: String, message: Stri
|
||||
"message": message,
|
||||
}))
|
||||
|
||||
func _on_web_client_tcp_client_left_lobby(client_name: String) -> void:
|
||||
func _on_web_client_tcp_client_left_lobby(client_name: String, currently_connected_client_names: Array) -> void:
|
||||
_write_line("{client_name} left the lobby".format({"client_name": client_name}))
|
||||
|
||||
func _on_web_client_tcp_connection_status_changed(new_status: WebClientTCP.ConnectionStatus) -> void:
|
||||
|
||||
Reference in New Issue
Block a user