satoshinm / WebSandboxMC

Bukkit plugin providing a web-based interface with an interactive WebGL 3D preview or glimpse of your server 🕷⏳📦 ⛺
https://www.spigotmc.org/resources/websandboxmc.39415/
MIT License
19 stars 5 forks source link

Slow connections start player inside of blocks, too low #50

Open satoshinm opened 7 years ago

satoshinm commented 7 years ago

On the test server http://netcraft.herokuapp.com/, often the player starts beneath the top of the world, a couple blocks (4-5?), it seems to be related to having a slow connection (don't see this usually when testing locally) - maybe a race condition?

Thought I fixed this in https://github.com/satoshinm/WebSandboxMC/issues/40 by https://github.com/satoshinm/WebSandboxMC/commit/ad983a56c9e64522a69f5ea72fc8934bc374c4fb but its cropping up again on the test server in production. Reported at https://forums.glowstone.net/topic/56/websandboxmc-web-based-client-providing-an-interactive-glimpse-of-a-part-of-your-server-using-webgl-html5/8

screen shot 2017-05-01 at 9 28 49 pm screen shot 2017-05-01 at 9 28 45 pm

satoshinm commented 7 years ago

Maybe a symptom of https://github.com/satoshinm/NetCraft/issues/107 WebGL warnings and errors in online mode only? The main loop was running too early. But the fix there only omitted rendering chunks too early, if !g->initialized.

Should handle_movement(dt) also not be called until initialized? Will this fix it, or is the problem deeper, a symptom of sending lots of block updates (B, commands) followed by a player position (P, command) right at the end, and the client takes a while to update all the blocks? Also consider https://github.com/satoshinm/NetCraft/issues/136 Compact chunk updates.

Testing locally with NetCraft build 354 craft.html#netcraft.herokuapp.com%2080 I haven't seen this yet. I start above the top of the tree.