Giter Site home page Giter Site logo

starrypy3k's Introduction

This project is DEPRECATED and will not work on Starbound 1.0+!

Please use StarryPy3k, which supports Python 3 and Starbound 1.0+, instead!

StarryPy

StarryPy is Twisted-based plugin-driven Starbound server wrapper. It is currently in beta.

Features

With the built-in plugins (which are removable):

  • User management. Kicking, banning, whois, player listing. Multiple user levels.
  • Message of the day
  • Build protection by user level.
  • Warping.
  • Give item.
  • Starter items for new players.
  • Join/quit announcements.
  • And more.

Version 1.7.2 is here!

With this most recent release, we are compatible with the current release of Starbound (Glad Giraffe - Protocol 711). Any bugs found in the process, please open an issue ticket, so we can squash them as quickly as possible.

Upgrading from older versions of StarryPy

This version of StarryPy should be completely compatible with all version back to 1.5. If you run into any problems, please let us know.

Installation

StarryPy runs on Python 2.7. It has been tested with Python 2.7.6, 2.7.5, 2.7.2, and PyPy.

Below I provide installation instructions for Linux and Windows. Please note that Windows setup is more complex and in general seems to be buggier. I develop for Linux primarily, so you may consider the windows instructions unsupported; though they did work for me in a VM.

Linux

(CentOS instructions coming in the near future.) On Debian, the installation is decidedly simple, but it will require sudo access if you do not have python 2.7 installed.

First, let's make sure that all the prerequisites are installed:

sudo apt-get install python2.7 python-dev python-pip git

After installing the prerequisites, clone the repo in the directory of your choice using git:

git clone https://github.com/CarrotsAreMediocre/StarryPy

Then install the Python requirements:

sudo pip install -r StarryPy/requirements.txt

Windows

As a reminder, though this worked for me I cannot guarantee it will work for you. I offer no particular support for running StarryPy on windows as it has become a huge time sink that has dragged me away from development proper. If, however, you run into actual bugs with the server in Windows, please do let me know.

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 32-bit 2.7 version and not the python 3 version; the server will not run on Python 3, nor will it work with the 64-bit version on Windows due to licensing requirements.

Download StarryPy from GitHub.

I personally recommend using git, but a zip file will suffice. Please note that if you choose not to use git (not too hard to figure out), future upgrades are far more likely to break everything.

If not using git, click the Download zip file on the right side of the page.

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

Install requirements.

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.

Configuration

There are two areas of configuration that we are concerned with. The first is the StarryPy configuration, and the second is Starbound configuration.

For StarryPy, you will have to create a configuration file. Copy config.json.default to config.json in the config/ folder, and edit the following variables:

  • upstream_port: This is the port that Starbound will be running on. I recommend 21024. It must match the port in your starbound.config file.
  • upstream_hostname: Change this if you are hosting the wrapper on a different computer than your server.
  • bind_port: This should be 21025 normally; it is the port that StarryPy listens on.
  • passthrough: Make sure this is false. It is an emergency off switch for StarryPy.

In addition you may also want to setup

  • owner_uuid: This should be the UUID associated with whatever in-game character you want to have 'ownership' rights on the server. From there you can promote others to moderator, admin, or even owner as well.
  • admin_ss: This is a password that unlocks the ability for Moderators, Admins and Owners to use commands on the server. This is a deadman switch system, meaning that you will not be able to use privileged commands if you do not have this password setup. Once you have set a password here, when logging into your server from Starbound, type this password in the account field. This is used in addition to your server password.
  • log_level: This is, but default, set to DEBUG. If you want leaner logs, set it to INFO. If you want to see all the details going on in the background, set it to VDEBUG.
  • irc settings: If you want chat replication to an IRC chatroom, setup your bot parameters here. A password is may not be required for all servers, but the added security isn't a bad idea.

Finally, find starbound.config and change gameport to be exactly the same as upstream_port in config.json.

If you're on windows, be sure to set starbound_path to the correct path (remembering to escape backslashes, e.g., C:\\Program Files\\Steam\\SteamApps\\common\\StarBound)

