Documentation
¶
Index ¶
- func HashPassword(password string) string
- func HashPasswordLegacy(password string) string
- func New(db *sql.DB) (*client, error)
- func VerifyPassword(plaintext, hashed string) bool
- func VerifyPasswordLegacy(plaintext, hashed string) bool
- type Account
- type Character
- type Inventory
- type InventoryItem
- type ItemName
- type LSAccount
- type ListCharactersRequest
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
HashPassword hashes a plaintext password using TAkP-style algorithm Based on EQMacEmu implementation: just SHA-1 without salt
func HashPasswordLegacy ¶
HashPasswordLegacy provides a simpler MD5-only version (without XOR) This might be useful for compatibility with existing databases
func VerifyPassword ¶
VerifyPassword verifies a plaintext password against a hashed password
func VerifyPasswordLegacy ¶
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
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
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