Commit cb9fe5df authored by nanahira's avatar nanahira

add display_watchers

parent 7df8cfc5
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"side_timeout": false, "side_timeout": false,
"replay_delay": false, "replay_delay": false,
"hide_name": false, "hide_name": false,
"display_watchers": true,
"i18n": { "i18n": {
"auto_pick": false, "auto_pick": false,
"default": "zh-cn", "default": "zh-cn",
......
...@@ -3122,6 +3122,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)-> ...@@ -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) ygopro.stoc_send_chat(client, "${chat_warn_level0}", ygopro.constants.COLORS.RED)
cancel = true cancel = true
if !(room and (room.random_type or room.arena)) 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 return cancel
if client.abuse_count>=5 or CLIENT_is_banned_by_mc(client) if client.abuse_count>=5 or CLIENT_is_banned_by_mc(client)
log.warn "BANNED CHAT", client.name, client.ip, msg log.warn "BANNED CHAT", client.name, client.ip, msg
...@@ -3193,6 +3196,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)-> ...@@ -3193,6 +3196,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
if client.abuse_count>=5 if client.abuse_count>=5
ygopro.stoc_send_chat_to_room(room, "#{client.name} ${chat_banned}", ygopro.constants.COLORS.RED) 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}") 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 await return cancel
ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)-> ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
......
...@@ -4160,6 +4160,10 @@ ...@@ -4160,6 +4160,10 @@
cancel = true; cancel = true;
} }
if (!(room && (room.random_type || room.arena))) { 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; return cancel;
} }
if (client.abuse_count >= 5 || CLIENT_is_banned_by_mc(client)) { if (client.abuse_count >= 5 || CLIENT_is_banned_by_mc(client)) {
...@@ -4242,6 +4246,10 @@ ...@@ -4242,6 +4246,10 @@
ygopro.stoc_send_chat_to_room(room, `${client.name} \${chat_banned}`, ygopro.constants.COLORS.RED); 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}"); 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; return cancel;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment