LiteNetLibManager icon indicating copy to clipboard operation
LiteNetLibManager copied to clipboard

OnClientDisconnected peer. disconnectInfo.Reason: ConnectionFailed

Open astromediaonly opened this issue 1 year ago • 10 comments

Hi, its probably my stupidity but as I cant find it I will ask to be sure:

Is there any potential issue with Unity 6? I did some upgrades and opened my project with new version and surprisingly there were no errors considering LiteNetLib or the Manager but when I start server it shows OnStartServer and acts like everything works ok but when I start client it tryes connection (several UDP packets from what I as able to read from wireshark) but then shows "OnClientDisconnected peer. disconnectInfo.Reason: ConnectionFailed" and I have no idea how to debug that. I did checked the usual stuff like ip and port and that seems to be set correctly for both server and client. If somebody has any idea what to try to figure out where the issue is it would be great as Im out of options I know.

astromediaonly avatar Mar 03 '25 21:03 astromediaonly

I face this problem too, going to check it.

insthync avatar Mar 04 '25 10:03 insthync

Try turn this on

Image

insthync avatar Mar 04 '25 10:03 insthync

Thats a huge relief, I thought Im going crazy again :) (its easy to get lost or do something weird when you work on project one week per 6 months during vacation and dont remember all you need anymore)

I did checked and that one seems to be already ticked so probably not the cause ... I hope. It helped in your case? (Now Im starting to worry a bit again :) )

astromediaonly avatar Mar 04 '25 11:03 astromediaonly

Yes, it helped

insthync avatar Mar 04 '25 11:03 insthync

I guess I will have to upgrade also the LiteNetLibManager and hope I guess - I did not upgraded this yet as there were no errors and I do remember upgrades broke links in scene and I dont remember how to not break that cleanly (if it was even possible) ... but thats probably one difference - I use 1-2 years old version I guess and you probably newer ... hopefully it will helps atleast. But if you have some tips how to investigate further in case it will not help or in case it will be easier than upgrading this stuff let me know :)

astromediaonly avatar Mar 04 '25 11:03 astromediaonly

Hmm I dont think the upgrade will be viable - the new version does not seem to work at all and Im not sure why:

Image

astromediaonly avatar Mar 04 '25 16:03 astromediaonly

A new version required Unity addressable package, and this one.

Not sure how are you going to use this lib, it have many better open source libs nowadays.

insthync avatar Mar 05 '25 00:03 insthync

I see, I will give it a try, thanks.

Is it so? Its a few years Im developing my hobby projects and was always using it but I guess lot of changed meanwhile but as I see MMO Kit is still being developed I guess its not that outdated? :) ... If you know about anything that is that better I can take a look but I guess changing it to different one will be even more work. But Im still baffled by how it can not write any error but not work in my case so I may have to despite being very attached to it :/

EDIT: oh its too late - based on usecase I see ... in this one Im just using it to do basic messaging and syncing custom coordinate system for movement (space game) ... nothing fancy but I have one RPG project too Im switching between to have some change in development once in a while

astromediaonly avatar Mar 05 '25 01:03 astromediaonly

Meanwhile I did tried those packages and Im getting this:

Image

Despite it being there:

Image

Thats weird. I was looking at usual places like repository readme and docs but I did not found mention about those extra needed packages and so - is there somewhere updated instalation instruction or so? (Im not blaming you if you werent in the mood to update them yet - Im just trying to figure out if I did missed something and should have been able to figure it out on my own or not :) )

astromediaonly avatar Mar 05 '25 12:03 astromediaonly

Ufff after enabling debug for LiteNetLib and going trough most of the connection code I did found the culprit - my derivation of LiteNetLibGameManager was somehow lacking base.Update(); in Update method so the server version was not polling and resolving connection requests. I have no idea how it worked before the upgrade :D ... So my fault, sorry - you may close it if you dont want to comment how to finish the upgrade to new version (for possible future reference).

astromediaonly avatar Mar 07 '25 13:03 astromediaonly