Run it

After making sure the Starbound server is running, use your terminal (cmd or powershell on windows) and cd to the directory you installed StarryPy into. Enter python server.py to start the proxy.

Built-in plugins

StarryPy is nearly entirely plugin driven (our plugin manager is a plugin!), so there are quite a few built-in plugins. The truly important plugins are in the core/ plugins folder. If you remove any of those, it's likely that most other plugins will break. We'll break them down by core plugin and normal plugin classes.

If you are looking for commands, they have been removed from the listing due to the constant flux and the time required for documentation. For a list of commands that you can access from your current user level, use /help. For help with a specific command, use /help command_name.

Core Plugins

Core plugins are plugins that have no dependencies and are intended to be accessed by other plugins. If your plugin doesn't meet those criteria, it is recommended to put it in the normal plugins folder.

Player Manager

The player manager is perhaps the most essential plugin of them all. It keeps track of each player that logs in, tracks their position, and manages kicks/bans. It is composed of the actual database manager, using SQLAlchemy on an SQLite3 backend by default.

Command Plugin

This is a core plugin that works in conjunction with the plugin class SimpleCommandPlugin. SimpleCommandPlugins automatically register their commands with the instantiated command plugin and when a chat packet is sent it is automatically parsed. If it matches one of these commands, it sends it off to that function for processing. If it doesn't match any of the commands, it sends it on its merry way to the actual starbound server for processing.

Plugins

Admin Commands

The admin commands plugin implements player management from in game.

Admin Messenger

This command forwards a message to all active moderators or greater. Any command prefixed with ## will be sent to moderators+ only. Access: Everyone

Announcer

This plugin simply announces whenever a player joins or quits the server.

Colored names

This plugin displays color codes for each username depending on rank. The colors are set in config.json.

MOTD

This plugin sends a Message of the Day on login.

New Player Greeter

Greets first-time players on the server. Gives them a greeting that can be configured in the config file and can also give them a pack of starter items. (200 Coal is currently included to give you a sample of the format expected.)

Planet Protection

This plugin protects specified planets against modification in any way. Currently if a planet is protected only those users who are the planet's protect list may make modifications.

Plugin Manager

This plugin provides a method of enabling/disabling plugins. I know it's silly that it's a plugin, you don't have to tell me.

Warpy

This plugin provides various methods for warping players around.

PoI and Bookmarks

These are two seperate plugins that do similar things. Every user has the ability to planets to their own personal bookmark list, allowing for fast return to the planet later.

Points of Interest are setup by administrators for the whole community, allowing fast, fuel-free travel to those desintations.

WebGUI

If activated, this will give you a web-GUI to administrate your StarryPy server. You can log in with your Character's name and the password you set as "ownerpassword" in the StarryPy config.

Config Parameters:
  • cookie_token: A secure token for Cookies. Leave this blank. The plugin will fill it.
  • ownerpassword: Password for the web-GUI.
  • port: The port the web-GUI will listen on.
  • remember_cookie_token: If set to true, you will stay logged in until you log out (even after you restart StarryPy). If set to false, a new cookie_token will be generated on every start of StarryPy.
  • restart_script: Path to a script to restart starbound and/or StarryPy.
Credits:

Plugin development

There are several built-in plugins that you can derive inspiration from. The plugin API is decidedly simple, and simply responds to packet events. There is a convenience plugin class called SimpleCommandPlugin which responds to user commands in chat. Currently there is no easy way to modify packets, however they can be dropped or allowed to send by any plugin intercepting that packet type.

All plugins must ultimately derive from BasePlugin. Do not override the __init__ method unless you absolutely know that you need to. All setup functions should be done in activate()

There will be more to come in the near future, for now please examine the base plugin classes.

Please consider letting us know of your plugin(s) so it can be listed at our plugin list. Pull requests are much appreciated! Please note that any plugins that we integrate into StarryPy proper must be licensed under an open-source license. We suggest the MIT or BSD licenses. If this isn't acceptable to you, we will only be able to provide a link.

Troubleshooting

None of the commands are working

You likely did not provide the admin_ss password. If the server is responding "You're not logged in, so I can't let you do that", then this is the case. Please check that you have the admin_ss password set, and that you are putting it in the account field at login.

If you are seeing responses from the Starbound built-in commands, then you are either in passthrough mode, connecting directly to the vanilla server, or your account is in a foul state. For the first case, check config.json and ensure that passthrough is false. For the next, ensure you are indeed connecting to to the StarryPy server port, and not the vanilla server's. If you're account is fouled, have another moderator or admin kick you character. This seems to clear the bad sate.

If you are running StarryPy on the same computer you're playing it from, it is likely it is using the gameport in starbound.config to connect to. To avoid this, use localhost:21025 in the hostname field in Starbound. Other computers will be able to connect fine.

Something else?

If you're having another issue, check the Issues tab over on the side. If you find that your issue isn't there, please create a new issue with a copy of your debug.log (if applicable.)

Planned features

We haven't been able to pack in everything we've wanted to in this version. We love contributions, so please feel free to write whatever plugins/improve the core however you can.

We have quite a roadmap, here are some of the highlights you can expect in the next major version, and in the development branch before that if you're feeling brave:

  • Creature spawning. Want to spawn a couple dozen bone dragons? So do we!
  • Internationalization. Translate plugins and core messages with ease to your preferred language.
  • Client filtering based on modded items. Though asset digests aren't supported right now, we want to do some minor filtering to keep out the riff-raff (if you as an admin want to.)
  • Plugin dependency overhaul. Really only interesting to developers, but it will allow for complex dependency resolution.

There are many more planned features, minor and major. If you have a feature you'd just love to have that we haven't covered here, put in a feature request on the issues page.

Contributing

We're absolutely happy to accept pull requests. There is a freenode channel called ##starbound-dev that we discuss our development on primarily. We also have the channel ##starrypy for discussion specific to our wrapper.

Other than that, please report any bugs you find with the appropriate section of the debug.log file that is generated.

starrypy3k's People

Contributors

amorporkian avatar dopeghoti avatar evonzee avatar germaniumsystem avatar kamilion avatar kharidiron avatar tsunder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starrypy3k's Issues

Is /poi PLANET_NAME failing to work?

Hey everyone,

/poi - works as a command

but when trying to do /poi NAME (to force the ship to go somewhere)

It doesn't work. Did i perhaps set something wrong:?

-/motd

Does the MOTD have a time parameter? Not sure if it pops up enough.

Or perhaps when an admin uses /motd it forces it to all users with a 5 minute cool down?

Players with zero-length names cause various errors

If a player joins the server with an empty string for their name, it causes problems for StarryPy. Things I've noticed so far:

  1. /list_players stops when their entry is reached
  2. messages sent raise the following exception

2016-08-05 20:46:43 - ERROR - starrypy.plugin_manager # Exception encountered in plugin on action: c hat_sent Traceback (most recent call last): File ".\StarryPy3k\plugin_manager.py", line 45, in do if not (yield from p(packet, connection)): File ".\StarryPy3k\plugins\chat_enhancements.py", line 75, in on_chat_sent sender = self._decorate_line(connection) File ".\StarryPy3k\plugins\chat_enhancements.py", line 98, in _decorate_line connection.player.alias) AttributeError: 'Player' object has no attribute 'alias'

Since zero-length alias strings are (apparently) valid they should be handled gracefully.

Idea: more RP compatibility

Hell!o

I've been asked about the possibility of a command short-formed to /ooc or "out of character"

Apparently this RP based command will be used to change the color of the sentence, An example could be..

/ooc [color] [text] - color can be a predefined word such as red or a hex code

I think /nick can do it, but then it comes into permissions and other issues.

What do you think?

Installation of pathlib and asyncio on systems without Visual Studio

