6f3d772
Branches > main > 6f3d772 > files / src / net
Don't blindly recur over packet handling results
Commit: 6f3d772269e21debb532d0dac4b470ec36f1d8f7
Parent: b254107
1 changed file:
src/net/bowmap/network/server.clj view file
@@ -17,17 +17,16 @@ clientbound-packets (req! client ::client/clientbound-packets) serverbound-frames (req! connection ::connection/serverbound-frames)] (loop [client client]- (recur- (alt!!- serverbound-frames ([frame]- (if (some? frame)- (handle/handle!! client (decode-packet! frame (::state/connection-state client)))- (throw (EOFException. "Reached end of client socket"))))- clientbound-packets ([pk]- (if (some? pk)- (do (send-packet!! client pk)- client)- (throw (Exception. "Clientbound packets was closed idk why"))))))))+ (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"))))+ 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