Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
srvpro
Commits
abc3aa44
Commit
abc3aa44
authored
Feb 07, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into tcg_random
parents
3f5b65b8
a75c58a1
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
489 additions
and
338 deletions
+489
-338
README.md
README.md
+6
-6
config_build/config.json
config_build/config.json
+5
-0
config_tourney/config.json
config_tourney/config.json
+5
-0
data/default_config.json
data/default_config.json
+10
-1
data/i18n.json
data/i18n.json
+4
-0
docs/install_centos_6.sh
docs/install_centos_6.sh
+14
-33
docs/install_centos_7.sh
docs/install_centos_7.sh
+14
-32
docs/install_ubuntu_14.sh
docs/install_ubuntu_14.sh
+15
-43
docs/install_ubuntu_16.sh
docs/install_ubuntu_16.sh
+13
-44
docs/install_ubuntu_18.sh
docs/install_ubuntu_18.sh
+15
-32
docs/update.sh
docs/update.sh
+7
-7
ygopro-server.coffee
ygopro-server.coffee
+113
-6
ygopro-server.js
ygopro-server.js
+268
-134
No files found.
README.md
View file @
abc3aa44
...
@@ -29,12 +29,12 @@
...
@@ -29,12 +29,12 @@
### 使用方法
### 使用方法
*
可参考
[
wiki
](
https://github.com/moecube/srvpro/wiki
)
安装
*
可参考
[
wiki
](
https://github.com/moecube/srvpro/wiki
)
安装
*
一键安装:
*
一键安装:
*
CentOS 7
`curl -sL https://purerosefallen.github.io/ygopro-server/install_centos_7.sh |
sudo -E
bash -`
*
CentOS 7
`curl -sL https://purerosefallen.github.io/ygopro-server/install_centos_7.sh | bash -`
*
CentOS 6
`curl -sL https://purerosefallen.github.io/ygopro-server/install_centos_6.sh |
sudo -E
bash -`
*
CentOS 6
`curl -sL https://purerosefallen.github.io/ygopro-server/install_centos_6.sh | bash -`
*
Ubnutu 18
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_18.sh |
sudo -E
bash -`
*
Ubnutu 18
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_18.sh | bash -`
*
Ubnutu 16
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_16.sh |
sudo -E
bash -`
*
Ubnutu 16
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_16.sh | bash -`
*
Ubnutu 14
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_14.sh |
sudo -E
bash -`
*
Ubnutu 14
`curl -sL https://purerosefallen.github.io/ygopro-server/install_ubuntu_14.sh | bash -`
*
更新数据
`curl -sL https://purerosefallen.github.io/ygopro-server/update.sh |
sudo -E
bash -`
*
更新数据
`curl -sL https://purerosefallen.github.io/ygopro-server/update.sh | bash -`
*
手动安装:
*
手动安装:
*
`git clone https://github.com/moecube/srvpro.git`
*
`git clone https://github.com/moecube/srvpro.git`
*
`cd srvpro`
*
`cd srvpro`
...
...
config_build/config.json
View file @
abc3aa44
...
@@ -72,6 +72,11 @@
...
@@ -72,6 +72,11 @@
"enabled"
:
false
,
"enabled"
:
false
,
"generate_count"
:
500
"generate_count"
:
500
},
},
"pre_release_compat"
:
{
"enabled"
:
false
,
"official_database"
:
"./ygopro/cards.cdb"
,
"pre_release_database"
:
"./../ygopro-pre-data/expansions/pre-release.cdb"
},
"random_duel"
:
{
"random_duel"
:
{
"enabled"
:
true
,
"enabled"
:
true
,
"no_rematch_check"
:
false
,
"no_rematch_check"
:
false
,
...
...
config_tourney/config.json
View file @
abc3aa44
...
@@ -72,6 +72,11 @@
...
@@ -72,6 +72,11 @@
"enabled"
:
false
,
"enabled"
:
false
,
"generate_count"
:
500
"generate_count"
:
500
},
},
"pre_release_compat"
:
{
"enabled"
:
false
,
"official_database"
:
"./ygopro/cards.cdb"
,
"pre_release_database"
:
"./../ygopro-pre-data/expansions/pre-release.cdb"
},
"random_duel"
:
{
"random_duel"
:
{
"enabled"
:
false
,
"enabled"
:
false
,
"no_rematch_check"
:
false
,
"no_rematch_check"
:
false
,
...
...
data/default_config.json
View file @
abc3aa44
...
@@ -77,6 +77,11 @@
...
@@ -77,6 +77,11 @@
"enabled"
:
false
,
"enabled"
:
false
,
"generate_count"
:
500
"generate_count"
:
500
},
},
"pre_release_compat"
:
{
"enabled"
:
false
,
"official_database"
:
"./ygopro/cards.cdb"
,
"pre_release_database"
:
"./../ygopro-pre-data/expansions/pre-release.cdb"
},
"random_duel"
:
{
"random_duel"
:
{
"enabled"
:
false
,
"enabled"
:
false
,
"no_rematch_check"
:
false
,
"no_rematch_check"
:
false
,
...
@@ -172,6 +177,10 @@
...
@@ -172,6 +177,10 @@
"password"
:
"123456"
,
"password"
:
"123456"
,
"port"
:
7933
"port"
:
7933
},
},
"side_restrict"
:
{
"enabled"
:
false
,
"restrict_cards"
:
[]
},
"test_mode"
:
{
"test_mode"
:
{
"watch_public_hand"
:
false
,
"watch_public_hand"
:
false
,
"no_connect_count_limit"
:
false
,
"no_connect_count_limit"
:
false
,
...
@@ -237,7 +246,7 @@
...
@@ -237,7 +246,7 @@
"command"
:
"bash"
,
"command"
:
"bash"
,
"args"
:
[
"args"
:
[
"-c"
,
"-c"
,
"cd ocgcore ; git pull origin master ; cd ../script ; git pull origin master ; cd .. ; premake5 gmake ; cd build ; make config=release ; cd .. ; strip ygopro"
"cd ocgcore ; git pull origin master ; cd ../script ; git pull origin master ; cd .. ;
~/
premake5 gmake ; cd build ; make config=release ; cd .. ; strip ygopro"
],
],
"path"
:
"./ygopro/"
"path"
:
"./ygopro/"
}
}
...
...
data/i18n.json
View file @
abc3aa44
...
@@ -186,8 +186,10 @@
...
@@ -186,8 +186,10 @@
"vip_set_victory"
:
"Your victory word have been set."
,
"vip_set_victory"
:
"Your victory word have been set."
,
"vip_password_changed"
:
"Password changed."
,
"vip_password_changed"
:
"Password changed."
,
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"pre_release_compat_hint"
:
"It seems like you're a duelist with pre-release cards. The pre-release compat mode is turned on."
,
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part2"
:
"."
,
"replay_hint_part2"
:
"."
,
"invalid_side_rule"
:
"Illegal cards are contained in your side deck."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
},
},
"es-es"
:
{
"es-es"
:
{
...
@@ -521,8 +523,10 @@
...
@@ -521,8 +523,10 @@
"vip_set_victory"
:
"已设置胜利台词。"
,
"vip_set_victory"
:
"已设置胜利台词。"
,
"vip_password_changed"
:
"密码修改成功。"
,
"vip_password_changed"
:
"密码修改成功。"
,
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"pre_release_compat_hint"
:
"看起来你是使用先行卡数据的用户,已开启先行卡兼容模式。"
,
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"invalid_side_rule"
:
"副卡组中包含不允许换入副卡组的卡。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
},
"ko-kr"
:
{
"ko-kr"
:
{
...
...
docs/install_centos_6.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# install script for CentOS 7
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
sudo
yum
install
epel-release yum-utils
-y
sudo
yum
install
epel-release yum-utils
curl wget
-y
sudo
rpm
--import
"http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
sudo
rpm
--import
"http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
curl https://download.mono-project.com/repo/centos6-stable.repo |
sudo tee
/etc/yum.repos.d/mono-centos6-stable.repo
curl https://download.mono-project.com/repo/centos6-stable.repo |
sudo tee
/etc/yum.repos.d/mono-centos6-stable.repo
curl
--silent
--location
https://rpm.nodesource.com/setup_10.x |
sudo
bash -
curl
--silent
--location
https://rpm.nodesource.com/setup_10.x |
sudo
bash -
sudo
yum update
-y
sudo
yum
install
nodejs git gcc gcc-c++ sqlite-devel readline-devel openssl-devel mono-complete
-y
sudo
yum
install
-y
nodejs git gcc gcc-c++ sqlite-devel readline-devel openssl-devel wget mono-complete firewalld
sudo
npm
install
pm2
-g
sudo
npm
install
pm2
-g
sudo
systemctl start firewalld
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
22/tcp
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
7210-7219/tcp
sudo
firewall-cmd
--reload
mkdir
lib
mkdir
lib
cd
lib
cd
lib
wget https://nchc.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
--no-check-certificate
tar
jxvf p7zip_16.02_src_all.tar.bz2
cd
p7zip_16.02
sudo
make all3
install
cd
..
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
tar
xzfv redis-stable.tar.gz
tar
xzfv redis-stable.tar.gz
cd
redis-stable
cd
redis-stable
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo cp
-rf
src/redis-server /usr/bin/
sudo cp
-rf
src/redis-server /usr/bin/
cd
..
cd
..
pm2 start redis-server
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
cp
-rf
premake5 ~
cp
-rf
premake5 ~
...
@@ -40,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
...
@@ -40,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
tar
xf libevent-2.0.22-stable.tar.gz
tar
xf libevent-2.0.22-stable.tar.gz
cd
libevent-2.0.22-stable/
cd
libevent-2.0.22-stable/
./configure
./configure
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
...
@@ -50,22 +37,15 @@ cd ..
...
@@ -50,22 +37,15 @@ cd ..
cd
..
cd
..
git clone https://github.com/purerosefallen/ygopro-server ygopro-server
cd
ygopro-server
npm
install
cp
-rf
config_build config
mkdir
decks decks_save replays
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
cd
ygopro/
cd
ygopro/
git submodule foreach git checkout master
git submodule foreach git checkout master
~/premake5 gmake
~/premake5 gmake
cd
build/
cd
build/
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
..
cd
..
ln
-s
bin/release/ygopro ./
ln
-s
bin/release/ygopro ./
strip ygopro
strip ygopro
mkdir
replay
cd
..
cd
..
git clone https://github.com/purerosefallen/windbot
git clone https://github.com/purerosefallen/windbot
...
@@ -73,12 +53,13 @@ cd windbot
...
@@ -73,12 +53,13 @@ cd windbot
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
ln
-s
bin/Release/WindBot.exe
.
ln
-s
bin/Release/WindBot.exe
.
ln
-s
../ygopro/cards.cdb
.
ln
-s
../ygopro/cards.cdb
.
pm2 start pm2.json
cd
..
cd
..
pm2 start ygopro-server.js
git clone https://github.com/purerosefallen/ygopro-server
pm2 start ygopro-webhook.js
cd
ygopro-server
pm2 start restart.js
npm
install
ln
-s
../ygopro
.
pm2 save
ln
-s
../windbot
.
pm2 startup
mkdir
config
cp
data/default_config.json config/config.json
cd
..
docs/install_centos_7.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# install script for CentOS 7
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
sudo
yum
install
epel-release yum-utils
-y
sudo
yum
install
epel-release yum-utils
curl wget
-y
sudo
rpm
--import
"http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
sudo
rpm
--import
"http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
curl https://download.mono-project.com/repo/centos7-stable.repo |
sudo tee
/etc/yum.repos.d/mono-centos7-stable.repo
curl https://download.mono-project.com/repo/centos7-stable.repo |
sudo tee
/etc/yum.repos.d/mono-centos7-stable.repo
curl
--silent
--location
https://rpm.nodesource.com/setup_10.x |
sudo
bash -
curl
--silent
--location
https://rpm.nodesource.com/setup_10.x |
sudo
bash -
sudo
yum update
-y
sudo
yum
install
nodejs git gcc gcc-c++ sqlite-devel readline-devel openssl-devel mono-complete
-y
sudo
yum
install
-y
nodejs git gcc gcc-c++ sqlite-devel readline-devel openssl-devel wget mono-complete firewalld
sudo
npm
install
pm2
-g
sudo
npm
install
pm2
-g
sudo
systemctl start firewalld
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
22/tcp
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
7210-7219/tcp
sudo
firewall-cmd
--reload
mkdir
lib
mkdir
lib
cd
lib
cd
lib
wget https://nchc.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
--no-check-certificate
tar
jxvf p7zip_16.02_src_all.tar.bz2
cd
p7zip_16.02
sudo
make all3
install
cd
..
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
tar
xzfv redis-stable.tar.gz
tar
xzfv redis-stable.tar.gz
cd
redis-stable
cd
redis-stable
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo cp
-rf
src/redis-server /usr/bin/
sudo cp
-rf
src/redis-server /usr/bin/
cd
..
cd
..
pm2 start redis-server
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
cp
-rf
premake5 ~
cp
-rf
premake5 ~
...
@@ -40,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
...
@@ -40,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
tar
xf libevent-2.0.22-stable.tar.gz
tar
xf libevent-2.0.22-stable.tar.gz
cd
libevent-2.0.22-stable/
cd
libevent-2.0.22-stable/
./configure
./configure
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
...
@@ -50,22 +37,15 @@ cd ..
...
@@ -50,22 +37,15 @@ cd ..
cd
..
cd
..
git clone https://github.com/purerosefallen/ygopro-server ygopro-server
cd
ygopro-server
npm
install
cp
-rf
config_build config
mkdir
decks decks_save replays
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
cd
ygopro/
cd
ygopro/
git submodule foreach git checkout master
git submodule foreach git checkout master
~/premake5 gmake
~/premake5 gmake
cd
build/
cd
build/
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
..
cd
..
ln
-s
bin/release/ygopro ./
ln
-s
bin/release/ygopro ./
strip ygopro
strip ygopro
mkdir
replay
cd
..
cd
..
git clone https://github.com/purerosefallen/windbot
git clone https://github.com/purerosefallen/windbot
...
@@ -73,12 +53,14 @@ cd windbot
...
@@ -73,12 +53,14 @@ cd windbot
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
ln
-s
bin/Release/WindBot.exe
.
ln
-s
bin/Release/WindBot.exe
.
ln
-s
../ygopro/cards.cdb
.
ln
-s
../ygopro/cards.cdb
.
pm2 start pm2.json
cd
..
cd
..
pm2 start ygopro-server.js
git clone https://github.com/purerosefallen/ygopro-server
pm2 start ygopro-webhook.js
cd
ygopro-server
pm2 start restart.js
npm
install
ln
-s
../ygopro
.
ln
-s
../windbot
.
mkdir
config
cp
data/default_config.json config/config.json
cd
..
pm2 save
pm2 startup
docs/install_ubuntu_14.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# install script for Ubnutu 16
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-get
install
-y
apt-transport-https
sudo
apt-get
install
-y
apt-transport-https
curl wget
echo
"deb http://download.mono-project.com/repo/ubuntu stable-trusty main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
echo
"deb http://download.mono-project.com/repo/ubuntu stable-trusty main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
sudo
apt-get upgrade
-y
sudo
apt-get
install
-y
git build-essential libreadline-dev libsqlite3-dev libevent-dev mono-complete nodejs
sudo
apt-get
install
-y
curl git build-essential libreadline-dev libsqlite3-dev mono-complete nodejs firewalld
sudo
npm
install
pm2
-g
sudo
npm
install
pm2
-g
sudo
systemctl start firewalld
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
22/tcp
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
7210-7219/tcp
sudo
firewall-cmd
--reload
mkdir
lib
mkdir
lib
cd
lib
cd
lib
wget https://nchc.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
--no-check-certificate
tar
jxvf p7zip_16.02_src_all.tar.bz2
cd
p7zip_16.02
sudo
make all3
install
cd
..
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
tar
xzfv redis-stable.tar.gz
tar
xzfv redis-stable.tar.gz
cd
redis-stable
cd
redis-stable
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo cp
-rf
src/redis-server /usr/bin/
sudo cp
-rf
src/redis-server /usr/bin/
cd
..
cd
..
pm2 start redis-server
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
cp
-rf
premake5 ~
cp
-rf
premake5 ~
wget
'https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz'
-O
libevent-2.0.22-stable.tar.gz
--no-check-certificate
tar
xf libevent-2.0.22-stable.tar.gz
cd
libevent-2.0.22-stable/
./configure
make
sudo
make
install
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib/libevent_pthreads-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib64/libevent_pthreads-2.0.so.5
cd
..
cd
..
cd
..
git clone https://github.com/purerosefallen/ygopro-server ygopro-server
cd
ygopro-server
npm
install
cp
-rf
config_build config
mkdir
decks decks_save replays
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
cd
ygopro/
cd
ygopro/
git submodule foreach git checkout master
git submodule foreach git checkout master
~/premake5 gmake
~/premake5 gmake
git checkout
-f
git submodule foreach git checkout
-f
cd
build/
cd
build/
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
..
cd
..
ln
-s
bin/release/ygopro ./
ln
-s
bin/release/ygopro ./
strip ygopro
strip ygopro
mkdir
replay
cd
..
cd
..
git clone https://github.com/purerosefallen/windbot
git clone https://github.com/purerosefallen/windbot
...
@@ -73,12 +43,14 @@ cd windbot
...
@@ -73,12 +43,14 @@ cd windbot
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
ln
-s
bin/Release/WindBot.exe
.
ln
-s
bin/Release/WindBot.exe
.
ln
-s
../ygopro/cards.cdb
.
ln
-s
../ygopro/cards.cdb
.
pm2 start pm2.json
cd
..
cd
..
pm2 start ygopro-server.js
git clone https://github.com/purerosefallen/ygopro-server
pm2 start ygopro-webhook.js
cd
ygopro-server
pm2 start restart.js
npm
install
ln
-s
../ygopro
.
ln
-s
../windbot
.
mkdir
config
cp
data/default_config.json config/config.json
cd
..
pm2 save
pm2 startup
docs/install_ubuntu_16.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# install script for Ubnutu 16
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-get
install
-y
apt-transport-https
sudo
apt-get
install
-y
apt-transport-https
curl wget
echo
"deb http://download.mono-project.com/repo/ubuntu stable-xenial main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
echo
"deb http://download.mono-project.com/repo/ubuntu stable-xenial main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
sudo
apt-get upgrade
-y
sudo
apt-get
install
-y
git build-essential libreadline-dev libsqlite3-dev libevent-dev mono-complete nodejs
sudo
apt-get
install
-y
curl git build-essential libreadline-dev libsqlite3-dev mono-complete nodejs firewalld
sudo
npm
install
pm2
-g
sudo
npm
install
pm2
-g
sudo
systemctl start firewalld
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
22/tcp
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
7210-7219/tcp
sudo
firewall-cmd
--reload
mkdir
lib
mkdir
lib
cd
lib
cd
lib
wget https://nchc.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
--no-check-certificate
tar
jxvf p7zip_16.02_src_all.tar.bz2
cd
p7zip_16.02
sudo
make all3
install
cd
..
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
tar
xzfv redis-stable.tar.gz
tar
xzfv redis-stable.tar.gz
cd
redis-stable
cd
redis-stable
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo cp
-rf
src/redis-server /usr/bin/
sudo cp
-rf
src/redis-server /usr/bin/
cd
..
cd
..
pm2 start redis-server
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
cp
-rf
premake5 ~
cp
-rf
premake5 ~
wget
'https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz'
-O
libevent-2.0.22-stable.tar.gz
--no-check-certificate
tar
xf libevent-2.0.22-stable.tar.gz
cd
libevent-2.0.22-stable/
./configure
make
sudo
make
install
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib/libevent_pthreads-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib64/libevent_pthreads-2.0.so.5
cd
..
cd
..
cd
..
git clone https://github.com/purerosefallen/ygopro-server ygopro-server
cd
ygopro-server
npm
install
cp
-rf
config_build config
mkdir
decks decks_save replays
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
cd
ygopro/
cd
ygopro/
git submodule foreach git checkout master
git submodule foreach git checkout master
~/premake5 gmake
~/premake5 gmake
cd
build/
cd
build/
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
..
cd
..
ln
-s
bin/release/ygopro ./
ln
-s
bin/release/ygopro ./
strip ygopro
strip ygopro
mkdir
replay
cd
..
cd
..
git clone https://github.com/purerosefallen/windbot
git clone https://github.com/purerosefallen/windbot
...
@@ -73,12 +41,13 @@ cd windbot
...
@@ -73,12 +41,13 @@ cd windbot
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
ln
-s
bin/Release/WindBot.exe
.
ln
-s
bin/Release/WindBot.exe
.
ln
-s
../ygopro/cards.cdb
.
ln
-s
../ygopro/cards.cdb
.
pm2 start pm2.json
cd
..
cd
..
pm2 start ygopro-server.js
git clone https://github.com/purerosefallen/ygopro-server
pm2 start ygopro-webhook.js
cd
ygopro-server
pm2 start restart.js
npm
install
ln
-s
../ygopro
.
pm2 save
ln
-s
../windbot
.
pm2 startup
mkdir
config
cp
data/default_config.json config/config.json
cd
..
docs/install_ubuntu_18.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# install script for Ubnutu 16
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-key adv
--keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-get
install
-y
curl wget
echo
"deb http://download.mono-project.com/repo/ubuntu stable-bionic main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
echo
"deb http://download.mono-project.com/repo/ubuntu stable-bionic main"
|
sudo tee
/etc/apt/sources.list.d/mono-official-stable.list
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
curl
-sL
https://deb.nodesource.com/setup_10.x |
sudo
bash -
sudo
apt-get upgrade
-y
sudo
apt-get
install
-y
git build-essential libreadline-dev libsqlite3-dev libssl1.0-dev mono-complete nodejs
sudo
apt-get
install
-y
curl git build-essential libreadline-dev libsqlite3-dev mono-devel nodejs firewalld
sudo
npm
install
pm2
-g
sudo
npm
install
pm2
-g
sudo
systemctl start firewalld
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
22/tcp
sudo
firewall-cmd
--zone
=
public
--permanent
--add-port
=
7210-7219/tcp
sudo
firewall-cmd
--reload
mkdir
lib
mkdir
lib
cd
lib
cd
lib
wget https://nchc.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
--no-check-certificate
tar
jxvf p7zip_16.02_src_all.tar.bz2
cd
p7zip_16.02
sudo
make all3
install
cd
..
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
wget http://download.redis.io/releases/redis-stable.tar.gz
--no-check-certificate
tar
xzfv redis-stable.tar.gz
tar
xzfv redis-stable.tar.gz
cd
redis-stable
cd
redis-stable
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo cp
-rf
src/redis-server /usr/bin/
sudo cp
-rf
src/redis-server /usr/bin/
cd
..
cd
..
pm2 start redis-server
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
wget
-O
- https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz |
tar
zfx -
cp
-rf
premake5 ~
cp
-rf
premake5 ~
...
@@ -39,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
...
@@ -39,7 +27,7 @@ wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stab
tar
xf libevent-2.0.22-stable.tar.gz
tar
xf libevent-2.0.22-stable.tar.gz
cd
libevent-2.0.22-stable/
cd
libevent-2.0.22-stable/
./configure
./configure
make
make
-j
$PROCESS_COUNT
sudo
make
install
sudo
make
install
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
sudo ln
-s
/usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
...
@@ -49,22 +37,15 @@ cd ..
...
@@ -49,22 +37,15 @@ cd ..
cd
..
cd
..
git clone https://github.com/purerosefallen/ygopro-server ygopro-server
cd
ygopro-server
npm
install
cp
-rf
config_build config
mkdir
decks decks_save replays
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
git clone https://github.com/purerosefallen/ygopro
--branch
=
server
--recursive
cd
ygopro/
cd
ygopro/
git submodule foreach git checkout master
git submodule foreach git checkout master
~/
~/
premake5 gmake
~/premake5 gmake
cd
build/
cd
build/
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
..
cd
..
ln
-s
bin/release/ygopro ./
ln
-s
bin/release/ygopro ./
strip ygopro
strip ygopro
mkdir
replay
cd
..
cd
..
git clone https://github.com/purerosefallen/windbot
git clone https://github.com/purerosefallen/windbot
...
@@ -72,12 +53,14 @@ cd windbot
...
@@ -72,12 +53,14 @@ cd windbot
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
ln
-s
bin/Release/WindBot.exe
.
ln
-s
bin/Release/WindBot.exe
.
ln
-s
../ygopro/cards.cdb
.
ln
-s
../ygopro/cards.cdb
.
pm2 start pm2.json
cd
..
cd
..
pm2 start ygopro-server.js
git clone https://github.com/purerosefallen/ygopro-server
pm2 start ygopro-webhook.js
cd
ygopro-server
pm2 start restart.js
npm
install
ln
-s
../ygopro
.
ln
-s
../windbot
.
mkdir
config
cp
data/default_config.json config/config.json
cd
..
pm2 save
pm2 startup
docs/update.sh
View file @
abc3aa44
#!/bin/bash
#!/bin/bash
# update script
export
PROCESS_COUNT
=
$(
grep
-c
"processor"
/proc/cpuinfo
)
git
pull
origin master
git
fetch
origin master
git reset
--hard
FETCH_HEAD
git reset
--hard
FETCH_HEAD
cd
windbot
cd
windbot
git
pull
origin master
git
fetch
origin master
git reset
--hard
FETCH_HEAD
git reset
--hard
FETCH_HEAD
echo
y |
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
cd
../ygopro
cd
../ygopro
git
pull
origin server
git
fetch
origin server
git reset
--hard
FETCH_HEAD
git reset
--hard
FETCH_HEAD
git submodule foreach git
pull
origin master
git submodule foreach git
fetch
origin master
git submodule foreach git reset
--hard
FETCH_HEAD
git submodule foreach git reset
--hard
FETCH_HEAD
~/premake5 gmake
~/premake5 gmake
cd
build
cd
build
make
config
=
release
make
config
=
release
-j
$PROCESS_COUNT
cd
../
cd
../
strip ygopro
strip ygopro
cd
../
cd
../
ygopro-server.coffee
View file @
abc3aa44
...
@@ -44,6 +44,7 @@ import_datas = [
...
@@ -44,6 +44,7 @@ import_datas = [
"abuse_count"
,
"abuse_count"
,
"ban_mc"
,
"ban_mc"
,
"vip"
,
"vip"
,
"is_using_pre_release"
,
"vpass"
,
"vpass"
,
"rag"
,
"rag"
,
"rid"
,
"rid"
,
...
@@ -341,6 +342,9 @@ if settings.modules.windbot.enabled
...
@@ -341,6 +342,9 @@ if settings.modules.windbot.enabled
if
settings
.
modules
.
heartbeat_detection
.
enabled
if
settings
.
modules
.
heartbeat_detection
.
enabled
long_resolve_cards
=
loadJSON
(
'./data/long_resolve_cards.json'
)
long_resolve_cards
=
loadJSON
(
'./data/long_resolve_cards.json'
)
if
settings
.
modules
.
pre_release_compat
.
enabled
sqlite3
=
require
(
'sqlite3'
).
verbose
()
# 组件
# 组件
ygopro
=
require
'./ygopro.js'
ygopro
=
require
'./ygopro.js'
roomlist
=
require
'./roomlist.js'
if
settings
.
modules
.
http
.
websocket_roomlist
roomlist
=
require
'./roomlist.js'
if
settings
.
modules
.
http
.
websocket_roomlist
...
@@ -1015,6 +1019,22 @@ SOCKET_flush_data = (sk, datas) ->
...
@@ -1015,6 +1019,22 @@ SOCKET_flush_data = (sk, datas) ->
datas
.
splice
(
0
,
datas
.
length
)
datas
.
splice
(
0
,
datas
.
length
)
return
true
return
true
replace_buffer
=
(
buffer
,
list
,
start_pos
)
->
found
=
0
len
=
buffer
.
length
if
len
<
4
+
start_pos
return
0
for
i
in
[
start_pos
...
len
-
3
]
code
=
buffer
.
readInt32LE
(
i
)
if
list
[
code
]
code
=
list
[
code
]
buffer
.
writeInt32LE
(
code
,
i
)
found
++
i
+=
3
if
i
>=
len
-
4
break
return
found
class
Room
class
Room
constructor
:
(
name
,
@
hostinfo
)
->
constructor
:
(
name
,
@
hostinfo
)
->
@
name
=
name
@
name
=
name
...
@@ -1039,6 +1059,44 @@ class Room
...
@@ -1039,6 +1059,44 @@ class Room
@
replays
=
[]
@
replays
=
[]
ROOM_all
.
push
this
ROOM_all
.
push
this
if
settings
.
modules
.
pre_release_compat
.
enabled
list_official_to_pre
=
{}
list_pre_to_official
=
{}
@
list_official_to_pre
=
list_official_to_pre
@
list_pre_to_official
=
list_pre_to_official
temp_list
=
{}
try
official_database
=
new
sqlite3
.
Database
(
settings
.
modules
.
pre_release_compat
.
official_database
)
pre_release_database
=
new
sqlite3
.
Database
(
settings
.
modules
.
pre_release_compat
.
pre_release_database
)
pre_release_database
.
each
(
"select id,name from texts"
,
(
err
,
result
)
->
if
err
log
.
warn
(
"Error loading pre-release database."
,
err
)
else
temp_list
[
result
.
name
]
=
result
.
id
return
,
(
err
)
->
if
err
log
.
warn
(
"Error loaded pre-release database."
,
err
)
else
official_database
.
each
(
"select id,name from texts"
,
(
err
,
result
)
->
if
err
log
.
warn
(
"Error loading official database."
,
err
)
else
if
temp_list
[
result
.
name
]
and
temp_list
[
result
.
name
]
!=
result
.
id
official_code
=
result
.
id
pre_release_code
=
temp_list
[
result
.
name
]
list_official_to_pre
[
official_code
]
=
pre_release_code
list_pre_to_official
[
pre_release_code
]
=
official_code
return
,
(
err
)
->
if
err
log
.
warn
(
"Error loaded official database."
,
err
)
return
)
return
)
catch
error
log
.
warn
(
"Error loading databases"
,
error
)
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
delete
@
hostinfo
.
comment
delete
@
hostinfo
.
comment
if
lflists
.
length
if
lflists
.
length
...
@@ -1769,6 +1827,8 @@ ygopro.ctos_follow 'PLAYER_INFO', true, (buffer, info, client, server, datas)->
...
@@ -1769,6 +1827,8 @@ ygopro.ctos_follow 'PLAYER_INFO', true, (buffer, info, client, server, datas)->
client
.
name
=
name
client
.
name
=
name
client
.
vpass
=
vpass
client
.
vpass
=
vpass
client
.
name_vpass
=
if
vpass
then
name
+
"$"
+
vpass
else
name
client
.
name_vpass
=
if
vpass
then
name
+
"$"
+
vpass
else
name
if
settings
.
modules
.
pre_release_compat
.
enabled
client
.
is_using_pre_release
=
client
.
name_vpass
==
"COMPAT"
#console.log client.name, client.vpass
#console.log client.name, client.vpass
if
settings
.
modules
.
vip
.
enabled
and
CLIENT_check_vip
(
client
)
if
settings
.
modules
.
vip
.
enabled
and
CLIENT_check_vip
(
client
)
client
.
vip
=
true
client
.
vip
=
true
...
@@ -2396,6 +2456,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
...
@@ -2396,6 +2456,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
and
!
client
.
reconnecting
return
unless
room
and
!
client
.
reconnecting
msg
=
buffer
.
readInt8
(
0
)
msg
=
buffer
.
readInt8
(
0
)
if
settings
.
modules
.
pre_release_compat
.
enabled
and
client
.
is_using_pre_release
replace_buffer
(
buffer
,
room
.
list_official_to_pre
,
1
)
if
settings
.
modules
.
retry_handle
.
enabled
if
settings
.
modules
.
retry_handle
.
enabled
if
ygopro
.
constants
.
MSG
[
msg
]
==
'RETRY'
if
ygopro
.
constants
.
MSG
[
msg
]
==
'RETRY'
if
!
client
.
retry_count
?
if
!
client
.
retry_count
?
...
@@ -3259,7 +3321,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3259,7 +3321,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
client
.
side_interval
=
null
client
.
side_interval
=
null
client
.
side_tcount
=
null
client
.
side_tcount
=
null
else
else
client
.
start_deckbuf
=
buffer
client
.
start_deckbuf
=
Buffer
.
from
(
buffer
)
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
if
settings
.
modules
.
http
.
quick_death_rule
>=
2
and
room
.
started
and
room
.
death
and
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
!=
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name_vpass
]
if
settings
.
modules
.
http
.
quick_death_rule
>=
2
and
room
.
started
and
room
.
death
and
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
!=
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name_vpass
]
win_pos
=
if
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name_vpass
]
then
0
else
oppo_pos
win_pos
=
if
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name_vpass
]
then
0
else
oppo_pos
...
@@ -3272,13 +3334,22 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3272,13 +3334,22 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
])
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
])
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
])
if
room
.
hostinfo
.
mode
==
2
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
])
if
room
.
hostinfo
.
mode
==
2
return
true
return
true
if
settings
.
modules
.
side_restrict
.
enabled
and
room
.
started
for
code
in
settings
.
modules
.
side_restrict
.
restrict_cards
if
_
.
indexOf
(
buff_side
,
code
)
>
-
1
or
(
settings
.
modules
.
pre_release_compat
.
enabled
and
_
.
indexOf
(
buff_side
,
room
.
list_pre_to_official
[
code
])
>
-
1
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"${invalid_side_rule}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
3
code
:
0
}
return
true
struct
=
ygopro
.
structs
[
"deck"
]
struct
.
_setBuff
(
buffer
)
if
room
.
random_type
or
room
.
arena
if
room
.
random_type
or
room
.
arena
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
last_active_time
=
moment
()
room
.
last_active_time
=
moment
()
else
if
!
room
.
started
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
else
if
!
room
.
started
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
struct
=
ygopro
.
structs
[
"deck"
]
struct
.
_setBuff
(
buffer
)
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
...
@@ -3312,14 +3383,49 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3312,14 +3383,49 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
else
else
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_part1}
#{
found_deck
}
${deck_incorrect_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_part1}
#{
found_deck
}
${deck_incorrect_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
return
false
else
else
#log.info("player deck not found: " + client.name)
#log.info("player deck not found: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
return
false
if
settings
.
modules
.
pre_release_compat
.
enabled
found
=
false
buff_main_new
=
[]
buff_side_new
=
[]
for
code
in
buff_main
code_
=
code
if
room
.
list_pre_to_official
[
code
]
code_
=
room
.
list_pre_to_official
[
code
]
found
=
true
buff_main_new
.
push
(
code_
)
for
code
in
buff_side
code_
=
code
if
room
.
list_pre_to_official
[
code
]
code_
=
room
.
list_pre_to_official
[
code
]
found
=
true
buff_side_new
.
push
(
code_
)
if
found
compat_deckbuf
=
buff_main_new
.
concat
(
buff_side_new
)
struct
.
set
(
"mainc"
,
buff_main_new
.
length
)
struct
.
set
(
"sidec"
,
buff_side_new
.
length
)
struct
.
set
(
"deckbuf"
,
compat_deckbuf
)
buffer
=
struct
.
buffer
client
.
main
=
buff_main_new
client
.
side
=
buff_side_new
if
!
room
.
started
client
.
is_using_pre_release
=
found
or
client
.
vpass
==
"COMPAT"
if
client
.
is_using_pre_release
ygopro
.
stoc_send_chat
(
client
,
"${pre_release_compat_hint}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
return
false
return
false
ygopro
.
ctos_follow
'RESPONSE'
,
false
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
ctos_follow
'RESPONSE'
,
false
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
and
(
room
.
random_type
or
room
.
arena
)
return
unless
room
if
settings
.
modules
.
pre_release_compat
.
enabled
and
client
.
is_using_pre_release
replace_buffer
(
buffer
,
room
.
list_pre_to_official
,
0
)
return
unless
room
.
random_type
or
room
.
arena
room
.
last_active_time
=
moment
()
room
.
last_active_time
=
moment
()
return
return
...
@@ -3499,8 +3605,9 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server, datas)->
...
@@ -3499,8 +3605,9 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server, datas)->
return
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
or
settings
.
modules
.
replay_delay
unless
room
return
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
or
settings
.
modules
.
replay_delay
unless
room
if
settings
.
modules
.
cloud_replay
.
enabled
and
room
.
random_type
if
settings
.
modules
.
cloud_replay
.
enabled
and
room
.
random_type
Cloud_replay_ids
.
push
room
.
cloud_replay_id
Cloud_replay_ids
.
push
room
.
cloud_replay_id
if
settings
.
modules
.
replay_delay
and
room
.
hostinfo
.
mode
==
1
and
client
.
pos
==
0
and
not
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
if
settings
.
modules
.
replay_delay
and
room
.
hostinfo
.
mode
==
1
and
not
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
room
.
replays
.
push
(
buffer
)
# console.log("Replay saved: " + (room.duel_count - 1))
room
.
replays
[
room
.
duel_count
-
1
]
=
buffer
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
if
client
.
pos
==
0
if
client
.
pos
==
0
dueltime
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
dueltime
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
...
...
ygopro-server.js
View file @
abc3aa44
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment