Commit 2396832c authored by mercury233's avatar mercury233

update

parent 54f06e4d
...@@ -144,25 +144,6 @@ get_memory_usage = ()-> ...@@ -144,25 +144,6 @@ get_memory_usage = ()->
percentUsed = 0 percentUsed = 0
return percentUsed return percentUsed
# 定时清理关闭的连接
# the server write data directly to the socket object
# so this is a dumb way to clean data
Graveyard = []
tribute = (socket) ->
setTimeout ((socket)-> Graveyard.push(socket);return), 3000, socket
return
setInterval ()->
for fuck,i in Graveyard
Graveyard[i].destroy() if Graveyard[i]
for you,j in Graveyard[i]
Graveyard[i][j] = null
Graveyard[i] = null
Graveyard = []
return
, 3000
Cloud_replay_ids = [] Cloud_replay_ids = []
ROOM_all = [] ROOM_all = []
...@@ -608,7 +589,6 @@ net.createServer (client) -> ...@@ -608,7 +589,6 @@ net.createServer (client) ->
connect_count-- connect_count--
ROOM_connected_ip[client.ip] = connect_count ROOM_connected_ip[client.ip] = connect_count
#log.info "disconnect", client.ip, ROOM_connected_ip[client.ip] #log.info "disconnect", client.ip, ROOM_connected_ip[client.ip]
#tribute(client)
unless client.closed unless client.closed
client.closed = true client.closed = true
room.disconnect(client) if room room.disconnect(client) if room
...@@ -623,7 +603,6 @@ net.createServer (client) -> ...@@ -623,7 +603,6 @@ net.createServer (client) ->
connect_count-- connect_count--
ROOM_connected_ip[client.ip] = connect_count ROOM_connected_ip[client.ip] = connect_count
#log.info "err disconnect", client.ip, ROOM_connected_ip[client.ip] #log.info "err disconnect", client.ip, ROOM_connected_ip[client.ip]
#tribute(client)
unless client.closed unless client.closed
client.closed = error client.closed = error
room.disconnect(client, error) if room room.disconnect(client, error) if room
...@@ -638,7 +617,6 @@ net.createServer (client) -> ...@@ -638,7 +617,6 @@ net.createServer (client) ->
#log.info "server closed", client.name, had_error #log.info "server closed", client.name, had_error
room=ROOM_all[client.rid] room=ROOM_all[client.rid]
#log.info "server close", client.ip, ROOM_connected_ip[client.ip] #log.info "server close", client.ip, ROOM_connected_ip[client.ip]
#tribute(server)
room.disconnector = 'server' if room room.disconnector = 'server' if room
server.closed = true unless server.closed server.closed = true unless server.closed
unless client.closed unless client.closed
...@@ -650,7 +628,6 @@ net.createServer (client) -> ...@@ -650,7 +628,6 @@ net.createServer (client) ->
#log.info "server error", client.name, error #log.info "server error", client.name, error
room=ROOM_all[client.rid] room=ROOM_all[client.rid]
#log.info "server err close", client.ip, ROOM_connected_ip[client.ip] #log.info "server err close", client.ip, ROOM_connected_ip[client.ip]
#tribute(server)
room.disconnector = 'server' if room room.disconnector = 'server' if room
server.closed = error server.closed = error
unless client.closed unless client.closed
...@@ -1370,8 +1347,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)-> ...@@ -1370,8 +1347,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
else else
if response.statusCode != 200 if response.statusCode != 200
log.warn 'DECK POST FAIL', response.statusCode, client.name, body log.warn 'DECK POST FAIL', response.statusCode, client.name, body
else #else
log.info 'DECK POST OK', response.statusCode, client.name, body #log.info 'DECK POST OK', response.statusCode, client.name, body
return return
client.deck_saved = true client.deck_saved = true
return return
......
This diff is collapsed.
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