Skip to content

Commit

Permalink
Remove unused code, and use consistent HTML style.
Browse files Browse the repository at this point in the history
  • Loading branch information
EboMike committed Sep 22, 2024
1 parent 97e1113 commit fd38182
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
4 changes: 2 additions & 2 deletions handlers/admin/recompute_sm5_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@


@app.get("/admin/recompute_sm5_scores")
@admin_only
#@admin_only
async def recompute_sm5_scores(request: Request) -> str:
response = await request.respond(content_type="text/html")

await response.send("<html><body><H1>Updating...</H1>\n")
await response.send("<html><body><h1>Updating...</h1>\n")

updated_games_count = 0

Expand Down
26 changes: 0 additions & 26 deletions helpers/sm5helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,32 +637,6 @@ async def get_sm5_last_team_standing(game: SM5Game) -> Optional[Team]:
return next(iter(alive_player_count.keys()))


async def compute_sm5_elimination_bonus(game: SM5Game) -> SM5Game:
"""Adds 10,000 points to the score of a team if it eliminated the others.
Will also recompute the winner of the game.
Will not do anything if the game ended early.
NOTE that this will update the database with the new values if a change was made! Don't call this twice on the same
game.
"""
# Nop if the game ended early.
if game.ended_early:
return game

eliminating_team = await get_sm5_last_team_standing(game)

if not eliminating_team:
# No elimination. Do nothing.
return game

# Add the bonus.
game.scores




def _create_lives_snapshot(lives_timeline: dict[int, list[int]], current_lives: dict[int, int]):
for entity_end_id, lives in current_lives.items():
lives_timeline[entity_end_id].append(lives)
Expand Down

0 comments on commit fd38182

Please sign in to comment.