PlumyGames / mgpp

The next generation of Mindustry modding.
https://plumygames.github.io/mgpp/
GNU General Public License v3.0
48 stars 3 forks source link

Can't fetch latest be version, so use 22767 as default instead. #9

Closed liplum closed 2 years ago

liplum commented 2 years ago

When I tried using the latest Mindustry client, I got this.

mindustry {
    client {
        mindustry be latest
    }
}
Can't fetch latest be version, so use 22767 as default instead.
java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
    at java.net.URL.openStream(URL.java:1067)
    at kotlin.io.TextStreamsKt.readBytes(ReadWrite.kt:150)
    at io.github.liplum.mindustry.IGameSpec$DefaultImpls.LatestBE(GameSpec.kt:110)
    at io.github.liplum.mindustry.ServerSpec.LatestBE(GameSpec.kt:184)
    at io.github.liplum.mindustry.IGameSpec$DefaultImpls.be(GameSpec.kt:70)
    at io.github.liplum.mindustry.ServerSpec.be(GameSpec.kt:184)
    at Build_gradle$2.execute(build.gradle.kts:29)
    at Build_gradle$2.execute(build.gradle.kts:4)
    at org.gradle.internal.extensibility.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:173)
    at org.gradle.internal.extensibility.ExtensionsStorage.configureExtension(ExtensionsStorage.java:64)
    at org.gradle.internal.extensibility.DefaultConvention.configure(DefaultConvention.java:194)
    at io.github.liplum.mindustry.Extension.mindustry(Extensions.kt:23)
    at Build_gradle.<init>(build.gradle.kts:24)
liplum commented 2 years ago

You might face the GitHub API limit if you accessed that url too many times. latest notation is important for a modder going after the latest version but sometimes troublesome to deal with the network. I will try to "cache' it so that it won't try to fetch from GitHub API too frequently. Anyways, even though I decide to cache it, you can still sepcify which game version you want, which is recommended and the final solution.

Prosta4okua commented 2 years ago

lmao, why are you talking with yourself

liplum commented 2 years ago

lmao, why are you talking with yourself

Meanwhile, I'm a user of mgpp, thus I created an issue to address what I faced in production environment. Also, GitHub provides me a useful tool to manage agenda, why not make use of it.

phinner commented 2 years ago

This guy is a genius...