 
 
 (defn load-backup []
-  (if-let [has-backup (.exists (java.io.File. "world-data"))]
+  (println "loading from" (.getAbsolutePath (File. "world-data")) ":" (.exists (File. "world-data")))
+  (if (.exists (File. "world-data"))
     (let [backup (slurp "world-data")]
       (if (not= backup "")
         (read-string backup)

  (when game
    (case game
      "all" (ws/ws-generate-response @world-atom)
      "archive" (ws/ws-generate-response (vec (for [f (.listFiles (java.io.File. (str "games/")))] (.getName f))))
      "none" nil
      (if (nil? (get @world-atom game))
        (when (.exists (java.io.File. (str "games/" game ".game")))
          (ws/ws-generate-response {game (read-string (slurp (str "games/" game ".game")))}))
        (ws/ws-generate-response {game (get @world-atom game)})))))


(ns dartbot.core
  (:import [java.net InetAddress]
           [java.io File])
  (:require [dartbot.ws :as ws]
            [dartbot.udp :as udp]
            [dartbot.http :as http]
