@@ -864,15 +864,24 @@ class GameTab
864864 Json::Value rootRegion;
865865 Json::Value rootCSelect;
866866 Json::Value rootSummoner;
867+ Json::Value rootPartcipants;
868+
869+ std::wstring summNames = L" " ;
870+ bool isRanked = false ;
867871
868872 if (reader->parse (champSelect.c_str (), champSelect.c_str () + static_cast <int >(champSelect.length ()), &rootCSelect, &err))
869873 {
870874 auto teamArr = rootCSelect[" myTeam" ];
871875 if (teamArr.isArray ())
872876 {
873- std::wstring summNames = L" " ;
874877 for (Json::Value::ArrayIndex i = 0 ; i < teamArr.size (); ++i)
875878 {
879+ if (teamArr[i][" nameVisibilityType" ].asString () == " HIDDEN" )
880+ {
881+ isRanked = true ;
882+ break ;
883+ }
884+
876885 std::string summId = teamArr[i][" summonerId" ].asString ();
877886 if (summId != " 0" )
878887 {
@@ -884,6 +893,26 @@ class GameTab
884893 }
885894 }
886895
896+ if (isRanked)
897+ {
898+ summNames = L" " ;
899+
900+ LCU::SetCurrentClientRiotInfo ();
901+ std::string participants = HTTP::Request (" GET" , " https://127.0.0.1/chat/v5/participants/champ-select" , " " ,
902+ LCU::riot.header , " " , " " , LCU::riot.port );
903+ if (reader->parse (participants.c_str (), participants.c_str () + static_cast <int >(participants.length ()), &rootPartcipants, &err))
904+ {
905+ auto participantsArr = rootPartcipants[" participants" ];
906+ if (participantsArr.isArray ())
907+ {
908+ for (Json::Value::ArrayIndex i = 0 ; i < participantsArr.size (); ++i)
909+ {
910+ summNames += Utils::StringToWstring (participantsArr[i][" name" ].asString ()) + L" ," ;
911+ }
912+ }
913+ }
914+ }
915+
887916 std::wstring region;
888917 if (website == " U.GG" ) // platformId (euw1, eun1, na1)
889918 {
@@ -904,6 +933,9 @@ class GameTab
904933
905934 if (!region.empty ())
906935 {
936+ if (summNames.empty ())
937+ return " Failed to get summoner names" ;
938+
907939 if (summNames.at (summNames.size () - 1 ) == L' ,' )
908940 summNames.pop_back ();
909941
0 commit comments