Skip to content

🌐 Website for community hosted seasons for C&C Remastered Tiberian Dawn.

Notifications You must be signed in to change notification settings

dan-mcm/cnc-community-ladder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CNC Community Ladder

style: styled-components code style: prettier XO code linter Google Analytics Heroku Discord

This community run project was built for the C&C Remastered Collection: Tiberian Dawn game. Initially EA supported an online leaderboard @ https://cnc.community/command-and-conquer-remastered/leaderboard/tiberian-dawn that was manually reset every few months, however after the third season EA had seemingly dropped support for ladder resets for competitive quickmatch online games.

To help keep the online community alive and active I created this project for a community run leaderboard that aimed to:

  • Record players elo scores using the official EA/Petroglyph API Endpoints (see DB Repo) & reset the scoring at automatically defined intervals (every x months etc.)
  • Generate Leaderboard & Player Analytics based on players stats and serve these via https://tibdawn.com/ website (now deprecated - previously running via Heroku/Route53)
  • Setup a brand new custom map pool - the existing quickmatch setup for this game had a pool of 7 random maps players could be assigned, this new functionality enabled auto recording of scores from players who manually setup lobbies with 8 new maps
  • Setup a special OBS browser endpoint that allowed streamers to pull data from API while streaming live on Twitch to show off their most up to date scoring systems - a similar project was previously active on the official leaderboard that inspired this adaptation

After a few months of the project being live EA decided to implement an automatic elo/scoring reset on their old ladder system which marked the deprecation of this project.

As the project is now deprecated you can refer to the following sources for a snapshot of the sites initial appearance, addition of new features & community interaction:

Technical Overview

Setup with:

Component libraries include:

For Code Styling & Linting:

  • Prettier is used for code styling throughout the project.
  • XO is used to enforce linting styles alongside Prettier.

DevOps:

  • A pre-commit hook is setup to automatically run the code styler, linter and tests before enabling a successful push to the repo.
  • In addition to the pre-commit hook basic CircleCI test integration has been setup (see CircleCI badge above for current test status Passing/Failed). This will block merges to the master branch in the event tests fails on a PR.
  • A Dockerfile & Makefile are available for portable deployment.
  • Google Analytics tracking enabled

Endpoints

/

Serves built react app.

/leaderboard/:season

Fetches leaderboard results for a specified season from our DB.

/elohistory/:season/:player

Fetches information specific to a specified player from our DB.

/awards/total/:season

Fetches our top ranked players for total games played

/awards/faction/random/:season or /awards/faction/{GDI/Nod}/:season

Returns our top ranked players for a specific faction.

/health

General health check endpoint currently in use with Uptime Robot

/nightbot/:season/:playername

Used for nightbot extension

/obs/:season/:playername

Used for obs extension

Running Locally

Note: there is now a dependency on a DB, the codebase for which is available here

yarn install
yarn dev # will start react app on port 3000 and express server on port 5000 by default

Using Docker

Not Tested

# build docker image
docker build . # or you can run the command

# run docker container and portforward port 3000
docker run -ti -p 3000:3000 <docker-image-id>

# publish docker image to docker hub
docker push <docker-repo>

Using Makefile

Not Tested

# this will default to 'build' command
make

# this will push the image to docker hub
make push

# this will both build and publish for expediency
make deploy

Tests

Handled by ReactScripts a pre-configured version of Jest to save hassle with Babel configuration.

Deployment & Hosting

Heroku

The main website is currently hosted on Heroku. There are two projects - one for the main website cnc-site and a second that handles the DB updates running effectively as a cronjob cnc-db-cron. The cnc-site builds the project with yarn build and serves it as yarn server. The cnc-db-cron is ran every 10 minutes with the yarn cron command.

Updates pushed to the master branch will trigger an immediate deploy of the site.
DB cron updates must be manually triggered.

Github Pages

For a separate map making contest that was held a github pages site was hosted through this repo on GitHub pages @ https://dan-mcm.github.io/cnc-community-ladder/. Due to domain structures the Github pages codebase is maintained on the deploy-branch with source code hosted on the gh-pages branch.

Heroku configuration

For logs

heroku login
heroku logs -a cnc-site -t
heroku logs -a cnc-db-cron -t

About

🌐 Website for community hosted seasons for C&C Remastered Tiberian Dawn.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published