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

Load Map TIMEOUT #2984

Closed
SnaiperoG3D opened this issue Nov 2, 2021 · 3 comments
Closed

Load Map TIMEOUT #2984

SnaiperoG3D opened this issue Nov 2, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@SnaiperoG3D
Copy link

SnaiperoG3D commented Nov 2, 2021

1. 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.

2. I have Gaia usage in my game which load and unload terrain scenes and its a big problem for me

3. 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:

  1. 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.
  2. I made vars: server and client at KcpTransport as public to have access to connections of server and connection of client.
  3. 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

@NuclearCookie
Copy link

I have the same issue where the clients get disconnected when the scene load takes longer than the KCP timeout value.

@MrGadget1024
Copy link
Collaborator

closing as duplicate of MirrorNetworking/kcp2k#8

@MrGadget1024 MrGadget1024 added the duplicate This issue or pull request already exists label Nov 2, 2021
@MrGadget1024
Copy link
Collaborator

I got this bug only with KCP.

Please add your details to the other bug in the KCP repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants