Skip to content

Commit

Permalink
Region bug patch
Browse files Browse the repository at this point in the history
Patched a bug where the region could not be identified.

Fixes #12
  • Loading branch information
SuppliedOrange committed May 24, 2024
1 parent a7da065 commit 5006cb3
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,29 @@ def get_region():
"""
Get the region code of the current game.
"""
with open(
os.path.join(os.getenv("LOCALAPPDATA"), R"VALORANT\Saved\Logs\ShooterGame.log"),
"rb",
) as f:
region = None

with open( os.path.join(os.getenv("LOCALAPPDATA"), R"VALORANT\Saved\Logs\ShooterGame.log"), "rb",) as f:
lines = f.readlines()
for line in lines:
if b"regions" in line:
region = line.split(b"regions/")[1].split(b"]")[0]
return region.decode()

# Region finder Test 1
if not region:
for line in lines:
if b"regions/" in line:
region = line.split(b"regions/")[1].split(b"]")[0]
region = region.decode()
break

# Region finder Test 2
if not region:
for line in lines:
if b"config/" in line:
region = line.split(b"config/")[1].split(b"]")[0]
region = region.decode()
break

return region


def errorAlert(line1, line2, time):
"""
Expand Down

0 comments on commit 5006cb3

Please sign in to comment.