Code Monkey home page Code Monkey logo

cncnet-ladder-api's Introduction

CnCNet Ladder API

This is the main repository for the CnCNet Ladder API.

Getting started

  • Set up docker on your computer (either docker desktop or docker engine with docker-compose)
  • Copy .env-example to .env and configure docker related env.
  • Copy cncnet-api/.env-example to .env and configure laravel related env.

Production

If you are setting up your developpement environment, you can skip this chapter and go to the Development section.

  • Build docker image: docker-compose build
  • Start docker container: docker-compose up -d
  • Install dependencies and run any migrations inside the app service container: docker exec cncnet_ladder_app composer install && php artisan migrate
  • Generate laravel key inside the container docker exec cncnet_ladder_app php artisan key:generate.
  • Compile latest scss: npm run prod

Development

If you are setting up a prod or staging environment, you can skip this chapter and go to the Production section.

  • Build docker-compose -f docker-dev-compose.yml build
  • Run docker-compose -f docker-dev-compose.yml up -d to build and start the docker container
  • Install dependencies : docker exec cncnet_ladder_app composer install
  • Generate laravel key inside the container docker exec cncnet_ladder_app php artisan key:generate. This will output the new key, you must manually copy past it into your cncnet-api/.env.

After changing the .env :

  • rebuild docker with docker-compose -f .\docker-dev-compose.yml up -d.
  • clear cache with docker exec cncnet_ladder_app php artisan optimize:clear
  • Restore a database backup or migrate with docker exec cncnet_ladder_app php artisan migrate for an empty database

You are ready to go !

  • Open up http://localhost
  • Watch scss for changes: npm run watch
  • Access to phpmyadmin: open up http://localhost:8080
  • Access to database with you dbms : host:localhost port:3307 user:DB_USER pass:DB_PASS
  • Open a shell : docker exec -it cncnet_ladder_app /bin/bash

Storage links

Replace user with the host user ln -s /home/user/site/storage/app/avatars /home/user/site/public/avatars ln -s /home/user/site/storage/app/media /home/user/site/public/media

Built with

  • PHP 8.3
  • Laravel 11
  • Docker (PHP, Nginx, Mysql (Mariadb))

Useful resources

Troubleshooting

No supported encrypter found. The cipher and / or key length are invalid

You either forgot to generate the key or your env variable are not up to date

  • Generate key : docker exec cncnet_ladder_app php artisan key:generate or
  • Update env : rebuild docker with docker-compose -f .\docker-dev-compose.yml up -d.

SQLSTATE[42S02]: Base table or view not found ...

Your database is empty or missing tables

  • Restore from a backup or
  • Run migrations : docker exec cncnet_ladder_app php artisan migrate

cncnet-ladder-api's People

Contributors

alexp8 avatar dependabot[bot] avatar dkeetonx avatar funkyfr3sh avatar grantbartlett avatar rohsyl avatar sean3z avatar tomsons26 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rohsyl dkeetonx

cncnet-ladder-api's Issues

Game details

Currently options like "Superweapons" should not be shown for games like RA, but for YR it should.

Ladder API upgrade

  • Upgrade Laravel from 5 to 5.2 to fix tinker and some other misc error.
  • Look into auth issue with 501 some people have experienced

Points

Currently points are awarded to both players for participating.
Higher number for the winner, lower for the loser.

However consideration needed for time lapsed in points calc.

QM Player Achievements

QM Ladder Achievements

Provide unlockable achievements for each ladder that players can play for and unlock. Purpose is to provide extra incentive to play Quick Match. Players' unlocked achievements would then be viewable on their player profile page.

Include achievements on the player page or provide a link to the player's achievements, highlight the achievements they have unlocked, grey out the locked achievements. Add extra flair/style to the difficult achievements, cool artwork/coloring/wording.

Current ideas for RA2/YR Achievements:


General:
Win QM games: 10, 50, 100, 300, 500, 1000, 1500, 3000
In one month play: 50 games, 100, 300, 500
In one month win: 30 games, 50, 75, 100, 200, 300
Achieve top 10 rank: 1 time, 2 times, 3, 5, 10
Achieve top 25 rank: 1 time, 2 times, 3, 5, 10
Achieve top 50 rank: 1 time, 2 times, 3, 5, 10
Achieve rank 1 in back to back months LEGENDARY
Achieve top 5 in back to back months
Achieve top 15 in back to back months
TODO add additional achievements..

Multi-ladder (RA2/YR/Blitz only):
Achieve top 25 rank in 2 different ladders in one month
Achieve top 25 rank in 3 different ladders in one month
Achieve top 10 rank in 2 different ladders in one month
Achieve top 10 rank in 3 different ladders in one month LEGENDARY

Destroy enemy units:

Lifelong:
Destroy enemy rhino tanks: 30, 60, 100, 200, 300, 500, 1000
TODO add achievements for other units...

In one game:
Destroy enemy rhino tanks: 20, 35, 60
TODO add achievements for other units...


Allied
Lifelong:
Win games as Allied: 10 games, 50, 100, 500, 1000

