SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Add support for ModDrop update checks

Pathoschild opened this issue ยท 3 comments

commented

Add support for update-checking mods hosted on the new ModDrop site.

commented

ModDrop created an API to let SMAPI fetch basic info, but my contact wasn't sure whether posting the details here would be okay.

Below is the pattern used to validate ModDrop's mod version format. It allows some non-semantic formats like 1.2.3.4.5.6.8, so we'll need to depend on authors respecting versioning conventions (like we do on Chucklefish and Nexus).

(\d+(?:\.\d+)*)(?:[-. ]?((?:alpha|beta|prerelease|pre|rc|a|b)+))?(?:[-. ]?(\d+)\b)?
commented

Done in develop for the upcoming SMAPI 2.9 (including the mod compatibility list, update key parsing, and the update-check API).

commented

Here's the API info from the ModDrop developer for reference (got the okay to post it):

[POST] https://www.moddrop.com/api/mods/data

Data expected ( preferably in JSON ) is:

public class GetModArgs {
   public List<long> ModIDs { get; set; }

   #region Optional

    public bool Files { get; set; }

    public bool Mods { get; set; }

    #endregion Optional
}

Data returned (In JSON) is:

public class GetModsResult {

    [JsonProperty("mods")]
    public Dictionary<long, GetModResult> Mods { get; set; }
}

Shape of a "GetModResult:

public class GetModResult {

    [JsonProperty("files")]
    public List<PackageSerialization> Files { get; set; }

    [JsonProperty("mod")]
    public ModSerialization Mod { get; set; }
}