Skip to content

Inconsistencies in the on client connected and disconnected callbacks #1880

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

Closed
NaolShow opened this issue Apr 17, 2022 · 1 comment · Fixed by #2789
Closed

Inconsistencies in the on client connected and disconnected callbacks #1880

NaolShow opened this issue Apr 17, 2022 · 1 comment · Fixed by #2789
Assignees

Comments

@NaolShow
Copy link

NaolShow commented Apr 17, 2022

Transport inconsistencies

So while moving from UNetTransport to UnityTransport I found that there is an inconsistencies between those two with the OnClientDisconnected callback (from NetworkManager). This only happens when being a client-only, so not the host and not the server.

Here's the difference between the two:

  • When using UNetTransport: The event is triggered when the local client is getting disconnected from the server (either kicked or failed connection approval)
  • When using UnityTransport: Same as UnetTransport BUT also triggers when the client shutdowns the network (and so disconnects intentionnaly)

This is a small inconsistencies, but it messed up with my game behaviour after moving to UnityTransport. The question is which one of the behaviour is the correct one?
For me, the most logical one is UnityTransport and so UNetTransport have a problem with the OnClientDisconnected event.

Other inconsistencies

Here it's the same, some inconsistencies, (not related to transport), but they are also annoying (I use workarounds in my game):

OnClientConnectedCallback:

  • In server(host or server only): Called when a client connects and passed the connection approval (including host) => This works
  • In client(host or client only): Same that the server, but this triggers only for local client => Works

OnClientDisconnectedCallback (here are the inconsistencies):

  • In server(host or server only): Called when a client disconnects BUT doesn't get called when the host disconnects => Inconsistencies with on ClientConnectedCallback
  • In client(client only): See the first part of my message (inconsistencies between transport) but it should logically have the same behaviour as the UnityTransport

I am using the latest Netcode release (1.0.0-pre.7)

@NaolShow NaolShow added the stat:awaiting-triage Status - Awaiting triage from the Netcode team. label Apr 17, 2022
@johann-r-unity
Copy link
Contributor

Hi @NaolShow ,
Thank you for reaching out.
Unet transport is deprecated and will not be supported in the future.
Is it recommended to use UnityTransport instead.
Have a nice day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants