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

fix

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