1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Tutorial Starbound Server UI

Discussion in 'Multiplayer' started by Nividica, Dec 20, 2013.

  1. Nividica

    Nividica Master Chief

    Starbound Server UI, SSUI.
    A user interface for the Starbound server, by Nividica.

    Features
    • Push of a button starting and stopping the server.
    • Allows changing the server application priority on the fly.
    • Shows statistic information about the number of loaded worlds, number of connected players, and memory usage.
    • Detailed information about each connected player, including IP and Port.
    • Individual logs for info, warning, and error log levels.
    • Logs for players and world history.
    • Copy selected lines from logs to the Clipboard.
    • Configurable server path
    • Manual Universe Folder Backups
    • Remote control via networking.

    Requirements/Assumptions
    • Windows XP Service Pack 3 or later.
    • Tested with server versions: Offended Koala, Angry Koala

    Planned Features

    • Configuration options
      • Periodic restart timer (will only occur when no players are connected)
      • Memory ceiling, will restart ASAP if the ceiling is hit.
      • Configurable Controller port.
    • Detect a server crash and allow automatic restart
    • Possible feature: Interface to the server accounts file
    • Web version
      • CGI and standalone builds
      • With password protected interface
    • Linux and Mac support


    FAQ
    Windows Manager
    Q: How do I connect a manager to the controller?
    A: Under the menu "Controller Link" click "Connect"

    Q: How do I connect to a remote machine running the controller?
    A: Assuming properly forwarded/open ports, Under the menu "Controller Link" click "Set Address And Port", then connect.

    Q: Will the controller stop if the manager disconnects?
    A: No, it will continue running.

    Q: Can more than one manager connect to the controller?
    A: Yes.

    Q: Can I copy log lines out of the manager?
    A: Yes, highlight the lines you wish to copy and right-click to open the copy menu.


    Windows Controller
    Installation
    Q: How do I run the controller?
    A: You can run the controller by double clicking SSUI_Controller.exe, or you can optionally install it as a windows service.

    Q: How do I install or remove it as a service?
    A: Use the included batch scripts install_service.bat and uninstall_service.bat . Please note these require administrator privileges.

    Q: Does the controller need/accept any command line arguments?
    A: No.

    Usage
    Q: Can I type commands into the controller from the command prompt?
    A: No, it is designed to be commanded from managers.

    Q: Does the controller log to a file?
    A: Not at this time.

    Q: Can I stop the controller?
    A: If your are not running it as a service, pressing ctrl-c will shutdown the controller and the starbound server.
    If you are running it as a service launch the service manager either by typing in "services" in the start bar, or typing in "services.msc" in the run prompt. Locate the service "Starbound Server Controller", right-click and select "Stop".

    Network
    Q: What port does the controller listen on?
    A: TCP 21000

    Q: Can I remotely connect to a controller?
    A: Assuming properly forwarded/open ports, yes you can.
    Note: However you can only use the browse button in the managers config editor if the manager and controller are on the same machine.

    Stop/Exit/Terminate
    Q: How does the controller handle stop events such as CTRL-C or a computer restart?
    A: The controller watches for these events and will comply once the starbound server has shutdown.

    Q: How does the controller tell the starbound server to quit?
    A: The controller will first issue a CTRL-C, if the starbound server does not comply within 10 seconds it will be forcefully terminated.

    Q: Forcefully terminated? How?
    A: If the controller is aware of the starbound server PID a Terminate(0) call is made, else the OS is directed to kill any processes with the same name as the starbound server.

    Q: What happens to the starbound server if the controller crashes or is killed?
    A: In the event of a controller crash, it will make every effort to gracefully stop the starbound sever. If the controller is killed the starbound server must also be killed, as it is a child process of the controller.

    Config File
    Q: I need/want to edit the config file manually, where is it?
    A: "%APPDATA%/SSUI/config.txt" If you are not running it as a service.
    "C:\Windows\System32\config\systemprofile\AppData\Roaming\SSUI\" if you are running as a service.

    Q: How is the config file formatted?
    A: KeyName TAB Value.



    Manager Screenshot
    [​IMG]


    Downloads ( Goto File->Download Once On The Page )
    Change Log

    • V 2.0.1 - 01/06/2014
      • Manager Bugfix: Address and Port now properly update without requiring a socket reset.

    • V 2.0 - 01/03/2014
      • Complete back-end overhaul.
      • Separated into two programs, a controller and a manager.
      • Controller, back-end, controls the starbound server and can be run as a service.
      • Manager, front-end, displays information provided by the controller.
      • Controller
        • In-depth control-c processing.
        • Shutting down the starbound server is nicer than ever before.
        • Now waits 10 seconds for a nice/clean shutdown before a forceful kill.
        • Fully functional service routines installed.
        • More crash prevention routines.
        • Bugfix: No longer crashes when a valid config file can not be loaded.
      • Manager
        • Reworked menu's to reflect program separation
        • Removed flavor icons
        • Included Controller log
        • All logs can now be copied to the clipboard
    • V 1.2 - 12/22/2013
      • Added manual backup feature
      • Backup will wait up to 30 seconds per locked file to unlock during backup
      • Added configurable backup path
      • Maximum log lines is now configurable
      • Added status information area
    • V 1.1 - 12/21/2013
      • Updated server stop code to send proper termination sequence
      • Added Settings window
      • Server path is now configurable
      • Statistic refresh rate is now configurable
     
    Last edited: Jan 6, 2014
    Alex WaveDiver likes this.
  2. TheOtherDrew

    TheOtherDrew Big Damn Hero

    Ctrl-C is the "nice" way of shutting down the server. Are you going to add support for this so that the server will save before shutting down? Just from reading what you posted it does not sound like you do. Thanks.

    I have to say that your application looks very well put together.
     
  3. Nividica

    Nividica Master Chief

    So far i've not had any luck getting the internal command processor to send a Ctrl+C into the server. It sends the keystrokes, but not the signal. I'm looking into a canonical extension that will allow proper signal processing. But so far the only way I can shut down the server is by killing it via PID, even sending it the term signal is just ignored. What I would love to see is either an IPC command or simple keyboard command, such as /quit, to stop the server added in future updates. When I get it working I will update.
     
  4. Soulztealer

    Soulztealer Master Chief

    Will you be adding a ban and white list option?
     
  5. Nividica

    Nividica Master Chief

    I'm not sure how to do a whitelist, however the server already has the ability to ban players based on names and/or IP's via the "accesscontrol.config" file. I do plan on writing an interface to that file eventually yes.
     
  6. Soulztealer

    Soulztealer Master Chief

    Cool great! what is the path to the "accesscontrol.config" file I looked for it and couldnt find it?
     
  7. Opalium

    Opalium Pangalactic Porcupine

    \Starbound\Universe\accesscontrol.config
     
  8. Nividica

    Nividica Master Chief

    It's located in the universe folder(C:\Program Files (x86)\Steam\steamapps\common\Starbound\universe), I haven't looked up the syntax for the file yet however.
     
  9. Soulztealer

    Soulztealer Master Chief

  10. Spaccaossi

    Spaccaossi Aquatic Astronaut

    I would like to try it, unfortunately I don't have Starbound installed on the default directory and that's probably why I get this error message when trying to start it:

    An exception of class NilObjectException was not handled. The application must shut down.

    I think I'll just wait for a configurable path, the software looks promising, keep up the good work.
     
  11. Nividica

    Nividica Master Chief

    Yeah, I haven't bothered with error checking the path since it is not yet configurable. Once I get this 'nice' way to terminate figured out thats next on my list
     
  12. benbenzjmm

    benbenzjmm Space Hobo

    Can not download~~:(
     
  13. Nividica

    Nividica Master Chief

    Updated the link, sorry about that, it seems a direct link has a timeout.
     
  14. TheOtherDrew

    TheOtherDrew Big Damn Hero

    Did some reading, this may be what you are looking for. I only assume C#, as i don't recall reading that's what you wrote this in. Stack OverFlow link
    Should help you sort it out, if you have not got it yet. I'm novice in programming, so good luck and thanks!

    EDIT: I have a request for you. Can you add the ability to make timed backups of the universe folder or any pertinent files? It would be nice to have a backup folder with timestamps.
    I know you're busy working on other things, so no rush. thanks a ton!

    EDIT 2: Maybe instead of having timed backups, your app would backup when a new user enters the server, and a logfile with their info could be placed in the directory. This way if they are a griefer you would have their info and a good backup. Just a thought.
     
    Last edited: Dec 21, 2013
  15. TheOtherDrew

    TheOtherDrew Big Damn Hero

    You could if you like create a symlinked folder located at "C:\Program Files (x86)\Steam\steamapps\common\Starbound\"
    That way you can keep your starbound install at it's location and still use the app until it is updated.
    Here is a great tool for easy symlinking. Symlinker.
    If you have questions about how to do this, free free to respond and I will walk you through it.

    This is what I do to run the server from a ramdisk, since I don't have an SSD.
     
  16. Nividica

    Nividica Master Chief

    Uploaded version 1.1
    • Updated server stop code to send proper termination sequence
    • Added Settings window
    • Server path is now configurable
    • Statistic refresh rate is now configurable
     
  17. supernet2

    supernet2 Existential Complex

    Nice GUI ill look into using this for my server... currently using Icers starbound server. Seems to run stably as long as i dont get a major errors in the server it usually holds for 11-22hours before manual/automated reboot must be done.

    Did you do stress testing on it? like maximum amount of errors the program can use before the server basically locks up?
     
  18. benbenzjmm

    benbenzjmm Space Hobo

    windows 2003 can not work?
     
  19. Nividica

    Nividica Master Chief

    The manual backup function is complete, now I can look into expanding that into timed or player events. Are you looking to have it perform a back every-time a new player logs on? This has the potential for creating a lot of backups for the first run as your regular players log on. Also, I am handing off the copy request to the OS to copy the universe folder to the backup location, as the OS can handle the request much faster, however if the server is in to process of writing to a file, there is the potential for that file not to get copied to the backup due to being locked. I don't know the internals of how the server program writes to files or if it uses a shadow writer. Until this information becomes available, or when the server can be instructed to pause saving, there is no way to 100% guarantee every file can be copied. With that in mind, I will be writing an integrity routine that will attempt to copy any locked files to the backup once they are released. Its the best I can do until the server itself becomes more flexible.
    As for the logfile, I can add in a dump of the player history into a special log file inside of the backed up universe folder if thats what your looking for.
     
  20. Nividica

    Nividica Master Chief

    As it is programed right now, the UI can run without any issues regardless of how many errors the server generates. There is bound to be memory issues if left running continuously as the log file will just continue to grow. However I already have a fix for that planed with the maximum number of log lines to keep settings option in the works. But so far even with thousands of log lines the programs memory footprint only grows by a few megs.
    Also in the planed features is an automated reboot system. This system could be adapted to queue up a restart once a certain number of errors have occurred. Just like with the timed, and memory ceiling restarts this would only happen automatically when the server has no players logged on, but could be forced to restart manually.
     
    supernet2 likes this.

Share This Page