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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
MyCard
srvpro
Commits
1bf648a2
Commit
1bf648a2
authored
May 08, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make recover replay available to non-tournament mode
parent
6a13b897
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
data/default_config.json
data/default_config.json
+1
-1
ygopro-server.coffee
ygopro-server.coffee
+4
-4
ygopro-server.js
ygopro-server.js
+4
-4
No files found.
data/default_config.json
View file @
1bf648a2
...
...
@@ -169,7 +169,7 @@
"replay_path"
:
"./replays/"
,
"replay_archive_tool"
:
"7z"
,
"block_replay_to_player"
:
false
,
"enable_recover"
:
tru
e
,
"enable_recover"
:
fals
e
,
"show_ip"
:
false
,
"show_info"
:
true
,
"log_save_path"
:
"./config/"
,
...
...
ygopro-server.coffee
View file @
1bf648a2
...
...
@@ -1026,7 +1026,7 @@ CLIENT_is_banned_by_mc = global.CLIENT_is_banned_by_mc = (client) ->
return
client
.
ban_mc
and
client
.
ban_mc
.
banned
and
moment
().
isBefore
(
client
.
ban_mc
.
until
)
CLIENT_send_replays
=
global
.
CLIENT_send_replays
=
(
client
,
room
)
->
return
false
unless
settings
.
modules
.
replay_delay
and
not
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
and
room
.
replays
.
length
and
room
.
hostinfo
.
mode
==
1
and
!
client
.
replays_sent
and
!
client
.
closed
return
false
unless
settings
.
modules
.
replay_delay
and
not
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
and
room
.
replays
.
length
and
room
.
hostinfo
.
mode
==
1
and
!
client
.
replays_sent
and
!
client
.
closed
client
.
replays_sent
=
true
i
=
0
for
buffer
in
room
.
replays
...
...
@@ -1195,7 +1195,7 @@ class Room
if
settings
.
modules
.
tournament_mode
.
enabled
@
hostinfo
.
replay_mode
|=
0x1
if
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
)
or
(
@
hostinfo
.
mode
==
1
and
settings
.
modules
.
replay_delay
)
if
(
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
or
(
@
hostinfo
.
mode
==
1
and
settings
.
modules
.
replay_delay
)
@
hostinfo
.
replay_mode
|=
0x2
param
=
[
0
,
@
hostinfo
.
lflist
,
@
hostinfo
.
rule
,
@
hostinfo
.
mode
,
@
hostinfo
.
duel_rule
,
...
...
@@ -3566,13 +3566,13 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server, datas)->
ygopro
.
stoc_follow
'REPLAY'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
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
.
block_replay_to_player
or
settings
.
modules
.
replay_delay
unless
room
if
settings
.
modules
.
cloud_replay
.
enabled
and
room
.
random_type
Cloud_replay_ids
.
push
room
.
cloud_replay_id
if
!
room
.
replays
[
room
.
duel_count
-
1
]
# console.log("Replay saved: ", room.duel_count - 1, client.pos)
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
or
settings
.
modules
.
tournament_mode
.
enable_recover
if
client
.
pos
==
0
dueltime
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
replay_filename
=
dueltime
...
...
ygopro-server.js
View file @
1bf648a2
...
...
@@ -1375,7 +1375,7 @@
CLIENT_send_replays
=
global
.
CLIENT_send_replays
=
function
(
client
,
room
)
{
var
buffer
,
i
,
len2
,
m
,
ref2
;
if
(
!
(
settings
.
modules
.
replay_delay
&&
!
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
&&
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
&&
room
.
replays
.
length
&&
room
.
hostinfo
.
mode
===
1
&&
!
client
.
replays_sent
&&
!
client
.
closed
))
{
if
(
!
(
settings
.
modules
.
replay_delay
&&
!
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
&&
room
.
replays
.
length
&&
room
.
hostinfo
.
mode
===
1
&&
!
client
.
replays_sent
&&
!
client
.
closed
))
{
return
false
;
}
client
.
replays_sent
=
true
;
...
...
@@ -1579,7 +1579,7 @@
if
(
settings
.
modules
.
tournament_mode
.
enabled
)
{
this
.
hostinfo
.
replay_mode
|=
0x1
;
}
if
((
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
)
||
(
this
.
hostinfo
.
mode
===
1
&&
settings
.
modules
.
replay_delay
))
{
if
((
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
block_replay_to_player
)
||
(
this
.
hostinfo
.
mode
===
1
&&
settings
.
modules
.
replay_delay
))
{
this
.
hostinfo
.
replay_mode
|=
0x2
;
}
param
=
[
0
,
this
.
hostinfo
.
lflist
,
this
.
hostinfo
.
rule
,
this
.
hostinfo
.
mode
,
this
.
hostinfo
.
duel_rule
,
(
this
.
hostinfo
.
no_check_deck
?
'
T
'
:
'
F
'
),
(
this
.
hostinfo
.
no_shuffle_deck
?
'
T
'
:
'
F
'
),
this
.
hostinfo
.
start_lp
,
this
.
hostinfo
.
start_hand
,
this
.
hostinfo
.
draw_count
,
this
.
hostinfo
.
time_limit
,
this
.
hostinfo
.
replay_mode
];
...
...
@@ -4764,7 +4764,7 @@
var
duellog
,
dueltime
,
i
,
len2
,
len3
,
m
,
n
,
player
,
ref2
,
ref3
,
replay_filename
,
room
;
room
=
ROOM_all
[
client
.
rid
];
if
(
!
room
)
{
return
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
&&
settings
.
modules
.
tournament_mode
.
block_replay_to_player
||
settings
.
modules
.
replay_delay
;
return
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
block_replay_to_player
||
settings
.
modules
.
replay_delay
;
}
if
(
settings
.
modules
.
cloud_replay
.
enabled
&&
room
.
random_type
)
{
Cloud_replay_ids
.
push
(
room
.
cloud_replay_id
);
...
...
@@ -4773,7 +4773,7 @@
// console.log("Replay saved: ", room.duel_count - 1, client.pos)
room
.
replays
[
room
.
duel_count
-
1
]
=
buffer
;
}
if
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
)
{
if
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
||
settings
.
modules
.
tournament_mode
.
enable_recover
)
{
if
(
client
.
pos
===
0
)
{
dueltime
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
);
replay_filename
=
dueltime
;
...
...
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