db

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserExists         = errors.New("username already exists")
	ErrInvalidCredentials = errors.New("invalid username or password")
)

Functions

func AuthenticatePlayer

func AuthenticatePlayer(username, password string) (int, error)

func CheckRegistrationLimit

func CheckRegistrationLimit(ip string) error

func CleanupOldAttempts

func CleanupOldAttempts()

func GetUsername

func GetUsername(playerID int) (string, error)

func InitDB

func InitDB(dbPath string) error

func LoadPlayerState

func LoadPlayerState(playerID int) (x, y int, err error)

func RegisterPlayer

func RegisterPlayer(username, password string) (int, error)

func SavePlayerState

func SavePlayerState(playerID int, x, y int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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