File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -762,7 +762,8 @@ void PopulateLobbyPlayerListbox(void)
762762 NGMP_OnlineServices_RoomsInterface* pRoomsInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_RoomsInterface>();
763763 NGMP_OnlineServices_StatsInterface* pStatsInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_StatsInterface>();
764764 NGMP_OnlineServices_AuthInterface* pAuthInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_AuthInterface>();
765- if (pRoomsInterface != nullptr && pStatsInterface != nullptr && pAuthInterface != nullptr )
765+ NGMP_OnlineServices_SocialInterface* pSocialInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_SocialInterface>();
766+ if (pRoomsInterface != nullptr && pStatsInterface != nullptr && pAuthInterface != nullptr && pSocialInterface != nullptr )
766767 {
767768 int64_t localUserID = pAuthInterface->GetUserID ();
768769
@@ -839,10 +840,17 @@ void PopulateLobbyPlayerListbox(void)
839840 });
840841
841842 // Admin/staff first
842- std::stable_partition (sorted.begin (), sorted.end (),
843+ auto adminSorted = std::stable_partition (sorted.begin (), sorted.end (),
843844 [](const auto & x) {
844845 return x.m_bIsAdmin ;
845846 });
847+
848+ // friends next, after admin and if not admin
849+ std::stable_partition (adminSorted, sorted.end (),
850+ [=](const auto & x)
851+ {
852+ return pSocialInterface->IsUserFriend (x.user_id );
853+ });
846854 }
847855
848856
You can’t perform that action at this time.
0 commit comments