In one game:
Build grizzly tanks: 50/100
Build Mirage tanks: 30/60
Build prism tanks: 20/50
Build battle fortresses: 10/30
Build dogs: 50/100
Build GIs: 50/100
Build GGI: 30/60
Build dogs: 50/100
Build Rocketeers: 30/60
Build snipers: 30/60
Build chrono legionnaires: 10/30
Build Harriers: 10/24
Build Black Eagles: 10/24


Soviet
Lifelong:
Win games as Soviet: 10 games, 50, 100, 500, 1000
Build rhino tanks: 50, 100, 500, 1000, 3000, 5000
Build dogs: 50, 100, 500, 1000, 3000, 5000

In one game:
Build conscripts: 50/100
Build dogs: 50/100
Build desolators: 25/50
Build rhinos: 50/100
Build siege: 30/60
Build drones: 50/100
Build kirovs: 20/50
Build 10 war factories
Build 10 barracks
Build 10 nuclear reactors
Build 25 tesla reactors


Yuri:
Win games as Yuri: 10 games, 50, 100, 500, 1000

In one game:
Build 50/100 lasher tanks
Build 30/60 magnetron tanks
Build 20/50 masterminds
Build 10/30 flying disks
Build 50/100 brutes
Build 30/50 yuri clones


DB Tables:
achievement: achivement_id, achievement_type, ladder_id, achiement_name
achievement_tracker: achivement_id, user_id, achivement_unlocked_date, count
achievement_type: achievement_type => enum {'CAREER', 'IMMEDIATE', 'MULTI')

  • career = achievements unlocked over time, progress carried over month to month
  • immediate = unlocked in one match
  • multi = achievements that span over multiple ladders

Track when players do not accept found matches

When a player is in queue and a match is found, they can click cancel or wait 15 seconds for the match to bail.
Some players abuse this feature and queue consecutively but do not accept the match, preventing opponent from playing QM.

Need to track to track when a player cancels the match, the time of the cancellation and who the opponent was.
Then admins could monitor players when and who are cancelling matches.

Future enhancement: If player cancels more than 2 matches within 5 minute span they should go on cooldown from entering queue.

Broken links

Navigation and footer areas especially need revising.

Create endpoint for host to create unique game identifier

When in the client, host clicks START. The host will then send off a request for a unique identifier for the game that will be shared with other players upon game start.

The identifier is then added everyone's stats dmp upon returning from game and uploaded to be parsed.

Map veteos refactor

Refactor map vetoes into a new table, not dependent on the order of the map pool. Faction pick / Vetoes should map to player_id, map_id.

Is this still in active development?

Hello,

I was just wondering if this is in active development and what the plans are for this?

I came across this and thought I could maybe contribute to this. I just want to know if this is worth my time?

Average FPS

11:56 < FunkyFr3sh1> my afps test counts only games with at least 8min and it displays the highest afps of the last 20 games
11:56 < FunkyFr3sh1> my idea was that if he can play at least one fast game then it wasn't him who lagged
11:57 < FunkyFr3sh1> the real laggers won't have a single fast game
11:57 < FunkyFr3sh1> this way you don't get bad afps stats if you play a few games against known laggers
11:57 < FunkyFr3sh1> e.g. i play 10 games with the chinese on the pentium 2, but my afps shows 60
11:58 < FunkyFr3sh1> theirs shows as 45
12:07 < FunkyFr3sh1> btw, don't forget to check the game speed
12:07 < FunkyFr3sh1> only save afps stats of max speed games

Create endpoint for retrieving badges

An endpoint that is fetched for Red Alert, Tiberian Sun, Yuri's Revenge badges.

It will return a list of idents and the associated badges linked to those accounts.

CnCNet clients will then process the list and display badges matching those in the lobby.

API bug with current_matches endpoint

Endpoint: /api/v1/qm/ladder/{ladder}/current_matches (ApiQuickMatchController::getActiveMatches())

Bug: Full list of active games is not displayed, sometimes active games are omitted from the result.

Cause: Unknown, probably an issue with the underlying laravel queries being used to fetch the data.

Functions used: LadderService::getRecentSpawnedMatches(), LadderService::getRecentFinishedMatches()

Map pool system rework

Unlock additional maps as you gain points. Benefits new players to have a smaller pool, grants experienced players large map pool as they gain points

AI Bot matching preference

As a user I would like the option to decide whether I match the AI Bot in QM. When enabled I will match the AI after 1 minute of not matching other players.

Unable to login - temp solution for local dev

For local dev for me and for Burg on Discord, we had to do this to be able to "login" to the ladder site. Just a heads up for those wanting to dev locally.

Maybe theres some config issue we needed in the env (not sure).
image

New ladder month QM Nickname creation

When a player opens the quick match client for a new month of ladder, the ladder API is only returning nicknames for some of the ladders.
The Ladder API should initialize a QM player for each ladder, (pull their nick from last month or copy from different ladder?).

It seems players need to re-create nicknames for ladders every month.

Example: I opened the QM client at the start of September ladder, I have 2 nicks created that were created for me for "TS" and "YR" but not Blitz/RA2/RA etc. I have to manually go to the ladder website to register nicks for the missing ladders. I did play RA2 and Blitz QMs last month.
image

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.