Skip to content

TimerHelp 设置时间问题 #25

@DreamChaseAndVera

Description

@DreamChaseAndVera

使用 毫秒时间戳 传入 SetDifferenceTime,_isSecLevel = false,但是 _differenceTime 是毫秒的时间差,
获取 ServerNow 可以修改为
public static long ServerNow()
{
if (_isSecLevel)
{
return _differenceTime + ClientNowSeconds();
}

return _differenceTime + ClientNowMillisecond();//毫秒级

}
在 SetDifferenceTime 中可以修改为
if (_isSecLevel)
{
_differenceTime = timeSpan - ClientNowSeconds();
}
else
{
_differenceTime = timeSpan - ClientNowMillisecond();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions