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.

Server Discussion StarryPy - A plugin driven server wrapper written in Python.

Discussion in 'Multiplayer' started by Carrots Are Mediocre, Jan 29, 2014.

  1. Djet

    Djet Sandwich Man

    Where commandline, could you please give clear instruction, and I can't understand what to do with this bunch of files, I got used to the .bat
    I downloaded and installed Python27 and pip, downloaded the files from github, what do I do now?
    Or can't I because I have windows 8 ?
     
    Last edited: Jan 29, 2014
  2. Higgins

    Higgins Tentacle Wrangler

    Linux install all working great. StarryPY + CommandStar running no problem atm. :)
     
  3. Archer

    Archer Spaceman Spiff

    This is fantastic! We'll be trying it out this evening :)

    I'll report back to this thread with any feedback/issues.
     
  4. plzt

    plzt Seal Broken

    I'm currently getting an error of:

    Code:
    2014-01-29 14:37:51,696 - starrypy - INFO - Started server.
    2014-01-29 14:37:51,869 - starrypy.plugin_manager.PluginManager - INFO - Loaded
    plugins: command_dispatcher, Active: True
    player_manager, Active: True
    mute_manager, Active: True
    user_management_commands, Active: True
    admin_messenger, Active: True
    announcer_plugin, Active: True
    bouncer, Active: False
    colored_names_plugin, Active: True
    motd_plugin, Active: True
    new_player_greeter_plugin, Active: True
    planet_protect, Active: True
    plugin_manager, Active: True
    warpy_plugin, Active: True
    2014-01-29 14:38:54,520 - starrypy - INFO - Created StarryPyServerProtocol with
    UUID xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    2014-01-29 14:39:34,520 - starrypy - ERROR - Couldn't disconnect protocol.
    Which then gives me the error: "Join Failed! Unknown Server Version" after attempting to log in


    EDIT:
    I can connect to the server without the wrapper
    A friend can also connect to vanilla server but gets the same issue/error with the wrapper
     
    Last edited: Jan 29, 2014
  5. Dorky

    Dorky Big Damn Hero

    This sounds amazing. I can't wait to try it. :)
     
  6. SloanReynolds

    SloanReynolds Starship Captain

    At the risk of sounding like an idiot I don't get how to install this. :( It sounds like you need to run a python command; couldn't you include an install script with the download?
     
  7. kyoto

    kyoto Orbital Explorer

    Okay, I tried to create tiny plugin for StarryPy. I'm newbie in Python, sorry for bad code (I can fix it in future). :D
    Server status plugin available here. You can send query on specified port (specified in server_status.py) and plugin return status (online/offline) and number of players.
    Also include small php script for embed this in your website.

    Now plugin always return "online: true" because I don't know how to detect server runned. Server crashing sometimes, but StarryPy still working. Is it possible to add crash detecting and autorestar?
     
  8. Maffi

    Maffi Astral Cartographer

    Are you sure you have set up the correct port for the game server in your config?
     
  9. Maffi

    Maffi Astral Cartographer

    Thats a bit tricky indeed. You could make the reactor connectTCP() to the server (like we do in server.py) with a new minimalistic factory and check if you get an protocol_version packet from it. Feel free to come over to ##starbound-dev in freenode IRC for further questions and discussions!
     
  10. plzt

    plzt Seal Broken

    Well.... no?! haha

    If I set the port to be the same on game and wrapper I get the same issue except I get about 30 of the "Created...." line and only get the disconnect on a ctrl+c
    If I have the ports separate ( "gamePort" : 21025, and "server_port": 21024,) then I get the error above

    I may have missed something basic here but I'm not sure what!
     
  11. kyoto

    kyoto Orbital Explorer

    What port is set in starbound.config?
     
  12. plzt

    plzt Seal Broken

    As above, game port being the starbound.config one, server_port is from the wrapper
     
  13. kyoto

    kyoto Orbital Explorer

    Thanks, I understand.
    Sorry, but my english is not good for chatting.
     
  14. Maffi

    Maffi Astral Cartographer

    Okay, the wording in our config.json is a bit misleading. I already have a change to that in our current development branch.
    Anyway, you have to put the port on which the gameserver listens in the StarryPy config. Starrypy itself will listen on 21025, so you cant use that one for the gamserver, use 21024 instead.
     
  15. Higgins

    Higgins Tentacle Wrangler

    Need some help with the /move_ship command. I want to move my own ship to..

    -69232049, 8766403Beta Chara 034 III

    I don't quite get how the command needs to be filled.

    /move_ship beta -69232049 8766403 z? 3 sateliite?
     
  16. Stadl0r

    Stadl0r Contact!

    The plugin is working great for me. One thing I`d like to see is the ability to edit each usergroups abilities. Also when I protect a planet, seems like other players lose the ability to edit their ship and interact with it.
     
  17. Higgins

    Higgins Tentacle Wrangler

    You can do this simply by editing the py files. For example:

    Code:
        @permissions(UserLevels.ADMIN)
        def whois(self, data):
    You can change to UserLevels.MODERATOR
     
  18. plzt

    plzt Seal Broken

    Ah I see - so set both to 21024? Same problem :(
     
  19. Indulgentu

    Indulgentu Aquatic Astronaut

    I tried installing Twisted manually as it wasnt working, and now I am getting tons of errors when starting the server:
    Code:
    C:\Users\*********\Desktop\StarryPy-master>python server.py
    Traceback (most recent call last):
      File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
      File "<frozen importlib._bootstrap>", line 868, in _load_module
      File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
      File "C:\Python33\lib\site-packages\twisted\internet\reactor.py", line 38, in
    <module>
        from twisted.internet import default
      File "C:\Python33\lib\site-packages\twisted\internet\default.py", line 56, in
    <module>
        install = _getInstallFunction(platform)
      File "C:\Python33\lib\site-packages\twisted\internet\default.py", line 50, in
    _getInstallFunction
        from twisted.internet.selectreactor import install
      File "C:\Python33\lib\site-packages\twisted\internet\selectreactor.py", line 1
    8, in <module>
        from twisted.internet import posixbase
      File "C:\Python33\lib\site-packages\twisted\internet\posixbase.py", line 24, i
    n <module>
        from twisted.internet import error, udp, tcp
      File "C:\Python33\lib\site-packages\twisted\internet\udp.py", line 51, in <mod
    ule>
        from twisted.internet import base, defer, address
      File "C:\Python33\lib\site-packages\twisted\internet\base.py", line 23, in <mo
    dule>
        from twisted.internet import fdesc, main, error, abstract, defer, threads
      File "C:\Python33\lib\site-packages\twisted\internet\defer.py", line 29, in <m
    odule>
        from twisted.python import lockfile, log, failure
      File "C:\Python33\lib\site-packages\twisted\python\lockfile.py", line 52, in <
    module>
        _open = file
    NameError: name 'file' is not defined
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "server.py", line 7, in <module>
        from twisted.internet import reactor
      File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
      File "<frozen importlib._bootstrap>", line 1022, in load_module
      File "<frozen importlib._bootstrap>", line 1003, in load_module
      File "<frozen importlib._bootstrap>", line 563, in module_for_loader_wrapper
    KeyError: 'twisted.internet.reactor'
    Heeelp? :(
     
  20. Carrots Are Mediocre

    Carrots Are Mediocre Zero Gravity Genie

    Hey guys, I thought I'd outline the installation instructions for windows a bit more thoroughly since those were lacking.

    Here's a step by step instruction guide. I ran in an XP VM, but it should work the same in any version of windows XP or greater.

    Step 1
    Download python. We'll be using ActiveState python for ease of use. This way you don't have to monkey around with your paths. Just download it from here. Make sure you grab the 2.7 version and not the python 3 version; the server will not run on Python 3.

    Install in, just use the default options.

    Step 2
    Download StarryPy from github. I personally recommend using git, but a zip file will suffice. Click the Download zip file on the right side of the page. Here's the repo link if you don't want to do searching for it.

    Move the StarryPy-master folder somewhere convenient. You can rename it to whatever you like.

    Step 3
    For this step, you'll need to get inside the StarryPy folder in the command prompt. For Vista or greater, which hopefully you are all running, you can simply open up the folder, make sure you don't have any files selected, and then hold down shift and right click in the empty space of the folder. There will be an option to 'Open Command Window Here' or something along those lines.

    If you can't find that window, run the command 'cmd'. Then, use 'cd directory_name' to get to the right place. If you go too high, use 'cd..' to go down a level.

    Once you're in the StarryPy folder, run 'pypm install -r requirements.txt' to install all of the dependencies. It will give you an error about enum34; don't worry about it, we'll take care of that next.

    After all the components are done installing, run 'pypm install pip'. Wait for that to finish installing, and then run 'pip install enum34'.

    Finally, once that's done, we can move onto configuration.

    Step 4
    In the StarryPy folder you'll find a config.json.example. I wouldn't open it with notepad, because it uses unix style line endings. Notepad++ or Sublime Text would be ideal, but wordpad will do in a pinch. Open it up and set your server hostname and port.

    The server port is the port you'd be running Starbound on. I recommend 21024 for simplicity's sake. Generally the default options will be fine. Save the file as config.json in the same directory. Do not put the server port as 21025.

    Finally, we need to edit the starbound configuration file to run on the port you set in that config.json. Open up your starbound folder and find starbound.config. Change the gameport in there to the same port that you set in config.json. Here's an example setup of config.json and starbound.config so you understand how it's done.

    config.json
    Code:
    {
        "server_hostname": "localhost",
        "debug_file": "debug.log",
        "core_plugin_path": "./core_plugins",
        "owner_uuid": "",
        "player_db": "config/player.db",
        "server_port": 21024,
        "plugin_path": "./plugins",
        "command_prefix": "/",
        "passthrough" : false,
        "colors": {
            "default": "^#F7EB43;",
            "guest": "^#F7EB43;",
            "registered": "^#A0F743;",
            "moderator": "^#4385F7;",
            "admin": "^#C443F7;",
            "owner": "^#F7434C;"   
        }
    }
    
    
    starbound.config
    Code:
    {
      "allowAdminCommands" : true,
      "allowAdminCommandsFromAnyone" : true,
      "attemptAuthentication" : false,
      "audioChannelSeparation" : [ -25, 25 ],
      "audioChannels" : 2,
      "authHostname" : "auth.playstarbound.com",
      "authPort" : 21027,
      "bcryptRounds" : 5000,
      "bind" : "*",
      "checkAssetsDigest" : false,
      "claimFile" : "indev.claim",
      "clearPlayerFiles" : false,
      "clearUniverseFiles" : false,
      "controlPort" : 21026,
      "crafting.filterHaveMaterials" : false,
      "defaultWorldCoordinate" : "alpha:-84936662:-62554636:-13754701:6:12",
      "fullscreen" : false,
      "fullscreenResolution" : [ 1920, 1080 ],
      "gamePort" : 21024, // <--- This is the important one.
      "maxFrameskip" : 10,
      "maxPlayers" : 50,
      "maximized" : true,
      "maximizedResolution" : [ 1000, 600 ],
      "musicVol" : 0,
      "passwordHash" : "",
      "pixelRatioIdx" : 3,
      "renderPreSleepRemainder" : 4,
      "renderPriority" : true,
      "renderSleep" : true,
      "rootKey" : "removed",
      "sampleRate" : 44100,
      "serverName" : "A Starbound Server",
      "serverPasswords" : [ "", "duckies", "swordfish" ],
      "sfxVol" : 0,
      "speechBubbles" : true,
      "tileDamageLimit" : 49,
      "title.connectionString" : "",
      "upnpPortForwarding" : true,
      "useDefaultWorldCoordinate" : false,
      "username" : "",
      "vsync" : true,
      "waitForUpdate" : true,
      "windowTitle" : "Starbound - Beta",
      "windowedResolution" : [ 1000, 600 ],
      "zoomLevel" : 2
    }
    
    Finally, you'll need the UUID of a character to use as an owner profile. You can get this through the save file, or you can get it through the running server. If you get it from the savefile username, pop it in config.json and go below.

    Otherwise, get back to your command window and run 'python server.py'. With any luck you'll see the server bounce into action. Try connecting via your Starbound character. Once the connection is complete, you should see a player UUID with the username. Copy that into the owner slot and restart StarryPy.
     
    Last edited: Jan 29, 2014
    SexualRhinoceros likes this.

Share This Page