MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / GetLedgeUrl

Method GetLedgeUrl

KBotExt/CustomTab.h:418–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416
417private:
418 static std::string GetLedgeUrl()
419 {
420 Json::CharReaderBuilder builder;
421 const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
422 JSONCPP_STRING err;
423 Json::Value rootRegion;
424 std::string region;
425 std::string getRegion = LCU::Request("GET", "/riotclient/get_region_locale");
426 if (reader->parse(getRegion.c_str(), getRegion.c_str() + static_cast<int>(getRegion.length()), &rootRegion, &err))
427 {
428 region = rootRegion["webRegion"].asString();
429 }
430
431 if (!region.empty())
432 {
433 std::ifstream systemYaml(S.leaguePath + "system.yaml");
434 std::string line;
435 while (std::getline(systemYaml, line))
436 {
437 if (line.find("league_edge_url: ") != std::string::npos
438 && line.find(region) != std::string::npos)
439 {
440 std::string league_edge_url = line;
441 league_edge_url = league_edge_url.substr(league_edge_url.find("league_edge_url: ") + strlen("league_edge_url: "));
442 systemYaml.close();
443 return league_edge_url;
444 }
445 }
446 systemYaml.close();
447 }
448 return "";
449 }
450};

Callers

nothing calls this directly

Calls 2

c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected