models

package
v0.0.0-...-769df87 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCharacter

func DeleteCharacter(charID int64) error

func GetGlobalDB

func GetGlobalDB() *sql.DB

func InitGlobalDB

func InitGlobalDB(dsn *DataSourceConfig) error

func InsertCharacter

func InsertCharacter(ch *Character) (int64, error)

func InsertCharacterItem

func InsertCharacterItem(charID int64, itemID int32, slot int32) error

func IsRechargeAble

func IsRechargeAble(itemID int32) bool

func IsStackable

func IsStackable(itemID int32, ammount int16) bool

func SelectCharacterNameCount

func SelectCharacterNameCount(name string) (int, error)

func UpdateAccountSetGender

func UpdateAccountSetGender(username string, gender int) error

func UpdateAccountSetLoggedIn

func UpdateAccountSetLoggedIn(username string, logged bool) error

Types

type Account

type Account struct {
	ID                      int64  `json:"id"`
	Name                    string `json:"name"`
	Password                string `json:"password"`
	Salt                    string
	LoggedIn                byte `json:"status"`
	LastLogin               *int64
	CreateDat               *int64
	Birthday                *int64
	Banned                  byte
	BanReason               string
	GM                      byte
	Email                   string
	EmailCode               string
	ForumAccid              int
	Macs                    string
	LastPweMail             *int64
	TempBan                 *int64
	Greason                 byte
	PaypalNX                int
	MPoints                 int
	CardNX                  int
	DonatorPoints           byte
	Guest                   byte
	LastLoginInMilliSeconds int64
	LeaderPoints            byte
	PQPoints                byte
	LastKnownIP             string
	Pin                     string
	NomePessoal             string
	Fb                      string
	Twt                     string
	BetaPoints              int
	SiteLogged              string
	WebAdmin                int
	Nick                    string
	Mute                    int
	IP                      string
	Gender                  byte
}

Account -

func SelectAccountForLogin

func SelectAccountForLogin(username string) (*Account, error)

type Character

type Character struct {
	ID                int64
	AccountID         int64
	World             int32
	Name              string
	Level             int
	Exp               int
	Str               int
	Dex               int
	Luk               int
	Intt              int
	HP                int
	MP                int
	MaxHP             int
	MaxMP             int
	Meso              int
	HpApUsed          int
	MpApUsed          int
	Job               int
	SkinColor         int
	Gender            int
	Fame              int
	Hair              int
	Face              int
	Ap                int
	Sp                int
	MapID             int
	SpawnPoint        int
	GM                int
	Party             int
	BuddyCapacity     int
	CreateDate        *int64
	Rank              int
	RankMove          int
	JobRank           int
	JobRankMove       int
	GuildID           int
	GuildRank         int
	AllianceRank      int
	MessagerID        int
	MessengerPosition int
	Reborns           int
	PvpKills          int
	PvpDeaths         int
	Clan              int
	MountLevel        int
	Mountexp          int
	MountTiredness    int
	Married           int
	PartnerID         int
	CanTalk           int
	ZakumLvl          int
	MarriageQuest     int
	Omok              int
	MatchCard         int
	OmokWins          int
	OmokLosses        int
	OmokTies          int
	MatchCardWins     int
	MatchCardLosses   int
	MatchCardTies     int
	MerchantMesos     int
	HasMerchant       int
	GMText            int
	EquipSlots        int
	UseSlots          int
	SetupSlots        int
	EtcSlots          int
	BossPoints        int
	BossRepeats       int
	NextBQ            int64
	LeaderPoints      int
	PQPoints          int
	VotePoints        int
	Occupation        int
	JQPoints          int
	CashPoints        int
	JQRank            int
}

func SelectCharacterByAccountID

func SelectCharacterByAccountID(accountID int32) (*Character, error)

func SelectCharacterByAccountIDWorldID

func SelectCharacterByAccountIDWorldID(accountID int32, worldID int32) ([]*Character, error)

func SelectCharacterByCharacterID

func SelectCharacterByCharacterID(charID int32) (*Character, error)

type CharacterInventoryItem

type CharacterInventoryItem struct {
	InventoryItem
	InventoryEquipment
}

func SelectCharacterInventoryItem

func SelectCharacterInventoryItem(charID int64) ([]*CharacterInventoryItem, error)

type DataSourceConfig

type DataSourceConfig struct {
	IP       string `toml:"ip"`
	Port     int    `toml:"port"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	Database string `toml:"database"`
}

func (*DataSourceConfig) DSN

func (d *DataSourceConfig) DSN() string

type InventoryEquipment

type InventoryEquipment struct {
	InventoryEquipmentID int64
	InventoryItemID      int
	UpgradeSlots         int
	Level                int
	Str                  int
	Dex                  int
	Intt                 int
	Luk                  int
	HP                   int
	MP                   int
	WAtk                 int
	MAtk                 int
	WDef                 int
	MDef                 int
	Acc                  int
	Avoid                int
	Hands                int
	Speed                int
	Jump                 int
	RingID               int
	Locked               int
	Vicious              int
	Flag                 int
}

type InventoryItem

type InventoryItem struct {
	InventoryItemID int64
	CharacterID     int64
	StorageID       int
	ItemID          int
	InventoryType   int
	Position        int
	Quantity        int
	Owner           string
	Expiration      int64
	UniqueID        int64
	PetSlot         int
}

func SelectCharacterInventoryItemIDsAndPositionByInventoryType

func SelectCharacterInventoryItemIDsAndPositionByInventoryType(charID int64, inventoryType int) ([]*InventoryItem, error)

type Item

type Item struct {
	UUID         uuid.UUID
	InvID        byte
	SlotID       int16
	ItemID       int32
	ExpireTime   uint64
	Amount       int16
	CreatorName  string
	Flag         int16
	UpgradeSlots byte
	ReqLevel     byte
	ScrollLevel  byte
	Str          int16
	Dex          int16
	Int          int16
	Luk          int16
	ReqStr       int16
	ReqDex       int16
	ReqInt       int16
	ReqLuk       int16
	HP           int16
	MP           int16
	Watk         int16
	Matk         int16
	Wdef         int16
	Mdef         int16
	Accuracy     int16
	Avoid        int16
	Hands        int16
	Speed        int16
	Jump         int16
}

Item -

func CreateFromID

func CreateFromID(id int32, isDrop bool) (Item, bool)

TODO: Fill the rest out, for now this can be used to check functionality

Jump to

Keyboard shortcuts

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