Skip to content

Commit f34841e

Browse files
committed
Fix bug in websocket implementation
1 parent 7d4cd37 commit f34841e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/murepl/events.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
(defn disconnect [uuid]
2525
"Unsubscribe player identified by uuid from the events framework."
26-
(let [player (core/find-player-by-uuid uuid)
27-
observers (core/others-in-room player (core/lookup-location player))]
26+
(let [player (core/find-player-by-uuid uuid)
27+
observers (core/logout-player player)]
2828
(core/modify-player! (dissoc player :send-function))
2929
(notify-players observers (format "%s fades slowly away." (:name player)))))

src/murepl/net/websocket.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(println "Websocket connected: " con))
1313

1414
(defn close [con]
15-
(let [uuid (get clients con)]
15+
(let [uuid (get @clients con)]
1616
(events/disconnect uuid))
1717
(swap! clients dissoc con)
1818
(println "Websocket disconnected: " con))

0 commit comments

Comments
 (0)