summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-30 15:16:43 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-30 15:16:43 -0300
commitbd36c692357c85de7058a28abc63ab9abc228a58 (patch)
tree714b3c539b8180006c4de4e76c5f834ac3f1fe5f
parent0909dac3c032f23bf6335ae00f36f89e1f8408dd (diff)
downloadrenpy-bd36c692357c85de7058a28abc63ab9abc228a58.tar.gz
renpy-bd36c692357c85de7058a28abc63ab9abc228a58.tar.bz2
renpy-bd36c692357c85de7058a28abc63ab9abc228a58.tar.xz
renpy-bd36c692357c85de7058a28abc63ab9abc228a58.zip
Add sast/ folder so I can test if the fault is the YML or the poor tool I'm using
-rw-r--r--sast/client.rpy-sast.py13
-rw-r--r--sast/core.rpy-sast.py20
-rw-r--r--sast/discord.rpy-sast.py14
-rw-r--r--sast/gui.rpy-sast.py4
-rw-r--r--sast/manaplus.rpy-sast.py9
-rw-r--r--sast/manaverse.rpy-sast.py9
-rw-r--r--sast/mirrorlake.rpy-sast.py1
-rw-r--r--sast/options.rpy-sast.py5
-rw-r--r--sast/renpy.rpy-sast.py34
-rw-r--r--sast/screens.rpy-sast.py4
-rw-r--r--sast/soul.rpy-sast.py52
-rw-r--r--sast/update.rpy-sast.py58
12 files changed, 223 insertions, 0 deletions
diff --git a/sast/client.rpy-sast.py b/sast/client.rpy-sast.py
new file mode 100644
index 0000000..eebc423
--- /dev/null
+++ b/sast/client.rpy-sast.py
@@ -0,0 +1,13 @@
+if True:
+ def handle_client(CLIENT_NAME="", launch=False, download=True):
+ ## Local variables
+ f=False
+ if (CLIENT_NAME == ""):
+ CLIENT_NAME=persistent.evol2cli
+ # https://stackoverflow.com/questions/2791489/how-do-i-take-out-the-focus-or-minimize-a-window-with-python/2792059 (Windows)
+
+ ########################################################################
+ ## Cleanup
+ statusmsg=_("Thanks for playing!")
+ # time.sleep(0.1) ## TODO: Ensure the world finishes updating Vault
+ progress=100
diff --git a/sast/core.rpy-sast.py b/sast/core.rpy-sast.py
new file mode 100644
index 0000000..aae140d
--- /dev/null
+++ b/sast/core.rpy-sast.py
@@ -0,0 +1,20 @@
+if True:
+ renpy.add_python_directory("python-extra")
+ import requests, zlib, base64, sys, copy, uuid, time, json, traceback
+ ########
+ ## Force Update
+ if persistent.version != config.version:
+ persistent.version = config.version
+ if (persistent.evol2cli is not None and
+ persistent.host is not None and
+ handle_client(launch=True, download=False)):
+ md5check_client(silent=True)
+ if persistent.hello is None:
+ p1=2.5
+ p2=1.5
+ persistent.hello=True
+ stdout("Program died.")
+ USE_DUMMY_DATA = False
+ stdout("Auto-launching...")
+ AUTOLAUNCH=False
+ renpy.quit()
diff --git a/sast/discord.rpy-sast.py b/sast/discord.rpy-sast.py
new file mode 100644
index 0000000..9c231c5
--- /dev/null
+++ b/sast/discord.rpy-sast.py
@@ -0,0 +1,14 @@
+if True:
+ def readyCallback(current_user):
+ print('Our user: {}'.format(current_user))
+ stdout("Discord RPC disabled")
+ # Note: 'event_name': callback
+ responsive=False
+ print("")
+ try:
+ stdout("Shutdown requested, cleaning up...")
+ if persistent.discord:
+ discord_rpc.shutdown()
+ stdout("Thanks for playing the Mana Launcher.")
+ except:
+ pass
diff --git a/sast/gui.rpy-sast.py b/sast/gui.rpy-sast.py
new file mode 100644
index 0000000..a14ebcc
--- /dev/null
+++ b/sast/gui.rpy-sast.py
@@ -0,0 +1,4 @@
+if True:
+ gui.init(1280, 720)
+
+ ## This increases the size of the quick buttons to make them easier to touch
diff --git a/sast/manaplus.rpy-sast.py b/sast/manaplus.rpy-sast.py
new file mode 100644
index 0000000..082c031
--- /dev/null
+++ b/sast/manaplus.rpy-sast.py
@@ -0,0 +1,9 @@
+if True:
+ #############################################################################
+ def download_manaplus(fname):
+ installdir=get_path("manaplus")
+ status_update("Downloading %s on RAM..." % fname, 62)
+ r=requests.get(persistent.host+"/%s" % fname, timeout=60.0)
+ if (r.status_code != 200):
+ status_update("Failure retrieving M+: ERROR %d" % r.status_code)
+ return False
diff --git a/sast/manaverse.rpy-sast.py b/sast/manaverse.rpy-sast.py
new file mode 100644
index 0000000..d9f7255
--- /dev/null
+++ b/sast/manaverse.rpy-sast.py
@@ -0,0 +1,9 @@
+if True:
+ #############################################################################
+ def download_manaverse(fname):
+ installdir=get_path("manaplus")
+ status_update("Downloading %s on RAM..." % fname, 62)
+ r=requests.get(persistent.host+"/%s" % fname, timeout=60.0)
+ if (r.status_code != 200):
+ status_update("Failure retrieving M+: ERROR %d" % r.status_code)
+ return False
diff --git a/sast/mirrorlake.rpy-sast.py b/sast/mirrorlake.rpy-sast.py
new file mode 100644
index 0000000..150ca8d
--- /dev/null
+++ b/sast/mirrorlake.rpy-sast.py
@@ -0,0 +1 @@
+if True:
diff --git a/sast/options.rpy-sast.py b/sast/options.rpy-sast.py
new file mode 100644
index 0000000..3b6a5bb
--- /dev/null
+++ b/sast/options.rpy-sast.py
@@ -0,0 +1,5 @@
+if True:
+ ## Macintosh: HOME/Library/RenPy/<config.save_directory>
+ ## Linux: HOME/.renpy/<config.save_directory>
+
+ ## The following functions take file patterns. File patterns are case-
diff --git a/sast/renpy.rpy-sast.py b/sast/renpy.rpy-sast.py
new file mode 100644
index 0000000..d49c2bf
--- /dev/null
+++ b/sast/renpy.rpy-sast.py
@@ -0,0 +1,34 @@
+if True:
+ if persistent.steam:
+ stdout("Steam Module verification...")
+ try:
+ steam.init()
+ except:
+ import _renpysteam as steam
+ statusmsg=_("Validating SSL Certificates...")
+ stdout("Before menu OK")
+ build_vault()
+ stdout("Vault PEM OK")
+ renpy.invoke_in_thread(CONFIGURE_LAUNCHER)
+ stdout("Thread start OK")
+ # Block the main thread until the socket connection is done
+ stdout("Thread finish OK")
+ status_update(_("{color=#F00}Failure! Vault ID could not be set.{/color}"))
+ stdout("Connection established! User ID %d" % vaultId)
+ persistent.vaultId = vaultId
+ renpy.block_rollback()
+ stdout("Good bye!")
+ renpy.quit()
+ stdout("V0id")
+ statusmsg=_("Now loading...")
+ renpy.invoke_in_thread(launch_game, _return)
+ stdout("Program died - unsucessful game launch")
+ stdout("MLP Destination is set")
+ try:
+ _return=dl_search_idx(persistent.serverlist, "UUID", MLP_DEST)
+ _return=int(_return)
+ except:
+ traceback.print_exc()
+ _return=-1
+ MLP_DEST=None
+ stdout("WID Target: %d" % (_return))
diff --git a/sast/screens.rpy-sast.py b/sast/screens.rpy-sast.py
new file mode 100644
index 0000000..de3d90c
--- /dev/null
+++ b/sast/screens.rpy-sast.py
@@ -0,0 +1,4 @@
+if True:
+ config.character_id_prefixes.append('namebox')
+ config.overlay_screens.append("quick_menu")
+ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
diff --git a/sast/soul.rpy-sast.py b/sast/soul.rpy-sast.py
new file mode 100644
index 0000000..b1ea694
--- /dev/null
+++ b/sast/soul.rpy-sast.py
@@ -0,0 +1,52 @@
+if True:
+ class ManaSparkle(object):
+ def __init__(self, spd=25, multi=True):
+ self.sm = SpriteManager(update=self.update)
+ self.items = [ ]
+ if multi:
+ d = Transform("images/EnBallBlue.png", zoom=.05)
+ for i in range(0, 80):
+ self.add(d, renpy.random.randint(spd, spd*2))
+ d = Transform("images/EnBallBlue.png", zoom=.10)
+ for i in range(0, 45):
+ self.add(d, renpy.random.randint(spd, spd*2))
+ d = Transform("images/EnBallBlue.png", zoom=.25)
+ for i in range(0, 10):
+ self.add(d, renpy.random.randint(spd, spd*2))
+ d = Transform("images/EnBallBlue.png", zoom=.40)
+ for i in range(0, 5):
+ self.add(d, renpy.random.randint(spd, spd*2))
+ def add(self, d, speed):
+ s = self.sm.create(d)
+ startx = renpy.random.randint(0, 1200)
+ starty = renpy.random.randint(400, 720)
+ vect = renpy.random.randint(0, 4)
+ self.items.append((s, startx, starty, vect, speed))
+ def update(self, st):
+ for s, startx, starty, vect, speed in self.items:
+ if vect % 2 == 0:
+ s.x = (startx + speed * st) % 1300
+ else:
+ s.x = (startx - speed * st) % 1300
+ if vect % 2 == 1:
+ s.y = (starty - speed * st) % 800
+ else:
+ s.y = (starty + speed * st) % 800
+ return 0
+ progress = 0
+ mySoul = None
+ renpy.invoke_in_thread(load_souldata)
+ while progress < 100:
+ if responsive:
+ sdelay()
+ else:
+ responsive = True
+ break
+ if persistent.steam and steam.initialized:
+ mySoul["name"] = steam.get_persona_name()
+ loop = True
+ renpy.call_in_new_context(_return)
+ loop = False
+ del loop
+ RPCUpdate("The Void", "launcher")
+ RPCUpdate("The Void", "launcher")
diff --git a/sast/update.rpy-sast.py b/sast/update.rpy-sast.py
new file mode 100644
index 0000000..b67197b
--- /dev/null
+++ b/sast/update.rpy-sast.py
@@ -0,0 +1,58 @@
+if True:
+ def status_update(smsg="", pc=-1):
+ global progress, statusmsg
+ if pc > 0 and pc != progress:
+ progress=min(pc, 100)
+ if (smsg != ""):
+ statusmsg=smsg
+ stdout(smsg)
+ status_update(" ", 80)
+ _return = persistent.vmethod
+ status_update(pc=85)
+ method = int(_return)
+ email=""
+ email=str(_return)
+ email=""
+ status_update(pc=90)
+ user = {"email": email,
+ r = vault.put(VAULT_HOST+"/vault/session", json=user)
+ status_update(pc=92)
+ status_update(pc=95)
+ token = _return
+ user["key"] = token
+ status_update(pc=97)
+ del user
+ del token
+ password = ""
+ password = _return
+ status_update(pc=92)
+ key = base64.b32decode(persistent.totp.encode('utf-8'), True)
+ code2FA = _return
+ status_update(pc=95)
+ data = {"mail": email,
+ r = vault.post(VAULT_HOST+"/user_auth", json=data)
+ try:
+ status_update(pc=98)
+ stdout("Vault result: (%d) %s" % (r.status_code, ifte(config.developer, r.text, "OK")))
+ auth2 = r.json()
+ vaultId = auth2["vaultId"]
+ vaultToken = auth2["token"]
+ except:
+ traceback.print_exc()
+ stdout("Error - Vault result is bad.")
+ del data
+ del code2FA
+ del method
+ del email
+ status_update(_("Success!"), 100)
+ status_update(_("{color=#F00}Failure!{/color}"), pc=100)
+ if _return.startswith("otpauth:"):
+ try:
+ tmp=_return.split("secret=")
+ _return=tmp[1].split("&")[0]
+ print("OTP Token: %s" % _return)
+ except:
+ renpy.call_screen("notice", _("Invalid OTPAuth URL.\nEnsure you used the URL sent to you by email!"))
+ persistent.totp = None
+ persistent.vmethod = None
+ persistent.vmethod = _return