Skip to content

Commit

Permalink
Merge branch 'main' into feat/mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
OwOHamper authored Sep 25, 2023
2 parents 07eb003 + d1297ae commit dcd6092
Show file tree
Hide file tree
Showing 41 changed files with 294 additions and 176 deletions.
30 changes: 12 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
MIT License
The ISC License

Copyright (c) 2021 Isaac Kenyon
Copyright (c) 2021 - 2023 Zay Kenyon and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

[![Discord][discord-shield]][discord-url]
[![Downloads][downloads-shield]][downloads-url]
[![Language][language-shield]][language-url]
[![License][license-shield]][license-url]



<ol>
<li><a href="#about-the-project">About The Project</a></li>
Expand All @@ -35,14 +33,15 @@

### Bundled Release:

1) Download the [release](https://github.com/isaacKenyon/valorant-rank-yoinker/releases/latest).
2) Extract **all** files.
3) Run vRY.exe.
1) Download [Microsoft Visual C++ Libraries](https://github.com/abbodi1406/vcredist/releases)
2) Download the [release](https://github.com/isaacKenyon/valorant-rank-yoinker/releases/latest).
3) Extract **all** files.
4) Run vRY.exe.

### Running from source:

1) Download [Python 3.10](https://www.python.org/downloads/release/python-3100/), make sure it is added to the PATH. (This is an option on installation.)
1) Any Python version post 3.8 should work.
1) Any Python version post 3.10 should work.
2) Download the [source](https://github.com/isaacKenyon/VALORANT-rank-yoinker/archive/refs/heads/main.zip).
3) Open a terminal within the source folder.
4) `pip install -r requirements.txt`
Expand Down Expand Up @@ -74,7 +73,7 @@ If you want to make a small change to the application, you can:

## What about that Tweet?

