summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:25:00 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:25:00 -0400
commit077d8e4f401ad1806c6af0540f432366314a2300 (patch)
tree525c6787f90a1e962f9a3b84ee495b2d0e8e2cc8 /src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other
parent0539bb8f3705e5c50d0e5790e2af97f39aed04b8 (diff)
downloadSMAPI-077d8e4f401ad1806c6af0540f432366314a2300.tar.gz
SMAPI-077d8e4f401ad1806c6af0540f432366314a2300.tar.bz2
SMAPI-077d8e4f401ad1806c6af0540f432366314a2300.zip
remove some unused/redundant code
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ApplySaveFixCommand.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs4
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs4
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/TestInputCommand.cs6
6 files changed, 15 insertions, 5 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ApplySaveFixCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ApplySaveFixCommand.cs
index 957b0e75..b02ba4b1 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ApplySaveFixCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ApplySaveFixCommand.cs
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which runs one of the game's save migrations.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class ApplySaveFixCommand : ConsoleCommand
{
/*********
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs
index 1955c14e..cf1dcbce 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs
@@ -1,8 +1,10 @@
-using StardewValley;
+using System.Diagnostics.CodeAnalysis;
+using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which sends a debug command to the game.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class DebugCommand : ConsoleCommand
{
/*********
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs
index 9beedb96..159d7c4a 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using Netcode;
@@ -9,6 +10,7 @@ using StardewValley.Network;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which regenerates the game's bundles.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class RegenerateBundlesCommand : ConsoleCommand
{
/*********
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs
index 27f6ce53..a233d588 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs
@@ -1,8 +1,10 @@
-using System.Diagnostics;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which shows the data files.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class ShowDataFilesCommand : ConsoleCommand
{
/*********
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs
index b97cb3e6..745b821b 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs
@@ -1,8 +1,10 @@
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which shows the game files.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class ShowGameFilesCommand : ConsoleCommand
{
/*********
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/TestInputCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/TestInputCommand.cs
index 46583dc3..8bf9f5db 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/TestInputCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/TestInputCommand.cs
@@ -1,8 +1,10 @@
using System;
+using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
{
/// <summary>A command which logs the keys being pressed for 30 seconds once enabled.</summary>
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Loaded using reflection")]
internal class TestInputCommand : ConsoleCommand
{
/*********
@@ -37,9 +39,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other
public override void OnUpdated(IMonitor monitor)
{
// handle expiry
- if (this.ExpiryTicks == null)
- return;
- if (this.ExpiryTicks <= DateTime.UtcNow.Ticks)
+ if (this.ExpiryTicks != null && this.ExpiryTicks <= DateTime.UtcNow.Ticks)
{
monitor.Log("No longer logging input.", LogLevel.Info);
this.ExpiryTicks = null;