eqdb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) string

HashPassword hashes a plaintext password using TAkP-style algorithm Based on EQMacEmu implementation: just SHA-1 without salt

func HashPasswordLegacy

func HashPasswordLegacy(password string) string

HashPasswordLegacy provides a simpler MD5-only version (without XOR) This might be useful for compatibility with existing databases

func New

func New(db *sql.DB) (*client, error)

New creates a new database client

func VerifyPassword

func VerifyPassword(plaintext, hashed string) bool

VerifyPassword verifies a plaintext password against a hashed password

func VerifyPasswordLegacy

func VerifyPasswordLegacy(plaintext, hashed string) bool

VerifyPasswordLegacy verifies against the legacy MD5-only hash

Types

type Account

type Account struct {
	ID             int32          `json:"id" db:"id"`
	LSAccountID    int32          `json:"lsaccount_id" db:"lsaccount_id"`
	Name           string         `json:"name" db:"name"`
	CharName       sql.NullString `json:"charname" db:"charname"`
	Status         int32          `json:"status" db:"status"`
	Revoked        bool           `json:"revoked" db:"revoked"`
	SuspendedUntil sql.NullTime   `json:"suspended_until" db:"suspendeduntil"`
	BanReason      sql.NullString `json:"ban_reason" db:"ban_reason"`
	SuspendReason  sql.NullString `json:"suspend_reason" db:"suspend_reason"`
	RevokedUntil   sql.NullTime   `json:"revoked_until" db:"revokeduntil"`
}

type Character

type Character struct {
	ID      int32  `json:"id" db:"id"`
	Name    string `json:"name" db:"name"`
	Surname string `json:"surname" db:"surname"`
	Race    int32  `json:"race" db:"race"`
	Class   int32  `json:"class" db:"class"`
	Level   int32  `json:"level" db:"level"`
	ZoneID  int32  `json:"zone_id" db:"zone_id"`
	Stats   Stats  `json:"stats" db:"stats"`
}

Character represents a character in the EQ emulator database

type Inventory

type Inventory []InventoryItem

Inventory represents a collection of inventory items

func (*Inventory) Scan

func (i *Inventory) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database retrieval

func (Inventory) Value

func (i Inventory) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database storage

type InventoryItem

type InventoryItem struct {
	SlotID   int32  `json:"slot_id" db:"slot_id"`
	ItemID   int32  `json:"item_id" db:"item_id"`
	Charges  int32  `json:"charges" db:"charges"`
	Location string `json:"location" db:"location"` // Original TAKP location string
}

InventoryItem represents an item in a character's inventory

func (*InventoryItem) Scan

func (ii *InventoryItem) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database retrieval

func (InventoryItem) Value

func (ii InventoryItem) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database storage

type ItemName

type ItemName struct {
	ID   int32  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

ItemName represents an item with its name

type LSAccount

type LSAccount struct {
	ID            int32     `json:"id" db:"LoginServerID"`
	Name          string    `json:"account_name" db:"AccountName"`
	Password      string    `json:"password" db:"AccountPassword"`
	LastLoginDate time.Time `json:"last_login_date" db:"LastLoginDate"`
}

type ListCharactersRequest

type ListCharactersRequest struct {
	AccountID int32 `json:"account_id"`
}

ListCharactersRequest represents parameters for listing characters

type Stats

type Stats struct {
	HP   int32 `json:"hp"`
	Mana int32 `json:"mana"`
	Str  int32 `json:"str"`
	Sta  int32 `json:"sta"`
	Agi  int32 `json:"agi"`
	Dex  int32 `json:"dex"`
	Wis  int32 `json:"wis"`
	Int  int32 `json:"int"`
	Cha  int32 `json:"cha"`
}

Stats represents character statistics

func (*Stats) Scan

func (s *Stats) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database retrieval

func (Stats) Value

func (s Stats) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database storage

Jump to

Keyboard shortcuts

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