attack now button
This commit is contained in:
@@ -543,3 +543,23 @@ def bot_logs():
|
||||
conn.close()
|
||||
return jsonify({'ok': True})
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# POST /dashboard/bootcamp-attack-now
|
||||
# Sets a one-shot flag consumed by the TM bot on the next poll.
|
||||
# ------------------------------------------------------------------
|
||||
@dashboard.route('/dashboard/bootcamp-attack-now', methods=['POST'])
|
||||
def bootcamp_attack_now():
|
||||
player_id = (request.json or {}).get('player_id')
|
||||
if not player_id:
|
||||
return jsonify({'error': 'missing player_id'}), 400
|
||||
key = f'bootcamp_attack_now_{player_id}'
|
||||
conn = get_db()
|
||||
conn.execute('''
|
||||
INSERT INTO kv_store (key, value, updated_at) VALUES (?, '1', ?)
|
||||
ON CONFLICT(key) DO UPDATE SET value='1', updated_at=excluded.updated_at
|
||||
''', (key, datetime.utcnow().isoformat()))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return jsonify({'ok': True})
|
||||
|
||||
Reference in New Issue
Block a user