jpenilla / chesscraft

Paper plugin adding in-world chess matches against players and chess engines (CPUs) to Minecraft
https://modrinth.com/plugin/chesscraft
Apache License 2.0
19 stars 2 forks source link

Support automatic downloads for Stockfish versions >= 16 #17

Closed jpenilla closed 10 months ago

jpenilla commented 1 year ago

Stockfish removed all old downloads from their site, which broke our auto downloader. The downloader has since been 'fixed' using archive.org for versions up to 15.1.

Starting with Stockfish 16, GitHub Releases is the official source for prebuilt binaries. We should add support for this somehow so that we can auto-download SF16 and new versions in the future.

The variety of binaries provided is different now as well, so this will probably require changes to the CPU feature detection; which needs to be changed anyways to support ARM CPUs (even though SF only provides x86-64 binaries for many platforms, these can often be used on aarch64 systems, for example with Apple's Rosetta). When implementing the new downloading logic it would also be a good time to properly support macOS; whether only for 16+ or also legacy versions.

jpenilla commented 1 year ago

https://files.stockfishchess.org/ seems to be back up (only pre-16 versions, we will have to see if 16 ends up here once 17 is out)...

Olen commented 1 year ago

Getting the assets for releases is pretty trivial using the github API: https://docs.github.com/en/free-pro-team@latest/rest/releases/releases?apiVersion=2022-11-28#list-releases You can use any github-token to authenticate. I just tested with both a "classic" and a "fine grained token" without any permissions, and I was able to retrieve the JSON-list of stockfish-releases (with all their assets). So you should probably be able to distribute a token in the JAR without any dangerous implications.

Classic token

image

Fine grained token

image

jpenilla commented 10 months ago

https://github.com/jpenilla/chesscraft/commit/f530c4ee8f73195acd9179cd0416c2248de1017d