Skip to content

peer_disconnected documentation does not mirror that of peer_connected #11122

@jcoppock

Description

@jcoppock

Your Godot version:
v4.5.beta1.mono.official [46c495ca2]

Issue description:
The documentation for peer_connected and peer_disconnected is inconsistent. They both receive signals when the server (peer ID of 1) connects or disconnects, but it's only mentioned on peer_connected. Assuming a disconnect signal would be received because a connect signal is received may be efficient, but I did not make that assumption at first, hence this issue.

Here's a simple code example that just shows the signal connections. (This example does not show the other aspects of setting up networking)

func _ready() -> void:
	multiplayer.peer_connected.connect(_on_peer_connected)
	multiplayer.peer_disconnected.connect(_on_peer_disconnected)

func _on_peer_connected(id: int) -> void:
	print("Peer connected: ", id)

func _on_peer_disconnected(id: int) -> void:
	print("Peer disconnected: ", id)

Here is a screenshot of my client logs after starting the server, connecting a client, and stopping the server.

Image

URL to the documentation page (if already existing):
MultiplayerAPI#peer_disconnected

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositorybugtopic:network

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions