This commit is contained in:
JustArchi
2020-12-18 22:06:15 +01:00
parent c5c55dc44e
commit 34c5f5cf8b
10 changed files with 346 additions and 284 deletions

View File

@@ -366,6 +366,20 @@ namespace ArchiSteamFarm {
return success ? !string.IsNullOrEmpty(steamApiKey) : null;
}
[PublicAPI]
public async Task<bool> JoinGroup(ulong groupID) {
if ((groupID == 0) || !new SteamID(groupID).IsClanAccount) {
throw new ArgumentOutOfRangeException(nameof(groupID));
}
string request = "/gid/" + groupID;
// Extra entry for sessionID
Dictionary<string, string> data = new(2, StringComparer.Ordinal) { { "action", "join" } };
return await UrlPostWithSession(SteamCommunityURL, request, data: data, session: ESession.CamelCase).ConfigureAwait(false);
}
[PublicAPI]
public async Task<(bool Success, HashSet<ulong>? MobileTradeOfferIDs)> SendTradeOffer(ulong steamID, IReadOnlyCollection<Steam.Asset>? itemsToGive = null, IReadOnlyCollection<Steam.Asset>? itemsToReceive = null, string? token = null, bool forcedSingleOffer = false, ushort itemsPerTrade = Trading.MaxItemsPerTrade) {
if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) {
@@ -2207,19 +2221,6 @@ namespace ArchiSteamFarm {
return true;
}
internal async Task<bool> JoinGroup(ulong groupID) {
if ((groupID == 0) || !new SteamID(groupID).IsClanAccount) {
throw new ArgumentOutOfRangeException(nameof(groupID));
}
string request = "/gid/" + groupID;
// Extra entry for sessionID
Dictionary<string, string> data = new(2, StringComparer.Ordinal) { { "action", "join" } };
return await UrlPostWithSession(SteamCommunityURL, request, data: data, session: ESession.CamelCase).ConfigureAwait(false);
}
internal async Task MarkInventory() {
if (ASF.InventorySemaphore == null) {
throw new InvalidOperationException(nameof(ASF.InventorySemaphore));