Skip to content

Commit

Permalink
fix ranked multisearch on oce
Browse files Browse the repository at this point in the history
  • Loading branch information
KebsCS committed Nov 22, 2023
1 parent 866cdd5 commit 6bafe36
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions KBotExt/GameTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ class GameTab
JSONCPP_STRING err;

LCU::SetCurrentClientRiotInfo();
std::string getChat = cpr::Get(cpr::Url{ std::format("https://127.0.0.1:{}/chat/v5/participants/champ-select", LCU::riot.port) },
std::string getChat = cpr::Get(cpr::Url{ std::format("https://127.0.0.1:{}/chat/v5/participants", LCU::riot.port) },
cpr::Header{ Utils::StringToHeader(LCU::riot.header) }, cpr::VerifySsl{ false }).text;
if (!reader->parse(getChat.c_str(), getChat.c_str() + static_cast<int>(getChat.length()), &root, &err))
{
Expand All @@ -1130,7 +1130,19 @@ class GameTab
continue;
}

const std::string cid = participantsArr[0]["cid"].asString();
std::string cid = "";
for (auto& i : participantsArr)
{
if (i["cid"].asString().contains("champ-select"))
{
cid = i["cid"].asString();
break;
}
}
if (cid == "")
{
continue;
}

if (instantMute || sideNotification)
{
Expand Down Expand Up @@ -1462,7 +1474,7 @@ class GameTab

LCU::SetCurrentClientRiotInfo();
std::string participants = cpr::Get(
cpr::Url{ std::format("https://127.0.0.1:{}/chat/v5/participants/champ-select", LCU::riot.port) },
cpr::Url{ std::format("https://127.0.0.1:{}/chat/v5/participants", LCU::riot.port) },
cpr::Header{ Utils::StringToHeader(LCU::riot.header) }, cpr::VerifySsl{ false }).text;
if (reader->parse(participants.c_str(), participants.c_str() + static_cast<int>(participants.length()), &rootPartcipants,
&err))
Expand All @@ -1472,6 +1484,8 @@ class GameTab
{
for (auto& i : participantsArr)
{
if (!i["cid"].asString().contains("champ-select"))
continue;
summNames += Utils::StringToWstring(i["game_name"].asString()) + L"%23" + Utils::StringToWstring(i["game_tag"].asString()) + L",";
}
}
Expand Down

0 comments on commit 6bafe36

Please sign in to comment.