Documentation
¶
Index ¶
- Constants
- Variables
- type Account
- type DBHandler
- func (db *DBHandler) Close() error
- func (db *DBHandler) DeletePlayer(PlayerID, AccountID int) (int, error)
- func (db *DBHandler) Exec(query string, args ...any) (sql.Result, error)
- func (db *DBHandler) FinishPlayer(character *protocol.SP_CL2LS_REQ_CHAR_CREATE, AccountId int) error
- func (db *DBHandler) FinishTutorial(PlayerID, AccountID int) error
- func (db *DBHandler) GetPlayer(PlayerID int) (*Player, error)
- func (db *DBHandler) GetPlayerInventorySlots(PlayerID int, start int, end int) ([]protocol.SItemBase, error)
- func (db *DBHandler) GetPlayers(AccountID int) ([]Player, error)
- func (db *DBHandler) NewAccount(Login, Password string) (*Account, error)
- func (db *DBHandler) NewPlayer(AccountID int, FirstName, LastName string, slot int) (int, error)
- func (db *DBHandler) Query(query string, args ...any) (*sql.Rows, error)
- func (db *DBHandler) SetPlayerInventorySlots(PlayerID int, start int, items []protocol.SItemBase) error
- func (db *DBHandler) Setup() error
- func (db *DBHandler) Transaction(transaction func(*sql.Tx) error) (err error)
- func (db *DBHandler) TryLogin(Login, Password string) (*Account, error)
- type Inventory
- type Player
Constants ¶
View Source
const (
QUERY_PLAYERS = `` /* 631-byte string literal not displayed */
)
Variables ¶
View Source
var ( ErrLoginInvalidID = errors.New("invalid Login ID") ErrLoginInvalidPassword = errors.New("invalid ID && Password combo") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountID int `db:"accountid"` Login string `db:"login"` Password string `db:"password"` Selected int `db:"selected"` AccountLevel int `db:"accountlevel"` Created int `db:"created"` LastLogin int `db:"lastlogin"` BannedUntil int `db:"banneduntil"` BannedSince int `db:"bannedsince"` BanReason string `db:"banreason"` }
type DBHandler ¶
type DBHandler struct {
// contains filtered or unexported fields
}
func OpenPostgresDB ¶
func (*DBHandler) DeletePlayer ¶
returns the deleted Slot number
func (*DBHandler) FinishPlayer ¶
func (db *DBHandler) FinishPlayer(character *protocol.SP_CL2LS_REQ_CHAR_CREATE, AccountId int) error
TODO: should this operate on the raw packet? should we do validation here or prior?
func (*DBHandler) FinishTutorial ¶
func (*DBHandler) GetPlayerInventorySlots ¶
func (db *DBHandler) GetPlayerInventorySlots(PlayerID int, start int, end int) ([]protocol.SItemBase, error)
start && end are both inclusive
func (*DBHandler) NewAccount ¶
func (*DBHandler) SetPlayerInventorySlots ¶
func (db *DBHandler) SetPlayerInventorySlots(PlayerID int, start int, items []protocol.SItemBase) error
start is inclusive
func (*DBHandler) Transaction ¶
calls transaction, if transaction returns a non-nil error the transaction is rolled back. otherwise the transaction is committed
type Player ¶
type Player struct { PlayerID int AccountID int AccountLevel int Slot int PCStyle protocol.SPCStyle PCStyle2 protocol.SPCStyle2 EquippedNanos [3]int Nanos [config.NANO_COUNT]protocol.SNano Equip [config.AEQUIP_COUNT]protocol.SItemBase Inven [config.AINVEN_COUNT]protocol.SItemBase Bank [config.ABANK_COUNT]protocol.SItemBase SkywayLocationFlag []byte FirstUseFlag []byte Quests []byte HP int Level int Taros int FusionMatter int Mentor int X, Y, Z int Angle int BatteryN int BatteryW int WarpLocationFlag int ActiveNanoSlotNum int Fatigue int CurrentMissionID int IPCState int8 }
Click to show internal directories.
Click to hide internal directories.