Jofthomas commited on
Commit
a06953b
·
verified ·
1 Parent(s): 47ad9a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -20,7 +20,7 @@ mcp = FastMCP(
20
  port=7860,
21
  )
22
 
23
- # --- Global state for current user session ---
24
  current_session = {
25
  'username': None,
26
  'active_battle_id': None
@@ -39,11 +39,11 @@ def battle_player(opponent_username: str, username: str = "MCPTrainer") -> dict:
39
  """
40
  global current_session
41
  try:
42
- # Send battle challenge (fire-and-forget)
43
  challenge_result = start_battle_against_player(username, opponent_username)
44
 
45
  current_session['username'] = username
46
- # Don't set active_battle_id yet since battle hasn't started
47
 
48
  return {
49
  "status": "challenge_queued",
@@ -158,7 +158,6 @@ def get_current_battle_state(battle_id: str = None) -> dict:
158
  "message": "No active battle. Start a battle first."
159
  }
160
 
161
- # Get battle state
162
  battle_info = get_battle_state(target_battle_id)
163
 
164
  return {
@@ -212,7 +211,6 @@ async def download_replay(battle_id: str = None) -> dict:
212
  "message": "No battle ID provided. Specify a battle_id or start a battle first."
213
  }
214
 
215
- # Download replay
216
  replay_path = await download_battle_replay(target_battle_id)
217
 
218
  return {
 
20
  port=7860,
21
  )
22
 
23
+
24
  current_session = {
25
  'username': None,
26
  'active_battle_id': None
 
39
  """
40
  global current_session
41
  try:
42
+
43
  challenge_result = start_battle_against_player(username, opponent_username)
44
 
45
  current_session['username'] = username
46
+
47
 
48
  return {
49
  "status": "challenge_queued",
 
158
  "message": "No active battle. Start a battle first."
159
  }
160
 
 
161
  battle_info = get_battle_state(target_battle_id)
162
 
163
  return {
 
211
  "message": "No battle ID provided. Specify a battle_id or start a battle first."
212
  }
213
 
 
214
  replay_path = await download_battle_replay(target_battle_id)
215
 
216
  return {