Commit 6e36465f authored by nanahira's avatar nanahira

Merge branch 'master' into koishi

parents 22eceb68 0ad19f16
Pipeline #29617 passed with stages
in 20 minutes and 11 seconds
......@@ -90,6 +90,7 @@
"record_match_scores": false,
"post_match_scores": false,
"post_match_accesskey": "123456",
"disable_chat": false,
"blank_pass_modes": {
"S": true,
"M": true,
......
......@@ -209,6 +209,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": {
......@@ -567,6 +568,7 @@
"refresh_fail": "刷新场面失败。",
"banned_athletic_deck_part1": "娱乐匹配中禁止使用使用数前",
"banned_athletic_deck_part2": "的竞技卡组。请更换卡组。",
"chat_disabled": "本房间禁止聊天。",
"using_athletic_deck": " 正在使用竞技卡组。"
},
"ko-kr": {
......
......@@ -395,6 +395,9 @@ loadLFList = (path) ->
}
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
......@@ -1818,7 +1821,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 @duel_stage == ygopro.constants.DUEL_STAGE.BEGIN) 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
......@@ -1828,7 +1831,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: () ->
......@@ -1992,6 +1995,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
......@@ -3035,13 +3047,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)->
......@@ -3144,7 +3156,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)
......@@ -3218,7 +3230,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,
......@@ -3526,6 +3538,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)
......
This diff is collapsed.
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