Commit 3acc229f authored by mercury233's avatar mercury233

fix

parent 70c97420
......@@ -400,6 +400,11 @@ class Room
try
@process = spawn './ygopro', param, {cwd: 'ygopro'}
@process.on 'error', (err)=>
_.each @players, (player)->
ygopro.stoc_die(player, "建立房间失败,请重试")
this.delete()
return
@process.on 'exit', (code)=>
@disconnector = 'server' unless @disconnector
this.delete()
......
......@@ -530,6 +530,14 @@
this.process = spawn('./ygopro', param, {
cwd: 'ygopro'
});
this.process.on('error', (function(_this) {
return function(err) {
_.each(_this.players, function(player) {
return ygopro.stoc_die(player, "建立房间失败,请重试");
});
_this["delete"]();
};
})(this));
this.process.on('exit', (function(_this) {
return function(code) {
if (!_this.disconnector) {
......
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