summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/core.rpy3
-rw-r--r--game/options.rpy5
-rw-r--r--game/renpy.rpy2
-rw-r--r--game/update.rpy24
4 files changed, 31 insertions, 3 deletions
diff --git a/game/core.rpy b/game/core.rpy
index 441ad39..292c664 100644
--- a/game/core.rpy
+++ b/game/core.rpy
@@ -9,6 +9,7 @@ init -3 python:
renpy.add_python_directory("python-extra")
import requests, zlib, base64, sys, copy, uuid, time, json, traceback
import os.path
+ import _renpysteam as steam
print("\n[STDBY] Loading Basic functions.......")
@@ -114,6 +115,6 @@ label die:
default statusmsg = "Not yet initialized"
default progress = 0
default responsive = True
-
+default has_steam = False
diff --git a/game/options.rpy b/game/options.rpy
index 68609a6..cee107a 100644
--- a/game/options.rpy
+++ b/game/options.rpy
@@ -232,3 +232,8 @@ init python:
## by a slash.
# define build.itch_project = "renpytom/test-project"
+
+## Steam Application ID which is used for optional Steam integration
+
+define config.steam_appid = 1570940
+
diff --git a/game/renpy.rpy b/game/renpy.rpy
index be00f4e..f827855 100644
--- a/game/renpy.rpy
+++ b/game/renpy.rpy
@@ -55,6 +55,8 @@ label start:
pause 1.5
hide TMW2 with dissolve
centered "Error"
+ #steam.get_account_id()
+ "User ID: [accId]"
return
diff --git a/game/update.rpy b/game/update.rpy
index 0e29fb4..b50af4c 100644
--- a/game/update.rpy
+++ b/game/update.rpy
@@ -79,7 +79,7 @@ init python:
#############################################################################
def CONFIGURE_LAUNCHER():
- global progress, statusmsg, responsive
+ global progress, statusmsg, responsive, accId
statusmsg="Loading user configuration..."
#########################################################################
# If persistent data is not yet set, it must be created
@@ -160,7 +160,27 @@ init python:
# Before starting, we must check for Vault or Steam credentials
# This block is 1~20%
status_update("Verifying credentials...", 80)
- # TODO
+ try:
+ if not steam.init():
+ raise Exception("Steam is not running!")
+ status_update("Attempting Steam authentication...", 81)
+ accId = steam.get_account_id()
+ stdout("Steam login active, user %d" % accId)
+ token = steam.get_session_ticket()
+ auth = {"accId": accId, "token": token}
+ status_update("Waiting for Vault reply...", 85)
+ # Erm.
+ time.sleep(2.0)
+ steam.cancel_ticket()
+ # r.post
+ # Get reply
+ # Receive the Vault Token
+ has_steam = True
+ stdout("Steam session initialized successfully", True)
+ except:
+ traceback.print_exc()
+ accId = 0
+ status_update("Steam login disabled, trying Vault...", 90)
status_update("Complete!", 100)