|
|
@@ -895,14 +895,29 @@ function onceRewardQuery(human)
|
|
|
end
|
|
|
|
|
|
-- 设置奖励物品列表:[[102,500],[118,10],[111,100000]]
|
|
|
- Grid.makeItem(msgRet.reward[0], 102, 500)
|
|
|
- Grid.makeItem(msgRet.reward[1], 118, 10)
|
|
|
- Grid.makeItem(msgRet.reward[2], 111, 100000)
|
|
|
+ local success, err = pcall(function()
|
|
|
+ Grid.makeItem(msgRet.reward[1], 102, 500)
|
|
|
+ Grid.makeItem(msgRet.reward[2], 118, 10)
|
|
|
+ Grid.makeItem(msgRet.reward[3], 111, 100000)
|
|
|
+ msgRet.reward[0] = 3 -- 设置数组长度
|
|
|
+ end)
|
|
|
+
|
|
|
+ if not success then
|
|
|
+ Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 错误: 设置奖励物品失败: "..tostring(err))
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 奖励物品已设置: [102,500], [118,10], [111,100000], status="..msgRet.status)
|
|
|
|
|
|
if human.fd then
|
|
|
- Msg.send(msgRet, human.fd)
|
|
|
- Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 查询协议已发送: fd="..human.fd..", status="..msgRet.status)
|
|
|
+ local sendSuccess, sendErr = pcall(function()
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+ end)
|
|
|
+ if sendSuccess then
|
|
|
+ Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 查询协议已发送: fd="..human.fd..", status="..msgRet.status)
|
|
|
+ else
|
|
|
+ Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 错误: 发送协议失败: "..tostring(sendErr))
|
|
|
+ end
|
|
|
else
|
|
|
Log.write(Log.LOGID_DEBUG, "[onceRewardQuery] 错误: human.fd为nil,无法发送协议")
|
|
|
end
|