From 9ba06704077c32f84aa4c4aeff8b75e66e1c0486 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 Apr 2022 11:21:44 -0400 Subject: fix Nexus API key needed to launch web project locally --- .../Framework/Clients/Nexus/DisabledNexusClient.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs (limited to 'src/SMAPI.Web/Framework/Clients') diff --git a/src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs b/src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs new file mode 100644 index 00000000..6edd5f64 --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs @@ -0,0 +1,31 @@ +using System.Threading.Tasks; +using StardewModdingAPI.Toolkit.Framework.UpdateData; + +namespace StardewModdingAPI.Web.Framework.Clients.Nexus +{ + /// A client for the Nexus website which does nothing, used for local development. + internal class DisabledNexusClient : INexusClient + { + /********* + ** Accessors + *********/ + /// + public ModSiteKey SiteKey => ModSiteKey.Nexus; + + + /********* + ** Public methods + *********/ + /// Get update check info about a mod. + /// The mod ID. + public Task GetModData(string id) + { + return Task.FromResult( + new GenericModPage(ModSiteKey.Nexus, id).SetError(RemoteModStatus.TemporaryError, "The Nexus client is currently disabled due to the configuration.") + ); + } + + /// + public void Dispose() { } + } +} -- cgit