Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Connection Error Callback #33

Open
SnaiperoG3D opened this issue Nov 3, 2021 · 0 comments
Open

Client Connection Error Callback #33

SnaiperoG3D opened this issue Nov 3, 2021 · 0 comments

Comments

@SnaiperoG3D
Copy link

Ill duplicate my post with additional details from Mirror's repo.

As i see there is no way to get client connection errors. 2 examples:

  1. Client connection error before client connect to server. Which means connection not even happend.
    Client Recv: failed to connect to ip=localhost port=7777 reason=System.Net.Sockets.SocketException (0x80004005)
    As a result game start showing loading screen, got this message at console and runs infinity loading screen because there is no way to catch it exept OnClientDisconnect which i dont need because it not make any sence. Because this method happend every time client disconnect, what i dont need. I need an error, to disable loading screen and show popup to client with error what happend to his game.

  2. Server and client different versions i have server running on previos version, and im trying to connect from new version and i have these warnings on console:
    id: 29556. This can happen if no handler was registered for this message.
    NetworkClient: failed to unpack and invoke message. Disconnecting.
    As a result, i start show loading screen, then i got these warnings, connection not happend and i have infinity loading screen. So i want to catch ANY client connection error and do my stuff, like show error popup or something OnClientError() doest work for it. Idk why, it just never called.

Mr.Gadget says:

These are unrelated issues and should be separate tickets.

Mirror has error events that the transport can raise, but the transport has to raise them. File a ticket with the transport's repo to raise NetworkClient.OnErrorEvent. Then you can override Network Manager's OnClientError(Exception exception).

You need to handle a version check with the server before it gets so far as to have broken handlers. Network Authenticator would be well suited to this.

As i understand form Mr.Gadet answer and my findings of kcp code, there is no call of OnErrorEvent on transport. And as a result i cant catch errors to run my code. I can use only OnClientDisconnect but it calls every time when client disconnect what i dont need. Both examples are just examples of client errors that i would like to catch and i can describe a bunch of other errors, but it doesnt metter what kind of errors, its not a point. In other words it would be good to catch ANY client connection error with Network Manager's OnClientError(Exception exception).

@SnaiperoG3D SnaiperoG3D changed the title Client Error Callback Client Connection Error Callback Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants