Commit bcfe4525 authored by mercury233's avatar mercury233
parents 3b8b6594 947de68d
Dockerfile
.git
.gitattributes
.gitignore
.gitmodules
.gitkeep
.dockerignore
FROM node FROM node
RUN apt-get update RUN apt-get update
RUN apt-get install -y git build-essential premake4 libfreetype6-dev libevent-dev libsqlite3-dev liblua5.2-dev mono-complete RUN apt-get install -y git build-essential premake4 libfreetype6-dev libevent-dev libsqlite3-dev liblua5.2-dev mono-complete cmake
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
...@@ -17,11 +17,22 @@ WORKDIR /usr/src/app/ygopro ...@@ -17,11 +17,22 @@ WORKDIR /usr/src/app/ygopro
RUN ln -s bin/release/ygopro ygopro RUN ln -s bin/release/ygopro ygopro
RUN strip ygopro RUN strip ygopro
WORKDIR /usr/src/app/ygosharp
RUN xbuild /property:Configuration=Release /property:OutDir=/usr/src/app/windbot/
RUN mv /usr/src/app/windbot /usr/src/app/windbot-source RUN mv /usr/src/app/windbot /usr/src/app/windbot-source
WORKDIR /usr/src/app/windbot-source/NLua/Core/KeraLua
ENV CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64
RUN make -f Makefile.Linux
RUN xbuild KeraLua.Net45.sln /p:Configuration=Release
WORKDIR /usr/src/app/windbot-source/NLua
RUN xbuild NLua.Net45.sln /p:Configuration=Release
RUN mv /usr/src/app/windbot-source/NLua/Run/Release/net45/*.dll /usr/src/app/windbot-source/
WORKDIR /usr/src/app/windbot-source WORKDIR /usr/src/app/windbot-source
RUN xbuild /property:Configuration=Release /property:OutDir=/usr/src/app/windbot/ RUN xbuild /property:Configuration=Release /property:OutDir=/usr/src/app/windbot/
RUN mv /usr/src/app/windbot-source/NLua/Core/KeraLua/external/lua/linux/lib64/liblua52.so /usr/src/app/windbot/
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN rm -rf /usr/src/app/windbot-source #RUN rm -rf /usr/src/app/windbot-source
RUN ln -s /usr/src/app/ygopro/cards.cdb /usr/src/app/windbot/cards.cdb RUN ln -s /usr/src/app/ygopro/cards.cdb /usr/src/app/windbot/cards.cdb
WORKDIR /usr/src/app WORKDIR /usr/src/app
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
"enable_random_duel": false, "enable_random_duel": false,
"mycard_auth": false, "mycard_auth": false,
"post_start_watching": true, "post_start_watching": true,
"TCG_banlist_id": 8,
"enable_TCG_as_default": false, "enable_TCG_as_default": false,
"http": { "http": {
"port": 7922, "port": 7922,
......
This diff is collapsed.
...@@ -204,7 +204,9 @@ ...@@ -204,7 +204,9 @@
this.welcome = ''; this.welcome = '';
Room.all.push(this); Room.all.push(this);
this.hostinfo || (this.hostinfo = { this.hostinfo || (this.hostinfo = {
lflist: 0, lflist: function(list) {
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,
...@@ -259,10 +261,14 @@ ...@@ -259,10 +261,14 @@
switch (rule.charAt(2)) { switch (rule.charAt(2)) {
case "1": case "1":
case "T": case "T":
this.hostinfo.lflist = settings.modules.TCG_banlist_id; this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return list.tcg && list.date.isBefore();
});
break; break;
default: default:
this.hostinfo.lflist = 0; this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return !list.tcg && list.date.isBefore();
});
} }
if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0) { if ((param = parseInt(rule.charAt(3).match(/\d/))) >= 0) {
this.hostinfo.time_limit = param * 60; this.hostinfo.time_limit = param * 60;
...@@ -311,7 +317,9 @@ ...@@ -311,7 +317,9 @@
} }
if (rule.match(/(^|,|,)(TCGONLY|TO)(,|,|$)/)) { if (rule.match(/(^|,|,)(TCGONLY|TO)(,|,|$)/)) {
this.hostinfo.rule = 1; this.hostinfo.rule = 1;
this.hostinfo.lflist = settings.modules.TCG_banlist_id; this.hostinfo.lflist = _.findIndex(settings.lflist, function(list) {
return list.tcg && list.date.isBefore();
});
} }
if (rule.match(/(^|,|,)(OCGONLY|OO)(,|,|$)/)) { if (rule.match(/(^|,|,)(OCGONLY|OO)(,|,|$)/)) {
this.hostinfo.rule = 0; this.hostinfo.rule = 0;
......
This diff is collapsed.
// 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, log, 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,6 +40,20 @@ ...@@ -40,6 +40,20 @@
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');
settings.lflist = (function() {
var k, len, ref, results;
ref = fs.readFileSync('ygopro/lflist.conf', 'utf8').match(/!.*/g);
results = [];
for (k = 0, len = ref.length; k < len; k++) {
list = ref[k];
results.push({
date: moment(list.match(/!([\d\.]+)/)[1], 'YYYY.MM.DD'),
tcg: list.indexOf('TCG') !== -1
});
}
return results;
})();
ygopro = require('./ygopro.js'); ygopro = require('./ygopro.js');
Room = require('./room.js'); Room = require('./room.js');
...@@ -351,7 +365,7 @@ ...@@ -351,7 +365,7 @@
}); });
client.end(); client.end();
} else if (settings.modules.windbot && info.pass.slice(0, 2) === 'AI') { } else if (settings.modules.windbot && info.pass.slice(0, 2) === 'AI') {
if (info.pass.length > 3 && info.pass.slice(0, 3) === 'AI#') { if (info.pass.length > 3 && info.pass.slice(0, 3) === 'AI#' || info.pass.slice(0, 3) === 'AI_') {
name = info.pass.slice(3); name = info.pass.slice(3);
windbot = _.sample(_.filter(settings.modules.windbot, function(w) { windbot = _.sample(_.filter(settings.modules.windbot, function(w) {
return w.name === name || w.deck === name; return w.name === name || w.deck === name;
...@@ -442,6 +456,9 @@ ...@@ -442,6 +456,9 @@
start_hand: opt3 >> 4, start_hand: opt3 >> 4,
draw_count: opt3 & 0xF draw_count: opt3 & 0xF
}; };
options.lflist = _.findIndex(settings.lflist, function(list) {
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), ' ');
room["private"] = action === 2; room["private"] = action === 2;
......
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