add start_game

This commit is contained in:
ada-dmitry
2023-08-22 17:14:34 +03:00
parent 91e3a97179
commit 5cc1433ab4
+8 -9
View File
@@ -24,7 +24,7 @@ def action(): # put application's code here
if killedUserID != healedUserID: if killedUserID != healedUserID:
cur.execute(f"Select UserID from chats join userschats uc on uc.chatid = chats.chatid join " cur.execute(f"Select UserID from chats join userschats uc on uc.chatid = chats.chatid join "
f"users on users.userid = uc.userid where truechatid = '{trueChatID}' and TrueUserID = '{killedUserID}'") f"users on users.userid = uc.userid where truechatid = '{trueChatID}' and TrueUserID = '{killedUserID}'")
id = cur.fetchall()[0] id = cur.fetchall()[0]
cur.execute(f"UPDATE Users SET isAlive = false WHERE UserID = '{id}'") cur.execute(f"UPDATE Users SET isAlive = false WHERE UserID = '{id}'")
response["killedUserId"] = killedUserID response["killedUserId"] = killedUserID
@@ -48,15 +48,14 @@ def create():
db.close(cursor) db.close(cursor)
@app.route('/start_game') @app.route('/start_game', methods = ["POST"])
def start(): # Команда принимает на вход def start(): # Команда принимает на вход
pass TCI = request.json['chatID']
userlist = request.json['usderIDs']
cursor = db.connection.cursor()
@app.route('/action') for id in userlist:
def action(): db.query_ins_user(id, curs)
pass db.close()
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run()