Skip to content

Commit

Permalink
deploy: 224661c
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Dec 30, 2023
1 parent 8c8ae65 commit bad78c2
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 75 deletions.
93 changes: 48 additions & 45 deletions games/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,19 @@ <h1 class="title">Module <code>server.games.game</code></h1>
]

team_outcomes = [GameOutcome.UNKNOWN for _ in basic_info.teams]
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

if self.validity is ValidityState.VALID:
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
if self.validity is ValidityState.VALID:
await self.mark_invalid(ValidityState.UNKNOWN_RESULT)

try:
Expand Down Expand Up @@ -678,6 +677,8 @@ <h1 class="title">Module <code>server.games.game</code></h1>
await self.mark_invalid(ValidityState.UNEVEN_TEAMS_NOT_RANKED)
return

# TODO: This validity state seems to be impossible to get because it is
# already covered by UNEVEN_TEAMS_NOT_RANKED above.
if len(self.players) &lt; 2:
await self.mark_invalid(ValidityState.SINGLE_PLAYER)
return
Expand Down Expand Up @@ -735,8 +736,8 @@ <h1 class="title">Module <code>server.games.game</code></h1>
assert self.host is not None

async with self._db.acquire() as conn:
# Determine if the map is blacklisted, and invalidate the game for ranking purposes if
# so, and grab the map id at the same time.
# Determine if the map is blacklisted, and invalidate the game for
# ranking purposes if so, and grab the map id at the same time.
result = await conn.execute(
&#34;SELECT id, ranked FROM map_version &#34;
&#34;WHERE lower(filename) = lower(:filename)&#34;,
Expand Down Expand Up @@ -1416,20 +1417,19 @@ <h2 class="section-title" id="header-classes">Classes</h2>
]

team_outcomes = [GameOutcome.UNKNOWN for _ in basic_info.teams]
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

if self.validity is ValidityState.VALID:
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
if self.validity is ValidityState.VALID:
await self.mark_invalid(ValidityState.UNKNOWN_RESULT)

try:
Expand Down Expand Up @@ -1600,6 +1600,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
await self.mark_invalid(ValidityState.UNEVEN_TEAMS_NOT_RANKED)
return

# TODO: This validity state seems to be impossible to get because it is
# already covered by UNEVEN_TEAMS_NOT_RANKED above.
if len(self.players) &lt; 2:
await self.mark_invalid(ValidityState.SINGLE_PLAYER)
return
Expand Down Expand Up @@ -1657,8 +1659,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
assert self.host is not None

async with self._db.acquire() as conn:
# Determine if the map is blacklisted, and invalidate the game for ranking purposes if
# so, and grab the map id at the same time.
# Determine if the map is blacklisted, and invalidate the game for
# ranking purposes if so, and grab the map id at the same time.
result = await conn.execute(
&#34;SELECT id, ranked FROM map_version &#34;
&#34;WHERE lower(filename) = lower(:filename)&#34;,
Expand Down Expand Up @@ -2735,20 +2737,19 @@ <h1 id="params">Params</h1>
]

team_outcomes = [GameOutcome.UNKNOWN for _ in basic_info.teams]
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

if self.validity is ValidityState.VALID:
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
if self.validity is ValidityState.VALID:
await self.mark_invalid(ValidityState.UNKNOWN_RESULT)

try:
Expand Down Expand Up @@ -2987,8 +2988,8 @@ <h1 id="params">Params</h1>
assert self.host is not None

async with self._db.acquire() as conn:
# Determine if the map is blacklisted, and invalidate the game for ranking purposes if
# so, and grab the map id at the same time.
# Determine if the map is blacklisted, and invalidate the game for
# ranking purposes if so, and grab the map id at the same time.
result = await conn.execute(
&#34;SELECT id, ranked FROM map_version &#34;
&#34;WHERE lower(filename) = lower(:filename)&#34;,
Expand Down Expand Up @@ -3054,6 +3055,8 @@ <h1 id="params">Params</h1>
await self.mark_invalid(ValidityState.UNEVEN_TEAMS_NOT_RANKED)
return

# TODO: This validity state seems to be impossible to get because it is
# already covered by UNEVEN_TEAMS_NOT_RANKED above.
if len(self.players) &lt; 2:
await self.mark_invalid(ValidityState.SINGLE_PLAYER)
return
Expand Down
62 changes: 32 additions & 30 deletions games/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -836,20 +836,19 @@ <h3>Class variables</h3>
]

team_outcomes = [GameOutcome.UNKNOWN for _ in basic_info.teams]
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

if self.validity is ValidityState.VALID:
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
if self.validity is ValidityState.VALID:
await self.mark_invalid(ValidityState.UNKNOWN_RESULT)

try:
Expand Down Expand Up @@ -1020,6 +1019,8 @@ <h3>Class variables</h3>
await self.mark_invalid(ValidityState.UNEVEN_TEAMS_NOT_RANKED)
return

# TODO: This validity state seems to be impossible to get because it is
# already covered by UNEVEN_TEAMS_NOT_RANKED above.
if len(self.players) &lt; 2:
await self.mark_invalid(ValidityState.SINGLE_PLAYER)
return
Expand Down Expand Up @@ -1077,8 +1078,8 @@ <h3>Class variables</h3>
assert self.host is not None

async with self._db.acquire() as conn:
# Determine if the map is blacklisted, and invalidate the game for ranking purposes if
# so, and grab the map id at the same time.
# Determine if the map is blacklisted, and invalidate the game for
# ranking purposes if so, and grab the map id at the same time.
result = await conn.execute(
&#34;SELECT id, ranked FROM map_version &#34;
&#34;WHERE lower(filename) = lower(:filename)&#34;,
Expand Down Expand Up @@ -2155,20 +2156,19 @@ <h1 id="params">Params</h1>
]

team_outcomes = [GameOutcome.UNKNOWN for _ in basic_info.teams]
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

if self.validity is ValidityState.VALID:
team_player_partial_outcomes = [
{self.get_player_outcome(player) for player in team}
for team in basic_info.teams
]

try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
try:
# TODO: Remove override once game result messages are reliable
team_outcomes = (
self._outcome_override_hook()
or resolve_game(team_player_partial_outcomes)
)
except GameResolutionError:
if self.validity is ValidityState.VALID:
await self.mark_invalid(ValidityState.UNKNOWN_RESULT)

try:
Expand Down Expand Up @@ -2407,8 +2407,8 @@ <h1 id="params">Params</h1>
assert self.host is not None

async with self._db.acquire() as conn:
# Determine if the map is blacklisted, and invalidate the game for ranking purposes if
# so, and grab the map id at the same time.
# Determine if the map is blacklisted, and invalidate the game for
# ranking purposes if so, and grab the map id at the same time.
result = await conn.execute(
&#34;SELECT id, ranked FROM map_version &#34;
&#34;WHERE lower(filename) = lower(:filename)&#34;,
Expand Down Expand Up @@ -2474,6 +2474,8 @@ <h1 id="params">Params</h1>
await self.mark_invalid(ValidityState.UNEVEN_TEAMS_NOT_RANKED)
return

# TODO: This validity state seems to be impossible to get because it is
# already covered by UNEVEN_TEAMS_NOT_RANKED above.
if len(self.players) &lt; 2:
await self.mark_invalid(ValidityState.SINGLE_PLAYER)
return
Expand Down

0 comments on commit bad78c2

Please sign in to comment.