Skip to content

Commit bce8a89

Browse files
authored
Merge pull request #85 from nicekiwi/#70
Add option to only return SteamIDs to GetFriendList
2 parents 35615ce + fe22fce commit bce8a89

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ Returns the friend list of any Steam user, provided his Steam Community profile
229229
Name | Type | Description | Required | Default
230230
-----|------|-------------|----------|---------
231231
relationship| string (all or friend) | The type of friends to get | No | all
232+
summaries| bool (true or false) | To return the friend player summaries, or only steamIds | No | true
232233

233-
Once the list of friends is gathered, it is passed through [GetPlayerSummaries](#GetPlayerSummaries). This allows you to get back a collection of Player objects.
234+
Once the list of friends is gathered, if `summaries` is not set to `false`; it is passed through [GetPlayerSummaries](#GetPlayerSummaries). This allows you to get back a collection of Player objects.
234235

235236

236237
> Example Output: [GetFriendList](./examples/user/GetFriendList.txt)

src/Syntax/SteamApi/Steam/User.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function GetPlayerBans($steamId = null)
126126
return $client->players;
127127
}
128128

129-
public function GetFriendList($relationship = 'all')
129+
public function GetFriendList($relationship = 'all', $summaries = true)
130130
{
131131
// Set up the api details
132132
$this->method = __FUNCTION__;
@@ -152,7 +152,11 @@ public function GetFriendList($relationship = 'all')
152152
$steamIds[] = $friend->steamid;
153153
}
154154

155-
$friends = $this->GetPlayerSummaries(implode(',', $steamIds));
155+
if($summaries) {
156+
$friends = $this->GetPlayerSummaries(implode(',', $steamIds));
157+
} else {
158+
$friends = $steamIds;
159+
}
156160

157161
return $friends;
158162
}

0 commit comments

Comments
 (0)