A potential problem in setting up python 3 with StarryPy lies in the initial download of the asyncio and pathlib libraries when doing pip install -r "requirements.txt", where it will say "error: could not find vcvarsall.bat", due to pip being unable to find the C/C++ compiler for use.

Systems with at least Visual Studio 2010 installed will be okay, but systems without will be unable to download and install the binaries above; they can only get the pre-compiled libs from someone else and place it in their python3/libs/site-package/ folder. Attached is a rar file containing affected libs: https://www.dropbox.com/s/dheblt3xb7grikw/site-packages.rar

Add "maintenance" mode - reject new player connections

From @dopeghoti on August 6, 2016 22:5

I prefer not to kick players off of my server if I don't have to, just to upgrade Starbound or the proxy.

It would be helpful to add an owner or admin command to tell StarryPy to no longer accept new player connections until either told otherwise or it is restarted. That way, server admins can flip this switch, and when the last connected players leave of their own volition, the service(s) can be updated and restarted.

Bonus points for either or both of giving a configurable message shown to rejected clients, or for managing the MOTD and in-game broadcasts.

Copied from original issue: kharidiron#38

Configuration Manager

Hi !

~/Starbound/StarryPy3k/ python3 server.py       
Traceback (most recent call last):
  File "server.py", line 5, in <module>
    from configuration_manager import ConfigurationManager
ImportError: No module named 'configuration_manager'

Had you idea ? :/

Commands cannot be used on players with quotes in their name.

It appears that using commands on players with quotes in their name is impossible. The quotation mark seems to throw off the quoted argument extractor and no amount of single quotes or escaping seems to help. Log snippets are attached below.

Am I just missing something or is this legitimately an issue?

