From a878b43f3c44a4b604c291688b7d108e790370c6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 18 Aug 2021 00:41:47 -0300 Subject: Version 2.1.8.18 Detect outdated client/server and report --- game/01_init.rpy | 1 + game/02_init.rpy | 6 +++--- game/options.rpy | 2 +- game/script.rpy | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/game/01_init.rpy b/game/01_init.rpy index 20a2d4c..7015bc5 100644 --- a/game/01_init.rpy +++ b/game/01_init.rpy @@ -71,6 +71,7 @@ init -3 python: ERR_INVFULL=106 ERR_SUMMON=108 ERR_OK=200 + ERR_OUTDATED=401 # All error code library ERRNO=[FAILUREMSG, OFFLINEMSG, OKMSG, ERR_LOGIN_DEFAULT, ERR_INVALID, ERR_TIMEOUT, ERR_NOGEMS, ERR_INVFULL, ERR_OK] diff --git a/game/02_init.rpy b/game/02_init.rpy index 3791413..9ee3749 100644 --- a/game/02_init.rpy +++ b/game/02_init.rpy @@ -55,10 +55,8 @@ init -1 python: if raw in ERRNO: return raw - try: + if (type(raw) is int): return int(raw) - except: - pass # Maybe base 64 try: @@ -104,6 +102,8 @@ init -1 python: return ERR_JSONDECODER if (Player == ERR_LOGIN_DEFAULT): return ERR_LOGIN_DEFAULT + if (Player == ERR_OUTDATED): + return ERR_OUTDATED try: Player["inv"]=dlist() diff --git a/game/options.rpy b/game/options.rpy index 2d7ef01..ebc2048 100644 --- a/game/options.rpy +++ b/game/options.rpy @@ -17,7 +17,7 @@ init -2 python: ## The version of the game. - config.version = "2.1.8.8" + config.version = "2.1.8.18" ## Determines if the title given above is shown on the main menu screen. Set diff --git a/game/script.rpy b/game/script.rpy index 619d532..5f548c5 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -70,6 +70,9 @@ label login: if (message == ERR_LOGIN_DEFAULT): e "Error Code: [message]{fast}\n\nCould not estabilish connection to server." jump login + elif (message == ERR_OUTDATED): + e "A new update is available!\n\nPlease download it from app store or at {a=https://spheres.tmw2.org/download}spheres.tmw2.org{/a}." + jump quit else: e "Error Code: [message]{fast}\n\nCannot login to server. Terminating." jump quit -- cgit v1.2.3-60-g2f50