From 6fe796dfc3f40d5a7a643fd8a7816b15cc61f6d0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 3 Feb 2024 23:27:47 -0300 Subject: Update TODO list --- __main__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/__main__.py b/__main__.py index cf62be7..f6bdcd7 100755 --- a/__main__.py +++ b/__main__.py @@ -9,8 +9,7 @@ ## Published under the MIT License ##################################### -import requests, json, traceback, subprocess, hmac, struct, time, os, uuid, getpass -import base64 +import requests, json, traceback, subprocess, hmac, struct, time, os, uuid, base64 import tkinter as tk from tkinter.messagebox import showinfo, showerror, askyesno from functools import partial @@ -50,20 +49,18 @@ try: pref = json.loads(str(pref)) #print(repr(pref)) print("User settings loaded...") -#except FileNotFoundError: # <-- TODO except: print("Failed to load user settings!") err = traceback.format_exc().split("\n")[-2] print("Error: %s" % err) - # TODO: Move this to a function of its own, dont ask if FileNotFoundError - # Create new dummy prefs + ## Create new dummy prefs so it doesn't crash pref = {"user": "", "pass": "", "totp": "", "mana": False, "plus": False, "shell": True} - ## Do you want us to create a settings file? + ## If it is an error, give an option to not destroy the old settings if ("FileNotFoundError" in err): _savePref() print("New user settings created!") @@ -215,7 +212,7 @@ def launch_game(idx): auth = {"vaultId": vaultId, "token": vaultToken, "world": serverlist[idx]["UUID"]} - print(repr(auth)) + try: r=vault.post(VAULT_HOST+"/world_pass", json=auth, timeout=15.0) ## We got the access credentials @@ -239,6 +236,7 @@ def launch_game(idx): return -1 ## Handle server type + ## TODO: Do not use system-wide install unless specified so in prefs if not sys.platform.startswith('win'): CMD="manaplus" else: @@ -280,7 +278,10 @@ def world_select(): ## Create a list of all worlds ypos = 60 for w in serverlist: + ## TODO: Do not block main thread, launch this in a threading button = HoverButton(text=w["Name"], command=partial(launch_game, serverlist.index(w)), bg="#cc6600", fg="#fff", activebackground="#ee9933") + ## TODO: Handle MLP (on the threading?) + ## TODO: First login greeting? canva.create_window(200, ypos, window=button) ypos += 40 @@ -342,6 +343,7 @@ def login(): ## Change the display print("Connected to vault!") canva.destroy() + ## TODO: Do not jump to world selection if it is a new account world_select() return @@ -437,7 +439,7 @@ try: app=launch_game(idx) - ## Handle MLP + ## TODO: Handle MLP while app == 7: stdout("[CLIENT] Mirror Lake triggered.") r=vault.post(VAULT_HOST+"/getlake", json=auth, timeout=15.0) -- cgit v1.2.3-70-g09d2