Skip to content

Commit

Permalink
Add support for custom executable hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Dec 1, 2024
1 parent 5637445 commit 6b15010
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osu/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
server="ppy.sh",
stream="stable40",
version: Optional[int] = None,
executable_hash: Optional[str] = None,
tournament: bool = False,
events: Optional[Dict[ServerPackets, List[Callable]]] = {},
tasks: Optional[List[Task]] = [],
Expand Down Expand Up @@ -104,9 +105,12 @@ def __init__(
# Failed to get version
exit(1)

if executable_hash:
self.client = ClientInfo(self.version, executable_hash)
return

if not (updates := self.api.check_updates()):
# Updates are required because of the executable hash
# TODO: Custom executable hash?
exit(1)

self.client = ClientInfo.from_updates(self.version, updates)
Expand All @@ -133,6 +137,7 @@ def run(self, retry=False, exit_on_interrupt=False) -> None:
self.server,
self.stream,
self.version_number,
self.client.hash.executable_hash,
self.tourney,
self.events.handlers,
self.tasks.tasks,
Expand Down

0 comments on commit 6b15010

Please sign in to comment.