Commit 7f576fd4 authored by mercury233's avatar mercury233

log create room fail

parent 226a6fb7
...@@ -1328,6 +1328,7 @@ class Room ...@@ -1328,6 +1328,7 @@ class Room
@process = spawn './ygopro', param, {cwd: 'ygopro'} @process = spawn './ygopro', param, {cwd: 'ygopro'}
@process_pid = @process.pid @process_pid = @process.pid
@process.on 'error', (err)=> @process.on 'error', (err)=>
log.warn 'CREATE ROOM ERROR', err
_.each @players, (player)-> _.each @players, (player)->
ygopro.stoc_die(player, "${create_room_failed}") ygopro.stoc_die(player, "${create_room_failed}")
this.delete() this.delete()
...@@ -1364,7 +1365,8 @@ class Room ...@@ -1364,7 +1365,8 @@ class Room
@send_replays() @send_replays()
@process.kill() @process.kill()
return return
catch catch e
log.warn 'CREATE ROOM FAIL', e
@error = "${create_room_failed}" @error = "${create_room_failed}"
delete: -> delete: ->
return if @deleted return if @deleted
......
...@@ -1712,7 +1712,7 @@ ...@@ -1712,7 +1712,7 @@
} }
spawn(firstSeed) { spawn(firstSeed) {
var i, j, l, param, seeds; var e, i, j, l, param, seeds;
param = [0, this.hostinfo.lflist, this.hostinfo.rule, this.hostinfo.mode, this.hostinfo.duel_rule, (this.hostinfo.no_check_deck ? 'T' : 'F'), (this.hostinfo.no_shuffle_deck ? 'T' : 'F'), this.hostinfo.start_lp, this.hostinfo.start_hand, this.hostinfo.draw_count, this.hostinfo.time_limit, this.hostinfo.replay_mode]; param = [0, this.hostinfo.lflist, this.hostinfo.rule, this.hostinfo.mode, this.hostinfo.duel_rule, (this.hostinfo.no_check_deck ? 'T' : 'F'), (this.hostinfo.no_shuffle_deck ? 'T' : 'F'), this.hostinfo.start_lp, this.hostinfo.start_hand, this.hostinfo.draw_count, this.hostinfo.time_limit, this.hostinfo.replay_mode];
if (firstSeed) { if (firstSeed) {
param.push(firstSeed); param.push(firstSeed);
...@@ -1732,6 +1732,7 @@ ...@@ -1732,6 +1732,7 @@
}); });
this.process_pid = this.process.pid; this.process_pid = this.process.pid;
this.process.on('error', (err) => { this.process.on('error', (err) => {
log.warn('CREATE ROOM ERROR', err);
_.each(this.players, function(player) { _.each(this.players, function(player) {
return ygopro.stoc_die(player, "${create_room_failed}"); return ygopro.stoc_die(player, "${create_room_failed}");
}); });
...@@ -1781,6 +1782,8 @@ ...@@ -1781,6 +1782,8 @@
} }
}); });
} catch (error1) { } catch (error1) {
e = error1;
log.warn('CREATE ROOM FAIL', e);
return this.error = "${create_room_failed}"; return this.error = "${create_room_failed}";
} }
} }
......
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