voxel / voxel-clientmc

Minecraft client using WebSockets and voxel-engine (voxel.js plugin)
57 stars 13 forks source link

Initial chunk loading prevents timely keepalive, causing client timeout #18

Open deathcap opened 8 years ago

deathcap commented 8 years ago

The initial chunk processing and loading takes too long and blocks the main thread, meaning the server doesn't receive the keep-alive response from the client, so it kicks it after timing out:

16:12:59 [INFO] webuser-46 [/127.0.0.1:64531] connected, UUID: af66710c-eacb-3100-9b6d-d17e9046d7bc
16:12:59 [INFO] webuser-46 joined the game
16:13:23 [INFO] webuser-46 [/127.0.0.1:64531] lost connection
16:13:23 [INFO] webuser-46 left the game

(nearly just before chunks finish loading - but it is not quite fast enough)

Testing with a no-chunk server for example https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/examples/server does not timeout the client, because there are no chunks to process. But this is of course not a realistic scenario (real servers have lots of chunks..).

Chunk loading should either be made faster, or more asynchronous and/or on-demand (currently, the client displays all chunks it receives, immediately — should it?)

deathcap commented 8 years ago

Maybe related to using Glowstone++, need to isolate versus vanilla server