mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-23 01:38:36 +00:00
Revert "Disable server-side functionality in custom ASF builds"
This reverts commit 42ceb6d413.
This commit is contained in:
@@ -65,10 +65,6 @@ internal static class Backend {
|
|||||||
ArgumentNullException.ThrowIfNull(inventoryRemoved);
|
ArgumentNullException.ThrowIfNull(inventoryRemoved);
|
||||||
ArgumentException.ThrowIfNullOrEmpty(previousInventoryChecksum);
|
ArgumentException.ThrowIfNullOrEmpty(previousInventoryChecksum);
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(ArchiNet.URL, "/Api/Listing/AnnounceDiff/v2");
|
Uri request = new(ArchiNet.URL, "/Api/Listing/AnnounceDiff/v2");
|
||||||
|
|
||||||
AnnouncementDiffRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, inventory, inventoryChecksum, acceptedMatchableTypes, totalInventoryCount, matchEverything, ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration, tradeToken, inventoryRemoved, previousInventoryChecksum, nickname, avatarHash);
|
AnnouncementDiffRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, inventory, inventoryChecksum, acceptedMatchableTypes, totalInventoryCount, matchEverything, ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration, tradeToken, inventoryRemoved, previousInventoryChecksum, nickname, avatarHash);
|
||||||
@@ -100,10 +96,6 @@ internal static class Backend {
|
|||||||
throw new ArgumentOutOfRangeException(nameof(tradeToken));
|
throw new ArgumentOutOfRangeException(nameof(tradeToken));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(ArchiNet.URL, "/Api/Listing/Announce/v5");
|
Uri request = new(ArchiNet.URL, "/Api/Listing/Announce/v5");
|
||||||
|
|
||||||
AnnouncementRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, inventory, inventoryChecksum, acceptedMatchableTypes, totalInventoryCount, matchEverything, ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration, tradeToken, nickname, avatarHash);
|
AnnouncementRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, inventory, inventoryChecksum, acceptedMatchableTypes, totalInventoryCount, matchEverything, ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration, tradeToken, nickname, avatarHash);
|
||||||
@@ -135,10 +127,6 @@ internal static class Backend {
|
|||||||
throw new ArgumentNullException(nameof(acceptedMatchableTypes));
|
throw new ArgumentNullException(nameof(acceptedMatchableTypes));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(ArchiNet.URL, "/Api/Listing/Inventories/v2");
|
Uri request = new(ArchiNet.URL, "/Api/Listing/Inventories/v2");
|
||||||
|
|
||||||
Dictionary<string, string> headers = new(1, StringComparer.Ordinal) {
|
Dictionary<string, string> headers = new(1, StringComparer.Ordinal) {
|
||||||
@@ -171,10 +159,6 @@ internal static class Backend {
|
|||||||
throw new ArgumentNullException(nameof(realAppIDs));
|
throw new ArgumentNullException(nameof(realAppIDs));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(ArchiNet.URL, "/Api/SetParts/Request");
|
Uri request = new(ArchiNet.URL, "/Api/SetParts/Request");
|
||||||
|
|
||||||
SetPartsRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, matchableTypes, realAppIDs);
|
SetPartsRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), steamID, matchableTypes, realAppIDs);
|
||||||
@@ -186,10 +170,6 @@ internal static class Backend {
|
|||||||
ArgumentNullException.ThrowIfNull(bot);
|
ArgumentNullException.ThrowIfNull(bot);
|
||||||
ArgumentNullException.ThrowIfNull(webBrowser);
|
ArgumentNullException.ThrowIfNull(webBrowser);
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(ArchiNet.URL, "/Api/Listing/HeartBeat");
|
Uri request = new(ArchiNet.URL, "/Api/Listing/HeartBeat");
|
||||||
|
|
||||||
HeartBeatRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), bot.SteamID);
|
HeartBeatRequest data = new(ASF.GlobalDatabase?.Identifier ?? Guid.NewGuid(), bot.SteamID);
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotCommand2, I
|
|||||||
throw new ArgumentOutOfRangeException(nameof(steamID));
|
throw new ArgumentOutOfRangeException(nameof(steamID));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return await Commands.OnBotCommand(bot, access, args, steamID).ConfigureAwait(false);
|
return await Commands.OnBotCommand(bot, access, args, steamID).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,10 +90,6 @@ internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotCommand2, I
|
|||||||
await remoteCommunication.DisposeAsync().ConfigureAwait(false);
|
await remoteCommunication.DisposeAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
remoteCommunication = new RemoteCommunication(bot);
|
remoteCommunication = new RemoteCommunication(bot);
|
||||||
|
|
||||||
if (!RemoteCommunications.TryAdd(bot, remoteCommunication)) {
|
if (!RemoteCommunications.TryAdd(bot, remoteCommunication)) {
|
||||||
@@ -140,12 +132,6 @@ internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotCommand2, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override Task OnLoaded() {
|
public override Task OnLoaded() {
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
ASF.ArchiLogger.LogGenericWarning(Strings.PluginDisabledCustomBuild);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
Utilities.WarnAboutIncompleteTranslation(Strings.ResourceManager);
|
Utilities.WarnAboutIncompleteTranslation(Strings.ResourceManager);
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|||||||
@@ -74,11 +74,5 @@ namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher.Localization {
|
|||||||
return ResourceManager.GetString("ActivelyMatchingSomeConfirmationsFailed", resourceCulture);
|
return ResourceManager.GetString("ActivelyMatchingSomeConfirmationsFailed", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string PluginDisabledCustomBuild {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("PluginDisabledCustomBuild", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,4 @@
|
|||||||
<value>Some confirmations have failed, approximately {0} out of {1} trades were sent successfully.</value>
|
<value>Some confirmations have failed, approximately {0} out of {1} trades were sent successfully.</value>
|
||||||
<comment>{0} will be replaced by amount of the trade offers that succeeded (number), {1} will be replaced by amount of the trade offers that were supposed to be sent in total (number)</comment>
|
<comment>{0} will be replaced by amount of the trade offers that succeeded (number), {1} will be replaced by amount of the trade offers that were supposed to be sent in total (number)</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="PluginDisabledCustomBuild" xml:space="preserve">
|
|
||||||
<value>ItemsMatcherPlugin is not supported in custom ASF builds, the functionality is disabled.</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -51,10 +51,6 @@ internal static class ArchiNet {
|
|||||||
throw new InvalidOperationException(nameof(ASF.WebBrowser));
|
throw new InvalidOperationException(nameof(ASF.WebBrowser));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(URL, $"/Api/Checksum/{version}/{variant}");
|
Uri request = new(URL, $"/Api/Checksum/{version}/{variant}");
|
||||||
|
|
||||||
ObjectResponse<GenericResponse<string>>? response = await ASF.WebBrowser.UrlGetToJsonObject<GenericResponse<string>>(request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
ObjectResponse<GenericResponse<string>>? response = await ASF.WebBrowser.UrlGetToJsonObject<GenericResponse<string>>(request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
@@ -71,10 +67,6 @@ internal static class ArchiNet {
|
|||||||
throw new ArgumentOutOfRangeException(nameof(steamID));
|
throw new ArgumentOutOfRangeException(nameof(steamID));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
(_, IReadOnlyCollection<ulong>? badBots) = await CachedBadBots.GetValue(ECacheFallback.FailedNow, cancellationToken).ConfigureAwait(false);
|
(_, IReadOnlyCollection<ulong>? badBots) = await CachedBadBots.GetValue(ECacheFallback.FailedNow, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
return badBots?.Contains(steamID);
|
return badBots?.Contains(steamID);
|
||||||
@@ -84,7 +76,7 @@ internal static class ArchiNet {
|
|||||||
ArgumentNullException.ThrowIfNull(bot);
|
ArgumentNullException.ThrowIfNull(bot);
|
||||||
ArgumentNullException.ThrowIfNull(webBrowser);
|
ArgumentNullException.ThrowIfNull(webBrowser);
|
||||||
|
|
||||||
if (!bot.IsConnectedAndLoggedOn || SharedInfo.BuildInfo.IsCustomBuild) {
|
if (!bot.IsConnectedAndLoggedOn) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,10 +180,6 @@ internal static class ArchiNet {
|
|||||||
throw new InvalidOperationException(nameof(ASF.WebBrowser));
|
throw new InvalidOperationException(nameof(ASF.WebBrowser));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SharedInfo.BuildInfo.IsCustomBuild) {
|
|
||||||
return (false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
Uri request = new(URL, "/Api/BadBots");
|
Uri request = new(URL, "/Api/BadBots");
|
||||||
|
|
||||||
ObjectResponse<GenericResponse<ImmutableHashSet<ulong>>>? response = await ASF.WebBrowser.UrlGetToJsonObject<GenericResponse<ImmutableHashSet<ulong>>>(request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
ObjectResponse<GenericResponse<ImmutableHashSet<ulong>>>? response = await ASF.WebBrowser.UrlGetToJsonObject<GenericResponse<ImmutableHashSet<ulong>>>(request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user