 
 
 ; Handling Packets -----------------------------------------------------------------
-(defn handle-packet-keepalive [conn]
+(defn read-packet-keepalive [conn]
       (println "OMG got a keepalive")
       nil)
 
-(defn handle-packet-handshake [conn]
+(defn read-packet-handshake [conn]
       (println "OMG got a handshake")
       (-> {}
           (assoc :hash (red-string16 conn))))
 
-(defn handle-packet-login [conn]
+(defn read-packet-login [conn]
       (println "OMG got a login")
       (-> {}
           (assoc :eid (red-int conn))


(defn write-packet [conn packet-type payload]
      (cond
        (= packet-type :keepalive) nil
        (= packet-type :handshake) (write-packet-handshake conn payload)
        (= packet-type :login) (write-packet-login conn payload)
        )



; Writing Packets ------------------------------------------------------------------
(defn write-packet-keepalive [conn _]
      (writ-byte conn (:handshake packet-ids)))

(defn write-packet-handshake [conn {username :username}]
      (writ-byte conn (:handshake packet-ids))

