summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 18:16:09 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 18:16:09 -0400
commitc8ad50dad1d706a1901798f9396f6becfea36c0e (patch)
tree28bd818a5db39ec5ece1bd141a28de955950463b /src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs
parent451b70953ff4c0b1b27ae0de203ad99379b45b2a (diff)
parentf78093bdb58d477b400cde3f19b70ffd6ddf833d (diff)
downloadSMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.gz
SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.bz2
SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs')
-rw-r--r--src/SMAPI.Web/Framework/Clients/Nexus/DisabledNexusClient.cs31
1 files changed, 31 insertions, 0 deletions
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
+{
+ /// <summary>A client for the Nexus website which does nothing, used for local development.</summary>
+ internal class DisabledNexusClient : INexusClient
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <inheritdoc />
+ public ModSiteKey SiteKey => ModSiteKey.Nexus;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Get update check info about a mod.</summary>
+ /// <param name="id">The mod ID.</param>
+ public Task<IModPage?> GetModData(string id)
+ {
+ return Task.FromResult<IModPage?>(
+ new GenericModPage(ModSiteKey.Nexus, id).SetError(RemoteModStatus.TemporaryError, "The Nexus client is currently disabled due to the configuration.")
+ );
+ }
+
+ /// <inheritdoc />
+ public void Dispose() { }
+ }
+}