Skip to content

Commit

Permalink
removed old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MManoah committed Mar 20, 2021
1 parent 22d9363 commit 38f5d3a
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 380 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 0 additions & 6 deletions config/clubs.json

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -11,6 +11,7 @@
},
"build": {
"appId": "com.league.app",
"productName": "League Profile Tool",
"mac": {
"category": "Utility"
},
Expand Down
4 changes: 2 additions & 2 deletions src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
}
.sidebarcomp {
text-align: center;
margin-top: 0em;
margin-top: 2.4em;
display: block;
-webkit-app-region: no-drag;
}
Expand Down Expand Up @@ -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%;
Expand Down
19 changes: 0 additions & 19 deletions src/html/aram.html

This file was deleted.

84 changes: 0 additions & 84 deletions src/html/club.html

This file was deleted.

10 changes: 2 additions & 8 deletions src/html/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@
tool<br />
4. Paste it there, save, and restart the tool.
</dd>
<dt>Where do I see updates/changes?</dt>
<dt>Are there going to be any more updates?</dt>
<dd>
They will be posted in the discord server and the releases section of
github
</dd>
<dt>I want to develop another version of this tool</dt>
<dd>
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
</dd>
</dl>
</div>
Expand Down
6 changes: 0 additions & 6 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ <h3 id="rank">Chat Rank</h3>
<div class="sidebarcomp">
<h3 id="count">Champion and Skin Date</h3>
</div>
<div class="sidebarcomp">
<h3 id="club">Club Tag</h3>
</div>
<div class="sidebarcomp">
<h3 id="aram">Aram</h3>
</div>
<div class="sidebarcomp">
<h3 id="custom">Custom Request</h3>
</div>
Expand Down
131 changes: 8 additions & 123 deletions src/javascript/app.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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/",
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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",
Expand Down
15 changes: 0 additions & 15 deletions src/javascript/aram.js

This file was deleted.

Loading

0 comments on commit 38f5d3a

Please sign in to comment.