hexparrot / mineos-node

node.js implementation of mineos minecraft management
GNU General Public License v3.0
334 stars 170 forks source link

new server doesn't show up in webui after creation #31

Closed flareofghast closed 9 years ago

flareofghast commented 9 years ago

I run

sudo node webui.js

It seems to create the server fine according to the console output but it doesn't show up in the webui. Is this because it was created for my user and not root or something? so I would have to re-run but using

node webui.js

in order to see and run the new server? refreshing the page doesn't make it appear either. I re-ran using the sudo command and it now shows up.

hexparrot commented 9 years ago

It should always show up, no matter what user, but there seems to be a latent race condition somewhere in there that is causing this problem.

What's happening is that the chokidar file/directory watch at https://github.com/hexparrot/mineos-node/blob/master/server.js#L63 sees the directory created, but it outpaces the creation of server.properties, which is the actual validation of whether a directory is in fact, a Minecraft server.

Refreshing the web-ui should be sufficient, you should'nt have to restart the whole service, but I'll probably have to seek a clean, systematic way of delaying new server detection that isn't adding an arbitrary SetTimeout. In all likelihood it's going to be an nextTick added to that function.

hexparrot commented 9 years ago

Let's hope I'm not just getting sloppy and overzealous with commits:

cc95dcdbe35978228691b1e176000976d039cdca

hexparrot commented 9 years ago

I changed the way that server detection works so I think that this issue should be resolved; let me know if you have any continued issues with the latest commit and I can close this.

hexparrot commented 9 years ago

I think this is solved over much of the rewrite that has occurred in the server detection. If the issue persists, please reopen.