Documentation
¶
Index ¶
- Variables
- func CreateTables(db *pg.DB) error
- func Delete(db *pg.DB, userID uint64, req structs.NcAvatarEraseReq) error
- func DeleteTables(db *pg.DB) error
- func New(db *pg.DB, userID uint64, req structs.NcAvatarCreateReq) (structs.AvatarInformation, error)
- func Validate(db *pg.DB, userID uint64, req structs.NcAvatarCreateReq) error
- type Appearance
- type Attributes
- type Character
- type EquippedItems
- type ErrCharacter
- type Inventory
- type Location
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidClassGender = &ErrCharacter{
Code: 4,
Message: "invalid class gender data",
}
View Source
var ErrInvalidName = &ErrCharacter{
Code: 3,
Message: "invalid name",
}
View Source
var ErrInvalidSlot = &ErrCharacter{
Code: 0,
Message: "invalid slot",
}
View Source
var ErrNameTaken = &ErrCharacter{
Code: 1,
Message: "name taken",
}
View Source
var ErrNoSlot = &ErrCharacter{
Code: 2,
Message: "no slot available",
}
Functions ¶
func CreateTables ¶
func DeleteTables ¶
func New ¶
func New(db *pg.DB, userID uint64, req structs.NcAvatarCreateReq) (structs.AvatarInformation, error)
Types ¶
type Appearance ¶
type Appearance struct {
ID uint64
CharacterID uint64 //
Character *Character
Class uint8 `pg:",notnull"`
Gender uint8 `pg:",notnull,use_zero"`
HairType uint8 `pg:",notnull,use_zero"`
HairColor uint8 `pg:",notnull,use_zero"`
FaceType uint8 `pg:",notnull,use_zero"`
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
Appearance model for the database layer
type Attributes ¶
type Attributes struct {
ID uint64
CharacterID uint64
Character *Character
Level uint16 `pg:",notnull"`
Experience uint64 `pg:",notnull,use_zero"`
Fame uint64 `pg:",notnull,use_zero"`
Hp uint32 `pg:",notnull"`
Sp uint32 `pg:",notnull"`
Intelligence uint32 `pg:",notnull"`
Strength uint32 `pg:",notnull"`
Dexterity uint32 `pg:",notnull"`
Endurance uint32 `pg:",notnull"`
Spirit uint32 `pg:",notnull"`
Money uint64 `pg:",notnull,use_zero"`
KillPoints uint32 `pg:",notnull,use_zero"`
HpStones uint16 `pg:",notnull"`
SpStones uint16 `pg:",notnull"`
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
Attributes model for the database layer
type Character ¶
type Character struct {
ID uint64
UserID uint64 `pg:",notnull"`
Name string `pg:",notnull,unique"`
Appearance *Appearance
Attributes *Attributes
Location *Location
Inventory *Inventory
EquippedItems *EquippedItems
AdminLevel uint8 `pg:",notnull,use_zero"`
Slot uint8 `pg:",notnull,use_zero"`
IsDeleted bool `pg:",use_zero"`
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
Character model for the database layer
type EquippedItems ¶
type EquippedItems struct {
ID uint64
CharacterID uint64 //
Character *Character
Head uint16
Face uint16
Body uint16
Pants uint16
Boots uint16
LeftHand uint16
RightHand uint16
LeftMiniPet uint16
RightMiniPet uint16
ApparelHead uint16
ApparelFace uint16
ApparelEye uint16
ApparelBody uint16
ApparelPants uint16
ApparelBoots uint16
ApparelLeftHand uint16
ApparelRightHand uint16
ApparelBack uint16
ApparelTail uint16
ApparelAura uint16
ApparelShield uint16
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
EquippedItems model for the database layer
type ErrCharacter ¶
func (*ErrCharacter) Error ¶
func (ec *ErrCharacter) Error() string
type Inventory ¶
type Inventory struct {
ID uint64
CharacterID uint64 //
Character *Character
ShnID uint16 `pg:",notnull"`
Slot uint16 `pg:",notnull,use_zero"`
IsStack bool `pg:",notnull,use_zero"`
IsStored bool `pg:",notnull,use_zero"`
FromMonarch bool `pg:",notnull,use_zero"`
FromStore bool `pg:",notnull,use_zero"`
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
Inventory model for the database layer
type Location ¶
type Location struct {
ID uint64
CharacterID uint64 //
Character *Character
MapName string `pg:",notnull"`
X uint32 `pg:",notnull"`
Y uint32 `pg:",notnull"`
D uint32 `pg:",notnull"`
IsKQ bool `pg:",notnull,use_zero"`
DeletedAt time.Time `pg:",soft_delete"`
// contains filtered or unexported fields
}
Location model for the database layer
Click to show internal directories.
Click to hide internal directories.