diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-17 15:28:19 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-17 15:28:19 -0300 |
commit | 0f8983e7e6920ee210772664d2330a0943332fb2 (patch) | |
tree | c24174c2d5872d638406e2ce27a05626cfe7af9c /game/script.rpy | |
parent | 7fcbe894d220e4e02ded4f7d8706cae6798211cc (diff) | |
download | client-0f8983e7e6920ee210772664d2330a0943332fb2.tar.gz client-0f8983e7e6920ee210772664d2330a0943332fb2.tar.bz2 client-0f8983e7e6920ee210772664d2330a0943332fb2.tar.xz client-0f8983e7e6920ee210772664d2330a0943332fb2.zip |
Move registration utils to "register.rpy"
This includes both registering an email as registering a password (aka. new login)
Diffstat (limited to 'game/script.rpy')
-rw-r--r-- | game/script.rpy | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/game/script.rpy b/game/script.rpy index fede461..da20c6f 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -83,56 +83,6 @@ label start: jump login ############################################################################ -# Registration procedures -# You don't have an account yet -label register_email: - python: - import re - regex = '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$' - email = "" - # Ask player for their email - while email == "": - email=renpy.call_screen("input_box", "Welcome to %s!\nPlease insert your email to register an account: \n{size=24}Your account password will be emailed to you. This is the only way to recover a lost account. You can use an {a=https://www.tempmailaddress.com/}Temporary email{/a} if you wish.{/size}" % (config.name)) - if not re.search(regex, email): - email="" - renpy.call_screen("msgbox", - "The email you've entered is not valid.") - - # You've inserted a valid email - raw=send_packet("register", """{"email": "%s"}""" % email) - bt=json_decode(raw) - - try: - password=bt["password"] - valid=True - except: - # Either a SQL error, or a server error, or a connection error... - # But either way, we can't proceed! - renpy.call_screen("msgbox", "An error happened, maybe this email is already registered.\nPlease try again later.") - valid=False - - # An error happened, return to login screen - if not valid: - jump start - - # Save data - $ persistent.password=password - jump login - -# Registration procedures -# You already have an account and want to recover it -label register_password: - python: - password="" - while password == "": - password=renpy.call_screen("input_box", - "Welcome to %s!\nPlease insert your password: " % (config.name)) - if not password.isalnum(): - renpy.call_screen("msgbox", - "The password you've entered is not valid.") - password="" - jump login - # Login procedures label login: $message=login() @@ -204,6 +154,8 @@ label login: $stdout("This server doesn't have a MOTD") # TODO: Daily login rewards screen + jump loop + label loop: # Delete predictions, if possible $ renpy.free_memory() |