You need to sign in or sign up before continuing.
Commit df656ea8 authored by nanahira's avatar nanahira

Merge branch 'master' of https://github.com/Khriskh/srvpro into tcg_random

parents 48b09cd3 eb68e726
......@@ -434,7 +434,7 @@ ROOM_find_or_create_by_name = (name, player_ip)->
uname=name.toUpperCase()
if settings.modules.windbot.enabled and (uname[0...2] == 'AI' or (!settings.modules.random_duel.enabled and uname == ''))
return ROOM_find_or_create_ai(name)
if settings.modules.random_duel.enabled and (uname == '' or uname == 'S' or uname == 'M' or uname == 'T')
if settings.modules.random_duel.enabled and (uname == '' or uname == 'S' or uname == 'M' or uname == 'T' or uname == 'TOR' or uname == 'TR' or uname == 'OOR' or uname == 'OR')
return ROOM_find_or_create_random(uname, player_ip)
if room = ROOM_find_by_name(name)
return room
......@@ -851,6 +851,26 @@ class Room
@hostinfo.mode = 2
@hostinfo.start_lp = 16000
if (rule.match /(^|,|,)(OOR|OCGONLYRANDOM)(,|,|$)/)
@hostinfo.lflist = 0
@hostinfo.rule = 2
@hostinfo.mode = 0
if (rule.match /(^|,|,)(OR|OCGRANDOM)(,|,|$)/)
@hostinfo.lflist = 0
@hostinfo.rule = 0
@hostinfo.mode = 0
if (rule.match /(^|,|,)(TOR|TCGONLYRANDOM)(,|,|$)/)
@hostinfo.lflist = 1
@hostinfo.rule = 2
@hostinfo.mode = 0
if (rule.match /(^|,|,)(TR|TCGRANDOM)(,|,|$)/)
@hostinfo.lflist = 1
@hostinfo.rule = 1
@hostinfo.mode = 0
if (rule.match /(^|,|,)(TCGONLY|TO)(,|,|$)/)
@hostinfo.rule = 1
@hostinfo.lflist = _.findIndex lflists, (list)-> list.tcg
......
......@@ -568,7 +568,7 @@
if (settings.modules.windbot.enabled && (uname.slice(0, 2) === 'AI' || (!settings.modules.random_duel.enabled && uname === ''))) {
return ROOM_find_or_create_ai(name);
}
if (settings.modules.random_duel.enabled && (uname === '' || uname === 'S' || uname === 'M' || uname === 'T')) {
if (settings.modules.random_duel.enabled && (uname === '' || uname === 'S' || uname === 'M' || uname === 'T' || uname === 'TOR' || uname === 'TR' || uname === 'OOR' || uname === 'OR')) {
return ROOM_find_or_create_random(uname, player_ip);
}
if (room = ROOM_find_by_name(name)) {
......@@ -1090,6 +1090,26 @@
this.hostinfo.mode = 2;
this.hostinfo.start_lp = 16000;
}
if (rule.match(/(^|,|,)(OOR|OCGONLYRANDOM)(,|,|$)/)) {
this.hostinfo.lflist = 0;
this.hostinfo.rule = 2;
this.hostinfo.mode = 0;
}
if (rule.match(/(^|,|,)(OR|OCGRANDOM)(,|,|$)/)) {
this.hostinfo.lflist = 0;
this.hostinfo.rule = 0;
this.hostinfo.mode = 0;
}
if (rule.match(/(^|,|,)(TOR|TCGONLYRANDOM)(,|,|$)/)) {
this.hostinfo.lflist = 1;
this.hostinfo.rule = 2;
this.hostinfo.mode = 0;
}
if (rule.match(/(^|,|,)(TR|TCGRANDOM)(,|,|$)/)) {
this.hostinfo.lflist = 1;
this.hostinfo.rule = 1;
this.hostinfo.mode = 0;
}
if (rule.match(/(^|,|,)(TCGONLY|TO)(,|,|$)/)) {
this.hostinfo.rule = 1;
this.hostinfo.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