-
Notifications
You must be signed in to change notification settings - Fork 51
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
Mirror: KCP client disconnects if ServerChangeScene takes a lot of time #8
Comments
@t96bb thanks for reporting. will look into a fix. |
…ET where in the benchmark demo we send so many unreliable messages that no reliable messages (or ping) was received in the timeout interval, causing the connection to disconnect even though it did receive unreliable messages. lastReceive is even set for unreliable messages while not enabled (=during scene changes) to prepare the fix for #8 (just needs ping to go over unreliable now)
…ed' boolean. This is faster than invoking a Func<bool> every time and allows us to fix #8 more easily later by calling .Pause/.Unpause from OnEnable/OnDisable in MirrorTransport.
switching kcp2k OnCheckEnabled hook to .paused boolean. => should make it easy to also pause the timeout in Pause()/Unpause() to fix this bug. |
should be fixed in latest kcp version. |
there might be another issue according to mrgadget in discord. |
Hi Sorry, it's still there. Please, have a look at client log 00:04.935 ConnectionSend connection(0) bytes:7F-81-02-DD-4D-A6-C0-F8-FF-3F Before 20s - normal reply from server with pong message. After 10 seconds KCP connection disconnects automatically from server. |
I have this same issue. Longer scene changes = client booted. Switch back to Telepathy - OK USA |
Changing the default timeout on KCP connection fixed this issue. Needs to be public in the transport window |
Duplicate my message here:
I got temp solutioon by: "increase TIMEOUT for TickIncoming_Authenticated -> HandleTimeout method in KcpConnection.cs" But it cause as i think this problem: "hello, someone know what to do in that case? Android. When any player connect to server, play some time, then manual disable internet connection, client auto disconnecting. But he still present on server. As a result, that client reenable internet connection, connect to server, and there are 2 same players. How can i prevent it?" I got this bug only with KCP.
I added another const to KcpConnection with load map timeout, for me 50000 is enough. But timeout var will be overrided by KcpTransport Component, so new const should be exposed here too. Also i already changed this code for my game case (added stop coroutines when, etc.), but as i said i made it only for demostration and it should be changed for general usage |
Thanks for this. As it turns out it wasn’t this issue. They put some retarded idea in the transport so if any error occurs it will boot the client assuming it was malicious. I just took that out of the code as client authentication should be done on connection and that should be enough.
Cheers,
Nick
From: SnaiperoG3D ***@***.***>
Reply-To: vis2k/kcp2k ***@***.***>
Date: Wednesday, 3 November 2021 at 12:37 am
To: vis2k/kcp2k ***@***.***>
Cc: Nick Perry ***@***.***>, Comment ***@***.***>
Subject: Re: [vis2k/kcp2k] Mirror: KCP client disconnects if ServerChangeScene takes a lot of time (#8)
Duplicate my message here:
I had this bug 6 mounth ago:
"issue with kcp. i have two servers with two different maps on each one. first server have small map, second server have big map. both servers placed on linux. so client connect fine to server with small map, but when i try to connect to server with big map i have this error on server:
KCP: Connection timed out after not receiving any message for 10000ms. Disconnecting.
i guess while client load big map, there are no packages going to server or something, it reach 10000ms and server disconned the client. which does not make any sense because client doesnt even load the map
there is no such problem on tcp"
I got temp solutioon by: "increase TIMEOUT for TickIncoming_Authenticated -> HandleTimeout method in KcpConnection.cs"
But it cause as i think this problem: "hello, someone know what to do in that case? Android. When any player connect to server, play some time, then manual disable internet connection, client auto disconnecting. But he still present on server. As a result, that client reenable internet connection, connect to server, and there are 2 same players. How can i prevent it?"
I got this bug only with KCP.
I have Gaia usage in my game which load and unload terrain scenes and its a big problem for me
I found a solution, it should be changed and optimized but i think this description will be enough to understand how to solve that, main idea is to channge timeout for specific client which start load map after connect to server:
I added another const to KcpConnection with load map timeout, for me 50000 is enough. But timeout var will be overrided by KcpTransport Component, so new const should be exposed here too.
I made vars: server and client at KcpTransport as public to have access to connections of server and connection of client.
Then i added this code to my custom network manager, but i think it should present at NetworkManager
https://pastebin.com/KpdThNkb
Now i have 50000ms timeout when player handshake with server and when client starts load new scene, because server and client have their own timeout checkers and default 10000ms after. But on server it should run not with OnServerConnect but on similar method as client has OnClientChangeScene. Because it can be situation when player dies and will be respawned far away from dead position which means it will be full load as if he have first connect and it should be 50000ms again.
Also i already changed this code for my game case (added stop coroutines when, etc.), but as i said i made it only for demostration and it should be changed for general usage
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Ok, it will be fixed in next release? Just to know when i can check this out |
Ah no it won't be fixed. The devs thought I was a moron for even raising the problem. Apparently they think its perfectly reasonable to disconnect clients upon any error. Clearly they have never published a release before!! I even suggested a simple toggle for the strictness but too hard to add a public boolean I guess!
Get BlueMail for Android
…On 3 Nov 2021, 9:16 pm, at 9:16 pm, SnaiperoG3D ***@***.***> wrote:
Ok, it will be fixed in next release? Just to know when i can check
this out
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#8 (comment)
|
Well, so what we will do next? This problem with long client loading map and disconnecting wont be fixed? |
Well you can just use Telepathy as a transport instead? Or, go to Mirror discord and search the issue. You will find some posts and the code removal I did much to the displeasure of the devs!!
From: SnaiperoG3D ***@***.***>
Reply-To: vis2k/kcp2k ***@***.***>
Date: Wednesday, 3 November 2021 at 10:40 pm
To: vis2k/kcp2k ***@***.***>
Cc: Nick Perry ***@***.***>, Comment ***@***.***>
Subject: Re: [vis2k/kcp2k] Mirror: KCP client disconnects if ServerChangeScene takes a lot of time (#8)
Well, so what we will do next? This problem with long client loading map and disconnecting wont be fixed?
I making a mobile game with big map which split by parts by Gaia asset of Unity and takes a lot of time for some devices to load it and as a result there is no connection between client and server in the proccess, and as i found im not alone who got this problem, so what we should do? I see for now only one way to preload the map.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
During ServerChangeScene, server stops to receive any messages.
It is also affect for ping\pong messages.
Is scene is big enough it could take more than 10 seconds to load and all clients
with KCP transport disconnect because of checking this timeout.
The behavior could be easily emulated by adding following code
System.Threading.Thread.Sleep(15000);
at the beginning of FinishLoadScene method of NetworkManager.
[https://github.com/MirrorNetworking/Mirror/issues/2480]
The text was updated successfully, but these errors were encountered: