Skip to content

Commit

Permalink
add game name to list
Browse files Browse the repository at this point in the history
  • Loading branch information
bondiano committed Oct 29, 2023
1 parent e6aec95 commit bde7564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/ligretto_bot_clj/bot/bot.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
(let [update-timeout> (timeout update-game-timeout)
[event ch] (alts! [(:events> ctx)
update-timeout>])]
(tap> {:event event :message "handle-updates"})
(if (= ch update-timeout>)
(do
(log/errorf "[%s] Update game timeout" (:bot-id ctx))
Expand Down Expand Up @@ -114,7 +113,6 @@
(go-loop []
(<! (turn-timeout ctx))
(let [turn (strat/make-turn ctx)]
(tap> {:turn turn :message "game-loop!!!"})
(when turn
(emit-action! (:socket ctx) turn))
(log/debug (format "[%s] Turn: %s" bot-id turn)))
Expand All @@ -140,7 +138,6 @@
(throw (ex-info "Game start timeout" {:room-id room-id :bot-id bot-id})))

(log/infof "[%s] Game started: %s" bot-id room-id)
(tap> {:message "game-started" :data stated-game-event :ctx ctx})
(reset! game-state (:payload stated-game-event))
(reset! (:status ctx) :in-game)

Expand Down Expand Up @@ -179,7 +176,6 @@
(log/infof "[%s] Connected to room %s" bot-id room-id)
(reset! (:status ctx) :connected)
(reset! (:game-state ctx) (extract-game connected-data))
(tap> {:message "connected" :data connected-data :ctx ctx})
(process-game ctx))
timeout> (do
(log/errorf "[%s] Failed to connect to room %s" bot-id room-id)
Expand Down
5 changes: 3 additions & 2 deletions src/ligretto_bot_clj/web/views/home.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@
{:id "bots-list"}
(for [game games]
(let [bots (get bots (:game-id game))
game-id (some-> game :game-id name)]
game-id (some-> game :game-id name)
game-name (some-> game :game-state :name)]
(when (not (nil? game-id))
[:div.flex.flex-col.pt-2
[:h3.text-xl.font-bold.mb-4 (str "Game " game-id)]
[:h3.text-xl.font-bold.mb-4 (str "Game " game-name " (" game-id ")")]
[:div.grid.grid-cols-3.gap-4
(for [bot bots]
(BotCard game-id bot))]])))]))
Expand Down

0 comments on commit bde7564

Please sign in to comment.