Commit c41ed8c9 authored by nanahira's avatar nanahira

extime

parent 2a4e0b13
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
"start_lp": 8000, "start_lp": 8000,
"start_hand": 5, "start_hand": 5,
"draw_count": 1, "draw_count": 1,
"time_limit": 180 "time_limit": 180,
"extend_time": 1
}, },
"modules": { "modules": {
"welcome": "MyCard YGOPro Server", "welcome": "MyCard YGOPro Server",
......
...@@ -955,6 +955,11 @@ class Room ...@@ -955,6 +955,11 @@ class Room
lflist = parseInt(param[3]) - 1 lflist = parseInt(param[3]) - 1
@hostinfo.lflist = lflist @hostinfo.lflist = lflist
if (param = rule.match /(^|,|,)(EXTEND|EX)(\d+)(,|,|$)/)
extend_time = parseInt(param[3])
if (extend_time >= 60) then extend_time = 60
@hostinfo.extend_time = extend_time
if (rule.match /(^|,|,)(NOLFLIST|NF)(,|,|$)/) if (rule.match /(^|,|,)(NOLFLIST|NF)(,|,|$)/)
@hostinfo.lflist = -1 @hostinfo.lflist = -1
...@@ -975,7 +980,7 @@ class Room ...@@ -975,7 +980,7 @@ class Room
param = [0, @hostinfo.lflist, @hostinfo.rule, @hostinfo.mode, (if @hostinfo.enable_priority then 'T' else 'F'), param = [0, @hostinfo.lflist, @hostinfo.rule, @hostinfo.mode, (if @hostinfo.enable_priority then 'T' else 'F'),
(if @hostinfo.no_check_deck then 'T' else 'F'), (if @hostinfo.no_shuffle_deck then 'T' else 'F'), (if @hostinfo.no_check_deck then 'T' else 'F'), (if @hostinfo.no_shuffle_deck then 'T' else 'F'),
@hostinfo.start_lp, @hostinfo.start_hand, @hostinfo.draw_count, @hostinfo.time_limit, @hostinfo.replay_mode] @hostinfo.start_lp, @hostinfo.start_hand, @hostinfo.draw_count, @hostinfo.time_limit, @hostinfo.replay_mode, @hostinfo.extend_time]
try try
@process = spawn './ygopro', param, {cwd: 'ygopro'} @process = spawn './ygopro', param, {cwd: 'ygopro'}
......
...@@ -1096,7 +1096,7 @@ ...@@ -1096,7 +1096,7 @@
Room = (function() { Room = (function() {
function Room(name, hostinfo) { function Room(name, hostinfo) {
var draw_count, lflist, param, rule, start_hand, start_lp, time_limit; var draw_count, extend_time, lflist, param, rule, start_hand, start_lp, time_limit;
this.hostinfo = hostinfo; this.hostinfo = hostinfo;
this.name = name; this.name = name;
this.alive = true; this.alive = true;
...@@ -1213,6 +1213,13 @@ ...@@ -1213,6 +1213,13 @@
lflist = parseInt(param[3]) - 1; lflist = parseInt(param[3]) - 1;
this.hostinfo.lflist = lflist; this.hostinfo.lflist = lflist;
} }
if ((param = rule.match(/(^|,|,)(EXTEND|EX)(\d+)(,|,|$)/))) {
extend_time = parseInt(param[3]);
if (extend_time >= 60) {
extend_time = 60;
}
this.hostinfo.extend_time = extend_time;
}
if (rule.match(/(^|,|,)(NOLFLIST|NF)(,|,|$)/)) { if (rule.match(/(^|,|,)(NOLFLIST|NF)(,|,|$)/)) {
this.hostinfo.lflist = -1; this.hostinfo.lflist = -1;
} }
...@@ -1232,7 +1239,7 @@ ...@@ -1232,7 +1239,7 @@
this.no_watch = true; this.no_watch = true;
} }
} }
param = [0, this.hostinfo.lflist, this.hostinfo.rule, this.hostinfo.mode, (this.hostinfo.enable_priority ? 'T' : 'F'), (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.enable_priority ? 'T' : 'F'), (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, this.hostinfo.extend_time];
try { try {
this.process = spawn('./ygopro', param, { this.process = spawn('./ygopro', param, {
cwd: 'ygopro' cwd: 'ygopro'
......
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