Documentation
¶
Overview ¶
Package inputclock 记录客户端帧与服务器帧映射,并估算 RTT(延迟补偿入口)。
Index ¶
- type Clock
- func (c *Clock) CompensatedFrame(player string, clientFrame uint64, tick time.Duration) (uint64, bool)
- func (c *Clock) RTT(player string) time.Duration
- func (c *Clock) Record(s Sample)
- func (c *Clock) RewindFrames(player string, tick time.Duration) uint64
- func (c *Clock) ServerFrame(player string, clientFrame uint64) (uint64, bool)
- func (c *Clock) UpdateRTT(player string, rtt time.Duration)
- type Option
- type Sample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock 维护 per-player 帧映射与 RTT 估算。
func (*Clock) CompensatedFrame ¶
func (c *Clock) CompensatedFrame(player string, clientFrame uint64, tick time.Duration) (uint64, bool)
CompensatedFrame 返回用于 lag compensation 的目标服务器帧(serverFrame - rewind)。
func (*Clock) RewindFrames ¶
RewindFrames 按 tick 间隔估算 RTT 对应的 rewind 帧数(至少 1)。
func (*Clock) ServerFrame ¶
ServerFrame 返回 clientFrame 对应的服务器帧。
Click to show internal directories.
Click to hide internal directories.