Skip to content

Commit

Permalink
Use updated Victory enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Feb 1, 2025
1 parent a51df6f commit 630dfc6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- cron: '0 0 * * *'

env:
FAF_DB_VERSION: v133
FAF_DB_VERSION: v136
FLYWAY_VERSION: 7.5.4

jobs:
Expand Down
9 changes: 5 additions & 4 deletions server/db/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

@unique
class Victory(Enum):
DEMORALIZATION = 0
DOMINATION = 1
ERADICATION = 2
SANDBOX = 3
DEMORALIZATION = "DEMORALIZATION"
DOMINATION = "DOMINATION"
ERADICATION = "ERADICATION"
SANDBOX = "SANDBOX"
DECAPITATION = "DECAPITATION"


@unique
Expand Down
2 changes: 1 addition & 1 deletion server/games/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ async def update_game_stats(self):
# In some cases, games can be invalidated while running: we check for
# those cases when the game ends and update this record as appropriate.

game_type = str(self.game_options.get("Victory").value)
game_type = self.game_options.get("Victory").name

async with self._db.acquire() as conn:
await conn.execute(
Expand Down
42 changes: 21 additions & 21 deletions tests/data/test-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -197,28 +197,28 @@ insert into game_featuredMods (id, gamemod, name, description, publish, git_url,
(25, 'coop', 'Coop', 'Multiplayer campaign games', 1, 'https://github.com/FAForever/fa-coop.git', 'master', 'cop', TRUE);

insert into game_stats (id, startTime, gameName, gameType, gameMod, host, mapId, validity) values
(1, NOW(), 'Test game', '0', 6, 1, 1, 0),
(1, NOW(), 'Test game', 'DEMORALIZATION', 6, 1, 1, 0),
(41935, NOW(), 'MapRepetition', '0', 6, 1, NULL, 0),
(41936, NOW() + interval 1 minute, 'MapRepetition', '0', 6, 1, 1, 0),
(41937, NOW() + interval 2 minute, 'MapRepetition', '0', 6, 1, 2, 0),
(41938, NOW() + interval 3 minute, 'MapRepetition', '0', 6, 1, 3, 0),
(41939, NOW() + interval 4 minute, 'MapRepetition', '0', 6, 1, 4, 0),
(41940, NOW() + interval 5 minute, 'MapRepetition', '0', 6, 1, 5, 0),
(41941, NOW() + interval 6 minute, 'MapRepetition', '0', 6, 1, 6, 0),
(41942, NOW(), 'OldRatingNull', '0', 6, 1, NULL, 0),
(41943, NOW(), 'OldRatingLose', '0', 6, 1, NULL, 0),
(41944, NOW(), 'OldRatingWin', '0', 6, 1, NULL, 0),
(41945, NOW() + interval 7 minute, 'MapRepetition', '0', 6, 2, 6, 0),
(41946, NOW() + interval 8 minute, 'MapRepetition', '0', 6, 2, 5, 0),
(41947, NOW() + interval 9 minute, 'MapRepetition', '0', 6, 2, 4, 0),
(41948, NOW() + interval 10 minute, 'MapRepetition', '0', 6, 2, 3, 0),
(41949, NOW() + interval 1 minute, 'MapRepetition', '0', 6, 1, 7, 0),
(41950, NOW() + interval 2 minute, 'MapRepetition', '0', 6, 1, 8, 0),
(41951, NOW() + interval 3 minute, 'MapRepetition', '0', 6, 1, 9, 0),
(41952, NOW() + interval 4 minute, 'MapRepetition', '0', 6, 1, 7, 0),
(41953, NOW() + interval 1 minute, 'MapRepetition', '0', 6, 2, 5, 0),
(41954, NOW() + interval 2 minute, 'MapRepetition', '0', 6, 2, 6, 0),
(41955, NOW() + interval 3 minute, 'MapRepetition', '0', 6, 2, 7, 0);
(41936, NOW() + interval 1 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 1, 0),
(41937, NOW() + interval 2 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 2, 0),
(41938, NOW() + interval 3 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 3, 0),
(41939, NOW() + interval 4 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 4, 0),
(41940, NOW() + interval 5 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 5, 0),
(41941, NOW() + interval 6 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 6, 0),
(41942, NOW(), 'OldRatingNull', 'DEMORALIZATION', 6, 1, NULL, 0),
(41943, NOW(), 'OldRatingLose', 'DEMORALIZATION', 6, 1, NULL, 0),
(41944, NOW(), 'OldRatingWin', 'DEMORALIZATION', 6, 1, NULL, 0),
(41945, NOW() + interval 7 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 6, 0),
(41946, NOW() + interval 8 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 5, 0),
(41947, NOW() + interval 9 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 4, 0),
(41948, NOW() + interval 10 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 3, 0),
(41949, NOW() + interval 1 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 7, 0),
(41950, NOW() + interval 2 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 8, 0),
(41951, NOW() + interval 3 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 9, 0),
(41952, NOW() + interval 4 minute, 'MapRepetition', 'DEMORALIZATION', 6, 1, 7, 0),
(41953, NOW() + interval 1 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 5, 0),
(41954, NOW() + interval 2 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 6, 0),
(41955, NOW() + interval 3 minute, 'MapRepetition', 'DEMORALIZATION', 6, 2, 7, 0);

insert into game_player_stats (gameId, playerId, AI, faction, color, team, place, mean, deviation, scoreTime) values
(1, 1, 0, 0, 0, 2, 0, 1500, 500, NOW()),
Expand Down

0 comments on commit 630dfc6

Please sign in to comment.