We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3476ee6 commit 19d5cb5Copy full SHA for 19d5cb5
colyseus/connection.lua
@@ -48,6 +48,11 @@ function connection:send(data)
48
end
49
50
function connection:open()
51
+ -- skip if connection is already open
52
+ if self.state == 'OPEN' then
53
+ return
54
+ end
55
+
56
self.ws = websocket_async()
57
58
self.ws:on_connected(function(ok, err)
colyseus/room.lua
@@ -108,7 +108,7 @@ end
108
109
function Room:leave()
110
if (self.connection) then
111
- self.connection:close()
+ self.connection:send({ protocol.LEAVE_ROOM })
112
113
else
114
self:emit("leave")
0 commit comments