diff --git a/.gitignore b/.gitignore index ad279da..73daea4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* dist + # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/LICENSE b/LICENSE index 11db0b4..0c9fc6e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 MManoah +Copyright (c) 2021 MManoah Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/config/clubs.json b/config/clubs.json deleted file mode 100644 index efe2c8e..0000000 --- a/config/clubs.json +++ /dev/null @@ -1,6 +0,0 @@ -{ -"club Name": "clubData", -"Another Club": "clubData", -"Emoji Club 💔": "clubData", -"etc": "clubData" -} diff --git a/package.json b/package.json index 218cf9e..0e5f2ba 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "league-profile-tool", "productName": "league-profile-tool", - "version": "2.0.0", - "description": "My Electron application description", + "version": "2.4.6", + "description": "Tool that interacts with the Riot LCU", "main": "src/index.js", "scripts": { "start": "electron-forge start", @@ -11,6 +11,7 @@ }, "build": { "appId": "com.league.app", + "productName": "League Profile Tool", "mac": { "category": "Utility" }, diff --git a/src/css/index.css b/src/css/index.css index be07192..681f9a6 100644 --- a/src/css/index.css +++ b/src/css/index.css @@ -11,7 +11,7 @@ body { } .sidebarcomp { text-align: center; - margin-top: 0em; + margin-top: 2.4em; display: block; -webkit-app-region: no-drag; } @@ -49,7 +49,7 @@ h3 { text-align: center; font-size: 4em; text-shadow: 4px 4px #1d1d29; - margin-top: -19px; + margin-top: -25px; } .contact { margin-top: 50%; diff --git a/src/html/aram.html b/src/html/aram.html deleted file mode 100644 index e00224f..0000000 --- a/src/html/aram.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -
-
-

IMPORTANT

-

- *THIS EXPLOIT CAN RESULT IN A CHARGEBACK, USE AT YOUR OWN RISK!!* -

-

- *IF YOU HAVE ENOUGH RP FOR A SKIN BOOST, THIS WILL USE THAT RP!!* -

-

- *Only use this if you don't have enough RP for a skin boost!!* -

- -
- - diff --git a/src/html/club.html b/src/html/club.html deleted file mode 100644 index 904f47e..0000000 --- a/src/html/club.html +++ /dev/null @@ -1,84 +0,0 @@ - - - -
-
-

Select A Club

-

*Logout and Log Back In If It Doesn't Work*

-

*And Restart This Program*

-

*You must also be in a club first*

-

*User Clubs is located in config/clubs.json*

- -
- -

- *Enter summoners name, they MUST be connected to the chat. -

-

- If they left the lobby, it will not work* -

-
-
- -
-
- -
-
- -
-
- -
-
- -
- - -
- - diff --git a/src/html/faq.html b/src/html/faq.html index db4e0af..6df03d3 100644 --- a/src/html/faq.html +++ b/src/html/faq.html @@ -12,15 +12,9 @@ tool
4. Paste it there, save, and restart the tool. -
Where do I see updates/changes?
+
Are there going to be any more updates?
- They will be posted in the discord server and the releases section of - github -
-
I want to develop another version of this tool
-
- Go for it! If you have any questions feel free to ask in the discord - server, or send either of us a DM. + Most likely not as I don't play the game much anymore
diff --git a/src/index.html b/src/index.html index 3e498c7..9f43b4d 100644 --- a/src/index.html +++ b/src/index.html @@ -30,12 +30,6 @@

Chat Rank

Champion and Skin Date

-
-

Club Tag

-
-
-

Aram

-

Custom Request

