lib

package
v0.0.0-...-dc6ec6b Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Public Topics
	NatsGoldPricesIngest       = "goldprices.ingest"
	NatsGoldPricesDeduped      = "goldprices.deduped"
	NatsMarketOrdersIngest     = "marketorders.ingest"
	NatsMarketOrdersDeduped    = "marketorders.deduped"
	NatsMarketHistoriesIngest  = "markethistories.ingest"
	NatsMarketHistoriesDeduped = "markethistories.deduped"
	NatsValidMarketOrders      = "validmarketorders"
	NatsMapDataIngest          = "mapdata.ingest"
	NatsMapDataDeduped         = "mapdata.deduped"

	// Private Topics
	NatsSkillData           = "skills"
	NatsMarketNotifications = "marketnotifications"
)
View Source
const (
	SalesTax = 0.03
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CharacterID

type CharacterID string

Represents a character identifier in its UUID-style string format

type GoldPricesUpload

type GoldPricesUpload struct {
	Prices     []int   `json:"Prices"`
	TimeStamps []int64 `json:"Timestamps"`
}

GoldPricesUpload contains the current gold prices

func (*GoldPricesUpload) StringArrays

func (g *GoldPricesUpload) StringArrays() [][]string

type MapDataUpload

type MapDataUpload struct {
	ZoneID          int      `json:"ZoneID"`
	BuildingType    []int    `json:"BuildingType"`
	AvailableFood   []int    `json:"AvailableFood"`
	Reward          []int    `json:"Reward"`
	AvailableSilver []int    `json:"AvailableSilver"`
	Owners          []string `json:"Owners"`
	Buildable       []bool   `json:"Buildable"`
	IsForSale       []bool   `json:"IsForSale"`
	BuyPrice        []int    `json:"BuyPrice"`
}

MapDataUpload contains information on zone maps

func (*MapDataUpload) StringArrays

func (m *MapDataUpload) StringArrays() [][]string

type MarketExpiryNotification

type MarketExpiryNotification struct {
	MailID     int    `json:"Id"`
	ItemID     string `json:"ItemTypeId"`
	LocationID string `json:"LocationId"`
	Amount     int    `json:"Amount"`
	Expires    string `json:"Expires"`
	Price      int    `json:"UnitPriceSilver"`
	Sold       int    `json:"Sold"`
}

func (*MarketExpiryNotification) Type

type MarketHistoriesUpload

type MarketHistoriesUpload struct {
	AlbionId     uint32           `json:"AlbionId"`
	LocationId   int              `json:"LocationId"`
	QualityLevel uint8            `json:"QualityLevel"`
	Timescale    Timescale        `json:"Timescale"`
	Histories    []*MarketHistory `json:"MarketHistories"`
}

type MarketHistory

type MarketHistory struct {
	ItemAmount   int64  `json:"ItemAmount"`
	SilverAmount uint64 `json:"SilverAmount"`
	Timestamp    uint64 `json:"Timestamp"`
}

MarketHistory contains the 3 data arrays (Item amount, silver amount, and timestamp) These values come over the wire with indexes aligned, but are likely not sorted by time. Their sizes also value based on need as mentioned below.

func (*MarketHistory) StringArray

func (m *MarketHistory) StringArray() []string

StringArray for MarketHistory

type MarketNotification

type MarketNotification interface {
	Type() MarketNotificationType
}

type MarketNotificationType

type MarketNotificationType string
const (
	SalesNotification  MarketNotificationType = "SalesNotification"
	ExpiryNotification                        = "ExpiryNotification"
)

type MarketNotificationUpload

type MarketNotificationUpload struct {
	PrivateUpload
	Type         MarketNotificationType `json:"NotificationType"`
	Notification MarketNotification     `json:"Notification"`
}

type MarketOrder

type MarketOrder struct {
	ID               int    `json:"Id"`
	ItemID           string `json:"ItemTypeId"`
	GroupTypeId      string `json:"ItemGroupTypeId"`
	LocationID       int    `json:"LocationId"`
	QualityLevel     int    `json:"QualityLevel"`
	EnchantmentLevel int    `json:"EnchantmentLevel"`
	Price            int    `json:"UnitPriceSilver"`
	Amount           int    `json:"Amount"`
	AuctionType      string `json:"AuctionType"`
	Expires          string `json:"Expires"`
}

MarketOrder contains an order (offer or request)

func (*MarketOrder) StringArray

func (m *MarketOrder) StringArray() []string

type MarketSellNotification

type MarketSellNotification struct {
	MailID          int     `json:"Id"`
	ItemID          string  `json:"ItemTypeId"`
	LocationID      string  `json:"LocationId"`
	Amount          int     `json:"Amount"`
	Expires         string  `json:"Expires"`
	Price           int     `json:"UnitPriceSilver"`
	TotalAfterTaxes float32 `json:"TotalAfterTaxes"`
}

func (*MarketSellNotification) Type

type MarketUpload

type MarketUpload struct {
	Orders []*MarketOrder `json:"Orders"`
}

MarketUpload contains a list of orders

type PersonalizedUpload

type PersonalizedUpload interface {
	Personalize(CharacterID, string)
}

type PrivateUpload

type PrivateUpload struct {
	CharacterId   CharacterID `json:"CharacterId"`
	CharacterName string      `json:"CharacterName"`
}

func (*PrivateUpload) Personalize

func (p *PrivateUpload) Personalize(id CharacterID, name string)

type Skill

type Skill struct {
	ID               int     `json:"Id"`
	Level            int     `json:"Level"`
	PercentNextLevel float64 `json:"PercentNextLevel"`
	Fame             int     `json:"Fame"`
}

Skill contains a skill

type SkillsUpload

type SkillsUpload struct {
	PrivateUpload
	Skills []*Skill `json:"Skills"`
}

SkillsUpload contains a list of skills

type Timescale

type Timescale uint8

Timescale represents the three different timescale views available for market history

const (
	// Hours - 0 means we are looking at the 24 hour scale
	Hours Timescale = 0
	// Days - 1 means we are looking at the 7 day scale
	Days Timescale = 1
	// Weeks - 2 means we are looking at the 4 week scale
	Weeks Timescale = 2
)

func (Timescale) String

func (scale Timescale) String() string

Jump to

Keyboard shortcuts

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