Add a test method to download client and libraries.

Add a simple File object to simplify certain file operations.

INFO: Libraries are unfiltered. Some of the library that for other platform will be downloaded too.
This commit is contained in:
2026-07-11 01:19:36 +08:00
parent 4734cabe4c
commit 2bd9dd8105
5 changed files with 322 additions and 12 deletions
+15
View File
@@ -0,0 +1,15 @@
from pathlib import Path
class LauncherException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
class HashMismatchException(Exception):
def __init__(self, hash_name, got_hash, expected_hash, filepath: str | Path):
if type(filepath) == Path: filepath = Path(filepath).absolute().as_posix()
self.message = "File {} hash mismatch. Expected hash {}. Got hash {} ({})".format(filepath, got_hash,
expected_hash, hash_name)