util

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOverflow = errors.New("binary: varint overflows a 64-bit integer")

Functions

func GetPacificLocation

func GetPacificLocation() *time.Location

GetPacificLocation returns the time.Location for America/Los_Angeles (Pacific Time). It attempts to load the location from the system's timezone database.

func ParseMabiTime

func ParseMabiTime(t uint64) time.Time

ParseMabiTime converts a Mabinogi timestamp (ticks) to a time.Time object. Mabinogi servers use Pacific Time. This function handles both PST and PDT by loading the America/Los_Angeles location.

NOTE FOR FUTURE DEVELOPERS: If the timers are off by 1 hour, it is likely due to a Daylight Saving Time (DST) transition. Go's time.LoadLocation("America/Los_Angeles") should handle this automatically by using the system's tzdata. If it fails, check if the system timezone database is up to date or if tzdata is bundled.

func ReadUvarint

func ReadUvarint(r io.Reader) (uint64, int, error)

func TimeToMabiTime

func TimeToMabiTime(t time.Time) uint64

TimeToMabiTime is the inverse of ParseMabiTime, converting a time.Time to Mabinogi ticks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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