Commit 3e627773 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 4a79ae0a 94df683e
...@@ -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,
......
...@@ -1370,7 +1370,7 @@ class Room ...@@ -1370,7 +1370,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 = 0 @hostinfo.time_limit = 0
@hostinfo.no_check_deck = true @hostinfo.no_check_deck = true
...@@ -1449,10 +1449,10 @@ class Room ...@@ -1449,10 +1449,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+)(,|,|$)/)
...@@ -1487,6 +1487,9 @@ class Room ...@@ -1487,6 +1487,9 @@ class Room
@hostinfo.lflist = -1 @hostinfo.lflist = -1
if (rule.match /(^|,|,)(NOUNIQUE|NU)(,|,|$)/) if (rule.match /(^|,|,)(NOUNIQUE|NU)(,|,|$)/)
@hostinfo.rule = 4
if (rule.match /(^|,|,)(CUSTOM|DIY)(,|,|$)/)
@hostinfo.rule = 3 @hostinfo.rule = 3
if (rule.match /(^|,|,)(NOCHECK|NC)(,|,|$)/) if (rule.match /(^|,|,)(NOCHECK|NC)(,|,|$)/)
...@@ -2354,7 +2357,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)-> ...@@ -2354,7 +2357,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)
...@@ -2366,7 +2369,7 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)-> ...@@ -2366,7 +2369,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()
......
...@@ -1786,7 +1786,7 @@ ...@@ -1786,7 +1786,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 = 0; this.hostinfo.time_limit = 0;
this.hostinfo.no_check_deck = true; this.hostinfo.no_check_deck = true;
...@@ -1872,10 +1872,10 @@ ...@@ -1872,10 +1872,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+)(,|,|$)/))) {
...@@ -1926,6 +1926,9 @@ ...@@ -1926,6 +1926,9 @@
this.hostinfo.lflist = -1; this.hostinfo.lflist = -1;
} }
if (rule.match(/(^|,|,)(NOUNIQUE|NU)(,|,|$)/)) { if (rule.match(/(^|,|,)(NOUNIQUE|NU)(,|,|$)/)) {
this.hostinfo.rule = 4;
}
if (rule.match(/(^|,|,)(CUSTOM|DIY)(,|,|$)/)) {
this.hostinfo.rule = 3; this.hostinfo.rule = 3;
} }
if (rule.match(/(^|,|,)(NOCHECK|NC)(,|,|$)/)) { if (rule.match(/(^|,|,)(NOCHECK|NC)(,|,|$)/)) {
...@@ -3101,7 +3104,7 @@ ...@@ -3101,7 +3104,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),
...@@ -3115,7 +3118,7 @@ ...@@ -3115,7 +3118,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