Skip to content

Commit 1461a15

Browse files
author
Justin
committed
Re-add missing changes from a previous pull request.
1 parent 07457c2 commit 1461a15

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

SteamWebAPI2/Interfaces/ISteamUser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Steam.Models.SteamCommunity;
2-
using SteamWebAPI2.Models.SteamCommunity;
32
using System.Collections.Generic;
43
using System.Threading.Tasks;
54

@@ -15,6 +14,8 @@ public interface ISteamUser
1514

1615
Task<PlayerSummaryModel> GetPlayerSummaryAsync(long steamId);
1716

17+
Task<List<PlayerSummaryModel>> GetPlayerSummariesAsync(List<long> steamIds);
18+
1819
Task<IReadOnlyCollection<long>> GetUserGroupsAsync(long steamId);
1920

2021
Task<ulong> ResolveVanityUrlAsync(string vanityUrl, int? urlType = default(int?));

SteamWebAPI2/Interfaces/SteamUser.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ public async Task<PlayerSummaryModel> GetPlayerSummaryAsync(long steamId)
4343
}
4444
}
4545

46+
public async Task<List<PlayerSummaryModel>> GetPlayerSummariesAsync(List<long> steamIds)
47+
{
48+
// convert steam ids to a csv for the api
49+
var steamIdsCsv = string.Join(",", steamIds.Select(x => x.ToString()).ToArray());
50+
var parameters = new List<SteamWebRequestParameter>();
51+
parameters.AddIfHasValue(steamIdsCsv, "steamids");
52+
53+
var playerSummaries = await CallMethodAsync<PlayerSummaryResultContainer>("GetPlayerSummaries", 2, parameters);
54+
if (playerSummaries.Result.Players != null && playerSummaries.Result.Players.Count > 0)
55+
return playerSummaries.Result.Players.Select(player => AutoMapperConfiguration.Mapper.Map<PlayerSummary, PlayerSummaryModel>(player)).ToList();
56+
57+
return null;
58+
}
59+
4660
/// <summary>
4761
/// Returns a collection of a specific Steam User's friends list.
4862
/// </summary>

SteamWebAPI2/Interfaces/SteamWebAPIUtil.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public SteamWebAPIUtil(string steamWebApiKey)
1212
: base(steamWebApiKey, "ISteamWebAPIUtil")
1313
{ }
1414

15+
/// <summary>
16+
/// Returns the Steam Servers' known dates and times.
17+
/// </summary>
18+
/// <returns></returns>
1519
public async Task<SteamServerInfoModel> GetServerInfoAsync()
1620
{
1721
var steamServerInfo = await CallMethodAsync<SteamServerInfo>("GetServerInfo", 1);
@@ -21,6 +25,10 @@ public async Task<SteamServerInfoModel> GetServerInfoAsync()
2125
return steamServerInfoModel;
2226
}
2327

28+
/// <summary>
29+
/// Returns a collection of data related to all available supported Steam Web API endpoints.
30+
/// </summary>
31+
/// <returns></returns>
2432
public async Task<IReadOnlyCollection<SteamInterfaceModel>> GetSupportedAPIListAsync()
2533
{
2634
var steamApiListContainer = await CallMethodAsync<SteamApiListContainer>("GetSupportedAPIList", 1);

0 commit comments

Comments
 (0)