offline-minecraft-launcher/oml/stages/launcher-variables.py

27 lines
1.6 KiB
Python
Raw Normal View History

print(colored(colorama.Fore.GREEN,"\nSetting up launcher variables..."))
launcherVariables["auth_player_name"] = lv["name"]
launcherVariables["version_name"] = findInChainDeepest(versionsPath,lv["version"],["id"])
launcherVariables["game_directory"] = lv["gamePath"]
launcherVariables["assets_root"] = assetsPath
2022-05-13 22:51:47 +00:00
launcherVariables["game_assets"] = launcherVariables["assets_root"]
launcherVariables["auth_access_token"] = "-"
launcherVariables["auth_uuid"] = hashlib.md5(lv["name"].encode('utf-8')).hexdigest()
launcherVariables["user_type"] = "offline"
launcherVariables["version_type"] = clientJson["type"]
launcherVariables["natives_directory"] = nativesOutPath
launcherVariables["launcher_name"] = "offline-minecraft-launcher"
launcherVariables["launcher_version"] = "0.0"
launcherVariables["classpath"] = libraryList
launcherVariables["auth_session"] = "-"
launcherVariables["user_properties"] = "{}"
if lv["profileFolder"] == "1":
profilePath = p(lv["gamePath"],"profiles")
launcherVariables["game_directory"] = p(profilePath,lv["name"],lv["version"],".minecraft")
if not os.path.isdir(launcherVariables["game_directory"]): os.makedirs(launcherVariables["game_directory"])
os.chdir(launcherVariables["game_directory"])
if launcherVariables["game_directory"].replace(pUp(launcherVariables["game_directory"]) + os.sep,"",1) == ".minecraft":
print(colored(colorama.Fore.MAGENTA,"> game_directory is called .minecraft, setting APPDATA/HOME environment variables to parent directory."))
os.environ["APPDATA"] = pUp(launcherVariables["game_directory"])
2022-05-13 22:51:47 +00:00
os.environ["HOME"] = os.environ["APPDATA"]