Giter Club home page Giter Club logo

pr-downloader's Introduction

Beyond-All-Reason

Discord

Open source RTS game built on top of the Recoil RTS Engine

Where to download

https://www.beyondallreason.info/download

How to play

https://www.beyondallreason.info/guides

Development Quick Start

Beyond All Reason (BAR), consists of 2 primary components, the lobby (Chobby - https://github.com/beyond-all-reason/BYAR-Chobby) and the game code itself (this repository).

The game runs on top of the Recoil engine https://github.com/beyond-all-reason/spring.

In order to develop the game (this repository) you first need a working install of the lobby/launcher. There are 2 ways to do this:

  1. Download the full BAR application from the website and run it. This is probably what you will have done if you have previously installed and played the game.

  2. OR if you want to develop the lobby client, follow the guide in the Chobby README. First download a release of Chobby and then launch Chobby, this will automatically download and install the engine and other dependencies.

Once you have a working install of BAR you need a local development copy of the game code to work with. This code will live in the BAR install directory.

  1. To find the BAR install directory simply open the launcher (not full game) and click the "Open install directory" button. This is one of the 3 buttons (Toggle log and Upload log are the other 2). For Windows installs this might be your user's AppData/Local/Programs/Beyond-All-Reason/data directory.

  2. In the BAR install directory create the empty file devmode.txt. E.g: AppData/Local/Programs/Beyond-All-Reason/data/devmode.txt

  3. In the BAR install directory in the data folder in the games sub-directory (create games if it doesn't exist) clone the code for this repository into a directory with a name ending in .sdd. For example:

git clone https://github.com/beyond-all-reason/Beyond-All-Reason.git BAR.sdd

Ensure that you have the correct path by looking for the file Beyond-All-Reason/data/games/BAR.sdd/modinfo.lua

  1. Now you have the game code launch the full game from the launcher as normal. Then go to Settings > Developer > Singleplayer and select Beyond All Reason Dev.

  2. Now you can launch a match normally through the game UI. This match will use the dev copy of the LUA code which is in BAR-install-directory/data/games/BAR.sdd.

  3. If developing Chobby also clone the code into the games directory. Follow the guide in the Chobby README.

More on the .sdd directory to run raw LUA and the structure expected by Spring Engine is documented here.

pr-downloader's People

Contributors

abma avatar amdmi3 avatar antlerforce avatar ashdnazg avatar beherith avatar bigbluejay9 avatar born2crawl avatar bruno-dasilva avatar cleanrock avatar db81 avatar dzosz avatar gajop avatar jayaddison avatar jk3064 avatar krux02 avatar lhog avatar n0u avatar p2004a avatar padraicm avatar r-a-sattarov avatar renefritze avatar specing avatar sprunk avatar usaga avatar yaribz avatar

Watchers

 avatar  avatar  avatar  avatar

pr-downloader's Issues

Make sure all error paths print errors.

This is to audit code and ensure that all error paths are logging errors when failing so that it's easy to see what failed. It looks like at least CFileSystem::Rename doesn't do that, maybe it's more.

Output version info to stdout

in versions.gz, each line contains some info about the version:

byar:git:fff9e7afdb0f45378eadef107c9e5156ae3d32ef,0e0069460c09a7451f162f4927d91340,,Beyond All Reason test-16314-fff9e7a
byar:stable,1f606f2360acdede03e811c5a975b16d,,Beyond All Reason 0.01
byar:test,d78faaf04d16de64ac8c0ba38aa37cde,,Beyond All Reason test-22158-bf74011

Would it be possible to dump this info to stdout? Either before or after a download has finished is fine for my use.

Specifically, the md5 is useful to me in BAR Lobby because the .sdp files in the packages dir use them for filenames, and it helps to be able to know exactly which sdp file is needed ahead of time, instead of iterating through them to search for the version I'm looking for.

Output the filename of the downloaded map somewhere

I could manually query https://bar-springfiles.p2004a.com/find to get this info, but would prefer to just use prd's --download-map on its own if possible. Just need prd to print the filepath of the downloaded map somewhere so I can cache it

Improve `--validate-sdp`

Currently:
./pr-downloader.exe --filesystem-writepath "C:\Users\username\Repos\bar-lobby\dist_electron\content" --validate-sdp "C:\Users\username\Repos\bar-lobby\dist_electron\content\packages\cef6f6184a579cbf25f1dce3c21e305e.sdp"

This has some usage annoyances:

  • requires --filesystem-writepath to be specified, otherwise it looks up the related pool files in the wrong dir (defaulting to C:\Users\username\Documents\My Games\Spring\pool\ on windows).
  • requires user doing their own version lookup to know which sdp file relates to their content
  • is reaaaaally slow for what's essentially meant to be a quick check to see if a package is installed correctly. Would probably require some optimisation/caching to be done on installs to only mark packages as complete after all its files have finished downloading

Ability to download content by its name, rather than its tag

e.g. instead of ./pr-downloader.exe --download-game byar:git:fff9e7afdb0f45378eadef107c9e5156ae3d32ef, I would like to be able to do ./pr-downloader.exe --download-game "Beyond All Reason test-16314-fff9e7a".

This would save the lobby from having to its own version lookup.

Can't build pr-d under MSVC

Severity	Code	Description	Project	File	Line	Suppression State
Error	C1083	Cannot open include file: 'getopt.h': No such file or directory	pr-downloader	C:\spring\tools\pr-downloader\src\main.cpp	13	

Optimize pr-downloader to not re-download map if it's present.

This is a regression from some refactoring a bunch of time ago, and is a safe behavior to just redownload, but it can be optimized to not have to do it.

The implementation would be computing of map file hash on disk, and comparing with the one available in hosting.

Comparing just file presence is not enough, as client could ask to redownload because there is some corruption and existing file on disk is not recognized correctly as valid map.

`CURLSSLOPT_NATIVE_CA` not resolving certificates correctly in all cases.

When the windows installation is fresh (Can be simulated using Windows Sandbox), curl has issue with validating certificate for repos-cdn.beyondallreason.dev domain. Workaround is to load once https://repos-cdn.beyondallreason.dev/ in Edge or Internet Explorer and then certificate validation works just fine.

I believe this is upstream bug in curl: Next steps are to build minimal reproducible example, gather more data, and report upstream.

Add integration test for maps download

Task is to extend https://github.com/beyond-all-reason/pr-downloader/blob/master/test/functional_test.py with test for map downloads as currently only game downloads using Rapid are tested.


pr-downloader takes --download-map with the name of map to download (name is SpringName, unique identifier), and calls endpoint defined by PRD_HTTP_SEARCH_URL environment variable to find where it's located and how to download it. E.g.: https://files-cdn.beyondallreason.dev/find?category=map&springname=Angel%20Crossing%201.4 for map with spring name Angel Crossing 1.4.

Parsing in pr-downloader of response is in: https://github.com/beyond-all-reason/pr-downloader/blob/master/src/Downloader/Http/HttpDownloader.cpp#L117

The integration test HTTP server needs to be extended to support such endpoint and serve some small dummy file and test that:

  • Download works correctly
  • When hash in metadata doesn't match the hash of downloaded file it should error out
  • When something fails, it should not create a final .sd7 file but always temp file first

PS: this doesn't require pr-downloader compilation, you can get latest stable binaries from https://github.com/beyond-all-reason/spring-launcher/tree/master/bin and just execute intgration test against them.

CLI flag to log stdout messages as JSON

This will make it easier for the lobby to parse info from prd. Ideally, each object would follow a standard format, such as:

[Info] /spring/tools/pr-downloader/src/pr-downloader.cpp:178:DownloadSetConfig():Free disk space: 172128 MB

->

{
    "type": "info",
    "message": "Free disk space: 172128 MB"
}

ย 

[Progress]   7% [==                            ] 6550225/90399836

->

{
    "type": "download",
    "content": "Beyond All Reason test-16314-fff9e7a",
    "progress": {
        "bytesDownloaded": 6550225,
        "totalBytes": 90399836,
        "percent": 0.07
    }
}

There's also lot of guff in the current stdout that isn't useful for end users, would be preferable to hide that behind a --verbose flag.

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.