{"id":20747113,"url":"https://github.com/cactoes/leaguepp-connector","last_synced_at":"2025-03-11T13:33:48.305Z","repository":{"id":225733627,"uuid":"764323864","full_name":"cactoes/leaguepp-connector","owner":"cactoes","description":"A league of legends client connector written in c++20","archived":false,"fork":false,"pushed_at":"2024-03-04T14:40:40.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-05T01:49:40.213Z","etag":null,"topics":["cmake","cpp","cpp20","league-of-legends","league-of-legends-api","library","websocket"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cactoes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-27T21:49:06.000Z","updated_at":"2024-04-14T23:34:14.101Z","dependencies_parsed_at":"2024-03-04T01:48:04.830Z","dependency_job_id":"da4ea8a8-c808-4c6a-840a-8dd0cdc72ebe","html_url":"https://github.com/cactoes/leaguepp-connector","commit_stats":null,"previous_names":["cactoes/leaguepp-connector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cactoes%2Fleaguepp-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cactoes%2Fleaguepp-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cactoes%2Fleaguepp-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cactoes%2Fleaguepp-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cactoes","download_url":"https://codeload.github.com/cactoes/leaguepp-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243043329,"owners_count":20226799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp","cpp20","league-of-legends","league-of-legends-api","library","websocket"],"created_at":"2024-11-17T08:11:29.593Z","updated_at":"2025-03-11T13:33:48.267Z","avatar_url":"https://github.com/cactoes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## league++connector\na league of legends client connector written in c++20.\n\nthis library makes use of [nlohmann/json](https://github.com/nlohmann/json) for the json side of things.\n\n\u003e [!NOTE]\n\u003e windows only since league is windows only.\n\n## examples\nhere is an full [example](example/src/main.cpp) of the library.\n\n### connecting to the client\nthe header file exposes a function to connect to the client which takes in a config.\n```cpp\n#include \u003cconnector.hpp\u003e\n//...\n\n// setup the config\nconnector::config_t config = {};\n// enabling this will enable debugging for WebSocket++\nconfig.enableWebSocketLogging = false;\n// set function pointers to handlers for connect \u0026 disconnect events\nconfig.connectHandler = \u0026ConnectHandler;\nconfig.disconnectHandler = \u0026DisconnectHandler;\n// after how many ms should the connector try again to connect\nconfig.reconnectInterval = 1000;\n\n// connect to the client using our config\nconnector::Connect(config);\n```\n\n### adding event handlers\nto listen to events you'll need to pass the endpoint uri \u0026 an handler.\n```cpp\n#include \u003cconnector.hpp\u003e\n// ...\n\n// this is what a handler looks like. always void(string, json)\nvoid OnClientEvent(std::string uri, nlohmann::json data) { /* ... */ }\n\nconnector::AddEventHandler(\"/event/you-want-to-listen/to\", \u0026OnClientEvent)\n```\nwhile this list is outdated a lot of events are listed [here](https://lcu.vivide.re/) (for Client Version: 8.24)\n\n### making requests to the client\n```cpp\n#include \u003cconnector.hpp\u003e\n// ...\n\nauto result = connector::MakeRequest(connector::request_type::POST, \"/uri\", \"\\\"EXTRA_JSON_DATA_HERE (if needed)\\\"\");\n// result.data will hold a json object of the data\n// result.status will hold the http status code of the request\nif (result.status != 200) {\n    std::cout \u003c\u003c \"request failed\\n\";\n}\n```\n\n## including\nmake sure to use the `--recursive` flag when cloning this repository\n```cmake\n# ================\n# library: OpenSSL (v3)\n# note: required for cpp-httplib\n# ================\nset(OPENSSL_USE_STATIC_LIBS TRUE)\nfind_package(OpenSSL REQUIRED)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL)\n\n# ================\n# library: Boost\n# note: required for WebSocket++\n# ================\nset(Boost_USE_STATIC_LIBS TRUE)\nadd_definitions(\"-D_WEBSOCKETPP_CPP11_STL_\")\nfind_package(Boost REQUIRED COMPONENTS system)\ntarget_include_directories(${PROJECT_NAME} PRIVATE Boost::headers)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE Boost::system)\n\n# ================\n# library: league++connector\n# ================\nadd_subdirectory(PATH_TO_THIS_LIBRARY)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE leaguepp_connector)\n```\n\n## prerequisites\nthese are required development packages that need to be properly installed on your system.\n* `openssl` (v3) (https://www.openssl.org/)\n* `boost` (\u003e v1.84.0) (https://www.boost.org/)\n\n## notes\nthis was tested \u0026 built using:\n* Microsoft Visual C++ 2022 / Build Tools x64\n* Windows 10\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcactoes%2Fleaguepp-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcactoes%2Fleaguepp-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcactoes%2Fleaguepp-connector/lists"}