a587910b3c7d

Disconnect nicely.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 26 Aug 2011 18:12:13 -0400
parents 7aa6da5b1d8b
children d65fe7dddf1f
branches/tags (none)
files src/clojurecraft/core.clj

Changes

--- a/src/clojurecraft/core.clj	Fri Aug 26 18:09:25 2011 -0400
+++ b/src/clojurecraft/core.clj	Fri Aug 26 18:12:13 2011 -0400
@@ -89,7 +89,8 @@
       (let [packet (.poll outqueue 1 TimeUnit/SECONDS)]
         (when packet
           (let [[packet-type, payload] packet]
-            (write-packet bot packet-type payload))))))
+            (write-packet bot packet-type payload)))))
+    (write-packet bot :disconnectkick {:reason "Bye!"}))
   (println "done - output handler")
   (println "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"))