Commit dc38dcb0 authored by mercury233's avatar mercury233

don't load lflist date

parent 2786c6f6
...@@ -243,7 +243,7 @@ ROOM_find_or_create_ai = (name)-> ...@@ -243,7 +243,7 @@ ROOM_find_or_create_ai = (name)->
name = name + '#' + Math.floor(Math.random() * 100000) name = name + '#' + Math.floor(Math.random() * 100000)
if name.replace(/[^\x00-\xff]/g,"00").length>20 if name.replace(/[^\x00-\xff]/g,"00").length>20
log.info "long ai name", name log.info "long ai name", name
return { "error": "AI房间名过长" } return { "error": "AI房间名过长,请在建立房间后输入 /ai 来添加AI" }
result = new Room(name) result = new Room(name)
result.windbot = windbot result.windbot = windbot
return result return result
...@@ -288,7 +288,7 @@ class Room ...@@ -288,7 +288,7 @@ class Room
ROOM_all.push this ROOM_all.push this
@hostinfo ||= @hostinfo ||=
lflist: _.findIndex settings.lflist, (list)-> !list.tcg and list.date.isBefore() lflist: if settings.lflist.length then 0 else -1
rule: if settings.modules.enable_TCG_as_default then 2 else 0 rule: if settings.modules.enable_TCG_as_default then 2 else 0
mode: 0 mode: 0
enable_priority: false enable_priority: false
...@@ -339,9 +339,9 @@ class Room ...@@ -339,9 +339,9 @@ class Room
switch rule.charAt(2) switch rule.charAt(2)
when "1","T" when "1","T"
@hostinfo.lflist = _.findIndex settings.lflist, (list)-> list.tcg and list.date.isBefore() @hostinfo.lflist = _.findIndex settings.lflist, (list)-> list.tcg
else else
@hostinfo.lflist = _.findIndex settings.lflist, (list)-> !list.tcg and list.date.isBefore() @hostinfo.lflist = _.findIndex settings.lflist, (list)-> !list.tcg
if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0) if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0)
@hostinfo.time_limit = param * 60 @hostinfo.time_limit = param * 60
...@@ -386,7 +386,7 @@ class Room ...@@ -386,7 +386,7 @@ class Room
if (rule.match /(^|,|,)(TCGONLY|TO)(,|,|$)/) if (rule.match /(^|,|,)(TCGONLY|TO)(,|,|$)/)
@hostinfo.rule = 1 @hostinfo.rule = 1
@hostinfo.lflist = _.findIndex settings.lflist, (list)-> list.tcg and list.date.isBefore() @hostinfo.lflist = _.findIndex settings.lflist, (list)-> list.tcg
if (rule.match /(^|,|,)(OCGONLY|OO)(,|,|$)/) if (rule.match /(^|,|,)(OCGONLY|OO)(,|,|$)/)
@hostinfo.rule = 0 @hostinfo.rule = 0
......
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
if (name.replace(/[^\x00-\xff]/g, "00").length > 20) { if (name.replace(/[^\x00-\xff]/g, "00").length > 20) {
log.info("long ai name", name); log.info("long ai name", name);
return { return {
"error": "AI房间名过长" "error": "AI房间名过长,请在建立房间后输入 /ai 来添加AI"
}; };
} }
result = new Room(name); result = new Room(name);
...@@ -400,9 +400,7 @@ ...@@ -400,9 +400,7 @@
this.welcome = ''; this.welcome = '';
ROOM_all.push(this); ROOM_all.push(this);
this.hostinfo || (this.hostinfo = { this.hostinfo || (this.hostinfo = {
lflist: _.findIndex(settings.lflist, function(list) { lflist: settings.lflist.length ? 0 : -1,
return !list.tcg && list.date.isBefore();
}),
rule: settings.modules.enable_TCG_as_default ? 2 : 0, rule: settings.modules.enable_TCG_as_default ? 2 : 0,
mode: 0, mode: 0,
enable_priority: false, enable_priority: false,
...@@ -459,12 +457,12 @@ ...@@ -459,12 +457,12 @@
case "1": case "1":
case "T": case "T":
this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) { this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return list.tcg && list.date.isBefore(); return list.tcg;
}); });
break; break;
default: default:
this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) { this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return !list.tcg && list.date.isBefore(); return !list.tcg;
}); });
} }
if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0) { if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0) {
...@@ -515,7 +513,7 @@ ...@@ -515,7 +513,7 @@
if (rule.match(/(^|,|,)(TCGONLY|TO)(,|,|$)/)) { if (rule.match(/(^|,|,)(TCGONLY|TO)(,|,|$)/)) {
this.hostinfo.rule = 1; this.hostinfo.rule = 1;
this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) { this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return list.tcg && list.date.isBefore(); return list.tcg;
}); });
} }
if (rule.match(/(^|,|,)(OCGONLY|OO)(,|,|$)/)) { if (rule.match(/(^|,|,)(OCGONLY|OO)(,|,|$)/)) {
......
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