deoxxa / jsmc

Pure JavaScript Minecraft server
Other
82 stars 14 forks source link

map generation is sub-optimal #19

Open andrewrk opened 11 years ago

andrewrk commented 11 years ago

node v0.8.16, fresh jsmc checkout + npm install.

node server.example.js config.default.json

No output, server hangs, ctrl+C does nothing, server is not online.

deoxxa commented 11 years ago

Yeah, that's it generating the map. On the first run, or after the world is deleted, it'll sit there for a good minute or so depending on the hardware. The ctrl+c thing, I think, is because of the server-stop plugin.

I guess there's two problems:

  1. Map generation can block the entire server, not just for the duration of one chunk being generated (which is just a huge amount of CPU time, not much can be done there), but for the entire duration apparently.
  2. The server-stop plugin doesn't remove its handler on the first SIGINT.

The server-stop plugin should be easy enough to fix. The map generation resource usage is not fixable, but perhaps can be reworked (as separate process perhaps) to not block the server.

andrewrk commented 11 years ago

Ah, thanks for the explanation. I'll rename the issue and leave it open.