Skip to content

Conversation

@tinymins
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings August 27, 2025 17:55
@tinymins tinymins merged commit ba91350 into tinymins:master Aug 27, 2025
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds forced nRefresh setting for team monitoring countdown timers. The change modifies the countdown timer behavior to handle specific time values (-1 and -2) by forcing the nRefresh parameter to update expiration times.

  • Adds logic to handle nRefresh parameter when tTime.nTime is -1 or -2
  • Forces expiration time updates based on nRefresh values with a 3ms buffer
  • Includes Chinese comments explaining the forced refresh functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if ui and ui:IsValid() then
ui.obj:RemoveItem()
end
-- 2025.08.25增加倒计时条强制设置nRefresh,nTime为-1,-2强制更改nRefresh,为兼容旧数据,先判断有nRefresh字段再修改
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains garbled Chinese characters (���ӵ���ʱ��ǿ������nRefresh��nTimeΪ-1��-2ǿ�Ƹ���nRefresh��Ϊ���ݾ����ݣ����ж���nRefresh�ֶ����޸�). The comment should use proper UTF-8 encoding for Chinese characters.

Suggested change
-- 2025.08.25���ӵ���ʱ��ǿ������nRefresh��nTimeΪ-1��-2ǿ�Ƹ���nRefresh��Ϊ���ݾ����ݣ����ж���nRefresh�ֶ����޸�
-- 2025.08.25 新增倒计时强制刷新,nRefresh:nTime为-1或-2时强制刷新,nRefresh为刷新间隔,未设置则不刷新,nRefresh字段可修改

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +154
ST_TIME_EXPIRE[nType][szKey] = nTime + tParam.nRefresh * 1000 - 3
end
elseif tTime.nTime == -2 then
ST_TIME_EXPIRE[nType][szKey] = nil
ST_TIME_EXPIRE[nType][szKey] = nTime + (tParam.nRefresh or 0) * 1000 - 3
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number '3' appears in both lines 151 and 154 without explanation. Consider defining this as a named constant (e.g., EXPIRE_BUFFER_MS = 3) to improve code maintainability and make the purpose clear.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants