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
340b7149
Commit
340b7149
authored
Feb 10, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show ip & duel info in dashboard & replay dashboard
parent
6f635e0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
config.json
config.json
+4
-0
ygopro-server.coffee
ygopro-server.coffee
+7
-5
ygopro-server.js
ygopro-server.js
+7
-5
No files found.
config.json
View file @
340b7149
...
...
@@ -86,6 +86,8 @@
"deck_path"
:
"./decks/"
,
"replay_safe"
:
true
,
"replay_path"
:
"./replays/"
,
"show_ip"
:
false
,
"show_info"
:
true
,
"duel_log"
:
[],
"password"
:
"123456"
,
"port"
:
7933
...
...
@@ -136,6 +138,8 @@
"password"
:
"123456"
,
"websocket_roomlist"
:
false
,
"public_roomlist"
:
false
,
"show_ip"
:
false
,
"show_info"
:
true
,
"ssl"
:
{
"enabled"
:
false
,
"port"
:
7923
,
...
...
ygopro-server.coffee
View file @
340b7149
...
...
@@ -312,6 +312,7 @@ class Room
@
random_type
=
''
@
welcome
=
''
@
scores
=
{}
@
duel_count
=
0
ROOM_all
.
push
this
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
...
...
@@ -1247,6 +1248,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
client
.
lp
=
room
.
hostinfo
.
start_lp
if
client
.
pos
==
0
room
.
turn
=
0
room
.
duel_count
=
room
.
duel_count
+
1
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
...
...
@@ -1486,7 +1488,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
deck_arena
=
deck_arena
+
'custom'
#log.info "DECK LOG START", client.name, room.arena
if
settings
.
modules
.
deck_log
.
local
deck_name
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
+
' '
+
room
.
port
+
' '
+
client
.
pos
+
' '
+
client
.
name
.
replace
(
/[\/\\\?\*]/g
,
'_'
)
deck_name
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
+
' '
+
room
.
port
+
' '
+
client
.
pos
+
' '
+
client
.
ip
.
slice
(
7
)
+
' '
+
client
.
name
.
replace
(
/[\/\\\?\*]/g
,
'_'
)
fs
.
writeFile
settings
.
modules
.
deck_log
.
local
+
deck_name
+
'.ydk'
,
deck_text
,
'utf-8'
,
(
err
)
->
if
err
log
.
warn
'DECK SAVE ERROR'
,
err
...
...
@@ -1783,12 +1785,12 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)->
replay_filename
=
replay_filename
.
replace
(
/[\/\\\?\*]/g
,
'_'
)
+
".yrp"
duellog
=
{
time
:
dueltime
,
name
:
room
.
name
,
name
:
room
.
name
+
(
if
settings
.
modules
.
tournament_mode
.
show_info
then
(
" (Duel:"
+
room
.
duel_count
+
")"
)
else
""
)
,
roomid
:
room
.
port
.
toString
(),
cloud_replay_id
:
"R#"
+
room
.
cloud_replay_id
,
replay_filename
:
replay_filename
,
players
:
(
for
player
in
room
.
dueling_players
name
:
player
.
name
,
name
:
player
.
name
+
(
if
settings
.
modules
.
tournament_mode
.
show_ip
and
player
.
ip
!=
'::ffff:127.0.0.1'
then
(
" (IP: "
+
player
.
ip
.
slice
(
7
)
+
")"
)
else
""
)
+
(
if
settings
.
modules
.
tournament_mode
.
show_info
and
not
(
room
.
hostinfo
.
mode
==
2
and
player
.
pos
>
1
)
then
(
" (Score:"
+
room
.
scores
[
player
.
name
]
+
" LP:"
+
(
if
player
.
lp
?
then
player
.
lp
else
room
.
hostinfo
.
start_lp
)
+
")"
)
else
""
)
,
winner
:
player
.
pos
==
room
.
winner
)
}
...
...
@@ -1886,10 +1888,10 @@ if settings.modules.http
needpass
:
(
room
.
name
.
indexOf
(
'$'
)
!=
-
1
).
toString
(),
users
:
(
for
player
in
room
.
players
when
player
.
pos
?
id
:
(
-
1
).
toString
(),
name
:
player
.
name
,
name
:
player
.
name
+
(
if
settings
.
modules
.
http
.
show_ip
and
pass_validated
and
player
.
ip
!=
'::ffff:127.0.0.1'
then
(
" (IP: "
+
player
.
ip
.
slice
(
7
)
+
")"
)
else
""
)
+
(
if
settings
.
modules
.
http
.
show_info
and
room
.
started
and
not
(
room
.
hostinfo
.
mode
==
2
and
player
.
pos
>
1
)
then
(
" (Score:"
+
room
.
scores
[
player
.
name
]
+
" LP:"
+
(
if
player
.
lp
?
then
player
.
lp
else
room
.
hostinfo
.
start_lp
)
+
")"
)
else
""
)
,
pos
:
player
.
pos
),
istart
:
if
room
.
started
then
'start'
else
'wait'
istart
:
if
room
.
started
then
(
if
settings
.
modules
.
http
.
show_info
then
(
"Duel:"
+
room
.
duel_count
+
" Turn:"
+
(
if
room
.
turn
?
then
room
.
turn
else
0
))
else
'start'
)
else
'wait'
),
null
,
2
response
.
end
(
addCallback
(
u
.
query
.
callback
,
roomsjson
))
...
...
ygopro-server.js
View file @
340b7149
...
...
@@ -432,6 +432,7 @@
this
.
random_type
=
''
;
this
.
welcome
=
''
;
this
.
scores
=
{};
this
.
duel_count
=
0
;
ROOM_all
.
push
(
this
);
this
.
hostinfo
||
(
this
.
hostinfo
=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
)));
if
(
settings
.
lflist
.
length
)
{
...
...
@@ -1492,6 +1493,7 @@
client
.
lp
=
room
.
hostinfo
.
start_lp
;
if
(
client
.
pos
===
0
)
{
room
.
turn
=
0
;
room
.
duel_count
=
room
.
duel_count
+
1
;
}
}
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
NEW_TURN
'
)
{
...
...
@@ -1827,7 +1829,7 @@
deck_arena
=
deck_arena
+
'
custom
'
;
}
if
(
settings
.
modules
.
deck_log
.
local
)
{
deck_name
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
)
+
'
'
+
room
.
port
+
'
'
+
client
.
pos
+
'
'
+
client
.
name
.
replace
(
/
[\/\\\?\*]
/g
,
'
_
'
);
deck_name
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
)
+
'
'
+
room
.
port
+
'
'
+
client
.
pos
+
'
'
+
client
.
ip
.
slice
(
7
)
+
'
'
+
client
.
name
.
replace
(
/
[\/\\\?\*]
/g
,
'
_
'
);
fs
.
writeFile
(
settings
.
modules
.
deck_log
.
local
+
deck_name
+
'
.ydk
'
,
deck_text
,
'
utf-8
'
,
function
(
err
)
{
if
(
err
)
{
return
log
.
warn
(
'
DECK SAVE ERROR
'
,
err
);
...
...
@@ -2234,7 +2236,7 @@
replay_filename
=
replay_filename
.
replace
(
/
[\/\\\?\*]
/g
,
'
_
'
)
+
"
.yrp
"
;
duellog
=
{
time
:
dueltime
,
name
:
room
.
name
,
name
:
room
.
name
+
(
settings
.
modules
.
tournament_mode
.
show_info
?
"
(Duel:
"
+
room
.
duel_count
+
"
)
"
:
""
)
,
roomid
:
room
.
port
.
toString
(),
cloud_replay_id
:
"
R#
"
+
room
.
cloud_replay_id
,
replay_filename
:
replay_filename
,
...
...
@@ -2245,7 +2247,7 @@
for
(
k
=
0
,
len1
=
ref1
.
length
;
k
<
len1
;
k
++
)
{
player
=
ref1
[
k
];
results
.
push
({
name
:
player
.
name
,
name
:
player
.
name
+
(
settings
.
modules
.
tournament_mode
.
show_ip
&&
player
.
ip
!==
'
::ffff:127.0.0.1
'
?
"
(IP:
"
+
player
.
ip
.
slice
(
7
)
+
"
)
"
:
""
)
+
(
settings
.
modules
.
tournament_mode
.
show_info
&&
!
(
room
.
hostinfo
.
mode
===
2
&&
player
.
pos
>
1
)
?
"
(Score:
"
+
room
.
scores
[
player
.
name
]
+
"
LP:
"
+
(
player
.
lp
!=
null
?
player
.
lp
:
room
.
hostinfo
.
start_lp
)
+
"
)
"
:
""
)
,
winner
:
player
.
pos
===
room
.
winner
});
}
...
...
@@ -2380,14 +2382,14 @@
if
(
player
.
pos
!=
null
)
{
results1
.
push
({
id
:
(
-
1
).
toString
(),
name
:
player
.
name
,
name
:
player
.
name
+
(
settings
.
modules
.
http
.
show_ip
&&
pass_validated
&&
player
.
ip
!==
'
::ffff:127.0.0.1
'
?
"
(IP:
"
+
player
.
ip
.
slice
(
7
)
+
"
)
"
:
""
)
+
(
settings
.
modules
.
http
.
show_info
&&
room
.
started
&&
!
(
room
.
hostinfo
.
mode
===
2
&&
player
.
pos
>
1
)
?
"
(Score:
"
+
room
.
scores
[
player
.
name
]
+
"
LP:
"
+
(
player
.
lp
!=
null
?
player
.
lp
:
room
.
hostinfo
.
start_lp
)
+
"
)
"
:
""
)
,
pos
:
player
.
pos
});
}
}
return
results1
;
})(),
istart
:
room
.
started
?
'
start
'
:
'
wait
'
istart
:
room
.
started
?
(
settings
.
modules
.
http
.
show_info
?
"
Duel:
"
+
room
.
duel_count
+
"
Turn:
"
+
(
room
.
turn
!=
null
?
room
.
turn
:
0
)
:
'
start
'
)
:
'
wait
'
});
}
}
...
...
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