File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Steam . Models . SteamCommunity ;
2- using SteamWebAPI2 . Models . SteamCommunity ;
32using System . Collections . Generic ;
43using 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 ? ) ) ;
Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments