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
254b36bd
Commit
254b36bd
authored
Apr 29, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mc'
parents
530973f4
4939926b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
26 deletions
+79
-26
data/default_config.json
data/default_config.json
+3
-1
data/i18n.json
data/i18n.json
+4
-0
ygopro-server.coffee
ygopro-server.coffee
+31
-12
ygopro-server.js
ygopro-server.js
+41
-13
No files found.
data/default_config.json
View file @
254b36bd
...
@@ -13,7 +13,9 @@
...
@@ -13,7 +13,9 @@
"start_lp"
:
8000
,
"start_lp"
:
8000
,
"start_hand"
:
5
,
"start_hand"
:
5
,
"draw_count"
:
1
,
"draw_count"
:
1
,
"time_limit"
:
180
"time_limit"
:
180
,
"no_watch"
:
false
,
"auto_death"
:
false
},
},
"modules"
:
{
"modules"
:
{
"welcome"
:
"MyCard YGOPro Server"
,
"welcome"
:
"MyCard YGOPro Server"
,
...
...
data/i18n.json
View file @
254b36bd
...
@@ -192,6 +192,8 @@
...
@@ -192,6 +192,8 @@
"invalid_side_rule"
:
"Illegal cards are contained in your side deck."
,
"invalid_side_rule"
:
"Illegal cards are contained in your side deck."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
"arena_wait_timeout"
:
"Your opponent did not appear, you may quit without any penalty."
,
"arena_wait_timeout"
:
"Your opponent did not appear, you may quit without any penalty."
,
"auto_death_part1"
:
"This room is an auto-extra-duel room. The Extra Duel will begin after "
,
"auto_death_part2"
:
" minutes."
,
"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"
:
{
...
@@ -531,6 +533,8 @@
...
@@ -531,6 +533,8 @@
"invalid_side_rule"
:
"副卡组中包含不允许换入副卡组的卡。"
,
"invalid_side_rule"
:
"副卡组中包含不允许换入副卡组的卡。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
"arena_wait_timeout"
:
"由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。"
,
"arena_wait_timeout"
:
"由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。"
,
"auto_death_part1"
:
"本房间为自动加时赛房间。比赛开始"
,
"auto_death_part2"
:
"分钟后,将自动进入加时赛。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
},
"ko-kr"
:
{
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
254b36bd
...
@@ -1248,7 +1248,14 @@ class Room
...
@@ -1248,7 +1248,14 @@ class Room
@
hostinfo
.
enable_priority
=
true
@
hostinfo
.
enable_priority
=
true
if
(
rule
.
match
/(^|,|,)(NOWATCH|NW)(,|,|$)/
)
if
(
rule
.
match
/(^|,|,)(NOWATCH|NW)(,|,|$)/
)
@
no_watch
=
true
@
hostinfo
.
no_watch
=
true
if
(
param
=
rule
.
match
/(^|,|,)(DEATH|DH)(\d*)(,|,|$)/
)
death_time
=
parseInt
(
param
[
3
])
if
death_time
and
death_time
>
0
@
hostinfo
.
auto_death
=
death_time
else
@
hostinfo
.
auto_death
=
40
@
hostinfo
.
replay_mode
=
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
or
@
hostinfo
.
mode
==
1
and
settings
.
modules
.
replay_delay
then
1
else
0
@
hostinfo
.
replay_mode
=
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
or
@
hostinfo
.
mode
==
1
and
settings
.
modules
.
replay_delay
then
1
else
0
...
@@ -2109,6 +2116,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2109,6 +2116,8 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
start_lp
:
opt2
start_lp
:
opt2
start_hand
:
opt3
>>
4
start_hand
:
opt3
>>
4
draw_count
:
opt3
&
0xF
draw_count
:
opt3
&
0xF
no_watch
:
false
auto_death
:
false
}
}
options
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
((
options
.
rule
==
1
)
==
list
.
tcg
)
and
list
.
date
.
isBefore
()
options
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
((
options
.
rule
==
1
)
==
list
.
tcg
)
and
list
.
date
.
isBefore
()
room
=
new
Room
(
name
,
options
)
room
=
new
Room
(
name
,
options
)
...
@@ -2150,7 +2159,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2150,7 +2159,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
else
if
room
.
error
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
started
else
if
room
.
started
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
no_watch
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
...
@@ -2167,7 +2176,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2167,7 +2176,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
client
.
write
buffer
client
.
write
buffer
else
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
else
#client.room = room
#client.room = room
...
@@ -2237,7 +2246,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2237,7 +2246,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
else
if
settings
.
modules
.
challonge
.
enabled
else
if
settings
.
modules
.
challonge
.
enabled
pre_room
=
ROOM_find_by_name
(
info
.
pass
)
pre_room
=
ROOM_find_by_name
(
info
.
pass
)
if
pre_room
and
pre_room
.
started
and
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
pre_room
.
no_watch
if
pre_room
and
pre_room
.
started
and
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
pre_room
.
hostinfo
.
no_watch
room
=
pre_room
room
=
pre_room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
...
@@ -2300,7 +2309,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2300,7 +2309,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
else
if
room
.
error
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
started
else
if
room
.
started
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
no_watch
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
#client.setTimeout(300000) #连接后超时5分钟
#client.setTimeout(300000) #连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
...
@@ -2317,7 +2326,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2317,7 +2326,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
client
.
write
buffer
client
.
write
buffer
else
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
else
for
player
in
room
.
get_playing_player
()
when
player
and
player
!=
client
and
player
.
challonge_info
.
id
==
client
.
challonge_info
.
id
for
player
in
room
.
get_playing_player
()
when
player
and
player
!=
client
and
player
.
challonge_info
.
id
==
client
.
challonge_info
.
id
...
@@ -2389,7 +2398,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2389,7 +2398,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
else
if
room
.
error
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
started
else
if
room
.
started
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
no_watch
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
...
@@ -2406,7 +2415,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2406,7 +2415,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
client
.
write
buffer
client
.
write
buffer
else
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
else
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
...
@@ -2470,7 +2479,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2470,7 +2479,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
recorder
.
on
'error'
,
(
error
)
->
recorder
.
on
'error'
,
(
error
)
->
return
return
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
watcher
and
!
room
.
no_watch
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
watcher
and
!
room
.
hostinfo
.
no_watch
room
.
watcher
=
watcher
=
if
settings
.
modules
.
test_mode
.
watch_public_hand
then
room
.
recorder
else
net
.
connect
room
.
port
,
->
room
.
watcher
=
watcher
=
if
settings
.
modules
.
test_mode
.
watch_public_hand
then
room
.
recorder
else
net
.
connect
room
.
port
,
->
ygopro
.
ctos_send
watcher
,
'PLAYER_INFO'
,
{
ygopro
.
ctos_send
watcher
,
'PLAYER_INFO'
,
{
name
:
"the Big Brother"
name
:
"the Big Brother"
...
@@ -2601,7 +2610,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
...
@@ -2601,7 +2610,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
room
.
selecting_tp
=
false
room
.
selecting_tp
=
false
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
turn
=
0
room
.
turn
=
0
room
.
duel_count
=
room
.
duel_count
+
1
room
.
duel_count
++
if
room
.
death
and
room
.
duel_count
>
1
if
room
.
death
and
room
.
duel_count
>
1
if
room
.
death
==
-
1
if
room
.
death
==
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_final}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_final}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
@@ -2825,7 +2834,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
...
@@ -2825,7 +2834,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
ygopro
.
ctos_follow
'HS_TOOBSERVER'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
ctos_follow
'HS_TOOBSERVER'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
return
unless
room
if
room
.
no_watch
if
room
.
hostinfo
.
no_watch
ygopro
.
stoc_send_chat
(
client
,
"${watch_denied_room}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"${watch_denied_room}"
,
ygopro
.
constants
.
COLORS
.
RED
)
return
true
return
true
if
(
!
room
.
arena
and
!
settings
.
modules
.
challonge
.
enabled
)
or
client
.
is_local
if
(
!
room
.
arena
and
!
settings
.
modules
.
challonge
.
enabled
)
or
client
.
is_local
...
@@ -2857,7 +2866,7 @@ ygopro.ctos_follow 'HS_KICK', true, (buffer, info, client, server, datas)->
...
@@ -2857,7 +2866,7 @@ ygopro.ctos_follow 'HS_KICK', true, (buffer, info, client, server, datas)->
ygopro
.
stoc_follow
'TYPE_CHANGE'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
stoc_follow
'TYPE_CHANGE'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
selftype
=
info
.
type
&
0xf
selftype
=
info
.
type
&
0xf
is_host
=
((
info
.
type
>>
4
)
&
0xf
)
!=
0
is_host
=
((
info
.
type
>>
4
)
&
0xf
)
!=
0
# if room and room.no_watch and selftype == 7
# if room and room.
hostinfo.
no_watch and selftype == 7
# ygopro.stoc_die(client, "${watch_denied_room}")
# ygopro.stoc_die(client, "${watch_denied_room}")
# return true
# return true
client
.
is_host
=
is_host
client
.
is_host
=
is_host
...
@@ -3054,6 +3063,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
...
@@ -3054,6 +3063,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
if
room
.
random_type
==
'T'
if
room
.
random_type
==
'T'
# 双打房不记录匹配过
# 双打房不记录匹配过
ROOM_players_oppentlist
[
player
.
ip
]
=
null
ROOM_players_oppentlist
[
player
.
ip
]
=
null
if
room
.
hostinfo
.
auto_death
ygopro
.
stoc_send_chat_to_room
(
room
,
"${auto_death_part1}
#{
room
.
hostinfo
.
auto_death
}
${auto_death_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
settings
.
modules
.
hide_name
and
room
.
duel_count
==
0
if
settings
.
modules
.
hide_name
and
room
.
duel_count
==
0
for
player
in
room
.
get_playing_player
()
when
player
!=
client
for
player
in
room
.
get_playing_player
()
when
player
!=
client
ygopro
.
stoc_send
(
client
,
'HS_PLAYER_ENTER'
,
{
ygopro
.
stoc_send
(
client
,
'HS_PLAYER_ENTER'
,
{
...
@@ -3809,6 +3820,14 @@ if settings.modules.heartbeat_detection.enabled
...
@@ -3809,6 +3820,14 @@ if settings.modules.heartbeat_detection.enabled
return
return
,
settings
.
modules
.
heartbeat_detection
.
interval
,
settings
.
modules
.
heartbeat_detection
.
interval
setInterval
()
->
current_time
=
moment
()
for
room
in
ROOM_all
when
room
and
room
.
started
and
room
.
hostinfo
.
auto_death
and
!
room
.
auto_death_triggered
and
current_time
-
moment
(
room
.
start_time
)
>
60000
*
room
.
hostinfo
.
auto_death
room
.
auto_death_triggered
=
true
room
.
start_death
()
,
1000
# spawn windbot
# spawn windbot
windbot_looplimit
=
0
windbot_looplimit
=
0
...
...
ygopro-server.js
View file @
254b36bd
...
@@ -1428,7 +1428,7 @@
...
@@ -1428,7 +1428,7 @@
Room
=
(
function
()
{
Room
=
(
function
()
{
function
Room
(
name
,
hostinfo
)
{
function
Room
(
name
,
hostinfo
)
{
var
draw_count
,
error
,
lflist
,
list_official_to_pre
,
list_pre_to_official
,
official_database
,
param
,
pre_release_database
,
rule
,
start_hand
,
start_lp
,
temp_list
,
time_limit
;
var
d
eath_time
,
d
raw_count
,
error
,
lflist
,
list_official_to_pre
,
list_pre_to_official
,
official_database
,
param
,
pre_release_database
,
rule
,
start_hand
,
start_lp
,
temp_list
,
time_limit
;
this
.
hostinfo
=
hostinfo
;
this
.
hostinfo
=
hostinfo
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
alive
=
true
;
this
.
alive
=
true
;
...
@@ -1605,7 +1605,15 @@
...
@@ -1605,7 +1605,15 @@
this
.
hostinfo
.
enable_priority
=
true
;
this
.
hostinfo
.
enable_priority
=
true
;
}
}
if
(
rule
.
match
(
/
(
^|,|,
)(
NOWATCH|NW
)(
,|,|$
)
/
))
{
if
(
rule
.
match
(
/
(
^|,|,
)(
NOWATCH|NW
)(
,|,|$
)
/
))
{
this
.
no_watch
=
true
;
this
.
hostinfo
.
no_watch
=
true
;
}
if
((
param
=
rule
.
match
(
/
(
^|,|,
)(
DEATH|DH
)(\d
*
)(
,|,|$
)
/
)))
{
death_time
=
parseInt
(
param
[
3
]);
if
(
death_time
&&
death_time
>
0
)
{
this
.
hostinfo
.
auto_death
=
death_time
;
}
else
{
this
.
hostinfo
.
auto_death
=
40
;
}
}
}
}
}
this
.
hostinfo
.
replay_mode
=
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
||
this
.
hostinfo
.
mode
===
1
&&
settings
.
modules
.
replay_delay
?
1
:
0
;
this
.
hostinfo
.
replay_mode
=
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
||
this
.
hostinfo
.
mode
===
1
&&
settings
.
modules
.
replay_delay
?
1
:
0
;
...
@@ -2644,7 +2652,9 @@
...
@@ -2644,7 +2652,9 @@
no_shuffle_deck
:
!!
(
opt1
&
1
),
no_shuffle_deck
:
!!
(
opt1
&
1
),
start_lp
:
opt2
,
start_lp
:
opt2
,
start_hand
:
opt3
>>
4
,
start_hand
:
opt3
>>
4
,
draw_count
:
opt3
&
0xF
draw_count
:
opt3
&
0xF
,
no_watch
:
false
,
auto_death
:
false
};
};
options
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
options
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
((
options
.
rule
===
1
)
===
list
.
tcg
)
&&
list
.
date
.
isBefore
();
return
((
options
.
rule
===
1
)
===
list
.
tcg
)
&&
list
.
date
.
isBefore
();
...
@@ -2704,7 +2714,7 @@
...
@@ -2704,7 +2714,7 @@
}
else
if
(
room
.
error
)
{
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_die
(
client
,
room
.
error
);
ygopro
.
stoc_die
(
client
,
room
.
error
);
}
else
if
(
room
.
started
)
{
}
else
if
(
room
.
started
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
no_watch
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
hostinfo
.
no_watch
)
{
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
...
@@ -2732,7 +2742,7 @@
...
@@ -2732,7 +2742,7 @@
}
else
{
}
else
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
}
}
}
else
if
(
room
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
}
else
if
(
room
.
hostinfo
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
}
else
{
}
else
{
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
...
@@ -2813,7 +2823,7 @@
...
@@ -2813,7 +2823,7 @@
}
}
}
else
if
(
settings
.
modules
.
challonge
.
enabled
)
{
}
else
if
(
settings
.
modules
.
challonge
.
enabled
)
{
pre_room
=
ROOM_find_by_name
(
info
.
pass
);
pre_room
=
ROOM_find_by_name
(
info
.
pass
);
if
(
pre_room
&&
pre_room
.
started
&&
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
pre_room
.
no_watch
)
{
if
(
pre_room
&&
pre_room
.
started
&&
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
pre_room
.
hostinfo
.
no_watch
)
{
room
=
pre_room
;
room
=
pre_room
;
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
...
@@ -2892,7 +2902,7 @@
...
@@ -2892,7 +2902,7 @@
}
else
if
(
room
.
error
)
{
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_die
(
client
,
room
.
error
);
ygopro
.
stoc_die
(
client
,
room
.
error
);
}
else
if
(
room
.
started
)
{
}
else
if
(
room
.
started
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
no_watch
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
hostinfo
.
no_watch
)
{
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
if
(
settings
.
modules
.
vip
.
enabled
&&
client
.
vip
&&
vip_info
.
players
[
client
.
name
].
words
)
{
if
(
settings
.
modules
.
vip
.
enabled
&&
client
.
vip
&&
vip_info
.
players
[
client
.
name
].
words
)
{
...
@@ -2919,7 +2929,7 @@
...
@@ -2919,7 +2929,7 @@
}
else
{
}
else
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
}
}
}
else
if
(
room
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
}
else
if
(
room
.
hostinfo
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
}
else
{
}
else
{
ref8
=
room
.
get_playing_player
();
ref8
=
room
.
get_playing_player
();
...
@@ -2982,7 +2992,7 @@
...
@@ -2982,7 +2992,7 @@
}
else
if
(
room
.
error
)
{
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_die
(
client
,
room
.
error
);
ygopro
.
stoc_die
(
client
,
room
.
error
);
}
else
if
(
room
.
started
)
{
}
else
if
(
room
.
started
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
no_watch
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
hostinfo
.
no_watch
)
{
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
...
@@ -3010,7 +3020,7 @@
...
@@ -3010,7 +3020,7 @@
}
else
{
}
else
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied}
"
);
}
}
}
else
if
(
room
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
}
else
if
(
room
.
hostinfo
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
}
else
{
}
else
{
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
...
@@ -3094,7 +3104,7 @@
...
@@ -3094,7 +3104,7 @@
});
});
recorder
.
on
(
'
error
'
,
function
(
error
)
{});
recorder
.
on
(
'
error
'
,
function
(
error
)
{});
}
}
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
watcher
&&
!
room
.
no_watch
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
watcher
&&
!
room
.
hostinfo
.
no_watch
)
{
room
.
watcher
=
watcher
=
settings
.
modules
.
test_mode
.
watch_public_hand
?
room
.
recorder
:
net
.
connect
(
room
.
port
,
function
()
{
room
.
watcher
=
watcher
=
settings
.
modules
.
test_mode
.
watch_public_hand
?
room
.
recorder
:
net
.
connect
(
room
.
port
,
function
()
{
ygopro
.
ctos_send
(
watcher
,
'
PLAYER_INFO
'
,
{
ygopro
.
ctos_send
(
watcher
,
'
PLAYER_INFO
'
,
{
name
:
"
the Big Brother
"
name
:
"
the Big Brother
"
...
@@ -3245,7 +3255,7 @@
...
@@ -3245,7 +3255,7 @@
room
.
selecting_tp
=
false
;
room
.
selecting_tp
=
false
;
if
(
client
.
pos
===
0
)
{
if
(
client
.
pos
===
0
)
{
room
.
turn
=
0
;
room
.
turn
=
0
;
room
.
duel_count
=
room
.
duel_count
+
1
;
room
.
duel_count
++
;
if
(
room
.
death
&&
room
.
duel_count
>
1
)
{
if
(
room
.
death
&&
room
.
duel_count
>
1
)
{
if
(
room
.
death
===
-
1
)
{
if
(
room
.
death
===
-
1
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_final}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_final}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
...
@@ -3553,7 +3563,7 @@
...
@@ -3553,7 +3563,7 @@
if
(
!
room
)
{
if
(
!
room
)
{
return
;
return
;
}
}
if
(
room
.
no_watch
)
{
if
(
room
.
hostinfo
.
no_watch
)
{
ygopro
.
stoc_send_chat
(
client
,
"
${watch_denied_room}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_denied_room}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
return
true
;
return
true
;
}
}
...
@@ -3912,6 +3922,9 @@
...
@@ -3912,6 +3922,9 @@
ROOM_players_oppentlist
[
player
.
ip
]
=
null
;
ROOM_players_oppentlist
[
player
.
ip
]
=
null
;
}
}
}
}
if
(
room
.
hostinfo
.
auto_death
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${auto_death_part1}
"
+
room
.
hostinfo
.
auto_death
+
"
${auto_death_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
}
if
(
settings
.
modules
.
hide_name
&&
room
.
duel_count
===
0
)
{
if
(
settings
.
modules
.
hide_name
&&
room
.
duel_count
===
0
)
{
ref4
=
room
.
get_playing_player
();
ref4
=
room
.
get_playing_player
();
...
@@ -4951,6 +4964,21 @@
...
@@ -4951,6 +4964,21 @@
},
settings
.
modules
.
heartbeat_detection
.
interval
);
},
settings
.
modules
.
heartbeat_detection
.
interval
);
}
}
setInterval
(
function
()
{
var
current_time
,
len3
,
m
,
results
,
room
;
current_time
=
moment
();
results
=
[];
for
(
m
=
0
,
len3
=
ROOM_all
.
length
;
m
<
len3
;
m
++
)
{
room
=
ROOM_all
[
m
];
if
(
!
(
room
&&
room
.
started
&&
room
.
hostinfo
.
auto_death
&&
!
room
.
auto_death_triggered
&&
current_time
-
moment
(
room
.
start_time
)
>
60000
*
room
.
hostinfo
.
auto_death
))
{
continue
;
}
room
.
auto_death_triggered
=
true
;
results
.
push
(
room
.
start_death
());
}
return
results
;
},
1000
);
windbot_looplimit
=
0
;
windbot_looplimit
=
0
;
spawn_windbot
=
function
()
{
spawn_windbot
=
function
()
{
...
...
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