Commit 947de68d authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent ef01a51e
......@@ -30,9 +30,8 @@ settings.BANNED_user = []
settings.BANNED_IP = []
settings.modules.hang_timeout = 90
settings.version = parseInt(fs.readFileSync('ygopro/gframe/game.cpp', 'utf8').match(/PRO_VERSION = ([x\d]+)/)[1], '16')
lflist = (for list in fs.readFileSync('ygopro/lflist.conf', 'utf8').match(/![\d\.]+(?: TCG)?/g)
matched = list.match(/!([\d\.]+)(?: (TCG))?/)
{date: moment(matched[1], 'YYYY.MM.DD'), tcg: !!matched[2]})
settings.lflist = (for list in fs.readFileSync('ygopro/lflist.conf', 'utf8').match(/!.*/g)
{date: moment(list.match(/!([\d\.]+)/)[1], 'YYYY.MM.DD'), tcg: list.indexOf('TCG') != -1})
#组件
ygopro = require './ygopro.js'
......@@ -416,7 +415,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
start_hand: opt3 >> 4
draw_count: opt3 & 0xF
}
@hostinfo.lflist = _.findIndex settings.lflist, (list)-> ((rule == 1) == list.tcg) and list.date.isBefore()
options.lflist = _.findIndex settings.lflist, (list)-> ((options.rule == 1) == list.tcg) and list.date.isBefore()
room = new Room(name, options)
room.title = info.pass.slice(8).replace(String.fromCharCode(0xFEFF), ' ')
room.private = action == 2
......
// Generated by CoffeeScript 1.10.0
(function() {
var Graveyard, Room, _, bunyan, crypto, debug, dialogues, execFile, fs, http, http_server, https, https_server, lflist, list, log, matched, moment, net, options, os, path, pg, request, requestListener, roomlist, settings, tips, tribute, url, users_cache, wait_room_start, ygopro;
var Graveyard, Room, _, bunyan, crypto, debug, dialogues, execFile, fs, http, http_server, https, https_server, list, log, moment, net, options, os, path, pg, request, requestListener, roomlist, settings, tips, tribute, url, users_cache, wait_room_start, ygopro;
net = require('net');
......@@ -40,16 +40,15 @@
settings.version = parseInt(fs.readFileSync('ygopro/gframe/game.cpp', 'utf8').match(/PRO_VERSION = ([x\d]+)/)[1], '16');
lflist = (function() {
settings.lflist = (function() {
var k, len, ref, results;
ref = fs.readFileSync('ygopro/lflist.conf', 'utf8').match(/![\d\.]+(?: TCG)?/g);
ref = fs.readFileSync('ygopro/lflist.conf', 'utf8').match(/!.*/g);
results = [];
for (k = 0, len = ref.length; k < len; k++) {
list = ref[k];
matched = list.match(/!([\d\.]+)(?: (TCG))?/);
results.push({
date: moment(matched[1], 'YYYY.MM.DD'),
tcg: !!matched[2]
date: moment(list.match(/!([\d\.]+)/)[1], 'YYYY.MM.DD'),
tcg: list.indexOf('TCG') !== -1
});
}
return results;
......@@ -457,8 +456,8 @@
start_hand: opt3 >> 4,
draw_count: opt3 & 0xF
};
this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return ((rule === 1) === list.tcg) && list.date.isBefore();
options.lflist = _.findIndex(settings.lflist, function(list) {
return ((options.rule === 1) === list.tcg) && list.date.isBefore();
});
room = new Room(name, options);
room.title = info.pass.slice(8).replace(String.fromCharCode(0xFEFF), ' ');
......
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