Documentation
¶
Index ¶
- func CreateAccount(db *gorm.DB, account *Account) error
- func CreatePlayerOptions(db *gorm.DB, po *PlayerOptions) error
- func DeleteAccount(db *gorm.DB, account *Account) error
- func DeleteCharacter(db *gorm.DB, accountID uint, slot uint32) error
- func PermanentlyDeleteAccount(db *gorm.DB, account *Account) error
- func PermanentlyDeleteCharacter(db *gorm.DB, character *Character) error
- func UpdatePlayerOptions(db *gorm.DB, po *PlayerOptions) error
- func UpsertCharacter(db *gorm.DB, character *Character) error
- type Account
- type Character
- type GuildcardEntry
- type PlayerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccount ¶
CreateAccount persists the Account record to the database.
func CreatePlayerOptions ¶
func CreatePlayerOptions(db *gorm.DB, po *PlayerOptions) error
func DeleteAccount ¶
DeleteAccount soft-deletes an Account record from the database.
func DeleteCharacter ¶
DeleteCharacter soft-deletes a character record from the database.
func PermanentlyDeleteAccount ¶
PermanentlyDeleteAccount permanently deletes an Account record from the database.
func PermanentlyDeleteCharacter ¶
PermanentlyDeleteCharacter permanently deletes a character record from the database.
func UpdatePlayerOptions ¶
func UpdatePlayerOptions(db *gorm.DB, po *PlayerOptions) error
Types ¶
type Account ¶
type Account struct { ID uint64 `gorm:"primaryKey"` Username string `gorm:"unique; not null"` Password string `gorm:"not null"` Email string `gorm:"unique"` RegistrationDate time.Time Guildcard int `gorm:"AUTO_INCREMENT"` GM bool `gorm:"default:false"` Banned bool `gorm:"default:false"` Active bool `gorm:"default:true"` TeamID int PrivilegeLevel byte CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt }
Account contains the login information specific to each registered user.
func FindAccountByUsername ¶
FindAccountByUsername searches for an account with the specified username, returning the *Account instance if found or nil if there is no match.
type Character ¶
type Character struct { ID uint64 `gorm:"primaryKey"` Account *Account AccountID uint64 `gorm:"uniqueIndex:character_account_slot"` Guildcard uint64 GuildcardStr []byte Slot uint32 `gorm:"uniqueIndex:character_account_slot"` Experience uint32 Level uint32 NameColor uint32 ModelType byte NameColorChecksum uint32 SectionID byte Class byte V2Flags byte Version byte V1Flags uint32 Costume uint16 Skin uint16 Face uint16 Head uint16 Hair uint16 HairRed uint16 HairGreen uint16 HairBlue uint16 ProportionX float32 ProportionY float32 ReadableName string Name []byte Playtime uint32 ATP uint16 MST uint16 EVP uint16 HP uint16 DFP uint16 ATA uint16 LCK uint16 Meseta uint32 CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt }
Character is an instance of a character in one of the slots for an account.
type GuildcardEntry ¶
type GuildcardEntry struct { ID uint64 `gorm:"primaryKey"` Account *Account AccountID int Guildcard uint64 FriendGuildcard int Name []byte TeamName []byte Description []byte Language byte SectionID byte Class byte Comment []byte }
func FindGuildcardEntries ¶
func FindGuildcardEntries(db *gorm.DB, accountId uint64) ([]GuildcardEntry, error)
FindGuildcardEntries returns all the GuildcardEntry rows associated with an Account.
type PlayerOptions ¶
type PlayerOptions struct { ID uint64 `gorm:"primaryKey"` Account *Account AccountID int KeyConfig []byte }
func FindPlayerOptions ¶
func FindPlayerOptions(db *gorm.DB, accountId uint64) (*PlayerOptions, error)
FindPlayerOptions returns all of hte PlayerOptions associated with an Account.