Commit cfa53219 authored by mercury233's avatar mercury233

automatic kill ygopro process which has too much error

parent e5c9407d
...@@ -518,6 +518,9 @@ class Room ...@@ -518,6 +518,9 @@ class Room
log.info "YGOPRO " + data log.info "YGOPRO " + data
ygopro.stoc_send_chat_to_room this, data, ygopro.constants.COLORS.RED ygopro.stoc_send_chat_to_room this, data, ygopro.constants.COLORS.RED
@has_ygopro_error = true @has_ygopro_error = true
@ygopro_error_length = if @ygopro_error_length then @ygopro_error_length + data.length else data.length
if @ygopro_error_length > 10000
@process.kill()
return return
catch catch
@error = "${create_room_failed}" @error = "${create_room_failed}"
......
...@@ -695,6 +695,10 @@ ...@@ -695,6 +695,10 @@
log.info("YGOPRO " + data); log.info("YGOPRO " + data);
ygopro.stoc_send_chat_to_room(_this, data, ygopro.constants.COLORS.RED); ygopro.stoc_send_chat_to_room(_this, data, ygopro.constants.COLORS.RED);
_this.has_ygopro_error = true; _this.has_ygopro_error = true;
_this.ygopro_error_length = _this.ygopro_error_length ? _this.ygopro_error_length + data.length : data.length;
if (_this.ygopro_error_length > 10000) {
_this.process.kill();
}
}; };
})(this)); })(this));
} catch (error1) { } catch (error1) {
......
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