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
cb9fe5df
Commit
cb9fe5df
authored
Jun 18, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add display_watchers
parent
7df8cfc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
data/default_config.json
data/default_config.json
+1
-0
ygopro-server.coffee
ygopro-server.coffee
+6
-0
ygopro-server.js
ygopro-server.js
+8
-0
No files found.
data/default_config.json
View file @
cb9fe5df
...
...
@@ -24,6 +24,7 @@
"side_timeout"
:
false
,
"replay_delay"
:
false
,
"hide_name"
:
false
,
"display_watchers"
:
true
,
"i18n"
:
{
"auto_pick"
:
false
,
"default"
:
"zh-cn"
,
...
...
ygopro-server.coffee
View file @
cb9fe5df
...
...
@@ -3122,6 +3122,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
ygopro
.
stoc_send_chat
(
client
,
"${chat_warn_level0}"
,
ygopro
.
constants
.
COLORS
.
RED
)
cancel
=
true
if
!
(
room
and
(
room
.
random_type
or
room
.
arena
))
if
!
cancel
and
settings
.
modules
.
display_watchers
and
client
.
is_post_watcher
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
:
#{
msg
}
"
,
9
)
return
true
return
cancel
if
client
.
abuse_count
>=
5
or
CLIENT_is_banned_by_mc
(
client
)
log
.
warn
"BANNED CHAT"
,
client
.
name
,
client
.
ip
,
msg
...
...
@@ -3193,6 +3196,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
if
client
.
abuse_count
>=
5
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${chat_banned}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ROOM_ban_player
(
client
.
name
,
client
.
ip
,
"${random_ban_reason_abuse}"
)
if
!
cancel
and
settings
.
modules
.
display_watchers
and
client
.
is_post_watcher
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
:
#{
msg
}
"
,
9
)
return
true
await
return
cancel
ygopro
.
ctos_follow
'UPDATE_DECK'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
...
...
ygopro-server.js
View file @
cb9fe5df
...
...
@@ -4160,6 +4160,10 @@
cancel = true;
}
if (!(room && (room.random_type || room.arena))) {
if (!cancel && settings.modules.display_watchers && client.is_post_watcher) {
ygopro.stoc_send_chat_to_room(room, `${client.name}: ${msg}`, 9);
return true;
}
return cancel;
}
if (client.abuse_count >= 5 || CLIENT_is_banned_by_mc(client)) {
...
...
@@ -4242,6 +4246,10 @@
ygopro.stoc_send_chat_to_room(room, `${client.name} \${chat_banned}`, ygopro.constants.COLORS.RED);
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_abuse}");
}
if (!cancel && settings.modules.display_watchers && client.is_post_watcher) {
ygopro.stoc_send_chat_to_room(room, `${client.name}: ${msg}`, 9);
return true;
}
return cancel;
});
...
...
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