Skip to content

Improve Disconnect Logging for Clients #3789

@Reag

Description

@Reag

Is your feature request related to a problem? Please describe.
In our project, we have a pretty simple problem: why has a client been disconnected? Disconnects can happen for a variety of reasons, ranging from timeouts, bad netcode configurations, or version mismatches. Having inspected the code in the ConnectionRequestMessage, its clear that the server knows why a client is disconnected. However, this info is never shared with the client, leading to confusion about why the user cannot join the server. Given that we operate in a cloud environment, with the server running in a container, we need some way to inform the clients why they cannot connect.

Describe the solution you'd like
Ideally, we would like to have some kind of enum that is pass in with the DisconnectClient event that identifies why this is occurring. Currently, there is 'string reason = null' that is passed, but almost all of netcodes internal functions leave this as null. For example, the Deserialize function from ConnectionRequestMessage knows that a client has a version mismatch. However, it returns the default 'reason' for said disconnect, making any logic related to version mismatches impossible.

Describe alternatives you've considered
We have considered implementing our own version checks via the ConnectionApproval systems byte array payload. While that would solve this particular issue, it wouldn't help with other internal failures that happen after a client is connected (Say, failure during scene sync).

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:awaiting-triageStatus - Awaiting triage from the Netcode team.stat:reply-neededAwaiting reply from Unity accounttype:featureNew feature, request or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions