Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.81k stars 258 forks source link

Refuse to load known-incompatible mod versions #192

Closed Pathoschild closed 7 years ago

Pathoschild commented 7 years ago

Some mods are abandoned and known to be incompatible with the latest version of the game. That especially includes CJB Cheats Menu 1.12, which is the reason for a significant fraction of SMAPI support requests.

When a player tries to load a known-incompatible mod version, SMAPI should output a warning like this:

Can't load mod "CJB Cheats Menu" 1.12, because this mod version is not compatible with the latest version of the game. Please check for a newer mod version in one of these places: — official page: http://www.nexusmods.com/stardewvalley/mods/4/ — unofficial update: http://community.playstarbound.com/threads/125031/

This would probably use data stored in a StardewModdingAPI-data.json file like this:

{
   "IncompatibleMods": [
      {
         "ID": "<mod id>",
         "Name": "CJB Cheats Menu",
         "Version": "1.12",
         "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/4/",
         "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031/"
      }
   ]
}
tstaples commented 7 years ago

This could tie in nicely with #181 as it would mostly resolve the issue of pointing users of the outdated versions to the new unofficial versions.

Would this list of outdated mods be kept in the SMAPI repo itself? It seems troublesome to have to push a release just to update that list. Maybe hosting it in a separate repository (or in canimod) and having SMAPI fetch it from there would be better to allow for easier curation of the list.

Pathoschild commented 7 years ago

I'd keep it in the SMAPI repo for simplicity. This will only contain popular mods broken by a Stardew Valley update that don't have a newer compatible version, so it shouldn't need frequent updates.

Pathoschild commented 7 years ago

Done in the develop branch for the upcoming SMAPI 1.5 release. Mods can be listed in the StardewModdingAPI.data.json file in this format, specifying both the official mod page and the unofficial update (if any):

  {
    "ID": "CJBCheatsMenu",
    "Name": "CJB Cheats Menu",
    "Version": "1.12",
    "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/4",
    "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031"
  },

When the player tries to load an incompatible version, they'll see this message instead of the previous flood of errors:

"screenshot of error linking user to update pages"

Pathoschild commented 7 years ago

SMAPI 1.5 will release with four mods listed: Better Sprinklers, CJB Cheats Menu, CJB Item Spawner, and Chest Label System. These all have unofficial updates by @Entoarox, but the unofficial builds have the same version number as the official ones.

Blocked until @Entoarox can update them to a different version number, so SMAPI doesn't reject them as incompatible.

Pathoschild commented 7 years ago

@Entoarox updated his mods and SMAPI now supports his versioning convention. 👍