Documentation ¶
Index ¶
- Variables
- type DecorationTypeIDs
- type NewCharacterParams
- type Options
- type Service
- func (s *Service) AddCharacter(ctx context.Context, playerID int64, params NewCharacterParams) (dbmodels.Character, error)
- func (s *Service) AddClubSet(ctx context.Context, playerID int64, clubsetTypeID uint32) (dbmodels.Inventory, error)
- func (s *Service) AddExp(ctx context.Context, playerID int64, add int) (pangya.Rank, int, error)
- func (s *Service) AddPang(ctx context.Context, playerID, pang int64) (int64, error)
- func (s *Service) AddSession(ctx context.Context, playerID int64, address string) (dbmodels.Session, error)
- func (s *Service) Authenticate(ctx context.Context, username, password string) (dbmodels.Player, error)
- func (s *Service) DeleteExpiredSessions(ctx context.Context) error
- func (s *Service) GetCharacters(ctx context.Context, playerID int64) ([]pangya.PlayerCharacterData, error)
- func (s *Service) GetConsumables(ctx context.Context, playerID int64) ([10]uint32, error)
- func (s *Service) GetPlayer(ctx context.Context, playerID int64) (dbmodels.GetPlayerRow, error)
- func (s *Service) GetPlayerInventory(ctx context.Context, playerID int64) ([]dbmodels.Inventory, error)
- func (s *Service) GetSession(ctx context.Context, sessionID int64) (dbmodels.Session, error)
- func (s *Service) GetSessionByKey(ctx context.Context, sessionKey string) (dbmodels.Session, error)
- func (s *Service) HasCharacters(ctx context.Context, playerID int64) (bool, error)
- func (s *Service) PurchaseItem(ctx context.Context, ...) (dbmodels.SetPlayerCurrencyRow, error)
- func (s *Service) Register(ctx context.Context, username, password string) (dbmodels.Player, error)
- func (s *Service) SetCaddie(ctx context.Context, playerID int64, caddieID int64) error
- func (s *Service) SetCharacter(ctx context.Context, playerID int64, characterID int64) error
- func (s *Service) SetCharacterParts(ctx context.Context, playerID int64, data pangya.PlayerCharacterData) error
- func (s *Service) SetClubSet(ctx context.Context, playerID int64, clubsetID int64) error
- func (s *Service) SetComet(ctx context.Context, playerID int64, cometTypeID uint32, ...) (int64, error)
- func (s *Service) SetConsumables(ctx context.Context, playerID int64, newSlots [10]uint32, ...) error
- func (s *Service) SetDecoration(ctx context.Context, playerId int64, decoration DecorationTypeIDs) error
- func (s *Service) SetNickname(ctx context.Context, playerID int64, nickname string) (dbmodels.Player, error)
- func (s *Service) UpdateSessionExpiry(ctx context.Context, sessionID int64) (dbmodels.Session, error)
- func (s *Service) UseItem(ctx context.Context, playerID, itemTypeID int64, player *dbmodels.GetPlayerRow) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPassword = errors.New("invalid password") ErrUnknownUsername = errors.New("unknown user") )
Enumeration of possible errors that can be returned from authenticate.
Functions ¶
This section is empty.
Types ¶
type DecorationTypeIDs ¶ added in v0.0.3
type NewCharacterParams ¶ added in v0.0.3
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements account services using the database.
func NewService ¶
NewService creates new account services using the database.
func (*Service) AddCharacter ¶
func (s *Service) AddCharacter(ctx context.Context, playerID int64, params NewCharacterParams) (dbmodels.Character, error)
AddCharacter adds a character for a given player.
func (*Service) AddClubSet ¶ added in v0.0.3
func (*Service) AddSession ¶
func (s *Service) AddSession(ctx context.Context, playerID int64, address string) (dbmodels.Session, error)
AddSession adds a new session for a player.
func (*Service) Authenticate ¶
func (s *Service) Authenticate(ctx context.Context, username, password string) (dbmodels.Player, error)
Authenticate authenticates a user using the database.
func (*Service) DeleteExpiredSessions ¶
DeleteExpiredSessions deletes sessions that have expired.
func (*Service) GetCharacters ¶
func (s *Service) GetCharacters(ctx context.Context, playerID int64) ([]pangya.PlayerCharacterData, error)
GetCharacters returns the characters for a given player.
func (*Service) GetConsumables ¶ added in v0.0.3
func (*Service) GetPlayerInventory ¶ added in v0.0.3
func (*Service) GetSession ¶
GetSession gets a session by its ID.
func (*Service) GetSessionByKey ¶
GetSessionByKey gets a session by its session key.
func (*Service) HasCharacters ¶
HasCharacters returns whether or not the player has characters.
func (*Service) PurchaseItem ¶ added in v0.0.3
func (*Service) SetCharacter ¶ added in v0.0.3
func (*Service) SetCharacterParts ¶ added in v0.0.3
func (*Service) SetClubSet ¶ added in v0.0.3
func (*Service) SetConsumables ¶ added in v0.0.3
func (*Service) SetDecoration ¶ added in v0.0.3
func (*Service) SetNickname ¶
func (s *Service) SetNickname(ctx context.Context, playerID int64, nickname string) (dbmodels.Player, error)
SetNickname sets the player's nickname.
Click to show internal directories.
Click to hide internal directories.