//go:build linux package sqex import ( "os" "strconv" "strings" ) // RawTickCount returns host milliseconds since boot; used on non-Windows hosts // (e.g. when running the test suite in development). The game derives its // decryption key from the top 16 bits of its own uptime (~65s window), so this // only needs to be within that window of GetTickCount — /proc/uptime qualifies, // with no cgo or extra deps. func RawTickCount() uint32 { b, err := os.ReadFile("/proc/uptime") if err != nil { return 0 } f, err := strconv.ParseFloat(strings.Fields(string(b))[0], 64) if err != nil { return 0 } ms := f * 1000 if ms > 0xFFFFFFFF { ms = 0 // wrapped; extremely unlikely (596 days) } return uint32(ms) }