Skip to content

Commit e8d519a

Browse files
committed
Bug fixes
1 parent 64a920c commit e8d519a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

DetailedLoLRPC.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from multiprocessing import Process, freeze_support
1212
from subprocess import Popen, PIPE
1313
from nest_asyncio import apply
14+
from json import loads
1415

1516
if __name__ == "__main__":
1617

@@ -55,9 +56,9 @@ async def connect(connection):
5556
addLog({"internalName": internalName, "displayName": displayName, "summonerId": summonerId, "locale": locale})
5657

5758
async with request("GET", localeDiscordStrings(locale)) as resp:
58-
discord_strings = await resp.json()
59+
discord_strings = loads((await resp.text()).encode().decode('utf-8-sig'))
5960
async with request("GET", localeChatStrings(locale)) as resp:
60-
chat_strings = await resp.json()
61+
chat_strings = loads((await resp.text()).encode().decode('utf-8-sig'))
6162

6263
discStrings = {
6364
"bot": discord_strings["Disc_Pres_QueueType_BOT"],
@@ -81,12 +82,15 @@ async def disconnect(_):
8182
@connector.ws.register("/lol-gameflow/v1/session", event_types = ("CREATE", "UPDATE", "DELETE"))
8283
async def gameFlow(connection, event):
8384
data = event.data
85+
phase = data['phase']
86+
87+
if phase not in ("Lobby", "Matchmaking", "ChampSelect", "InProgress"): return
8488

8589
gameData = data['gameData']
8690
queueData = gameData['queue']
8791
mapData = data['map']
8892
mapIconData = mapData["assets"]["game-select-icon-active"]
89-
phase = data['phase']
93+
9094

9195
lobbyMem = len(await (await connection.request('get', '/lol-lobby/v2/lobby/members')).json())
9296

tray_icon.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os import _exit, system, startfile, path as op
22
from PIL import Image
33
from pystray import Icon, Menu, MenuItem
4-
from utilities import editConfig, fetchConfig, resourcePath, resetConfig, ISSUESURL, LOGDIR
4+
from utilities import editConfig, fetchConfig, resourcePath, resetConfig, ISSUESURL, LOGDIR, VERSION
55

66
img = Image.open(resourcePath("icon.ico"))
77

@@ -32,6 +32,8 @@ def rpbug(icon: Icon, query):
3232

3333
icon = Icon("DetailedLoLRPC", img, "DetailedLoLRPC",
3434
Menu(
35+
MenuItem(f"DetailedLoLRPC {VERSION} - by Ria", None, enabled=False),
36+
Menu.SEPARATOR,
3537
MenuItem("Use Skin's splash and name", skinSplash, checked = lambda item: fetchConfig("useSkinSplash")),
3638
MenuItem('Show "View splash art" button', viewSplash, checked = lambda item: fetchConfig("showViewArtButton")),
3739
MenuItem("Idle status", Menu(

utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from json import load as loadj, dump as dumpj
77
from easygui import enterbox
88

9-
VERSION = "v2.6"
9+
VERSION = "v2.7"
1010
GITHUBURL = "https://github.com/developers192/DetailedLoLRPC/releases/latest"
1111
ISSUESURL = "https://github.com/developers192/DetailedLoLRPC/issues/new"
1212
DEFAULTCONFIG = {

0 commit comments

Comments
 (0)