mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-02-01 10:17:44 +00:00
Remove no-longer-needed warning suppressions
This commit is contained in:
@@ -37,7 +37,6 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
|
|||||||
// Your plugin class should inherit the plugin interfaces it wants to handle
|
// Your plugin class should inherit the plugin interfaces it wants to handle
|
||||||
// If you do not want to handle a particular action (e.g. OnBotMessage that is offered in IBotMessage), it's the best idea to not inherit it at all
|
// If you do not want to handle a particular action (e.g. OnBotMessage that is offered in IBotMessage), it's the best idea to not inherit it at all
|
||||||
// This will keep your code compact, efficient and less dependent. You can always add additional interfaces when you'll need them, this example project will inherit quite a bit of them to show you potential usage
|
// This will keep your code compact, efficient and less dependent. You can always add additional interfaces when you'll need them, this example project will inherit quite a bit of them to show you potential usage
|
||||||
// ReSharper disable once UnusedType.Global - this is example plugin class that isn't used in our main code
|
|
||||||
internal sealed class ExamplePlugin : IASF, IBot, IBotCommand, IBotConnection, IBotFriendRequest, IBotMessage, IBotModules, IBotTradeOffer {
|
internal sealed class ExamplePlugin : IASF, IBot, IBotCommand, IBotConnection, IBotFriendRequest, IBotMessage, IBotModules, IBotTradeOffer {
|
||||||
// This is used for identification purposes, typically you want to use a friendly name of your plugin here, such as the name of your main class
|
// This is used for identification purposes, typically you want to use a friendly name of your plugin here, such as the name of your main class
|
||||||
// Please note that this property can have direct dependencies only on structures that were initialized by the constructor, as it's possible to be called before OnLoaded() takes place
|
// Please note that this property can have direct dependencies only on structures that were initialized by the constructor, as it's possible to be called before OnLoaded() takes place
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ namespace ArchiSteamFarm {
|
|||||||
throw new ArgumentNullException(nameof(inventory));
|
throw new ArgumentNullException(nameof(inventory));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((amountsToExtract == null) || (amountsToExtract.Count == 0) || amountsToExtract.Values.Any(kv => kv.SetsToExtract == 0)) {
|
if ((amountsToExtract == null) || (amountsToExtract.Count == 0)) {
|
||||||
throw new ArgumentNullException(nameof(amountsToExtract));
|
throw new ArgumentNullException(nameof(amountsToExtract));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -762,12 +762,11 @@ namespace ArchiSteamFarm {
|
|||||||
int partLength;
|
int partLength;
|
||||||
bool copyNewline = false;
|
bool copyNewline = false;
|
||||||
|
|
||||||
// ReSharper disable ArrangeMissingParentheses - conflict with Roslyn
|
|
||||||
if (message.Length - i > maxMessageLength) {
|
if (message.Length - i > maxMessageLength) {
|
||||||
int lastNewLine = message.LastIndexOf(Environment.NewLine, i + maxMessageLength - Environment.NewLine.Length, maxMessageLength - Environment.NewLine.Length, StringComparison.Ordinal);
|
int lastNewLine = message.LastIndexOf(Environment.NewLine, (i + maxMessageLength) - Environment.NewLine.Length, maxMessageLength - Environment.NewLine.Length, StringComparison.Ordinal);
|
||||||
|
|
||||||
if (lastNewLine > i) {
|
if (lastNewLine > i) {
|
||||||
partLength = lastNewLine - i + Environment.NewLine.Length;
|
partLength = (lastNewLine - i) + Environment.NewLine.Length;
|
||||||
copyNewline = true;
|
copyNewline = true;
|
||||||
} else {
|
} else {
|
||||||
partLength = maxMessageLength;
|
partLength = maxMessageLength;
|
||||||
@@ -777,12 +776,11 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If our message is of max length and ends with a single '\' then we can't split it here, it escapes the next character
|
// If our message is of max length and ends with a single '\' then we can't split it here, it escapes the next character
|
||||||
if ((partLength >= maxMessageLength) && (message[i + partLength - 1] == '\\') && (message[i + partLength - 2] != '\\')) {
|
if ((partLength >= maxMessageLength) && (message[(i + partLength) - 1] == '\\') && (message[(i + partLength) - 2] != '\\')) {
|
||||||
// Instead, we'll cut this message one char short and include the rest in next iteration
|
// Instead, we'll cut this message one char short and include the rest in next iteration
|
||||||
partLength--;
|
partLength--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper restore ArrangeMissingParentheses
|
|
||||||
string messagePart = message.Substring(i, partLength);
|
string messagePart = message.Substring(i, partLength);
|
||||||
|
|
||||||
messagePart = steamMessagePrefix + (i > 0 ? "…" : "") + messagePart + (maxMessageLength < message.Length - i ? "…" : "");
|
messagePart = steamMessagePrefix + (i > 0 ? "…" : "") + messagePart + (maxMessageLength < message.Length - i ? "…" : "");
|
||||||
@@ -862,16 +860,15 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
// ReSharper disable ArrangeMissingParentheses - conflict with Roslyn
|
|
||||||
while (i < message.Length) {
|
while (i < message.Length) {
|
||||||
int partLength;
|
int partLength;
|
||||||
bool copyNewline = false;
|
bool copyNewline = false;
|
||||||
|
|
||||||
if (message.Length - i > maxMessageLength) {
|
if (message.Length - i > maxMessageLength) {
|
||||||
int lastNewLine = message.LastIndexOf(Environment.NewLine, i + maxMessageLength - Environment.NewLine.Length, maxMessageLength - Environment.NewLine.Length, StringComparison.Ordinal);
|
int lastNewLine = message.LastIndexOf(Environment.NewLine, (i + maxMessageLength) - Environment.NewLine.Length, maxMessageLength - Environment.NewLine.Length, StringComparison.Ordinal);
|
||||||
|
|
||||||
if (lastNewLine > i) {
|
if (lastNewLine > i) {
|
||||||
partLength = lastNewLine - i + Environment.NewLine.Length;
|
partLength = (lastNewLine - i) + Environment.NewLine.Length;
|
||||||
copyNewline = true;
|
copyNewline = true;
|
||||||
} else {
|
} else {
|
||||||
partLength = maxMessageLength;
|
partLength = maxMessageLength;
|
||||||
@@ -881,12 +878,11 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If our message is of max length and ends with a single '\' then we can't split it here, it escapes the next character
|
// If our message is of max length and ends with a single '\' then we can't split it here, it escapes the next character
|
||||||
if ((partLength >= maxMessageLength) && (message[i + partLength - 1] == '\\') && (message[i + partLength - 2] != '\\')) {
|
if ((partLength >= maxMessageLength) && (message[(i + partLength) - 1] == '\\') && (message[(i + partLength) - 2] != '\\')) {
|
||||||
// Instead, we'll cut this message one char short and include the rest in next iteration
|
// Instead, we'll cut this message one char short and include the rest in next iteration
|
||||||
partLength--;
|
partLength--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper restore ArrangeMissingParentheses
|
|
||||||
string messagePart = message.Substring(i, partLength);
|
string messagePart = message.Substring(i, partLength);
|
||||||
|
|
||||||
messagePart = steamMessagePrefix + (i > 0 ? "…" : "") + messagePart + (maxMessageLength < message.Length - i ? "…" : "");
|
messagePart = steamMessagePrefix + (i > 0 ? "…" : "") + messagePart + (maxMessageLength < message.Length - i ? "…" : "");
|
||||||
@@ -1978,7 +1974,6 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
MobileAuthenticator? authenticator = JsonConvert.DeserializeObject<MobileAuthenticator>(json);
|
MobileAuthenticator? authenticator = JsonConvert.DeserializeObject<MobileAuthenticator>(json);
|
||||||
|
|
||||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json deserializes into null object
|
|
||||||
if (authenticator == null) {
|
if (authenticator == null) {
|
||||||
ArchiLogger.LogNullError(nameof(authenticator));
|
ArchiLogger.LogNullError(nameof(authenticator));
|
||||||
|
|
||||||
|
|||||||
@@ -437,7 +437,6 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json deserializes into null object
|
|
||||||
if (botConfig == null) {
|
if (botConfig == null) {
|
||||||
ASF.ArchiLogger.LogNullError(nameof(botConfig));
|
ASF.ArchiLogger.LogNullError(nameof(botConfig));
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json deserializes into null object
|
|
||||||
if (botDatabase == null) {
|
if (botDatabase == null) {
|
||||||
ASF.ArchiLogger.LogNullError(nameof(botDatabase));
|
ASF.ArchiLogger.LogNullError(nameof(botDatabase));
|
||||||
|
|
||||||
|
|||||||
@@ -363,7 +363,6 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json deserializes into null object
|
|
||||||
if (globalConfig == null) {
|
if (globalConfig == null) {
|
||||||
ASF.ArchiLogger.LogNullError(nameof(globalConfig));
|
ASF.ArchiLogger.LogNullError(nameof(globalConfig));
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json deserializes into null object
|
|
||||||
if (globalDatabase == null) {
|
if (globalDatabase == null) {
|
||||||
ASF.ArchiLogger.LogNullError(nameof(globalDatabase));
|
ASF.ArchiLogger.LogNullError(nameof(globalDatabase));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user