mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Revert "Resharper cleanup"
This reverts commit 7c8d7b5ada
.
Bad cleanup.
This commit is contained in:
parent
7c8d7b5ada
commit
fcf9686a79
33 changed files with 223 additions and 332 deletions
|
@ -106,7 +106,6 @@
|
|||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALLOW_COMMENT_AFTER_LBRACE/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AFTER_CONTROL_TRANSFER_STATEMENTS/@EntryValue">1</s:Int64>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_FIELD/@EntryValue">0</s:Int64>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/CASE_BLOCK_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/EMPTY_BLOCK_STYLE/@EntryValue">TOGETHER_SAME_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
|
|
|
@ -41,9 +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) {
|
||||
|
|
|
@ -188,8 +188,7 @@ namespace ArchiSteamFarm {
|
|||
Bot.ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
|
@ -243,8 +242,7 @@ namespace ArchiSteamFarm {
|
|||
Bot.ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
|
@ -627,8 +625,7 @@ namespace ArchiSteamFarm {
|
|||
Bot.ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
|
@ -666,8 +663,7 @@ namespace ArchiSteamFarm {
|
|||
Bot.ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
|
@ -810,13 +806,9 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal async Task<bool> HasValidApiKey() {
|
||||
return !string.IsNullOrEmpty(await GetApiKey().ConfigureAwait(false));
|
||||
}
|
||||
internal async Task<bool> HasValidApiKey() => !string.IsNullOrEmpty(await GetApiKey().ConfigureAwait(false));
|
||||
|
||||
internal static void Init() {
|
||||
Timeout = Program.GlobalConfig.ConnectionTimeout * 1000;
|
||||
}
|
||||
internal static void Init() => Timeout = Program.GlobalConfig.ConnectionTimeout * 1000;
|
||||
|
||||
internal async Task<bool> Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalPin) {
|
||||
if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce) || string.IsNullOrEmpty(parentalPin)) {
|
||||
|
@ -862,8 +854,7 @@ namespace ArchiSteamFarm {
|
|||
Bot.ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
if (authResult == null) {
|
||||
return false;
|
||||
|
|
|
@ -56,7 +56,6 @@ namespace ArchiSteamFarm {
|
|||
|
||||
private static readonly SemaphoreSlim GiftsSemaphore = new SemaphoreSlim(1);
|
||||
private static readonly SemaphoreSlim LoginSemaphore = new SemaphoreSlim(1);
|
||||
|
||||
internal readonly ArchiLogger ArchiLogger;
|
||||
internal readonly ArchiWebHandler ArchiWebHandler;
|
||||
internal readonly string BotName;
|
||||
|
@ -81,6 +80,7 @@ namespace ArchiSteamFarm {
|
|||
private readonly Timer HeartBeatTimer;
|
||||
private readonly SemaphoreSlim InitializationSemaphore = new SemaphoreSlim(1);
|
||||
private readonly ConcurrentHashSet<uint> OwnedPackageIDs = new ConcurrentHashSet<uint>();
|
||||
|
||||
private readonly Statistics Statistics;
|
||||
private readonly SteamApps SteamApps;
|
||||
private readonly SteamClient SteamClient;
|
||||
|
@ -510,9 +510,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal void OnFarmingStopped() {
|
||||
ResetGamesPlayed();
|
||||
}
|
||||
internal void OnFarmingStopped() => ResetGamesPlayed();
|
||||
|
||||
internal async Task OnNewConfigLoaded(ASF.BotConfigEventArgs args) {
|
||||
if (args == null) {
|
||||
|
@ -546,9 +544,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal void PlayGame(uint gameID, string gameName = null) {
|
||||
PlayGames(gameID.ToEnumerable(), gameName);
|
||||
}
|
||||
internal void PlayGame(uint gameID, string gameName = null) => PlayGames(gameID.ToEnumerable(), gameName);
|
||||
|
||||
internal void PlayGames(IEnumerable<uint> gameIDs, string gameName = null) {
|
||||
if (gameIDs == null) {
|
||||
|
@ -846,7 +842,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(() => Stop()).Forget();
|
||||
}
|
||||
|
||||
Bots.TryRemove(BotName, out _);
|
||||
Bots.TryRemove(BotName, out Bot _);
|
||||
}
|
||||
|
||||
private void Disconnect() {
|
||||
|
@ -925,9 +921,7 @@ namespace ArchiSteamFarm {
|
|||
return result;
|
||||
}
|
||||
|
||||
private ulong GetFirstSteamMasterID() {
|
||||
return BotConfig.SteamUserPermissions.Where(kv => (kv.Key != 0) && (kv.Key != SteamID) && (kv.Value == BotConfig.EPermission.Master)).Select(kv => kv.Key).OrderBy(steamID => steamID).FirstOrDefault();
|
||||
}
|
||||
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) {
|
||||
|
@ -1204,8 +1198,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await Task.Delay(Program.GlobalConfig.GiftsLimiterDelay * 1000).ConfigureAwait(false);
|
||||
GiftsSemaphore.Release();
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
private static async Task LimitLoginRequestsAsync() {
|
||||
|
@ -1213,8 +1206,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await Task.Delay(Program.GlobalConfig.LoginLimiterDelay * 1000).ConfigureAwait(false);
|
||||
LoginSemaphore.Release();
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
private async Task MarkInventoryIfNeeded() {
|
||||
|
@ -1684,8 +1676,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await ArchiWebHandler.JoinGroup(BotConfig.SteamMasterClanID).ConfigureAwait(false);
|
||||
JoinMasterChat();
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
Statistics?.OnLoggedOn().Forget();
|
||||
|
@ -2310,8 +2301,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await Task.Delay(1000).ConfigureAwait(false);
|
||||
await Program.Exit().ConfigureAwait(false);
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
|
||||
return FormatStaticResponse(Strings.Done);
|
||||
}
|
||||
|
@ -3173,8 +3163,7 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await Task.Delay(1000).ConfigureAwait(false);
|
||||
await Program.Restart().ConfigureAwait(false);
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
|
||||
return FormatStaticResponse(Strings.Done);
|
||||
}
|
||||
|
|
|
@ -95,9 +95,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal IEnumerable<ulong> GetBlacklistedFromTradesSteamIDs() {
|
||||
return BlacklistedFromTradesSteamIDs;
|
||||
}
|
||||
internal IEnumerable<ulong> GetBlacklistedFromTradesSteamIDs() => BlacklistedFromTradesSteamIDs;
|
||||
|
||||
internal bool IsBlacklistedFromTrades(ulong steamID) {
|
||||
if (steamID != 0) {
|
||||
|
|
|
@ -42,9 +42,7 @@ namespace ArchiSteamFarm.CMsgs {
|
|||
AcceptInvite = binaryReader.ReadBoolean();
|
||||
}
|
||||
|
||||
EMsg ISteamSerializableMessage.GetEMsg() {
|
||||
return EMsg.ClientAcknowledgeClanInvite;
|
||||
}
|
||||
EMsg ISteamSerializableMessage.GetEMsg() => EMsg.ClientAcknowledgeClanInvite;
|
||||
|
||||
void ISteamSerializable.Serialize(Stream stream) {
|
||||
if (stream == null) {
|
||||
|
|
|
@ -90,9 +90,7 @@ namespace ArchiSteamFarm {
|
|||
IdleFarmingTimer?.Dispose();
|
||||
}
|
||||
|
||||
internal void OnDisconnected() {
|
||||
StopFarming().Forget();
|
||||
}
|
||||
internal void OnDisconnected() => StopFarming().Forget();
|
||||
|
||||
internal async Task OnNewGameAdded() {
|
||||
// If we're not farming yet, obviously it's worth it to make a check
|
||||
|
@ -148,9 +146,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal void SetInitialState(bool paused) {
|
||||
StickyPause = Paused = paused;
|
||||
}
|
||||
internal void SetInitialState(bool paused) => StickyPause = Paused = paused;
|
||||
|
||||
internal async Task StartFarming() {
|
||||
if (NowFarming || Paused || !Bot.IsPlayingPossible) {
|
||||
|
@ -848,13 +844,9 @@ namespace ArchiSteamFarm {
|
|||
return (game != null) && Equals(game);
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return (int) AppID;
|
||||
}
|
||||
public override int GetHashCode() => (int) AppID;
|
||||
|
||||
private bool Equals(Game other) {
|
||||
return AppID == other.AppID;
|
||||
}
|
||||
private bool Equals(Game other) => AppID == other.AppID;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -45,16 +45,8 @@ namespace ArchiSteamFarm {
|
|||
Enumerator = collection.GetEnumerator();
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
Lock.Dispose();
|
||||
}
|
||||
|
||||
public bool MoveNext() {
|
||||
return Enumerator.MoveNext();
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
Enumerator.Reset();
|
||||
}
|
||||
public void Dispose() => Lock.Dispose();
|
||||
public bool MoveNext() => Enumerator.MoveNext();
|
||||
public void Reset() => Enumerator.Reset();
|
||||
}
|
||||
}
|
|
@ -72,9 +72,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator() {
|
||||
return new ConcurrentEnumerator<T>(HashSet, Lock);
|
||||
}
|
||||
public IEnumerator<T> GetEnumerator() => new ConcurrentEnumerator<T>(HashSet, Lock);
|
||||
|
||||
public void IntersectWith(IEnumerable<T> other) {
|
||||
using (Lock.WriterLock()) {
|
||||
|
@ -136,13 +134,9 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
void ICollection<T>.Add(T item) {
|
||||
Add(item);
|
||||
}
|
||||
void ICollection<T>.Add(T item) => Add(item);
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() {
|
||||
return GetEnumerator();
|
||||
}
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
internal bool AddRange(IEnumerable<T> items) {
|
||||
using (Lock.WriterLock()) {
|
||||
|
|
|
@ -77,9 +77,7 @@ namespace ArchiSteamFarm {
|
|||
ServerListProvider.ServerListUpdated += OnServerListUpdated;
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
ServerListProvider.ServerListUpdated -= OnServerListUpdated;
|
||||
}
|
||||
public void Dispose() => ServerListProvider.ServerListUpdated -= OnServerListUpdated;
|
||||
|
||||
internal static GlobalDatabase Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
|
@ -109,9 +107,7 @@ namespace ArchiSteamFarm {
|
|||
return globalDatabase;
|
||||
}
|
||||
|
||||
private void OnServerListUpdated(object sender, EventArgs e) {
|
||||
Save();
|
||||
}
|
||||
private void OnServerListUpdated(object sender, EventArgs e) => Save();
|
||||
|
||||
private void Save() {
|
||||
string json = JsonConvert.SerializeObject(this, CustomSerializerSettings);
|
||||
|
|
|
@ -29,9 +29,7 @@ using Newtonsoft.Json.Linq;
|
|||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class IPAddressConverter : JsonConverter {
|
||||
public override bool CanConvert(Type objectType) {
|
||||
return objectType == typeof(IPAddress);
|
||||
}
|
||||
public override bool CanConvert(Type objectType) => objectType == typeof(IPAddress);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
||||
JToken token = JToken.Load(reader);
|
||||
|
|
|
@ -29,9 +29,7 @@ using Newtonsoft.Json.Linq;
|
|||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class IPEndPointConverter : JsonConverter {
|
||||
public override bool CanConvert(Type objectType) {
|
||||
return objectType == typeof(IPEndPoint);
|
||||
}
|
||||
public override bool CanConvert(Type objectType) => objectType == typeof(IPEndPoint);
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
||||
JObject jo = JObject.Load(reader);
|
||||
|
|
|
@ -34,9 +34,7 @@ namespace ArchiSteamFarm {
|
|||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
private readonly ConcurrentHashSet<IPEndPoint> Servers = new ConcurrentHashSet<IPEndPoint>();
|
||||
|
||||
public Task<IEnumerable<IPEndPoint>> FetchServerListAsync() {
|
||||
return Task.FromResult<IEnumerable<IPEndPoint>>(Servers);
|
||||
}
|
||||
public Task<IEnumerable<IPEndPoint>> FetchServerListAsync() => Task.FromResult<IEnumerable<IPEndPoint>>(Servers);
|
||||
|
||||
public Task UpdateServerListAsync(IEnumerable<IPEndPoint> endPoints) {
|
||||
if (endPoints == null) {
|
||||
|
|
|
@ -489,9 +489,7 @@ namespace ArchiSteamFarm.JSON {
|
|||
return true;
|
||||
}
|
||||
|
||||
internal bool IsSteamCardsRequest() {
|
||||
return ItemsToGive.All(item => (item.AppID == Item.SteamAppID) && (item.ContextID == Item.SteamCommunityContextID) && (item.Type == Item.EType.TradingCard));
|
||||
}
|
||||
internal bool IsSteamCardsRequest() => ItemsToGive.All(item => (item.AppID == Item.SteamAppID) && (item.ContextID == Item.SteamCommunityContextID) && (item.Type == Item.EType.TradingCard));
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
internal enum ETradeOfferState : byte {
|
||||
|
|
|
@ -68,9 +68,7 @@ namespace ArchiSteamFarm {
|
|||
|
||||
private MobileAuthenticator() { }
|
||||
|
||||
public void Dispose() {
|
||||
ConfirmationsSemaphore.Dispose();
|
||||
}
|
||||
public void Dispose() => ConfirmationsSemaphore.Dispose();
|
||||
|
||||
internal void CorrectDeviceID(string deviceID) {
|
||||
if (string.IsNullOrEmpty(deviceID)) {
|
||||
|
@ -248,9 +246,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal void Init(Bot bot) {
|
||||
Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
}
|
||||
internal void Init(Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
|
||||
internal static async Task OnTimeChanged() {
|
||||
await TimeSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
|
|
@ -77,9 +77,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
private static async void OnTimeChanged(object sender, EventArgs e) {
|
||||
await MobileAuthenticator.OnTimeChanged().ConfigureAwait(false);
|
||||
}
|
||||
private static async void OnTimeChanged(object sender, EventArgs e) => await MobileAuthenticator.OnTimeChanged().ConfigureAwait(false);
|
||||
|
||||
private static class NativeMethods {
|
||||
internal const uint EnableQuickEditMode = 0x0040;
|
||||
|
|
|
@ -446,8 +446,7 @@ namespace ArchiSteamFarm {
|
|||
ServiceName = SharedInfo.ServiceName;
|
||||
}
|
||||
|
||||
protected override void OnStart(string[] args) {
|
||||
Task.Run(async () => {
|
||||
protected override void OnStart(string[] args) => Task.Run(async () => {
|
||||
// Normally it'd make sense to use already provided string[] args parameter above
|
||||
// However, that one doesn't seem to work when ASF is started as a service, it's always null
|
||||
// Therefore, we will use Environment args in such case
|
||||
|
@ -457,11 +456,8 @@ namespace ArchiSteamFarm {
|
|||
ShutdownResetEvent.Wait();
|
||||
Stop();
|
||||
});
|
||||
}
|
||||
|
||||
protected override async void OnStop() {
|
||||
await Shutdown().ConfigureAwait(false);
|
||||
}
|
||||
protected override async void OnStop() => await Shutdown().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,13 +48,9 @@ namespace ArchiSteamFarm {
|
|||
private DateTime LastPersonaStateRequest = DateTime.MinValue;
|
||||
private bool ShouldSendHeartBeats;
|
||||
|
||||
internal Statistics(Bot bot) {
|
||||
Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
}
|
||||
internal Statistics(Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot));
|
||||
|
||||
public void Dispose() {
|
||||
Semaphore.Dispose();
|
||||
}
|
||||
public void Dispose() => Semaphore.Dispose();
|
||||
|
||||
internal async Task OnHeartBeat() {
|
||||
// Request persona update if needed
|
||||
|
@ -89,9 +85,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
}
|
||||
|
||||
internal async Task OnLoggedOn() {
|
||||
await Bot.ArchiWebHandler.JoinGroup(SharedInfo.ASFGroupSteamID).ConfigureAwait(false);
|
||||
}
|
||||
internal async Task OnLoggedOn() => await Bot.ArchiWebHandler.JoinGroup(SharedInfo.ASFGroupSteamID).ConfigureAwait(false);
|
||||
|
||||
internal async Task OnPersonaState(SteamFriends.PersonaStateCallback callback) {
|
||||
if (callback == null) {
|
||||
|
|
|
@ -43,13 +43,9 @@ 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();
|
||||
}
|
||||
public void Dispose() => TradesSemaphore.Dispose();
|
||||
|
||||
internal async Task CheckTrades() {
|
||||
// We aim to have a maximum of 2 tasks, one already parsing, and one waiting in the queue
|
||||
|
@ -80,13 +76,10 @@ namespace ArchiSteamFarm {
|
|||
Task.Run(async () => {
|
||||
await Task.Delay(Program.GlobalConfig.InventoryLimiterDelay * 1000).ConfigureAwait(false);
|
||||
InventorySemaphore.Release();
|
||||
})
|
||||
.Forget();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
internal void OnDisconnected() {
|
||||
IgnoredTrades.ClearAndTrim();
|
||||
}
|
||||
internal void OnDisconnected() => IgnoredTrades.ClearAndTrim();
|
||||
|
||||
private async Task ParseActiveTrades() {
|
||||
HashSet<Steam.TradeOffer> tradeOffers = await Bot.ArchiWebHandler.GetActiveTradeOffers().ConfigureAwait(false);
|
||||
|
|
|
@ -68,9 +68,7 @@ namespace ArchiSteamFarm {
|
|||
return cookies.Count != 0 ? (from Cookie cookie in cookies where cookie.Name.Equals(name) select cookie.Value).FirstOrDefault() : null;
|
||||
}
|
||||
|
||||
internal static uint GetUnixTime() {
|
||||
return (uint) DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
}
|
||||
internal static uint GetUnixTime() => (uint) DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
|
||||
/*
|
||||
internal static int RandomNext(int maxWithout) {
|
||||
|
@ -99,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 _)) {
|
||||
if (!ulong.TryParse(textPart, NumberStyles.HexNumber, null, out ulong _)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,9 +50,7 @@ namespace ArchiSteamFarm {
|
|||
StopServer();
|
||||
}
|
||||
|
||||
public string GetStatus() {
|
||||
return Program.GlobalConfig.SteamOwnerID == 0 ? "{}" : Bot.GetAPIStatus(Bot.Bots);
|
||||
}
|
||||
public string GetStatus() => Program.GlobalConfig.SteamOwnerID == 0 ? "{}" : Bot.GetAPIStatus(Bot.Bots);
|
||||
|
||||
public string HandleCommand(string input) {
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
|
|
|
@ -305,11 +305,7 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
|
||||
#if !__MonoCS__
|
||||
|
||||
private static void InitNonMonoBehaviour() {
|
||||
ServicePointManager.ReusePort = true;
|
||||
}
|
||||
|
||||
private static void InitNonMonoBehaviour() => ServicePointManager.ReusePort = true;
|
||||
#endif
|
||||
|
||||
private async Task<byte[]> UrlGetToBytes(string request, string referer = null) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="2.0.0-beta0018" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Fody" version="1.30.0-beta01" targetFramework="net461" developmentDependency="true" />
|
||||
|
|
|
@ -39,8 +39,6 @@ namespace ConfigGenerator {
|
|||
Controls.Add(enhancedPropertyGrid);
|
||||
}
|
||||
|
||||
internal void RefreshText() {
|
||||
Text = Path.GetFileNameWithoutExtension(ASFConfig.FilePath);
|
||||
}
|
||||
internal void RefreshText() => Text = Path.GetFileNameWithoutExtension(ASFConfig.FilePath);
|
||||
}
|
||||
}
|
|
@ -68,9 +68,7 @@ namespace ConfigGenerator {
|
|||
}
|
||||
|
||||
// Gets the current bit value corresponding to all checked items
|
||||
private int GetCurrentValue() {
|
||||
return (from object t in Items select t as FlagCheckedListBoxItem).Where((item, i) => (item != null) && GetItemChecked(i)).Aggregate(0, (current, item) => current | item.Value);
|
||||
}
|
||||
private int GetCurrentValue() => (from object t in Items select t as FlagCheckedListBoxItem).Where((item, i) => (item != null) && GetItemChecked(i)).Aggregate(0, (current, item) => current | item.Value);
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
|
@ -148,9 +146,7 @@ namespace ConfigGenerator {
|
|||
Caption = c;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return Caption;
|
||||
}
|
||||
public override string ToString() => Caption;
|
||||
}
|
||||
|
||||
// UITypeEditor for flag enums
|
||||
|
@ -179,8 +175,6 @@ namespace ConfigGenerator {
|
|||
return FlagEnumCb.EnumValue;
|
||||
}
|
||||
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) {
|
||||
return UITypeEditorEditStyle.DropDown;
|
||||
}
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) => UITypeEditorEditStyle.DropDown;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="2.0.0-beta0018" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Fody" version="1.30.0-beta01" targetFramework="net461" developmentDependency="true" />
|
||||
|
|
|
@ -40,8 +40,6 @@ namespace ArchiSteamFarm {
|
|||
AvatarPictureBox.LoadAsync();
|
||||
}
|
||||
|
||||
private void AvatarPictureBox_LoadCompleted(object sender, AsyncCompletedEventArgs e) {
|
||||
MainForm.UpdateBotAvatar(Bot.BotName, AvatarPictureBox.Image);
|
||||
}
|
||||
private void AvatarPictureBox_LoadCompleted(object sender, AsyncCompletedEventArgs e) => MainForm.UpdateBotAvatar(Bot.BotName, AvatarPictureBox.Image);
|
||||
}
|
||||
}
|
|
@ -57,9 +57,7 @@ namespace ArchiSteamFarm {
|
|||
BotStatusForm.BotForms[PreviouslySelectedBotName].Visible = true;
|
||||
}
|
||||
|
||||
private async void MainForm_FormClosed(object sender, FormClosedEventArgs e) {
|
||||
await Program.InitShutdownSequence().ConfigureAwait(false);
|
||||
}
|
||||
private async void MainForm_FormClosed(object sender, FormClosedEventArgs e) => await Program.InitShutdownSequence().ConfigureAwait(false);
|
||||
|
||||
private async void MainForm_Load(object sender, EventArgs e) {
|
||||
BotListView.LargeImageList = BotListView.SmallImageList = AvatarImageList;
|
||||
|
|
|
@ -29,9 +29,7 @@ namespace ArchiSteamFarm {
|
|||
Application.Exit();
|
||||
}
|
||||
|
||||
internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) {
|
||||
return null;
|
||||
}
|
||||
internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) => null; // TODO
|
||||
|
||||
internal static async Task InitASF() {
|
||||
ASF.ArchiLogger.LogGenericInfo("ASF V" + SharedInfo.Version);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="2.0.0-beta0018" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Fody" version="1.30.0-beta01" targetFramework="net461" developmentDependency="true" />
|
||||
|
|
Loading…
Reference in a new issue