Commit a9ef1947 authored by nanahira's avatar nanahira

fix

parent bff7f5ca
...@@ -20,7 +20,7 @@ init = (http_server, ROOM_all)-> ...@@ -20,7 +20,7 @@ init = (http_server, ROOM_all)->
connection.filter = url.parse(connection.upgradeReq.url, true).query.filter || 'waiting' connection.filter = url.parse(connection.upgradeReq.url, true).query.filter || 'waiting'
connection.send JSON.stringify connection.send JSON.stringify
event: 'init' event: 'init'
data: room_data(room) for room in ROOM_all when room and room.established and (connection.filter == 'started' or !room.private) and ((room.stage != 0) == (connection.filter == 'started')) data: room_data(room) for room in ROOM_all when room and room.established and (connection.filter == 'started' or !room.private) and ((room.duel_stage != 0) == (connection.filter == 'started'))
create = (room)-> create = (room)->
broadcast('create', room_data(room), 'waiting') if !room.private broadcast('create', room_data(room), 'waiting') if !room.private
...@@ -33,7 +33,7 @@ start = (room)-> ...@@ -33,7 +33,7 @@ start = (room)->
broadcast('create', room_data(room), 'started') broadcast('create', room_data(room), 'started')
_delete = (room)-> _delete = (room)->
if(room.stage != 0) if(room.duel_stage != 0)
broadcast('delete', room.name, 'started') broadcast('delete', room.name, 'started')
else else
broadcast('delete', room.name, 'waiting') if !room.private broadcast('delete', room.name, 'waiting') if !room.private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment