Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶ added in v0.9.0
func RoundTime ¶ added in v0.9.0
Both the client and the original patcher treat the modification time as a floating point number, and then rounding to 6 decimal places.
Because of imprecisions within floating point numbers, the original patch (and therefore client) expect a slightly incorrect nanoseconds value, thus causing a typically off-by-one rounding error.
For example, if a file has a modification time of 1729218809s + 315336400ns, the correctly rounded nanoscond value should be 315336000ns (1729218809.315336). Instead, the client considers the floating point time as 1729218809.3153365s, thus causing it to round the nanoseconds to 315337000ns (1729218809.315337) instead.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
File type: txt
The cache file, named quickcheck.txt in the orignial patcher, stored a list of comma-separated values for the states of unpacked client resources from when the patcher was last run. If any of the non-path values (modification time, size, or uncompressed checksum) have changed, the unpacked resource should be reinstalled.
Each line in the file takes the form:
%s,%d.%06d,%d,%x
With these values associated with an unpacked resource:
- The relative path
- The modification time seconds
- The modification time milliseconds (padded to 6 digits)
- The size of the resource
- The md5 hash of the resource
func Read ¶ added in v0.10.0
func Read(r io.Reader, options ...ReadOptions) (*Cache, error)
Creates a *Cache from the entries scanned from the provided io.Reader. Read immediately returns an error if it fails to scan a line or parse a quick check entry.
type QuickCheck ¶
type RangeFunc ¶
type RangeFunc = func(qc QuickCheck) bool
type ReadOptions ¶ added in v0.12.1
type ReadOptions struct {
// Ignore malformed cache data
IgnoreUnmarshalErrors bool
}