Commit 51c82027 authored by nanahira's avatar nanahira

no more connect after closed

parent 4727df69
...@@ -1344,6 +1344,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -1344,6 +1344,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
(checksum & 0xFF) == 0 (checksum & 0xFF) == 0
finish = (buffer)-> finish = (buffer)->
if client.closed
return
action = buffer.readUInt8(1) >> 4 action = buffer.readUInt8(1) >> 4
if buffer != decrypted_buffer and action in [1, 2, 4] if buffer != decrypted_buffer and action in [1, 2, 4]
ygopro.stoc_die(client, '${invalid_password_unauthorized}') ygopro.stoc_die(client, '${invalid_password_unauthorized}')
...@@ -1497,6 +1499,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -1497,6 +1499,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
challonge.matches.index({ challonge.matches.index({
id: settings.modules.challonge.tournament_id, id: settings.modules.challonge.tournament_id,
callback: (err, data) -> callback: (err, data) ->
if client.closed
return
if err or !data if err or !data
if err if err
log.warn("Failed loading Challonge match info", err) log.warn("Failed loading Challonge match info", err)
......
...@@ -1652,6 +1652,9 @@ ...@@ -1652,6 +1652,9 @@
}; };
finish = function(buffer) { finish = function(buffer) {
var action, len2, m, name, opt1, opt2, opt3, options, ref2, room, title; var action, len2, m, name, opt1, opt2, opt3, options, ref2, room, title;
if (client.closed) {
return;
}
action = buffer.readUInt8(1) >> 4; action = buffer.readUInt8(1) >> 4;
if (buffer !== decrypted_buffer && (action === 1 || action === 2 || action === 4)) { if (buffer !== decrypted_buffer && (action === 1 || action === 2 || action === 4)) {
ygopro.stoc_die(client, '${invalid_password_unauthorized}'); ygopro.stoc_die(client, '${invalid_password_unauthorized}');
...@@ -1833,6 +1836,9 @@ ...@@ -1833,6 +1836,9 @@
id: settings.modules.challonge.tournament_id, id: settings.modules.challonge.tournament_id,
callback: function(err, data) { callback: function(err, data) {
var len4, len5, match, o, p, player, ref4, ref5; var len4, len5, match, o, p, player, ref4, ref5;
if (client.closed) {
return;
}
if (err || !data) { if (err || !data) {
if (err) { if (err) {
log.warn("Failed loading Challonge match info", err); log.warn("Failed loading Challonge match info", err);
......
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