def add_lose_e(account): try: result, e = db().add_lose_and_update_score_e(account) except: result = -1 e = "Unknown error" return {"result": result, "exception": e}
def sign_up(account, password, name): try: result, e = db().add_new_user(account, password, name) except: result = -1 e = "Unknown error" return {"result": result, "account": account, "name": name, "exception": e}
def determine_rival(account, rival): rival_list = [] if '/' in rival: rival_list= rival.split('/') else: rival_list.append(rival) result, e = db().determine_rival(account, rival_list) return {"rival": result, "exception": e}
def get_score(account): result = db().get_score(account) return result
def get_login(account): result, e = db().get_password(account) return {"password": result, "exception": e}