Skip to content

Commit

Permalink
Nexus blitz
Browse files Browse the repository at this point in the history
  • Loading branch information
developers192 committed Oct 25, 2023
1 parent 3d3e1d4 commit 5e38fef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
12 changes: 7 additions & 5 deletions DetailedLoLRPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def gameFlow(connection, event):
gameData = data['gameData']
queueData = gameData['queue']
mapData = data['map']
mapIconData = mapData["assets"]["game-select-icon-active"]
phase = data['phase']

lobbyMem = len(await (await connection.request('get', '/lol-lobby/v2/lobby/members')).json())
Expand All @@ -99,21 +100,21 @@ async def gameFlow(connection, event):
if phase == "Lobby":
if queueData["mapId"] == 0: return
RPC.update(details = f"{mapData['name']} ({queueData['description']})", \
large_image = mapIdimg(queueData["mapId"]), \
large_image = mapIcon(mapIconData), \
large_text = mapData['name'], \
state = discStrings["lobby"], \
party_size = [lobbyMem, queueData["maximumParticipantListSize"]])

elif phase == "Matchmaking":
RPC.update(details = f"{mapData['name']} ({queueData['description']})", \
large_image = mapIdimg(queueData["mapId"]), \
large_image = mapIcon(mapIconData), \
large_text = mapData['name'], \
state = discStrings["inQueue"], \
start = time())

elif phase == "ChampSelect":
RPC.update(details = f"{mapData['name']} ({queueData['description']})", \
large_image = mapIdimg(queueData["mapId"]), \
large_image = mapIcon(mapIconData), \
large_text = mapData['name'], \
state = discStrings["champSelect"])

Expand All @@ -130,7 +131,7 @@ async def gameFlow(connection, event):
buttons = ([{"label": "View Splash Art", "url": tftImg(compData["loadoutsIcon"])}] if fetchConfig("showViewArtButton") else None))
else:
RPC.update(details = f"{mapData['name']} ({queueData['description']})", \
large_image = mapIdimg(queueData["mapId"]), \
large_image = mapIcon(mapIconData), \
large_text = mapData['name'], \
state = discStrings["inGame"], \
start = time())
Expand Down Expand Up @@ -183,7 +184,8 @@ async def gameFlow(connection, event):
"mapId": queueData["mapId"],
"maximumParticipantListSize": queueData["maximumParticipantListSize"]},
"mapData": {"name": mapData['name'],
"mapStringId": mapData["mapStringId"]},
"mapStringId": mapData["mapStringId"],
"game-select-icon-active": mapIconData},
"phase": phase, "lobbyMem": lobbyMem})

@connector.ws.register("/lol-chat/v1/me", event_types = ("CREATE", "UPDATE", "DELETE"))
Expand Down
10 changes: 7 additions & 3 deletions cdngen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ def mapIdimg(mapid: int):
11: "classic_sru",
12: "aram",
22: "tft",
30: "gamemodex"
30: "gamemodex",
21: "shared"
}
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/content/src/leagueclient/gamemodeassets/{conv[mapid]}/img/game-select-icon-active.png"

def mapIcon(data):
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/" + "/".join(data.split("/")[2:]).lower()

def skinImg(champId, skinId):
if skinId / 1000 == champId:
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/{champId}.png"
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-tiles/{champId}/{skinId}.jpg"

def splashLink(champId, skinId):
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/{champId}/{skinId}.jpg"
return f"https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/uncentered/{champId}/{skinId}.jpg"

def tftImg(compDir):
name = compDir.split("/")[-1].lower()
Expand All @@ -37,6 +41,6 @@ def availabilityImg(a):
"chat": "https://i.imgur.com/I2XxZ5y.png",
"away": "https://i.imgur.com/X5YwSxs.png",
"dnd": "https://i.imgur.com/5I4uDSL.png",
"leagueIcon": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/LoL_icon.svg/256px-LoL_icon.svg.png"
"leagueIcon": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/assets/splashscreens/lol_icon.png"
}
return conv[a]
2 changes: 1 addition & 1 deletion utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from json import load as loadj, dump as dumpj
from easygui import enterbox

VERSION = "v2.5"
VERSION = "v2.6"
GITHUBURL = "https://github.com/developers192/DetailedLoLRPC/releases/latest"
ISSUESURL = "https://github.com/developers192/DetailedLoLRPC/issues/new"
DEFAULTCONFIG = {
Expand Down

0 comments on commit 5e38fef

Please sign in to comment.