The [Tweet](https://twitter.com/PlayVALORANT/status/1539728676815642624), which details Riot's API policies outlines how
The [Tweet](https://twitter.com/PlayVALORANT/status/1539728676815642624), which details Riot's API policies, outlines how
applications are not allowed to expose data hidden by the game client. As of Version 1.262, vRY respects streamer mode.

## Contributing
Expand Down Expand Up @@ -104,11 +103,5 @@ If you want to make a small change to the application, you can:
[discord-url]: https://discord.gg/HeTKed64Ka
[discord-banner]: https://discordapp.com/api/guilds/872101595037446144/widget.png?style=banner2

[downloads-shield]: https://img.shields.io/github/downloads/isaacKenyon/VALORANT-rank-yoinker/total?style=for-the-badge&logo=github
[downloads-url]: https://github.com/isaacKenyon/VALORANT-rank-yoinker/releases/latest

[language-shield]: https://img.shields.io/github/languages/top/isaacKenyon/Valorant-rank-yoinker?logo=python&logoColor=yellow&style=for-the-badge
[language-url]: https://www.python.org/

[license-shield]: https://img.shields.io/github/license/isaacKenyon/valorant-rank-yoinker?style=for-the-badge
[license-url]: https://github.com/isaacKenyon/valorant-rank-yoinker/blob/main/LICENSE
[downloads-shield]: https://img.shields.io/github/downloads/zayKenyon/VALORANT-rank-yoinker/total?style=for-the-badge&logo=github
[downloads-url]: https://github.com/zayKenyon/VALORANT-rank-yoinker/releases/latest
Binary file modified assets/Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/HS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Leaderboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Party.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/PeakRank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Rank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Rating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Skin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/WR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/rpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/HS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Leaderboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Party.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/PeakRank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Rank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Rating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/Skin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/WR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/rpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<!-- COPYWRITING -->
<div>
<h1>VALORANT rank yoinker</h1>
<p class="ui-text-intro">An app the VALORANT rank and players' equipped skins during a match</p>
<p class="ui-text-intro">See VALORANT players' ranks, skins, and more mid-game.</p>
<!-- CTA -->
<div class="ui-component-cta ui-layout-flex">
<a href="https://github.com/zayKenyon/VALORANT-rank-yoinker/releases/latest" role="link" class="ui-component-button ui-component-button-normal ui-component-button-primary">Download Now</a>
Expand Down Expand Up @@ -173,7 +173,7 @@ <h2>Party Indicator</h2>
<!-- FEATURE -->
<div>
<h2>Winrate %</h2>
<p class="ui-text-intro">Wondering why that low ranked player is in your lobby, surely they're not getting boosted? Well, it's because they have a winrate % (good for them).</p>
<p class="ui-text-intro">Wondering why that low ranked player is in your lobby, surely they're not getting boosted? Well, it's because they have a high winrate % (good for them).</p>
<ul class="ui-component-list--item ui-component-list-feature ui-layout-grid">
<li class="ui-component-list--item ui-component-list--item-check">See who's grinding.</li>
<li class="ui-component-list--item ui-component-list--item-check">Works for both sides.</li>
Expand Down
67 changes: 53 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from src.stats import Stats
from src.table import Table
from src.websocket import Ws
from src.os import get_os

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Expand Down Expand Up @@ -63,6 +64,14 @@ def get_ip():
Logging = Logging()
log = Logging.log

# OS Logging + quit if OS unsupported
if get_os()[1] == False:
print(f"Unsupported operating system: {get_os()[0]}\n")
log(f"Unsupported operating system: {get_os()[0]}\n")
program_exit(0)
else:
log(f"Operating system: {get_os()[0]}\n")

ChatLogging = ChatLogging()
chatlog = ChatLogging.chatLog

Expand All @@ -89,7 +98,7 @@ def get_ip():


ErrorSRC = Error(log)

Requests = Requests(version, log, ErrorSRC)
Requests.check_version()
Requests.check_status()
Expand All @@ -115,17 +124,22 @@ def get_ip():


agent_dict = content.get_all_agents()
map_dict = content.get_maps()

map_info = content.get_all_maps()
map_urls = content.get_map_urls(map_info)
map_splashes = content.get_map_splashes(map_info)

current_map = coregame.get_current_map(map_urls, map_splashes)

colors = Colors(hide_names, agent_dict, AGENTCOLORLIST)

loadoutsClass = Loadouts(Requests, log, colors, Server)
loadoutsClass = Loadouts(Requests, log, colors, Server, current_map)
table = Table(cfg, chatlog, log)

stats = Stats()

if cfg.get_feature_flag("discord_rpc"):
rpc = Rpc(map_dict, gamemodes, colors, log)
rpc = Rpc(map_urls, gamemodes, colors, log)
else:
rpc = None

Expand All @@ -137,11 +151,10 @@ def get_ip():
log(f"VALORANT rank yoinker v{version}")




valoApiSkins = requests.get("https://valorant-api.com/v1/weapons/skins")
gameContent = content.get_content()
seasonID = content.get_latest_season_id(gameContent)
previousSeasonID = content.get_previous_season_id(gameContent)
lastGameState = ""

print(color(f"\nWs Server - {get_ip()}:{cfg.port}", fore=(255, 127, 80)))
Expand All @@ -152,10 +165,7 @@ def get_ip():

richConsole = RichConsole()

# loop = asyncio.new_event_loop()
# asyncio.set_event_loop(loop)
# loop.run_until_complete(Wss.conntect_to_websocket(game_state))
# loop.close()

firstTime = True
firstPrint = True
while True:
Expand Down Expand Up @@ -191,7 +201,11 @@ def get_ip():
else:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
previous_game_state = game_state
game_state = loop.run_until_complete(Wss.recconect_to_websocket(game_state))
# We invalidate the cached responses when going from any state to menus
if previous_game_state != game_state and game_state == "MENUS":
rank.invalidate_cached_responses()
log(f"new game state: {game_state}")
loop.close()
firstTime = False
Expand Down Expand Up @@ -260,6 +274,7 @@ def get_ip():
# with alive_bar(total=len(Players), title='Fetching Players', bar='classic2') as bar:
isRange = False
playersLoaded = 1

heartbeat_data["map"] = map_dict[coregame_stats["MapID"].lower()],
with richConsole.status("Loading Players...") as status:
partyOBJ = menu.get_party_json(namesClass.get_players_puuid(Players), presence)
Expand Down Expand Up @@ -334,6 +349,8 @@ def get_ip():
# PARTY_ICON
party_icon = partyIcons[party]
playerRank = rank.get_rank(player["Subject"], seasonID)
previousPlayerRank = rank.get_rank(player["Subject"], previousSeasonID)

if player["Subject"] == Requests.puuid:
if cfg.get_feature_flag("discord_rpc"):
rpc.set_data({"rank": playerRank["rank"], "rank_name": colors.escape_ansi(NUMBERTORANKS[playerRank["rank"]]) + " | " + str(playerRank["rr"]) + "rr"})
Expand Down Expand Up @@ -390,6 +407,8 @@ def get_ip():

# RANK
rankName = NUMBERTORANKS[playerRank["rank"]]
if cfg.get_feature_flag("aggregate_rank_rr") and cfg.table.get("rr"):
rankName += f" ({playerRank['rr']})"

# RANK RATING
rr = playerRank["rr"]
Expand All @@ -403,6 +422,9 @@ def get_ip():
# PEAK RANK
peakRank = NUMBERTORANKS[playerRank["peakrank"]] + peakRankAct

# PREVIOUS RANK
previousRank = NUMBERTORANKS[previousPlayerRank["rank"]]

# LEADERBOARD
leaderboard = playerRank["leaderboard"]

Expand All @@ -422,6 +444,7 @@ def get_ip():
rankName,
rr,
peakRank,
previousRank,
leaderboard,
hs,
wr,
Expand Down Expand Up @@ -455,7 +478,7 @@ def get_ip():
player["Subject"]: {
"name": names[player["Subject"]],
"agent": agent_dict[player["CharacterID"].lower()],
"map": map_dict[coregame_stats["MapID"].lower()],
"map": current_map,
"rank": playerRank["rank"],
"rr": rr,
"match_id": coregame.match_id,
Expand All @@ -480,7 +503,7 @@ def get_ip():
# loadouts = loadoutsClass.get_match_loadouts(pregame.get_pregame_match_id(), pregame_stats, cfg.weapon, valoApiSkins, names,
# state="pregame")
playersLoaded = 1
with richConsole.status("Loading Players...") as status:
with richConsole.status("Loading Players...") as status:
# with alive_bar(total=len(Players), title='Fetching Players', bar='classic2') as bar:
presence = presences.get_presence()
partyOBJ = menu.get_party_json(namesClass.get_players_puuid(Players), presence)
Expand Down Expand Up @@ -508,6 +531,7 @@ def get_ip():
party_icon = partyIcons[party]
partyCount += 1
playerRank = rank.get_rank(player["Subject"], seasonID)
previousPlayerRank = rank.get_rank(player["Subject"], previousSeasonID)

if player["Subject"] == Requests.puuid:
if cfg.get_feature_flag("discord_rpc"):
Expand Down Expand Up @@ -566,6 +590,8 @@ def get_ip():

# RANK
rankName = NUMBERTORANKS[playerRank["rank"]]
if cfg.get_feature_flag("aggregate_rank_rr") and cfg.table.get("rr"):
rankName += f" ({playerRank['rr']})"

# RANK RATING
rr = playerRank["rr"]
Expand All @@ -577,6 +603,9 @@ def get_ip():
# PEAK RANK
peakRank = NUMBERTORANKS[playerRank["peakrank"]] + peakRankAct

# PREVIOUS RANK
previousRank = NUMBERTORANKS[previousPlayerRank["rank"]]

# LEADERBOARD
leaderboard = playerRank["leaderboard"]

Expand All @@ -597,6 +626,7 @@ def get_ip():
rankName,
rr,
peakRank,
previousRank,
leaderboard,
hs,
wr,
Expand Down Expand Up @@ -624,7 +654,7 @@ def get_ip():
Players = menu.get_party_members(Requests.puuid, presence)
names = namesClass.get_names_from_puuids(Players)
playersLoaded = 1
with richConsole.status("Loading Players...") as status:
with richConsole.status("Loading Players...") as status:
# with alive_bar(total=len(Players), title='Fetching Players', bar='classic2') as bar:
# log(f"retrieved names dict: {names}")
Players.sort(key=lambda Players: Players["PlayerIdentity"].get("AccountLevel"), reverse=True)
Expand All @@ -636,7 +666,7 @@ def get_ip():
playersLoaded += 1
party_icon = PARTYICONLIST[0]
playerRank = rank.get_rank(player["Subject"], seasonID)

previousPlayerRank = rank.get_rank(player["Subject"], previousSeasonID)
if player["Subject"] == Requests.puuid:
if cfg.get_feature_flag("discord_rpc"):
rpc.set_data({"rank": playerRank["rank"], "rank_name": colors.escape_ansi(NUMBERTORANKS[playerRank["rank"]]) + " | " + str(playerRank["rr"]) + "rr"})
Expand Down Expand Up @@ -665,6 +695,8 @@ def get_ip():

# RANK
rankName = NUMBERTORANKS[playerRank["rank"]]
if cfg.get_feature_flag("aggregate_rank_rr") and cfg.table.get("rr"):
rankName += f" ({playerRank['rr']})"

# RANK RATING
rr = playerRank["rr"]
Expand All @@ -677,6 +709,9 @@ def get_ip():
# PEAK RANK
peakRank = NUMBERTORANKS[playerRank["peakrank"]] + peakRankAct

# PREVIOUS RANK
previousRank = NUMBERTORANKS[previousPlayerRank["rank"]]

# LEADERBOARD
leaderboard = playerRank["leaderboard"]

Expand All @@ -696,6 +731,7 @@ def get_ip():
rankName,
rr,
peakRank,
previousRank,
leaderboard,
hs,
wr,
Expand Down Expand Up @@ -739,6 +775,9 @@ def get_ip():
table.set_runtime_col_flag('Party', False)
table.set_runtime_col_flag('Agent',False)

# We don't to show the RR column if the "aggregate_rank_rr" feature flag is True.
table.set_runtime_col_flag('RR', cfg.table.get("rr") and not cfg.get_feature_flag("aggregate_rank_rr"))

table.set_caption(f"VALORANT rank yoinker v{version}")
Server.send_payload("heartbeat",heartbeat_data)
table.display()
Expand Down
25 changes: 17 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
requests==2.26.0
urllib3==1.26.6
Colr~=0.9.1
websocket-server==0.6.0
websockets==10.3
certifi==2023.7.22
charset-normalizer==3.2.0
Colr==0.9.1
idna==3.4
inquirerpy==0.3.4
pypresence==4.2.1
nest_asyncio==1.5.5
rich==12.5.1
markdown-it-py==3.0.0
mdurl==0.1.2
nest-asyncio==1.5.6
pfzy==0.3.4
prompt-toolkit==3.0.39
Pygments==2.15.1
pypresence==4.3.0
requests==2.31.0
rich==13.5.1
urllib3==2.0.4
wcwidth==0.2.6
websocket-server==0.6.4
websockets==11.0.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
setup(
name = "VALORANT rank yoinker",
version = version,
description='vRY - Live Match Rank Viewer',
description='vRY - VALORANT rank yoinker',
executables = [Executable("main.py", icon="./assets/Logo.ico", target_name="vry.exe")],
options={"build_exe": build_exe_options}
)
Loading

0 comments on commit dcd6092

Please sign in to comment.