mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-12 22:50:39 +00:00
Post-merge Resharper fixes #501
This commit is contained in:
@@ -41,7 +41,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal DateTime LastPacketReceived { get; private set; } = DateTime.MinValue;
|
||||
|
||||
internal ArchiHandler(ArchiLogger archiLogger) => ArchiLogger = archiLogger ?? throw new ArgumentNullException(nameof(archiLogger));
|
||||
internal ArchiHandler(ArchiLogger archiLogger) => ArchiLogger = archiLogger ?? throw new ArgumentNullException(nameof(archiLogger));
|
||||
|
||||
public override void HandleMsg(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
|
||||
@@ -346,6 +346,7 @@ namespace ArchiSteamFarm {
|
||||
return appID;
|
||||
}
|
||||
|
||||
// ReSharper disable once LoopCanBePartlyConvertedToQuery - C# 7.0 out can't be used within LINQ query yet | https://github.com/dotnet/roslyn/issues/15619
|
||||
foreach (Dictionary<uint, SteamApps.PICSProductInfoCallback.PICSProductInfo> productInfoApps in productInfoResultSet.Results.Select(result => result.Apps)) {
|
||||
if (!productInfoApps.TryGetValue(appID, out SteamApps.PICSProductInfoCallback.PICSProductInfo productInfoApp)) {
|
||||
continue;
|
||||
@@ -841,7 +842,7 @@ namespace ArchiSteamFarm {
|
||||
Task.Run(() => Stop()).Forget();
|
||||
}
|
||||
|
||||
Bots.TryRemove(BotName, out Bot ignored);
|
||||
Bots.TryRemove(BotName, out Bot _);
|
||||
}
|
||||
|
||||
private void Disconnect() {
|
||||
@@ -923,12 +924,12 @@ namespace ArchiSteamFarm {
|
||||
private ulong GetFirstSteamMasterID() => BotConfig.SteamUserPermissions.Where(kv => (kv.Key != 0) && (kv.Key != SteamID) && (kv.Value == BotConfig.EPermission.Master)).Select(kv => kv.Key).OrderBy(steamID => steamID).FirstOrDefault();
|
||||
|
||||
private BotConfig.EPermission GetSteamUserPermission(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
ArchiLogger.LogNullError(nameof(steamID));
|
||||
return BotConfig.EPermission.None;
|
||||
if (steamID != 0) {
|
||||
return BotConfig.SteamUserPermissions.TryGetValue(steamID, out BotConfig.EPermission permission) ? permission : BotConfig.EPermission.None;
|
||||
}
|
||||
|
||||
return BotConfig.SteamUserPermissions.TryGetValue(steamID, out BotConfig.EPermission permission) ? permission : BotConfig.EPermission.None;
|
||||
ArchiLogger.LogNullError(nameof(steamID));
|
||||
return BotConfig.EPermission.None;
|
||||
}
|
||||
|
||||
private void HandleCallbacks() {
|
||||
|
||||
@@ -470,12 +470,12 @@ namespace ArchiSteamFarm.JSON {
|
||||
}
|
||||
|
||||
// Ensure that amount of items to give is at least amount of items to receive (per game and per type)
|
||||
foreach (KeyValuePair<uint, Dictionary<Item.EType, uint>> itemsPerGame in itemsToGivePerGame) {
|
||||
foreach (KeyValuePair<uint, Dictionary<Item.EType, uint>> itemsPerGame in itemsToGivePerGame) {
|
||||
if (!itemsToReceivePerGame.TryGetValue(itemsPerGame.Key, out Dictionary<Item.EType, uint> otherItemsPerType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<Item.EType, uint> itemsPerType in itemsPerGame.Value) {
|
||||
foreach (KeyValuePair<Item.EType, uint> itemsPerType in itemsPerGame.Value) {
|
||||
if (!otherItemsPerType.TryGetValue(itemsPerType.Key, out uint otherAmount)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private bool ParsingScheduled;
|
||||
|
||||
internal Trading(Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
internal Trading(Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
|
||||
public void Dispose() => TradesSemaphore.Dispose();
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace ArchiSteamFarm {
|
||||
for (byte i = 0; i < text.Length; i += split) {
|
||||
string textPart = string.Join("", text.Skip(i).Take(split));
|
||||
|
||||
if (!ulong.TryParse(textPart, NumberStyles.HexNumber, null, out ulong ignored)) {
|
||||
if (!ulong.TryParse(textPart, NumberStyles.HexNumber, null, out ulong _)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user