mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Workaround stale cache of CM servers
This commit is contained in:
@@ -49,7 +49,6 @@ using ArchiSteamFarm.Web.GitHub.Data;
|
||||
using ArchiSteamFarm.Web.Responses;
|
||||
using JetBrains.Annotations;
|
||||
using SteamKit2;
|
||||
using SteamKit2.Discovery;
|
||||
|
||||
namespace ArchiSteamFarm.Core;
|
||||
|
||||
@@ -676,22 +675,9 @@ public static class ASF {
|
||||
throw new InvalidOperationException(nameof(WebBrowser));
|
||||
}
|
||||
|
||||
// Ensure that we ask for a list of servers if we don't have any saved servers available
|
||||
IEnumerable<ServerRecord> servers = await GlobalDatabase.ServerListProvider.FetchServerListAsync().ConfigureAwait(false);
|
||||
|
||||
if (!servers.Any()) {
|
||||
ArchiLogger.LogGenericInfo(Strings.FormatInitializing(nameof(SteamDirectory)));
|
||||
|
||||
SteamConfiguration steamConfiguration = SteamConfiguration.Create(static builder => builder.WithProtocolTypes(GlobalConfig.SteamProtocols).WithCellID(GlobalDatabase.CellID).WithServerListProvider(GlobalDatabase.ServerListProvider).WithHttpClientFactory(static () => WebBrowser.GenerateDisposableHttpClient()));
|
||||
|
||||
try {
|
||||
await SteamDirectory.LoadAsync(steamConfiguration).ConfigureAwait(false);
|
||||
ArchiLogger.LogGenericInfo(Strings.Success);
|
||||
} catch (Exception e) {
|
||||
ArchiLogger.LogGenericWarningException(e);
|
||||
ArchiLogger.LogGenericWarning(Strings.BotSteamDirectoryInitializationFailed);
|
||||
}
|
||||
}
|
||||
// Kill SK2 servers cache in order to force refresh during initial connection
|
||||
// TODO: This should be removed when SK2 learns to purge its stale cache itself
|
||||
await GlobalDatabase.ServerListProvider.UpdateServerListAsync([]).ConfigureAwait(false);
|
||||
|
||||
HashSet<string> botNames;
|
||||
|
||||
|
||||
@@ -487,9 +487,6 @@ StackTrace:
|
||||
<data name="BotHeartBeatFailed" xml:space="preserve">
|
||||
<value>Failed to disconnect the client. Abandoning this bot instance!</value>
|
||||
</data>
|
||||
<data name="BotSteamDirectoryInitializationFailed" xml:space="preserve">
|
||||
<value>Could not initialize SteamDirectory: connecting with Steam Network might take much longer than usual!</value>
|
||||
</data>
|
||||
<data name="BotStopping" xml:space="preserve">
|
||||
<value>Stopping...</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user