lagcomp

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package lagcomp 在 snapbuf + inputclock 之上提供 server rewind 查询(延迟补偿)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compensator

type Compensator[S any] struct {
	Clock *inputclock.Clock
	Ring  *snapbuf.Ring[S]
	Tick  time.Duration
}

Compensator 根据 shooter 的 clientFrame 查询补偿后的世界快照。

func (*Compensator[S]) ExactAt

func (c *Compensator[S]) ExactAt(frame uint64) (S, bool)

ExactAt 不做 RTT 补偿,精确查 target 帧(测试/回放)。

func (*Compensator[S]) WorldAt

func (c *Compensator[S]) WorldAt(shooter string, clientFrame uint64) (S, uint64, bool)

WorldAt 返回 shooter 在 clientFrame 射击时刻应使用的补偿快照。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL