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
0ad19f16
Commit
0ad19f16
authored
Sep 09, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hide_name and disable_chat
parent
bd64c628
Pipeline
#29616
passed with stages
in 15 minutes
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
826 additions
and
783 deletions
+826
-783
data/default_config.json
data/default_config.json
+1
-0
data/i18n.json
data/i18n.json
+2
-0
ygopro-server.coffee
ygopro-server.coffee
+26
-11
ygopro-server.js
ygopro-server.js
+797
-772
No files found.
data/default_config.json
View file @
0ad19f16
...
...
@@ -79,6 +79,7 @@
"record_match_scores"
:
false
,
"post_match_scores"
:
false
,
"post_match_accesskey"
:
"123456"
,
"disable_chat"
:
false
,
"blank_pass_modes"
:
{
"S"
:
true
,
"M"
:
true
,
...
...
data/i18n.json
View file @
0ad19f16
...
...
@@ -178,6 +178,7 @@
"refresh_failed"
:
"Refresh field failed."
,
"banned_athletic_deck_part1"
:
"Entertainment Mode does not allow top "
,
"banned_athletic_deck_part2"
:
" popular meta decks. Please change your deck."
,
"chat_disabled"
:
"Chat is disabled in this room."
,
"using_athletic_deck"
:
" is using a competitive deck."
},
"es-es"
:
{
...
...
@@ -505,6 +506,7 @@
"refresh_fail"
:
"刷新场面失败。"
,
"banned_athletic_deck_part1"
:
"娱乐匹配中禁止使用使用数前"
,
"banned_athletic_deck_part2"
:
"的竞技卡组。请更换卡组。"
,
"chat_disabled"
:
"本房间禁止聊天。"
,
"using_athletic_deck"
:
" 正在使用竞技卡组。"
},
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
0ad19f16
...
...
@@ -314,6 +314,9 @@ init = () ->
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
false
,
"T"
:
false
}
delete
settings
.
modules
.
random_duel
.
blank_pass_match
imported
=
true
if
settings
.
modules
.
hide_name
==
true
settings
.
modules
.
hide_name
=
"start"
imported
=
true
#finish
keysFromEnv
=
Object
.
keys
(
process
.
env
).
filter
((
key
)
=>
key
.
startsWith
(
'SRVPRO_'
))
if
keysFromEnv
.
length
>
0
...
...
@@ -1660,7 +1663,7 @@ class Room
if
settings
.
modules
.
random_duel
.
record_match_scores
and
@
random_type
==
'M'
ROOM_player_flee
(
client
.
name_vpass
)
if
@
players
.
length
and
!
(
@
windbot
and
client
.
is_host
)
and
!
(
@
arena
and
@
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
client
.
pos
<=
3
)
left_name
=
(
if
settings
.
modules
.
hide_name
and
@
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
then
"********"
else
client
.
name
)
left_name
=
@
getMaskedPlayerName
(
client
)
ygopro
.
stoc_send_chat_to_room
this
,
"
#{
left_name
}
${left_game}"
+
if
error
then
":
#{
error
}
"
else
''
roomlist
.
update
(
this
)
if
!
@
windbot
and
@
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
http
.
websocket_roomlist
#client.room = null
...
...
@@ -1670,7 +1673,7 @@ class Room
#client.room = null
this
.
delete
()
if
!
CLIENT_reconnect_unregister
(
client
,
false
,
true
)
SERVER_kick
(
client
.
server
)
SERVER_kick
(
client
.
server
)
return
start_death
:
()
->
...
...
@@ -1816,6 +1819,15 @@ class Room
@
watcher_buffers
.
push
chat_buf
return
getMaskedPlayerName
(
player
,
sight_player
)
->
if
not
settings
.
modules
.
hide_name
or
(
sight_player
and
player
==
sight_player
)
or
not
(
@
random_type
or
@
arena
)
return
player
.
name
if
@
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
hide_name
==
"start"
return
"********"
if
settings
.
modules
.
hide_name
==
"always"
return
"********"
return
player
.
name
# 网络连接
netRequestHandler
=
(
client
)
->
if
!
client
.
isWs
...
...
@@ -2815,13 +2827,13 @@ ygopro.stoc_follow 'TYPE_CHANGE', true, (buffer, info, client, server, datas)->
ygopro
.
stoc_follow
'HS_PLAYER_ENTER'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
return
false
unless
room
and
settings
.
modules
.
hide_name
and
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
pos
=
info
.
pos
if
pos
<
4
and
pos
!=
client
.
pos
struct
=
ygopro
.
structs
.
get
(
"STOC_HS_PlayerEnter"
)
struct
.
_setBuff
(
buffer
)
struct
.
set
(
"name"
,
"********"
)
buffer
=
struct
.
buffer
if
room
and
settings
.
modules
.
hide_name
and
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
pos
=
info
.
pos
if
pos
<
4
and
pos
!=
client
.
pos
struct
=
ygopro
.
structs
.
get
(
"STOC_HS_PlayerEnter"
)
struct
.
_setBuff
(
buffer
)
struct
.
set
(
"name"
,
"********"
)
buffer
=
struct
.
buffer
await
return
false
ygopro
.
stoc_follow
'HS_PLAYER_CHANGE'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
...
...
@@ -2924,7 +2936,7 @@ wait_room_start_arena = (room)->
if
room
.
waiting_for_player_time
>
0
unless
room
.
waiting_for_player_time
%
5
for
player
in
room
.
players
when
player
display_name
=
(
if
settings
.
modules
.
hide_name
and
player
!=
room
.
waiting_for_player
then
"********"
else
room
.
waiting_for_player
.
name
)
display_name
=
room
.
getMaskedPlayerName
(
player
,
room
.
waiting_for_player
)
ygopro
.
stoc_send_chat
(
player
,
"
#{
if
room
.
waiting_for_player_time
<=
9
then
' '
else
''
}#{
room
.
waiting_for_player_time
}
${kick_count_down_arena_part1}
#{
display_name
}
${kick_count_down_arena_part2}"
,
if
room
.
waiting_for_player_time
<=
9
then
ygopro
.
constants
.
COLORS
.
RED
else
ygopro
.
constants
.
COLORS
.
LIGHTBLUE
)
else
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
room
.
waiting_for_player
.
name
}
${kicked_by_system}"
,
ygopro
.
constants
.
COLORS
.
RED
)
...
...
@@ -2990,7 +3002,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
clearInterval
client
.
side_interval
client
.
side_interval
=
null
client
.
side_tcount
=
null
if
settings
.
modules
.
hide_name
and
room
.
duel_count
==
0
if
settings
.
modules
.
hide_name
==
"start"
and
room
.
duel_count
==
0
for
player
in
room
.
get_playing_player
()
when
player
!=
client
ygopro
.
stoc_send
(
client
,
'HS_PLAYER_ENTER'
,
{
name
:
player
.
name
,
...
...
@@ -3186,6 +3198,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
:
#{
msg
}
"
,
9
)
return
true
return
cancel
if
room
.
random_type
and
settings
.
modules
.
random_duel
.
disable_chat
ygopro
.
stoc_send_chat
(
client
,
"${chat_disabled}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
return
true
if
client
.
abuse_count
>=
5
or
CLIENT_is_banned_by_mc
(
client
)
log
.
warn
"BANNED CHAT"
,
client
.
name
,
client
.
ip
,
msg
ygopro
.
stoc_send_chat
(
client
,
"${banned_chat_tip}"
+
(
if
client
.
ban_mc
and
client
.
ban_mc
.
message
then
(
": "
+
client
.
ban_mc
.
message
)
else
""
),
ygopro
.
constants
.
COLORS
.
RED
)
...
...
ygopro-server.js
View file @
0ad19f16
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