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