2017-02-18 10:57:19 - INFO - starrypy # Received connection from ::1
2017-02-18 10:57:19 - DEBUG - starrypy # New connection established.
2017-02-18 10:57:19 - INFO - starrypy.plugin.basic_auth # Player with privileged UUID 'deadbeefdeadbeefdeadbeefdeadbeef' successfully authenticated as 'beef'
2017-02-18 10:57:19 - INFO - starrypy.plugin.player_manager # Known player is attempting to log in: dead"beef
2017-02-18 10:57:19 - INFO - starrypy.plugin.player_manager # Player dead"beef is now at location: dead"beef's ship
2017-02-18 10:57:24 - INFO - starrypy.plugin.chat_logger # dead"beef: /who
2017-02-18 10:57:32 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead\"beef"
2017-02-18 10:57:37 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead"beef"
2017-02-18 10:57:45 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead"""beef"
2017-02-18 10:57:56 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois 'dead"beef'
2017-02-18 10:58:05 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois 'dead''beef'
2017-02-18 10:58:12 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois 'dead'"'beef'
2017-02-18 11:00:32 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois 'dead\"beef'
2017-02-18 11:25:07 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead\\"beef"
2017-02-18 11:25:12 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead\\\"beef"
2017-02-18 11:25:15 - INFO - starrypy.plugin.chat_logger # dead"beef: /whois "dead\\\\"beef"
[Info] Chat: 1 players online:
[Info] Chat: [^red;5^reset;] dead"beef
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!
[Info] Chat: Player not found!

Adding own roles and shuffling commands

Hello, I am aware that a way to move commands around to different roles is coming.

But is there anything happening about making our own roles? (for example a donator role)

In regards to both what do you think the ETA can be?

Chat censoring

From @ren-kun on August 7, 2016 9:42

If possible, have a dictionary that will check chat for cussing or rude words.

No more need to patrol chat for cussing etc.

Also allow the plugin to reload when adding new dictionary words on the fly.

Copied from original issue: kharidiron#40

Teleport command

It would be useful to have teleport re implemented, such that admins can /tp to users without having to be in their party.

Player database won't save

Hey,
It seems like every time I reboot StarryPy3k, the player database get wiped (i keep getting the greeting message to new players). Same thing for planets, so my /protect and /claims commands are not saved either.
I use python3.5, and I set the writing permissions on the /StarryPy3k folder. Is that a bug, or am I missing something?

thank you.

AFK plugin

Proper AFK settings. Autodetection should also be a possibility, though not a priority.

connection problem with starbound 1.2

I am surely stating the obvious here... but it seems that starbound 1.2 changed the packets between client and server. Therefore, Starrypy3k does not works right now with 1.2.

Warp plugin blocks access to Starbound's more powerfull built-in warp command

The addition of the warp plugin appears to have blocked access to Starbound's built-in warp command. Sadly, Starbound's warp command is quite a bit more powerful than the warp plugin and losing access is rather problematic.

Since the "warp" and "tp" commands are synonymous, removing the "warp" command and relying on "tp" alone may solve this problem.

Pushover support

While I closed the old PR for adding pushover support, as it wont work with the current code-version of SP3K, I am opening a ticket to re-examine the idea of implementing it for the future.

ref: #21

muted players transmit to IRC

behaviour: irc bridge transmits what muted players say
expected: irc bridge does not transmit what muted players say.

Ban/unban issue

From @ren-kun on September 23, 2016 11:24

Concerning the un-ban command. If you unban via IP, the next reboot, the person is banned again. You must unban via the original name that was banned.

Copied from original issue: kharidiron#57

Unique names

Make all names unique and disable the Starbound /nick command and handle that internally.

Error in chat

From @ren-kun on September 21, 2016 0:48

2016-09-20 19:03:34 - WARNING - starrypy.plugin.chat_enhancements # Sender [user] is sending a message that the wrapper isn't handling correctly

Copied from original issue: kharidiron#56

The /report does not show in other chat tabs

Is it possible to make /report high priority and appear in local & other chat tabs?

If moderators and higher can't see it in all chat tabs then there's a possibility of a delay for staff to respond when in their current tab

Protecting Instance worlds.

From @ren-kun on August 14, 2016 1:57

I would like to protect my custom instance worlds and things like the outpost.

People are going nuts on it and crashing the server with an immense amounts of items on the floor.

Copied from original issue: kharidiron#46

Player DB does not get saved from IDE - socket error without

so i fifgured it now for my environment
if i run from PyCharm IDE, then it never gets that socket error and it instanly closes
but never saves config
if i run from command line with python3 it saves, but it always gets that error on exit
takes from 10-40 sec to close

This is on windows - just adding notes for future look-into

Whois a players IP

From @ren-kun on September 23, 2016 11:27

You can whois a user based on their ID.

Would be good if we could whois an IP to bring up the relevant information as well

Copied from original issue: kharidiron#58

Terraforming bypasses planet protection

I'm trying to run a server, but our players are fighting over it using terraformers. We have a planet that players can easily get build permissions on, and as such, they're able to place down terraformers and proceed to fight over which biome the planet should be. This is very annoying and destroys what the planet SHOULD be. Why are Terraformers bypassing the planet protection?

Vehicle bypass planets protection

Hello,
so basically, some vehicles (like XS mech mod for example) can destroy blocks with their weapons, even if the planets was protected.
Is there a way to fix this?
thanks.

Discord Bot Crashed

Hello ; After I setup everything plus discord bot, It's decide to crash and it was working before restart ? I checked syntax/codes but still kinda pointless. I didn't change anything on it

Ignoring exception in on_message
Traceback (most recent call last):
  File "/.../.../..../starryp3k_main/virtualsb/lib/python3.5/site-packages/discord/client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "/.../.../..../starryp3k_main/StarryPy3k/plugins/discord_bot.py", line 76, in on_message
    yield from DiscordPlugin.send_to_game(message)
  File "/.../.../..../starryp3k_main/StarryPy3k/plugins/discord_bot.py", line 214, in send_to_game
    asyncio.ensure_future(cls.handle_command(message.content[1:]))
TypeError: handle_command() missing 1 required positional argument: 'data'

PS: I shorted the paths, don't think as path issue or something

Edit1 : when put "..." to the chat makes crash when I type an actual word/letter It's not sending message but not gives error either

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.