Skip to content

A Symfony 4 application to summarize BZFlag replay files and perform analysis on them

License

Notifications You must be signed in to change notification settings

allejo-experiments/postgame

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release GitHub license

A Symfony 4 website for summarizing BZFlag replay files and aggregating match/player analytics.

Homepage of this application List view of available replays Summary view of single replay

Project Setup

This project follows the standard Symfony 4 way of doing things, meaning Yarn + Webpack Encore for front-end assets and Symfony + Twig for back-end.

Additionally, this project is using the experimental BZFlag style-guide for its front-end design.

Setup

  1. Pull down the necessary submodules with git submodule update --init
  2. Duplicate .env to an .env.local file in the root of the project
  3. Set the DATABASE_URL environment variable

Production Deployment

To deploy to production, you don't need to install development dependencies.

# Install dependencies
composer install --no-dev --optimize-autoloader
yarn install --production

# Build our front-end assets
yarn build

# Setup Symfony cache
APP_ENV=prod APP_DEBUG=0 bin/console cache:clear

# Migrate database schemas
bin/console doctrine:migrations:migrate

Once you've built everything, point your web server to the public/ folder.

Local Development

For local development, you'll need to install development dependencies and run local processes.

# Install dependencies
composer install
yarn install

# Migrate database schemas
bin/console doctrine:migrations:migrate

# Run the CSS + JS build script in one terminal
yarn encore dev --watch

# (Optional) Run the PHP web server in another terminal. Otherwise, you'll
# need a local web server pointing to `public/`.
bin/console server:run

Site Administration

Once you've got the site configured and running, you'll want to manage replay files.

Importing Replays

You can import a single replay file or a directory of replay files. Replay files will only be imported once and duplicates will be ignored. Duplicates are determined by the SHA1 hash of the file; on import, replay files have their SHA1 values saved in the database.

bin/console app:replay:import <single file or directory of replays>

In order to force an upgrade of a replay file, use the --upgrade flag. This flag will keep the replay ID (so URLs don't break) but all other stats and events related to the replay will be deleted and imported again. This is useful for when new analysis options are available or there are bugs in the import process and require a reimport.

For running a cron job of imports, the --after option is available where you can set values such as --after="-2 days". When given a directory of replay files, only replays that have been touched in the past 2 days would be imported. This is helpful so you don't try reimporting thousands of replays each time.

For a full list of all available options, use the help command.

bin/console help app:replay:import

Deleting Replays

If you'd like to delete a replay from your database, get the ID of the replay and use the app:replay:delete command. This will perform a hard delete of the replay and cannot be undone; the URL for the given replay will break.

If there was a mistake in the import of a replay, consider using the --upgrade option in the import command.

bin/console app:replay:delete <replay id>

License

MIT

About

A Symfony 4 application to summarize BZFlag replay files and perform analysis on them

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 82.5%
  • Twig 12.9%
  • JavaScript 2.7%
  • SCSS 1.3%
  • Shell 0.6%