8c25299

Branches > main > 8c25299 > files / src / net / bowmap / server

Don't throw exception in client handling

Grahp, 2026-08-21

Commit: 8c25299a65ccaecd7e37c370eea6146f44e9e4c7
Parent: 6f3d772

1 changed file:

src/net/bowmap/network/server.clj modified (view file)

@@ -6,9 +6,7 @@    [net.bowmap.network.handle :as handle]    [net.bowmap.network.minecraft-server :as mc]    [net.bowmap.network.packets.serverbound :refer [decode-packet!]]-   [net.bowmap.network.state :as state])-  (:import-   [java.io EOFException]))+   [net.bowmap.network.state :as state]))  (defn handle-connection [connection]   (io-thread@@ -19,15 +17,13 @@         (loop [client client]           (alt!!             serverbound-frames ([frame]-                                (if (some? frame)-                                  (recur (handle/handle!! client (decode-packet! frame (::state/connection-state client))))-                                  (throw (EOFException. "Reached end of client socket"))))+                                (when (some? frame)+                                  (recur (handle/handle!! client (decode-packet! frame (::state/connection-state client))))))             clientbound-packets ([pk]                                  (if (some? pk)                                    (do (send-packet!! client pk)                                        (recur client))                                    (throw (Exception. "Clientbound packets was closed idk why")))))))-      (catch EOFException _)       (finally         ; TODO Send player disconnected fact, and update the player list from that         (connection/close! connection)))))