Exemple #1
0
def insert_result():
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        myprojects = DashboardService.insertBattleResult(connect, request.form['game_type'], session['user'], request.form['counter'],  request.form['result'])
        connect.close()
        return json.dumps(myprojects)
    return 'false'
Exemple #2
0
def myresults():
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        myprojects = DashboardService.getMyResultsSummary(connect, session['user'], request.form['game_type'])
        connect.close()
        return json.dumps(myprojects)
    return 'null'
Exemple #3
0
def gen_chara():
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        result = DashboardService.genTactics(connect, session['user'], request.form['id'])
        connect.close()
        return json.dumps(result)
    return 'false'
Exemple #4
0
def create_chara():
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        myprojects = DashboardService.createCharacter(connect, session['user'], request.form['name'], request.form['game_type'])
        connect.close()
        return json.dumps(myprojects)
    return 'false'
Exemple #5
0
def characters():
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        myprojects = DashboardService.getCharacters(connect, session['user'])
        connect.close()
        return json.dumps(myprojects)
    return 'false'
Exemple #6
0
def tactics_editor(pid):
    if 'user' in session:
        connect = MySQLdb.connect(db=config.DB_NAME, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, passwd=config.DB_PASSWD)
        result = DashboardService.getMyCharacter(connect, session['user'], pid)
        connect.close()
        return render_template('/game/tactics_editor.html', pid=pid, game_type=result['game_type'])
    else:
        return redirect(url_for('login_view'))