/aiotpt

Server for The Powder Toy written in Python

Primary LanguagePythonMIT LicenseMIT

aiotpt

Build Status

This is an implementation of a server for the falling sand game The Powder Toy, written in Python using aiohttp for asynchronous HTTP and PostgreSQL for data storage.

Due to various bugs in the client code of TPT, this server is currently only compatible with recent revisions of it (starting at commit 9a855cc to be accurate).

This project is still in its infancy and can not be considered stable or secure by any means. If you make an instance of it open to the public, Ristovski will probably hack you.

Installing

  • Install Python 3.5+
  • Install PostgreSQL 9.5+
  • Build the save renderer from source using --renderer and move the Render executable into renderer/
  • Build The Powder Toy from a modified source (change SERVER and STATICSERVER in src/Config.h to the host and port of your server, e.g. localhost:8080)
  • pip install -r requirements.txt
  • set DATABASE_URL=postgres://user@host:port/database
  • psql -f schema.sql
  • python -m aiotpt

Testing

  • Install aiotpt as described above
  • pip install pytest
  • py.test

Todo

  • Unit tests for all views
  • Allow static storage of saves instead of storing them inside the database
  • Inline documentation
  • Static HTML frontend/website
  • High-level moderation/administration tools
  • Basic analytics and cheat protection