garrettjoecox / scriptserver

A Minecraft server wrapper, allows for simple plugins in vanilla
GNU General Public License v3.0
68 stars 10 forks source link

Start doesn't work after a stop. #23

Closed ImBaedin closed 6 years ago

ImBaedin commented 6 years ago

Attempting to start a server after a stop command doesn't work for a few reasons.

  1. The stop command closes the server but not the RCON, causing an unhandled error that crashes node. This can be fixed by handling the error in Rcon.js
  2. For some reason it can't reconnect. I solved this by making a fresh Rcon object under the event that connects to the server.
  3. Closing the RCON right before killing the child process also throws an error. This can be solved by grabbing the diconnected event and killing it after.