Chykary / FizzySteamworks

A transport for Mirror using Steam / Steamworks.NET
283 stars 32 forks source link

FizzySteam NextClient will not trigger transport's OnDisconnected #46

Open wappenull opened 1 year ago

wappenull commented 1 year ago

NextClient will not call its own OnDisconnected event if disconnection is run via FizzyTransport.Shutdown (which include voluntary disconnect) which does not call NextClient.InternalDisconnect, result in transport.OnClientDisconnected never called, result in NetworkClient.RemoveTransportHandlers never called.

This will become error elsewhere such as client will fire AddPlayerMessage multiple times, etc.

Just to cross post it here from Mirror github repo issue. Full detail is in my comment in that issue.

Solution:

Add following line to your "FizzySteamworks\NextClient.cs" at location in this screen shot.

if( Connected )
    InternalDisconnect( );

image

Chykary commented 1 year ago

Want to submit a PR? Then I can merge and put up a new release. :-)