Skip to content

Commit 99b3f83

Browse files
committed
fix: 修复查看角色属性功能测试未限制来源的问题
1 parent 976c065 commit 99b3f83

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
return {
22
['[%s] wants to get your location, would you like to share?'] = '[%s] ϣ��ȡ���㵱ǰ���ڵ�ͼλ�ã����Ƿ�Ը�⹲����ǰλ����Ϣ��',
3+
['Block'] = '������',
4+
['[%s] wants to see your detailed character info, OK?'] = '[%s] ��֪��������ϸ��ɫ������Ϣ���Ƿ��֪��',
35
['[%s] want to see your info, OK?'] = '�ų� [%s] ��֪������װ�����ķ����Ƿ��֪��',
46
['I\'ve installed %s v%s'] = '���Ѱ�װ%s v%s��',
57
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
return {
22
['[%s] wants to get your location, would you like to share?'] = '[%s] 希望取得你當前所在地圖位置,你是否願意共享當前位置信息?',
3+
['Block'] = '屏蔽他',
4+
['[%s] wants to see your detailed character info, OK?'] = '[%s] 想知曉您的詳細角色屬性信息,是否告知?',
35
['[%s] want to see your info, OK?'] = '團長 [%s] 想知曉您的裝備、心法,是否告知?',
46
['I\'ve installed %s v%s'] = '我已安裝%s v%s。',
57
}

MY_!Base/src/BgMsgCenter.lua

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,54 @@ X.RegisterBgMsg('RL', function(_, data, nChannel, dwTalkerID, szTalkerName, bIsS
9999
end)
100100

101101
-- 查看完整属性
102+
local CHAR_INFO_BLOCK_LIST = {}
102103
X.RegisterBgMsg('CHAR_INFO', function(_, data, nChannel, dwTalkerID, szTalkerName, bIsSelf)
103104
if not bIsSelf and data[2] == X.GetClientPlayerID() then
104105
local nReplyChannel = X.IsTeammate(dwTalkerID)
105106
and PLAYER_TALK_CHANNEL.RAID
106107
or D.GetReplyChannel(nChannel, szTalkerName)
107-
if data[1] == 'ASK' then
108-
if not _G.MY_CharInfo or _G.MY_CharInfo.bEnable or data[3] == 'DEBUG' then
108+
if data[1] == 'ASK' then
109+
local bAcquaintance = X.IsTeammate(dwTalkerID) or X.IsFellowship(dwTalkerID) or X.IsAuthorPlayer(dwTalkerID, szTalkerName)
110+
local bDebug = data[3] == 'DEBUG' and bAcquaintance
111+
local bConfirm = not bAcquaintance and not bDebug
112+
local function fnResolve()
109113
local aInfo = X.GetClientPlayerCharInfo()
110-
if not X.IsTeammate(dwTalkerID) and not data[3] == 'DEBUG' then
114+
if not X.IsTeammate(dwTalkerID) and not bDebug then
111115
for _, v in ipairs(aInfo) do
112116
v.tip = nil
113117
end
114118
end
115119
X.SendBgMsg(nReplyChannel, 'CHAR_INFO', {'ACCEPT', dwTalkerID, aInfo}, true)
116-
else
120+
end
121+
local function fnReject()
117122
X.SendBgMsg(nReplyChannel, 'CHAR_INFO', {'REFUSE', dwTalkerID}, true)
118123
end
124+
if not CHAR_INFO_BLOCK_LIST[dwTalkerID] and (not _G.MY_CharInfo or _G.MY_CharInfo.bEnable or bDebug) then
125+
if bConfirm then
126+
X.MessageBox('MY_CharInfo', {
127+
szMessage = _L('[%s] wants to see your detailed character info, OK?', szTalkerName),
128+
{
129+
szOption = g_tStrings.STR_HOTKEY_SURE,
130+
fnAction = fnResolve,
131+
}, {
132+
szOption = g_tStrings.STR_HOTKEY_CANCEL,
133+
fnAction = fnReject,
134+
},
135+
{
136+
szOption = _L('Block'),
137+
bCheck = true,
138+
fnAction = function()
139+
fnReject()
140+
CHAR_INFO_BLOCK_LIST[dwTalkerID] = true
141+
end,
142+
}
143+
})
144+
else
145+
fnResolve()
146+
end
147+
else
148+
fnReject()
149+
end
119150
end
120151
end
121152
end)

MY_TeamTools/lang/zhcn.jx3dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ return {
66
['Option'] = '����',
77
['Open Panel'] = '�򿪽���',
88
['Please unlock talk lock first.'] = '���Ƚ����������',
9+
['[%s] will see your detailed character info request, sure to send request?'] = '�鿴 [%s] ����ϸ������Ϣ��Ҫ�Է�ȷ�ϣ�Ҫ��������������',
910
['Raid Stat'] = '�Ŷ�ͳ��',
1011
['Room Stat'] = '����ͳ��',
1112
-- MY_TeamTools_DeathLog

MY_TeamTools/lang/zhtw.jx3dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ return {
66
['Option'] = '設置',
77
['Open Panel'] = '打開界面',
88
['Please unlock talk lock first.'] = '請先解除聊天鎖。',
9+
['[%s] will see your detailed character info request, sure to send request?'] = '查看 [%s] 的詳細屬性信息需要對方確認,要繼續發送請求嗎?',
910
['Raid Stat'] = '團隊統計',
1011
['Room Stat'] = '房間統計',
1112
-- MY_TeamTools_DeathLog

MY_TeamTools/src/MY_CharInfo.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,16 @@ function D.ViewCharInfoToPlayer(dwID)
181181
if not nChannel or not szName then
182182
X.Alert(_L['Party limit'])
183183
else
184-
CharInfo.CreateFrame(dwID, szName)
185-
X.SendBgMsg(nChannel, 'CHAR_INFO', {'ASK', dwID, X.IsRestricted('MY_CharInfo.Daddy') and 'DEBUG'})
184+
local bAcquaintance = X.IsTeammate(dwID) or X.IsFellowship(dwID) or X.IsAuthorPlayer(X.GetClientPlayerID(), X.GetClientPlayerName())
185+
local function onAccept()
186+
CharInfo.CreateFrame(dwID, szName)
187+
X.SendBgMsg(nChannel, 'CHAR_INFO', {'ASK', dwID, X.IsRestricted('MY_CharInfo.Daddy') and 'DEBUG'})
188+
end
189+
if bAcquaintance then
190+
onAccept()
191+
else
192+
X.Confirm(_L('[%s] will see your detailed character info request, sure to send request?', szName), onAccept)
193+
end
186194
end
187195
end
188196

0 commit comments

Comments
 (0)