diff --git a/src/javascript/app.js b/src/javascript/app.js index 2f7b5ba..885e4b8 100644 --- a/src/javascript/app.js +++ b/src/javascript/app.js @@ -1,12 +1,12 @@ const { dialog } = require("electron").remote; const { remote } = require("electron"); const sidePanel = document.querySelectorAll("h3"); -let activePanel = sidePanel[0]; const LCUConnector = require("lcu-connector"); const connector = new LCUConnector(); const request = require("request"); const exit = document.querySelector("#exit"); -var LeagueClient; +let activePanel = sidePanel[0]; +let LeagueClient; /* Look if user has set the path to the client, if so use that path, @@ -47,7 +47,6 @@ class ClientConnection { this.#endpoints = { presetIcon: "/lol-summoner/v1/current-summoner/icon/", lolChat: "/lol-chat/v1/me/", - aram: "/lol-champ-select/v1/team-boost/purchase/", profile: "/lol-summoner/v1/current-summoner/summoner-profile/", friends: "/lol-chat/v1/friends/", conversations: "/lol-chat/v1/conversations/", @@ -76,21 +75,11 @@ class ClientConnection { this.makeRequest("PUT", body, this.#endpoints.lolChat); } - // Aram boost - requestAram() { - this.makeRequest("POST", "", this.#endpoints.aram); - } - // Change profile background requestBackground(body) { this.makeRequest("POST", body, this.#endpoints.profile); } - // Set club with club data - requestClubWData(body) { - this.makeRequest("PUT", body, this.#endpoints.lolChat); - } - // Change rank displayed on hover-card requestRank(body) { this.makeRequest("PUT", body, this.#endpoints.lolChat); @@ -116,8 +105,7 @@ class ClientConnection { }; reply.value = ""; let obj = JSON.parse(response.body); - let format = JSON.stringify(obj, null, 3); - reply.value = format; + reply.value = JSON.stringify(obj, null, 3); let input = new Event("input"); reply.dispatchEvent(input); } catch (e) { @@ -131,120 +119,17 @@ class ClientConnection { }); } - // Gets club of a friend - requestFriendClub(friendName, sendRequest, clubInfo, clubCode) { - this.#options["url"] = this.#url + this.#endpoints.friends; - this.#options["method"] = "GET"; - request(this.#options, function (error, response) { - if (response.statusCode === 404) { - return dialog.showErrorBox( - "Error", - "There was an error connecting to the friends list" - ); - } - let friendsList = JSON.parse(response.body); - for (let i = 0; i < friendsList.length; i++) { - // Friend has been found - if ( - friendName.value.toUpperCase() === friendsList[i].name.toUpperCase() - ) { - let availability = friendsList[i].availability; - let friendClubData = friendsList[i].lol.clubsData; - // Friend has to be online to get club data - if (availability === "offline" || availability === "mobile") { - return dialog.showErrorBox("Error", "That friend is offline"); - } else if (friendClubData === undefined) { - return dialog.showErrorBox( - "Error", - "That friends club data could not be found" - ); - } else { - if (sendRequest) { - clubInfo["lol"]["clubsData"] = friendClubData; - let endpoints = LeagueClient.endpoints; - LeagueClient.makeRequest("PUT", clubInfo, endpoints.lolChat); - } else { - let dialogOptions = { - type: "info", - title: "Success", - message: "The request has been made", - }; - dialog.showMessageBox(dialogOptions); - } - return (clubCode.value = friendClubData); - } - } - } - dialog.showErrorBox("Error", "Could not find that friend"); - }); - } - - // Gets club of person in custom game lobby, champ select, or post game - requestClub(lobbyType, summonerSearch, sendRequest, clubInfo) { - this.#options["url"] = this.#url + this.#endpoints.conversations; - this.#options["method"] = "GET"; - request(this.#options, function (error, response) { - if (response.statusCode === 404) { - return dialog.showErrorBox("Error", `There was an error\n${error}`); - } - let lobbyID = ""; - let conversations = JSON.parse(response.body); - let inLobby = false; - for (let i = 0; i < conversations.length; i++) { - let lobby = conversations[i]; - if (lobby.type === lobbyType) { - inLobby = true; - lobbyID = lobby.id; - let endpoint = LeagueClient.endpoints.conversations; - endpoint = `${endpoint}${lobbyID}/participants`; - let options = LeagueClient.options; - let url = LeagueClient.url; - options["url"] = url + endpoint; - options["method"] = "GET"; - request(options, function (error, response) { - let summoners = JSON.parse(response.body); - for (let i = 0; i < summoners.length; i++) { - let currentSummoner = summoners[i]; - if (currentSummoner.name.toUpperCase() === summonerSearch) { - let summonerClubData = currentSummoner.lol.clubsData; - clubCode.value = summonerClubData; - if (sendRequest) { - clubInfo["lol"]["clubsData"] = summonerClubData; - let endpoint = LeagueClient.endpoints.lolChat; - return LeagueClient.makeRequest("PUT", clubInfo, endpoint); - } else { - let dialogOptions = { - type: "info", - title: "Success", - message: "The request has been made", - }; - return dialog.showMessageBox(dialogOptions); - } - } - } - dialog.showErrorBox("Error", "Could not find that summoner"); - }); - } - } - if (!inLobby) { - dialog.showErrorBox("Error", `You are not in ${lobbyType}`); - } - }); - } makeRequest(method, body, endPoint) { this.#options["url"] = this.#url + endPoint; this.#options["method"] = method; this.#options["body"] = JSON.stringify(body); - this.run(this.#options); - } - run(command) { - request(command, function (error, response) { + request(this.#options, function (error, response) { let dialogOptions = {}; if ( - !error && - (response.statusCode === 201 || - response.statusCode === 200 || - response.statusCode === 204) + !error && + (response.statusCode === 201 || + response.statusCode === 200 || + response.statusCode === 204) ) { dialogOptions = { type: "info", diff --git a/src/javascript/aram.js b/src/javascript/aram.js deleted file mode 100644 index 5de8286..0000000 --- a/src/javascript/aram.js +++ /dev/null @@ -1,15 +0,0 @@ -var boost = document.getElementById("boost"); - -boost.addEventListener("mousedown", function () { - const dialogOptions = { - type: "question", - title: "Confirmation", - message: - "Are you sure you want to continue? \n(Make sure you don't have enough RP for a boost)", - buttons: ["Yes", "No"], - }; - - dialog.showMessageBox(dialogOptions).then((response) => { - if (response.response === 0) LeagueClient.requestAram(); - }); -}); diff --git a/src/javascript/club.js b/src/javascript/club.js deleted file mode 100644 index 13aec92..0000000 --- a/src/javascript/club.js +++ /dev/null @@ -1,113 +0,0 @@ -var club = document.querySelectorAll(".clubs"); -var setClub = document.getElementById("setClub"); -var clubCode = document.getElementById("clubCode"); -var friendName = document.getElementById("friendName"); -var lobbyMember = document.getElementById("lobbyMember"); -var champSelectMem = document.getElementById("champSelect"); -var postGameMem = document.getElementById("postGame"); -var getClubData = document.getElementById("getClubData"); -var customClubs = document.getElementById("customClubs"); -var fs = require("fs"); - -// Attempt to set any user set clubs in config/clubs.json -try { - const jsonString = fs.readFileSync("./config/clubs.json"); - const data = JSON.parse(jsonString); - Object.keys(data).forEach(function (key) { - var option = document.createElement("option"); - option.label = key; - option.text = key; - option.classList.add("club"); - option.value = data[key]; - customClubs.add(option); - }); -} catch (err) { - const dialogOptions = { - type: "error", - title: "Error", - message: `There was an error with custom user clubs (${err})\nPlease make sure config/clubs.json is in proper JSON format`, - buttons: ["Open Json Validator", "Ok"], - }; - dialog.showMessageBox(dialogOptions).then((response) => { - if (response.response === 0) - require("electron").shell.openExternal("https://jsonlint.com/"); - }); -} - -var clubKeys = { - -}; -var clubInfo = { - lol: { - clubsData: "", - }, -}; -for (var i = 0; i < club.length; i++) { - club[i].addEventListener("focus", function () { - friendName.classList.add("clubCodeFocus"); - }); - club[i].addEventListener("blur", function () { - friendName.classList.remove("clubCodeFocus"); - }); -} -club[0].addEventListener("change", function () { - clubInfo["lol"]["clubsData"] = clubKeys[this.value]; - LeagueClient.requestClubWData(clubInfo); -}); -club[1].addEventListener("change", function () { - clubInfo["lol"]["clubsData"] = this.value; - LeagueClient.requestClubWData(clubInfo); -}); - -setClub.addEventListener("mousedown", function () { - getClub(true); -}); -getClubData.addEventListener("mousedown", function () { - getClub(false); -}); -function getClub(sendRequest) { - if ( - clubCode.value === "" && - friendName.value === "" && - lobbyMember.value === "" && - champSelectMem.value === "" && - postGameMem.value === "" - ) { - return dialog.showErrorBox( - "Error", - "Custom club data, friends name, or lobby members cannot be empty" - ); - } else if (friendName.value !== "") { - LeagueClient.requestFriendClub(friendName, sendRequest, clubInfo, clubCode); - } else if (champSelectMem.value !== "") { - LeagueClient.requestClub( - "championSelect", - champSelectMem.value.toUpperCase(), - sendRequest, - clubInfo - ); - } else if (postGameMem.value !== "") { - LeagueClient.requestClub( - "postGame", - champSelectMem.value.toUpperCase(), - sendRequest, - clubInfo - ); - } else if (lobbyMember.value !== "") { - LeagueClient.requestClub( - "customGame", - lobbyMember.value.toUpperCase(), - sendRequest, - clubInfo - ); - } else { - if (sendRequest) { - clubInfo["lol"]["clubsData"] = clubCode.value; - return LeagueClient.requestClubWData(clubInfo); - } - dialog.showErrorBox( - "Error", - "Please enter a summoners name to get club data" - ); - } -} diff --git a/src/javascript/icon.js b/src/javascript/icon.js index bfef432..81f104e 100644 --- a/src/javascript/icon.js +++ b/src/javascript/icon.js @@ -32,6 +32,6 @@ iconButton.addEventListener("mousedown", function () { lolNames.addEventListener("mousedown", function (e) { e.preventDefault(); require("electron").shell.openExternal( - "https://lolnames.gg/en/statistics/icons/" + "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/" ); });