rickwillcox/Ender-Woods-World-Server

world crash on start up

Closed this issue · 4 comments

sometimes the world crashes on start up. Also had a time where having two clients open froze the godot world project completely and had to kill process to get unstuck.

crash.world.mp4

I think this is a better solution. This way we only send out packets based off the physics frame or 20fps so 20 packets per second.
image

The current implementation has about a 50% crash rate on my pc, I think because yielding the process is causing other functions to fail.

created a PR for this issue if you are happy with the solution I made.

With this some packets might get delayed to the next processing frame, because send_all_packets might execute first, and later we would still want to send more. I think we need to adjust Server's process_priority instead of yielding. That way we can make sure the packets are sent at the end of the frame. I am not certain though. I'm gonna ask on godot discord about that.

I think another issue with this is that the players might disconnect in the meantime and I keep trying to do RPCs on them. So the packet queue for the disconnected player needs to be either cleared or skipped