Skip to content

ConnectionApprovalCallback reasons #259

@derekdominoes

Description

@derekdominoes

Is your feature request related to a problem? Please describe.
There are many reasons a ConnectionApproval may be denied by a server. The two obvious cases are that the "connectionData' passed from the client does not contain the proper 'code' the server expects for allowing approval to the game or that the network connection to the server can not be reached (server down or network timeout).

However, other possibilities exist. The game may be full (maximum players allowed) or already in progress, etc... It would be useful if a 'reason' for approval being denied can be supplied back to the client. This would allow the client to make choices or display appropriate information to the user ("Game is full").

Describe the solution you'd like
One possible solution is to have both ConnectionApprovalCallback and OnClientDisconnectCallback be extended with an optional parameter (uint?) allowing information to be passed. It is also desirable if the internal state of any networking error be known to the client so this could be distinguished from server reasons.

Describe alternatives you've considered
I thought about sending an RPC message with the reason. But the "pending" client understandably doesn't seem to have a NetworkBehaviour I can get yet to call InvokeClientRpxXxx on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature, request or improvement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions