From 3956b6893e12984e0de0bddbd4f73c094a0146d4 Mon Sep 17 00:00:00 2001 From: NoOne Date: Sat, 30 May 2015 19:01:03 +0500 Subject: [PATCH] Fix: friend list with more than 100 friends When friend list have more than 100 friends only first 100 friends was previously returned. --- SteamApi/User.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SteamApi/User.php b/SteamApi/User.php index 98fe849..0136d46 100644 --- a/SteamApi/User.php +++ b/SteamApi/User.php @@ -83,12 +83,18 @@ public function GetFriendList($relationship = 'all') // Clean up the games $steamIds = array(); + $friends = array(); foreach ($client->friends as $friend) { $steamIds[] = $friend->steamid; + if (count($steamIds) == 100) { + $friends = array_merge($friends, $this->GetPlayerSummaries(implode(',', $steamIds))); + $steamIds = array(); + } } - $friends = $this->GetPlayerSummaries(implode(',', $steamIds)); + if (count($steamIds) > 0) + $friends = array_merge($friends, $this->GetPlayerSummaries(implode(',', $steamIds))); return $friends; }