Commit d024444c authored by mercury233's avatar mercury233

add log stderr

parent e035c61b
...@@ -416,6 +416,10 @@ class Room ...@@ -416,6 +416,10 @@ class Room
log.info "AI stderr: " + data log.info "AI stderr: " + data
return return
return return
@process.stderr.on 'data', (data)=>
log.info "YGOPRO stderr: " + data
@has_ygopro_error = true
return
catch catch
@error = "建立房间失败,请重试" @error = "建立房间失败,请重试"
delete: -> delete: ->
...@@ -448,6 +452,8 @@ class Room ...@@ -448,6 +452,8 @@ class Room
recorded_ip.push player_ip recorded_ip.push player_ip
redisdb.lpush(player_ip+":replays", replay_id) redisdb.lpush(player_ip+":replays", replay_id)
return return
if @has_ygopro_error
log.info "error replay: R#" + replay_id
return return
@watcher_buffers = [] @watcher_buffers = []
@recorder_buffers = [] @recorder_buffers = []
......
...@@ -556,6 +556,12 @@ ...@@ -556,6 +556,12 @@
} }
}; };
})(this)); })(this));
this.process.stderr.on('data', (function(_this) {
return function(data) {
log.info("YGOPRO stderr: " + data);
_this.has_ygopro_error = true;
};
})(this));
} catch (error1) { } catch (error1) {
this.error = "建立房间失败,请重试"; this.error = "建立房间失败,请重试";
} }
...@@ -588,6 +594,9 @@ ...@@ -588,6 +594,9 @@
recorded_ip.push(player_ip); recorded_ip.push(player_ip);
redisdb.lpush(player_ip + ":replays", replay_id); redisdb.lpush(player_ip + ":replays", replay_id);
}); });
if (this.has_ygopro_error) {
log.info("error replay: R#" + replay_id);
}
}); });
} }
this.watcher_buffers = []; this.watcher_buffers = [];
......
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