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
474f36fb
Commit
474f36fb
authored
Jun 22, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into tcg_random
parents
8e699948
1c96596f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
203 additions
and
103 deletions
+203
-103
Dockerfile
Dockerfile
+1
-1
README.md
README.md
+5
-7
data/default_config.json
data/default_config.json
+1
-0
data/pm2-docker-tournament.json
data/pm2-docker-tournament.json
+19
-0
package-lock.json
package-lock.json
+49
-57
ygopro-server.coffee
ygopro-server.coffee
+46
-14
ygopro-server.js
ygopro-server.js
+82
-24
No files found.
Dockerfile
View file @
474f36fb
# Dockerfile for SRVPro
FROM
node:stretch
FROM
node:
12-
stretch
# apt
RUN
apt update
&&
\
...
...
README.md
View file @
474f36fb
...
...
@@ -28,13 +28,6 @@
### 使用方法
*
可参考
[
wiki
](
https://github.com/moecube/srvpro/wiki
)
安装
*
一键安装:
*
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 | 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 | 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 | bash -`
*
手动安装:
*
`git clone https://github.com/moecube/srvpro.git`
*
`cd srvpro`
...
...
@@ -42,6 +35,11 @@
*
安装修改后的YGOPro服务端:https://github.com/moecube/ygopro/tree/server
*
`node ygopro-server.js`
即可运行
*
简易的控制台在 http://srvpro.ygo233.com/dashboard.html 或 http://srvpro-cn.ygo233.com/dashboard.html
*
使用本项目的Docker镜像: https://hub.docker.com/r/mycard/ygopro-server/
*
`7911`
: YGOPro端口
*
`7922`
: 管理后台端口
*
`/ygopro-server/config`
: SRVPro配置文件数据卷
*
`/ygopro-server/ygopro/expansions`
: YGOPro额外卡片数据卷
### 高级功能
*
待补充说明
...
...
data/default_config.json
View file @
474f36fb
...
...
@@ -167,6 +167,7 @@
"check_permit"
:
"https://api.mycard.moe/ygopro/match/permit"
,
"post_score"
:
false
,
"get_score"
:
false
,
"punish_quit_before_match"
:
false
,
"init_post"
:
{
"enabled"
:
false
,
"url"
:
"https://api.mycard.moe/ygopro/match/clear"
,
...
...
data/pm2-docker-tournament.json
0 → 100644
View file @
474f36fb
{
"apps"
:
[
{
"name"
:
"ygopro-server"
,
"script"
:
"/ygopro-server/ygopro-server.js"
,
"cwd"
:
"/ygopro-server"
},
{
"name"
:
"ygopro-tournament"
,
"script"
:
"/ygopro-server/ygopro-tournament.js"
,
"cwd"
:
"/ygopro-server"
},
{
"name"
:
"redis-server"
,
"script"
:
"/usr/bin/redis-server"
,
"cwd"
:
"/redis"
}
]
}
package-lock.json
View file @
474f36fb
...
...
@@ -158,9 +158,9 @@
"integrity"
:
"sha1-bbtozri8YPKzE9zFzhWZ8G0Z5no="
},
"combined-stream"
:
{
"version"
:
"1.0.
7
"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.
7
.tgz"
,
"integrity"
:
"sha512-
brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w
=="
,
"version"
:
"1.0.
8
"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.
8
.tgz"
,
"integrity"
:
"sha512-
FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg
=="
,
"requires"
:
{
"delayed-stream"
:
"~1.0.0"
}
...
...
@@ -189,9 +189,9 @@
}
},
"debug"
:
{
"version"
:
"
4.1.1
"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-
4.1.1
.tgz"
,
"integrity"
:
"sha512-
pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw
=="
,
"version"
:
"
3.2.6
"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-
3.2.6
.tgz"
,
"integrity"
:
"sha512-
mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ
=="
,
"requires"
:
{
"ms"
:
"^2.1.1"
}
...
...
@@ -293,9 +293,9 @@
"integrity"
:
"sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg=="
},
"fs-minipass"
:
{
"version"
:
"1.2.
5
"
,
"resolved"
:
"https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.
5
.tgz"
,
"integrity"
:
"sha512-
JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2o
Q=="
,
"version"
:
"1.2.
6
"
,
"resolved"
:
"https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.
6
.tgz"
,
"integrity"
:
"sha512-
crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaae
Q=="
,
"requires"
:
{
"minipass"
:
"^2.2.1"
}
...
...
@@ -553,14 +553,14 @@
"integrity"
:
"sha1-2qBoIGKCVCwIgojpdcKXwa53tpA="
},
"load-json-file"
:
{
"version"
:
"6.
0
.0"
,
"resolved"
:
"https://registry.npmjs.org/load-json-file/-/load-json-file-6.
0
.0.tgz"
,
"integrity"
:
"sha512-
3/eL1P4bnmFo3iQUGcDs9V+7IKUmwq//lcgRcduRsCf3AUe7NYFHkRIUUjbzOj3jpr0HIWfkZYUKrCdwLcMU/w
=="
,
"version"
:
"6.
1
.0"
,
"resolved"
:
"https://registry.npmjs.org/load-json-file/-/load-json-file-6.
1
.0.tgz"
,
"integrity"
:
"sha512-
Oxzrf5BMvKyMOwuAXwDUdTO1kBo646k1rc644wfr2xZWqXHKj70DHtLeU1COKFqPX0aUGflj2mOUMTJZfSMMyg
=="
,
"requires"
:
{
"graceful-fs"
:
"^4.1.15"
,
"parse-json"
:
"^4.0.0"
,
"strip-bom"
:
"^
3
.0.0"
,
"type-fest"
:
"^0.
4.1
"
"strip-bom"
:
"^
4
.0.0"
,
"type-fest"
:
"^0.
5.2
"
},
"dependencies"
:
{
"graceful-fs"
:
{
...
...
@@ -632,9 +632,9 @@
"integrity"
:
"sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"ms"
:
{
"version"
:
"2.1.
1
"
,
"resolved"
:
"https://registry.npmjs.org/ms/-/ms-2.1.
1
.tgz"
,
"integrity"
:
"sha512-
tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg
=="
"version"
:
"2.1.
2
"
,
"resolved"
:
"https://registry.npmjs.org/ms/-/ms-2.1.
2
.tgz"
,
"integrity"
:
"sha512-
sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w
=="
},
"mv"
:
{
"version"
:
"2.1.1"
,
...
...
@@ -648,10 +648,9 @@
}
},
"nan"
:
{
"version"
:
"2.13.2"
,
"resolved"
:
"https://registry.npmjs.org/nan/-/nan-2.13.2.tgz"
,
"integrity"
:
"sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw=="
,
"optional"
:
true
"version"
:
"2.14.0"
,
"resolved"
:
"https://registry.npmjs.org/nan/-/nan-2.14.0.tgz"
,
"integrity"
:
"sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
},
"natives"
:
{
"version"
:
"1.1.6"
,
...
...
@@ -665,11 +664,11 @@
"optional"
:
true
},
"needle"
:
{
"version"
:
"2.
3.1
"
,
"resolved"
:
"https://registry.npmjs.org/needle/-/needle-2.
3.1
.tgz"
,
"integrity"
:
"sha512-
CaLXV3W8Vnbps8ZANqDGz7j4x7Yj1LW4TWF/TQuDfj7Cfx4nAPTvw98qgTevtto1oHDrh3pQkaODbqupXlsWT
g=="
,
"version"
:
"2.
4.0
"
,
"resolved"
:
"https://registry.npmjs.org/needle/-/needle-2.
4.0
.tgz"
,
"integrity"
:
"sha512-
4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZ
g=="
,
"requires"
:
{
"debug"
:
"^
4.1.0
"
,
"debug"
:
"^
3.2.6
"
,
"iconv-lite"
:
"^0.4.4"
,
"sax"
:
"^1.2.4"
}
...
...
@@ -692,9 +691,9 @@
},
"dependencies"
:
{
"glob"
:
{
"version"
:
"7.1.
3
"
,
"resolved"
:
"https://registry.npmjs.org/glob/-/glob-7.1.
3
.tgz"
,
"integrity"
:
"sha512-
vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ
=="
,
"version"
:
"7.1.
4
"
,
"resolved"
:
"https://registry.npmjs.org/glob/-/glob-7.1.
4
.tgz"
,
"integrity"
:
"sha512-
hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A
=="
,
"requires"
:
{
"fs.realpath"
:
"^1.0.0"
,
"inflight"
:
"^1.0.4"
,
...
...
@@ -921,9 +920,9 @@
"integrity"
:
"sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"psl"
:
{
"version"
:
"1.1.3
1
"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.1.3
1
.tgz"
,
"integrity"
:
"sha512-
/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw
=="
"version"
:
"1.1.3
2
"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.1.3
2
.tgz"
,
"integrity"
:
"sha512-
MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g
=="
},
"pullstream"
:
{
"version"
:
"0.0.4"
,
...
...
@@ -987,9 +986,9 @@
}
},
"redis-commands"
:
{
"version"
:
"1.
4
.0"
,
"resolved"
:
"https://registry.npmjs.org/redis-commands/-/redis-commands-1.
4
.0.tgz"
,
"integrity"
:
"sha512-
cu8EF+MtkwI4DLIT0x9P8qNTLFhQD4jLfxLR0cCNkeGzs87FN6879JOJwNQR/1zD7aSYNbU0hgsV9zGY71Itvw
=="
"version"
:
"1.
5
.0"
,
"resolved"
:
"https://registry.npmjs.org/redis-commands/-/redis-commands-1.
5
.0.tgz"
,
"integrity"
:
"sha512-
6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg
=="
},
"redis-parser"
:
{
"version"
:
"2.6.0"
,
...
...
@@ -1086,20 +1085,13 @@
"integrity"
:
"sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
},
"sqlite3"
:
{
"version"
:
"4.0.
6
"
,
"resolved"
:
"https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.
6
.tgz"
,
"integrity"
:
"sha512-
EqBXxHdKiwvNMRCgml86VTL5TK1i0IKiumnfxykX0gh6H6jaKijAXvE9O1N7+omfNSawR2fOmIyJZcfe8HYWp
w=="
,
"version"
:
"4.0.
8
"
,
"resolved"
:
"https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.
8
.tgz"
,
"integrity"
:
"sha512-
kgwHu4j10KhpCHtx//dejd/tVQot7jc3sw+Sn0vMuKOw0X00Ckyg9VceKgzPyGmmz+zEoYue9tOLriWTvYy0w
w=="
,
"requires"
:
{
"nan"
:
"
~2.10.0
"
,
"nan"
:
"
^2.12.1
"
,
"node-pre-gyp"
:
"^0.11.0"
,
"request"
:
"^2.87.0"
},
"dependencies"
:
{
"nan"
:
{
"version"
:
"2.10.0"
,
"resolved"
:
"https://registry.npmjs.org/nan/-/nan-2.10.0.tgz"
,
"integrity"
:
"sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
}
}
},
"sshpk"
:
{
...
...
@@ -1150,9 +1142,9 @@
}
},
"strip-bom"
:
{
"version"
:
"
3
.0.0"
,
"resolved"
:
"https://registry.npmjs.org/strip-bom/-/strip-bom-
3
.0.0.tgz"
,
"integrity"
:
"sha
1-IzTBjpx1n3vdVv3vfprj1YjmjtM
="
"version"
:
"
4
.0.0"
,
"resolved"
:
"https://registry.npmjs.org/strip-bom/-/strip-bom-
4
.0.0.tgz"
,
"integrity"
:
"sha
512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=
="
},
"strip-json-comments"
:
{
"version"
:
"2.0.1"
,
...
...
@@ -1160,17 +1152,17 @@
"integrity"
:
"sha1-PFMZQukIwml8DsNEhYwobHygpgo="
},
"tar"
:
{
"version"
:
"4.4.
8
"
,
"resolved"
:
"https://registry.npmjs.org/tar/-/tar-4.4.
8
.tgz"
,
"integrity"
:
"sha512-
LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ
=="
,
"version"
:
"4.4.
10
"
,
"resolved"
:
"https://registry.npmjs.org/tar/-/tar-4.4.
10
.tgz"
,
"integrity"
:
"sha512-
g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA
=="
,
"requires"
:
{
"chownr"
:
"^1.1.1"
,
"fs-minipass"
:
"^1.2.5"
,
"minipass"
:
"^2.3.
4
"
,
"minizlib"
:
"^1.
1
.1"
,
"minipass"
:
"^2.3.
5
"
,
"minizlib"
:
"^1.
2
.1"
,
"mkdirp"
:
"^0.5.0"
,
"safe-buffer"
:
"^5.1.2"
,
"yallist"
:
"^3.0.
2
"
"yallist"
:
"^3.0.
3
"
}
},
"through"
:
{
...
...
@@ -1213,9 +1205,9 @@
"integrity"
:
"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type-fest"
:
{
"version"
:
"0.
4.1
"
,
"resolved"
:
"https://registry.npmjs.org/type-fest/-/type-fest-0.
4.1
.tgz"
,
"integrity"
:
"sha512-
IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPM
w=="
"version"
:
"0.
5.2
"
,
"resolved"
:
"https://registry.npmjs.org/type-fest/-/type-fest-0.
5.2
.tgz"
,
"integrity"
:
"sha512-
DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RS
w=="
},
"ultron"
:
{
"version"
:
"1.0.2"
,
...
...
ygopro-server.coffee
View file @
474f36fb
...
...
@@ -1567,10 +1567,13 @@ class Room
else
#log.info(client.name, @started, @disconnector, @random_type, @players.length)
if
@
arena
and
!
@
started
and
@
disconnector
!=
'server'
and
!
@
arena_score_handled
for
player
in
@
players
when
player
.
pos
!=
7
@
scores
[
player
.
name_vpass
]
=
0
if
@
players
.
length
==
2
and
!
client
.
arena_quit_free
if
settings
.
modules
.
arena_mode
.
punish_quit_before_match
and
@
players
.
length
==
2
and
!
client
.
arena_quit_free
for
player
in
@
players
when
player
.
pos
!=
7
@
scores
[
player
.
name_vpass
]
=
0
@
scores
[
client
.
name_vpass
]
=
-
9
else
for
player
in
@
players
when
player
.
pos
!=
7
@
scores
[
player
.
name_vpass
]
=
-
5
@
arena_score_handled
=
true
index
=
_
.
indexOf
(
@
players
,
client
)
@
players
.
splice
(
index
,
1
)
unless
index
==
-
1
...
...
@@ -2718,6 +2721,9 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
room
.
winner_name
=
room
.
dueling_players
[
pos
].
name_vpass
#log.info room.dueling_players, pos
room
.
scores
[
room
.
winner_name
]
=
room
.
scores
[
room
.
winner_name
]
+
1
if
room
.
match_kill
room
.
match_kill
=
false
room
.
scores
[
room
.
winner_name
]
=
99
if
settings
.
modules
.
vip
.
enabled
and
room
.
dueling_players
[
pos
].
vip
and
vip_info
.
players
[
room
.
dueling_players
[
pos
].
name
].
victory
for
line
in
_
.
lines
vip_info
.
players
[
room
.
dueling_players
[
pos
].
name
].
victory
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
...
...
@@ -2730,6 +2736,9 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
else
room
.
death
=
5
if
ygopro
.
constants
.
MSG
[
msg
]
==
'MATCH_KILL'
and
client
.
pos
==
0
room
.
match_kill
=
true
#lp跟踪
if
ygopro
.
constants
.
MSG
[
msg
]
==
'DAMAGE'
and
client
.
pos
==
0
pos
=
buffer
.
readUInt8
(
1
)
...
...
@@ -3846,15 +3855,16 @@ if settings.modules.mycard.enabled
CLIENT_kick
(
room
.
waiting_for_player
)
else
if
time_passed
>=
(
settings
.
modules
.
random_duel
.
hang_timeout
-
20
)
and
not
(
time_passed
%
10
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
room
.
waiting_for_player
.
name
}
${afk_warn_part1}
#{
settings
.
modules
.
random_duel
.
hang_timeout
-
time_passed
}
${afk_warn_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
for
room
in
ROOM_all
when
room
and
room
.
arena
and
!
room
.
started
and
room
.
get_playing_player
().
length
<
2
player
=
room
.
get_playing_player
()[
0
]
if
player
and
player
.
join_time
and
!
player
.
arena_quit_free
waited_time
=
moment
()
-
player
.
join_time
if
waited_time
>=
30000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_timeout}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
player
.
arena_quit_free
=
true
else
if
waited_time
>=
5000
and
waited_time
<
6000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_hint}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
settings
.
modules
.
arena_mode
.
punish_quit_before_match
for
room
in
ROOM_all
when
room
and
room
.
arena
and
!
room
.
started
and
room
.
get_playing_player
().
length
<
2
player
=
room
.
get_playing_player
()[
0
]
if
player
and
player
.
join_time
and
!
player
.
arena_quit_free
waited_time
=
moment
()
-
player
.
join_time
if
waited_time
>=
30000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_timeout}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
player
.
arena_quit_free
=
true
else
if
waited_time
>=
5000
and
waited_time
<
6000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_hint}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
return
,
1000
...
...
@@ -3876,6 +3886,7 @@ setInterval ()->
# spawn windbot
windbot_looplimit
=
0
windbot_process
=
null
spawn_windbot
=
()
->
if
/^win/
.
test
(
process
.
platform
)
...
...
@@ -3889,13 +3900,13 @@ spawn_windbot = () ->
windbot_process
=
spawn
windbot_bin
,
windbot_parameters
,
{
cwd
:
'windbot'
}
windbot_process
.
on
'error'
,
(
err
)
->
log
.
warn
'WindBot ERROR'
,
err
if
windbot_looplimit
<
1000
if
windbot_looplimit
<
1000
and
!
rebooted
windbot_looplimit
++
spawn_windbot
()
return
windbot_process
.
on
'exit'
,
(
code
)
->
log
.
warn
'WindBot EXIT'
,
code
if
windbot_looplimit
<
1000
if
windbot_looplimit
<
1000
and
!
rebooted
windbot_looplimit
++
spawn_windbot
()
return
...
...
@@ -3912,6 +3923,7 @@ spawn_windbot = () ->
if
settings
.
modules
.
windbot
.
enabled
and
settings
.
modules
.
windbot
.
spawn
spawn_windbot
()
rebooted
=
false
#http
if
settings
.
modules
.
http
...
...
@@ -4186,6 +4198,26 @@ if settings.modules.http
else
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['room not found', '"
+
u
.
query
.
deathcancel
+
"']"
))
else
if
u
.
query
.
reboot
if
!
auth
.
auth
(
u
.
query
.
username
,
u
.
query
.
pass
,
"stop"
,
"reboot"
)
response
.
writeHead
(
200
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
return
for
room
in
ROOM_all
when
room
if
room
.
started
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
=
0
room
.
scores
[
room
.
dueling_players
[
1
].
name_vpass
]
=
0
room
.
kicked
=
true
room
.
send_replays
()
room
.
process
.
kill
()
room
.
delete
()
rebooted
=
true
if
windbot_process
windbot_process
.
kill
()
response
.
writeHead
(
200
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['reboot ok', '"
+
u
.
query
.
reboot
+
"']"
))
throw
"rebooted"
else
if
u
.
query
.
generatekey
and
settings
.
modules
.
vip
.
enabled
if
!
auth
.
auth
(
u
.
query
.
username
,
u
.
query
.
pass
,
"vip"
,
"generate_keys"
)
response
.
writeHead
(
200
)
...
...
ygopro-server.js
View file @
474f36fb
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