Battle (FA game) begins

Submitted by Brutus5000 on Sat, 07/23/2016 - 23:35
Goal
  • Set battle status to 'Running'
  • Start the FA game
Input data
  • <battle id>
Preconditions

Battle initiated, all slots filled

SELECT battles.status, map.total_slots FROM battles
LEFT JOIN map_pool AS map ON battles.fk_map = map.id
WHERE battles.id = <battle id>

IF battles.status = 'I' THEN

ASSERT THAT -> SELECT COUNT(*) FROM battle_participants WHERE fk_battle = <battle id> <- EQUALS map.total_slots

Database transaction

UPDATE battles SET status = 'R', started_at = NOW()

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.