Skip to content

Commit f1e8411

Browse files
committed
Add visualization for password protected games
1 parent 8d10d7a commit f1e8411

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

agot-bg-game-server/src/common/EntireGame.ts

+2
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ export default class EntireGame extends GameState<null, LobbyGameState | IngameG
620620
const oldPlayerIds = this.entireGame.ingameGameState?.oldPlayerIds ?? [];
621621
const timeoutPlayerIds = this.entireGame.ingameGameState?.timeoutPlayerIds ?? [];
622622
const replacerIds = this.entireGame.ingameGameState?.replacerIds ?? [];
623+
const isPasswordProtected = this.entireGame.lobbyGameState?.password ? this.entireGame.lobbyGameState.password.length > 0 : false;
623624

624625
return {
625626
turn,
@@ -632,6 +633,7 @@ export default class EntireGame extends GameState<null, LobbyGameState | IngameG
632633
oldPlayerIds,
633634
timeoutPlayerIds,
634635
replacerIds,
636+
isPasswordProtected,
635637
publicChatRoomId: this.publicChatRoomId
636638
};
637639
}

agot-bg-website/agotboardgame_main/templates/agotboardgame_main/components/games_table.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
>
5454
<td class="text-center">
5555
{% if game.state == "IN_LOBBY" %}
56-
<span class="badge badge-success">Open</span>
56+
{% if game.view_of_game.isPasswordProtected %}
57+
<span class="badge badge-danger"><i class="fas fa-lock"></i></span>
58+
{% else %}
59+
<span class="badge badge-success">Open</span>
60+
{% endif %}
5761
{% elif game.state == "ONGOING" %}
5862
<span class="badge badge-warning">Ongoing</span>
5963
{% endif %}

0 commit comments

Comments
 (0)