incognitolm commited on
Commit
e0a05cd
·
verified ·
1 Parent(s): 0c6b470

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -36,7 +36,8 @@ async def create_game(request: Request):
36
  "currentAction": None,
37
  "currentChallenge": None,
38
  "pendingCardLoss": None,
39
- "votes": []
 
40
  }
41
 
42
  return {"success": True, "message": "Game created successfully!"}
@@ -135,6 +136,10 @@ async def handle_action(request: Request):
135
  else:
136
  return {"success": False, "message": f"Card {target} not found in {challenger['name']}'s hand."}
137
 
 
 
 
 
138
  return {"success": True, "message": f"Action '{action}' processed for player {player}."}
139
 
140
  @app.post("/api/joinGame")
@@ -148,6 +153,7 @@ async def join_game(request: Request):
148
  raise HTTPException(status_code=404, detail="Game not found.")
149
 
150
  game["players"].append(player_name)
 
151
  return {"success": True, "message": "Player joined successfully!"}
152
 
153
  @app.put("/api/startGame")
 
36
  "currentAction": None,
37
  "currentChallenge": None,
38
  "pendingCardLoss": None,
39
+ "votes": [],
40
+ "permissions": [player_name: 1]
41
  }
42
 
43
  return {"success": True, "message": "Game created successfully!"}
 
136
  else:
137
  return {"success": False, "message": f"Card {target} not found in {challenger['name']}'s hand."}
138
 
139
+ if action == 'income':
140
+ player["coins"] += 1
141
+
142
+
143
  return {"success": True, "message": f"Action '{action}' processed for player {player}."}
144
 
145
  @app.post("/api/joinGame")
 
153
  raise HTTPException(status_code=404, detail="Game not found.")
154
 
155
  game["players"].append(player_name)
156
+ game["permissions"].append(player_name: 1)
157
  return {"success": True, "message": "Player joined successfully!"}
158
 
159
  @app.put("/api/startGame")