   {:keep-alive keep-alive
    :handshake (handshake datomic)
    :join-game (join-game datomic)
+   :leave-game (leave-game datomic)
    :authenticate-user (authenticate-user datomic)
    :chat-message (chat-message datomic)})
 


  ;; Print connections
  (clojure.pprint/pprint @connections)

  ;; Remove all closed connections
  (clean-connections 0)

             assoc-in
             [game-id :players chan-id]
             (assoc socket-user :color (:player/color player))))))

(defn- leave-game
  [_]
  (fn [{:keys [chan-id] :as socket-user}
      {:keys [game-id]}]
    (remove-chan-form-room game-id chan-id)))

(defn- broadcast-game-message
  [game-id formatted-message]
