Commit 3e95da70 authored by nanahira's avatar nanahira

Merge branch 'master' into tcg_random

parents 2d7cc987 d9fc3b46
......@@ -63,7 +63,7 @@
"tips": {
"enabled": true,
"split_zh": false,
"get": false,
"get": "https://api.moecube.com/biu-tips/tips.json",
"get_zh": false
},
"dialogues": {
......
......@@ -1483,6 +1483,7 @@ class Room
@process = spawn './ygopro', param, {cwd: 'ygopro'}
@process_pid = @process.pid
@process.on 'error', (err)=>
log.warn 'CREATE ROOM ERROR', err
_.each @players, (player)->
ygopro.stoc_die(player, "${create_room_failed}")
this.delete()
......@@ -1519,7 +1520,8 @@ class Room
@send_replays()
@process.kill()
return
catch
catch e
log.warn 'CREATE ROOM FAIL', e
@error = "${create_room_failed}"
delete: ->
return if @deleted
......@@ -1755,7 +1757,7 @@ class Room
else
for player in @players when player.pos != 7
@scores[player.name_vpass] = -5
if @players.length == 2 and !client.arena_quit_free
if @players.length == 2 and @arena == 'athletic' and !client.arena_quit_free
@scores[client.name_vpass] = -9
@arena_score_handled = true
index = _.indexOf(@players, client)
......
......@@ -1906,7 +1906,7 @@
}
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];
if (firstSeed) {
param.push(firstSeed);
......@@ -1926,6 +1926,7 @@
});
this.process_pid = this.process.pid;
this.process.on('error', (err) => {
log.warn('CREATE ROOM ERROR', err);
_.each(this.players, function(player) {
return ygopro.stoc_die(player, "${create_room_failed}");
});
......@@ -1975,6 +1976,8 @@
}
});
} catch (error1) {
e = error1;
log.warn('CREATE ROOM FAIL', e);
return this.error = "${create_room_failed}";
}
}
......@@ -2332,7 +2335,7 @@
this.scores[player.name_vpass] = -5;
}
}
if (this.players.length === 2 && !client.arena_quit_free) {
if (this.players.length === 2 && this.arena === 'athletic' && !client.arena_quit_free) {
this.scores[client.name_vpass] = -9;
}
}
......
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