Commit 11df183b authored by mercury233's avatar mercury233 Committed by GitHub

update ot, BREAK the old config (#50)

parent 23b15a3e
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"lflist": 0, "lflist": 0,
"rule": 0, "rule": 0,
"mode": 0, "mode": 0,
"comment": "rule: 0=OCGONLY, 1=TCGONLY, 2=OT; mode: 0=SINGLE, 1=MATCH, 2=TAG", "comment": "rule: 0=OCG-ONLY, 1=TCG-ONLY, 2=SC-ONLY, 3=CUSTOM-ONLY, 4=NO-UNIQUE, 5=ALL; mode: 0=SINGLE, 1=MATCH, 2=TAG",
"duel_rule": 5, "duel_rule": 5,
"no_check_deck": false, "no_check_deck": false,
"no_shuffle_deck": false, "no_shuffle_deck": false,
......
...@@ -1248,7 +1248,7 @@ class Room ...@@ -1248,7 +1248,7 @@ class Room
@hostinfo.mode = 2 @hostinfo.mode = 2
@hostinfo.start_lp = 16000 @hostinfo.start_lp = 16000
else if name[0...3] == 'AI#' else if name[0...3] == 'AI#'
@hostinfo.rule = 2 @hostinfo.rule = 5
@hostinfo.lflist = -1 @hostinfo.lflist = -1
@hostinfo.time_limit = 999 @hostinfo.time_limit = 999
...@@ -1281,10 +1281,10 @@ class Room ...@@ -1281,10 +1281,10 @@ class Room
@hostinfo.lflist = 0 @hostinfo.lflist = 0
if (rule.match /(^|,|,)(OT|TCG)(,|,|$)/) if (rule.match /(^|,|,)(OT|TCG)(,|,|$)/)
@hostinfo.rule = 2 @hostinfo.rule = 5
if (rule.match /(^|,|,)(CN|CCG|CHINESE)(,|,|$)/) if (rule.match /(^|,|,)(SC|CN|CCG|CHINESE)(,|,|$)/)
@hostinfo.rule = 4 @hostinfo.rule = 2
@hostinfo.lflist = -1 @hostinfo.lflist = -1
if (param = rule.match /(^|,|,)LP(\d+)(,|,|$)/) if (param = rule.match /(^|,|,)LP(\d+)(,|,|$)/)
...@@ -1319,7 +1319,7 @@ class Room ...@@ -1319,7 +1319,7 @@ class Room
@hostinfo.lflist = -1 @hostinfo.lflist = -1
if (rule.match /(^|,|,)(NOUNIQUE|NU)(,|,|$)/) if (rule.match /(^|,|,)(NOUNIQUE|NU)(,|,|$)/)
@hostinfo.rule = 3 @hostinfo.rule = 4
if (rule.match /(^|,|,)(NOCHECK|NC)(,|,|$)/) if (rule.match /(^|,|,)(NOCHECK|NC)(,|,|$)/)
@hostinfo.no_check_deck = true @hostinfo.no_check_deck = true
...@@ -2171,7 +2171,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)-> ...@@ -2171,7 +2171,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
options = { options = {
lflist: settings.hostinfo.lflist lflist: settings.hostinfo.lflist
time_limit: settings.hostinfo.time_limit time_limit: settings.hostinfo.time_limit
rule: (opt1 >> 5) & 0x7 # 0 1 2 3 4 rule: (opt1 >> 5) & 0x7 # 0 1 2 3 4 5
mode: (opt1 >> 3) & 0x3 # 0 1 2 mode: (opt1 >> 3) & 0x3 # 0 1 2
duel_rule: (opt0 >> 1) || 5 # 1 2 3 4 5 duel_rule: (opt0 >> 1) || 5 # 1 2 3 4 5
no_check_deck: !!((opt1 >> 1) & 1) no_check_deck: !!((opt1 >> 1) & 1)
...@@ -2183,7 +2183,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)-> ...@@ -2183,7 +2183,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
auto_death: !!(opt0 & 0x1) ? 40 : false auto_death: !!(opt0 & 0x1) ? 40 : false
} }
#console.log(options) #console.log(options)
if(options.rule == 4) if(options.rule == 3)
options.lflist = -1 options.lflist = -1
else else
options.lflist = _.findIndex lflists, (list)-> ((options.rule == 1) == list.tcg) and list.date.isBefore() options.lflist = _.findIndex lflists, (list)-> ((options.rule == 1) == list.tcg) and list.date.isBefore()
......
...@@ -1633,7 +1633,7 @@ ...@@ -1633,7 +1633,7 @@
this.hostinfo.mode = 2; this.hostinfo.mode = 2;
this.hostinfo.start_lp = 16000; this.hostinfo.start_lp = 16000;
} else if (name.slice(0, 3) === 'AI#') { } else if (name.slice(0, 3) === 'AI#') {
this.hostinfo.rule = 2; this.hostinfo.rule = 5;
this.hostinfo.lflist = -1; this.hostinfo.lflist = -1;
this.hostinfo.time_limit = 999; this.hostinfo.time_limit = 999;
} else if ((param = name.match(/^(\d)(\d)(T|F)(T|F)(T|F)(\d+),(\d+),(\d+)/i))) { } else if ((param = name.match(/^(\d)(\d)(T|F)(T|F)(T|F)(\d+),(\d+),(\d+)/i))) {
...@@ -1665,10 +1665,10 @@ ...@@ -1665,10 +1665,10 @@
this.hostinfo.lflist = 0; this.hostinfo.lflist = 0;
} }
if (rule.match(/(^|,|,)(OT|TCG)(,|,|$)/)) { if (rule.match(/(^|,|,)(OT|TCG)(,|,|$)/)) {
this.hostinfo.rule = 2; this.hostinfo.rule = 5;
} }
if (rule.match(/(^|,|,)(CN|CCG|CHINESE)(,|,|$)/)) { if (rule.match(/(^|,|,)(SC|CN|CCG|CHINESE)(,|,|$)/)) {
this.hostinfo.rule = 4; this.hostinfo.rule = 2;
this.hostinfo.lflist = -1; this.hostinfo.lflist = -1;
} }
if ((param = rule.match(/(^|,|,)LP(\d+)(,|,|$)/))) { if ((param = rule.match(/(^|,|,)LP(\d+)(,|,|$)/))) {
...@@ -1719,7 +1719,7 @@ ...@@ -1719,7 +1719,7 @@
this.hostinfo.lflist = -1; this.hostinfo.lflist = -1;
} }
if (rule.match(/(^|,|,)(NOUNIQUE|NU)(,|,|$)/)) { if (rule.match(/(^|,|,)(NOUNIQUE|NU)(,|,|$)/)) {
this.hostinfo.rule = 3; this.hostinfo.rule = 4;
} }
if (rule.match(/(^|,|,)(NOCHECK|NC)(,|,|$)/)) { if (rule.match(/(^|,|,)(NOCHECK|NC)(,|,|$)/)) {
this.hostinfo.no_check_deck = true; this.hostinfo.no_check_deck = true;
...@@ -2864,7 +2864,7 @@ ...@@ -2864,7 +2864,7 @@
options = { options = {
lflist: settings.hostinfo.lflist, lflist: settings.hostinfo.lflist,
time_limit: settings.hostinfo.time_limit, time_limit: settings.hostinfo.time_limit,
rule: (opt1 >> 5) & 0x7, // 0 1 2 3 4 rule: (opt1 >> 5) & 0x7, // 0 1 2 3 4 5
mode: (opt1 >> 3) & 0x3, // 0 1 2 mode: (opt1 >> 3) & 0x3, // 0 1 2
duel_rule: (opt0 >> 1) || 5, // 1 2 3 4 5 duel_rule: (opt0 >> 1) || 5, // 1 2 3 4 5
no_check_deck: !!((opt1 >> 1) & 1), no_check_deck: !!((opt1 >> 1) & 1),
...@@ -2878,7 +2878,7 @@ ...@@ -2878,7 +2878,7 @@
} }
}; };
//console.log(options) //console.log(options)
if (options.rule === 4) { if (options.rule === 3) {
options.lflist = -1; options.lflist = -1;
} else { } else {
options.lflist = _.findIndex(lflists, function(list) { options.lflist = _.findIndex(lflists, function(list) {
......
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