pegasus

package
v0.0.0-...-a711c0c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AccoutInfoRequestBoosters = int32(util.GetAccountInfo_BOOSTERS)
View Source
const GameAccountEntityIDHi uint64 = (bnet.EntityIDKindGameAccount << 56) |
	(bnet.EntityIDRegionTest << 32) |
	(bnet.EntityIDGamePegasus)

Variables

This section is empty.

Functions

func BindSession

func BindSession(s *Server, hostSess *bnet.Session)

func ChoicesToCardDefs

func ChoicesToCardDefs(choices []DraftChoice) (defs []*shared.CardDef)

func MakeCardDef

func MakeCardDef(id, premium int32) *shared.CardDef

func MakeChest

func MakeChest() (chest shared.RewardChest)

func MakeDeckInfo

func MakeDeckInfo(deck *Deck) *shared.DeckInfo

func Migrate

func Migrate()

func PegasusDate

func PegasusDate(t time.Time) *shared.Date

Types

type Account

type Account struct {
	// Lo part of the entity ID for the pegasus account
	ID int64
	// Lo part of the entity ID for the bnet account
	BnetID    int64
	Gold      int64
	Dust      int64
	UpdatedAt time.Time
	Flags     int64

	Progress []SeasonProgress
	Licenses []License
	// contains filtered or unexported fields
}

func (*Account) Init

func (v *Account) Init(sess *Session)

type AccountLicense

type AccountLicense struct {
	ID        int64
	AccountID int64
	LicenseID int64
}

type Achieve

type Achieve struct {
	ID        int32
	AccountID int64
	AchieveID int32

	Progress        int32
	AckProgress     int32
	CompletionCount int32
	Active          bool
	// started_count doesn't seem to be used
	DateGiven     time.Time
	DateCompleted time.Time
}

type Booster

type Booster struct {
	ID          int64
	AccountID   int64
	BoosterType int
	Opened      bool
	Cards       []BoosterCard
}

type BoosterCard

type BoosterCard struct {
	ID        int64
	BoosterID int64
	CardID    int32
	Premium   int32
}

type Bundle

type Bundle struct {
	ID        int64
	ProductID string
	AppleID   string
	AmazonID  string
	GoogleID  string
	Items     []Product `gorm:"many2many:bundle_products;"`
	EventName string
}

type CollectionCard

type CollectionCard struct {
	ID        int64
	AccountID int64
	CardID    int32
	Premium   int32
	Num       int32
}

type Crafting

type Crafting struct{}

func (*Crafting) Init

func (s *Crafting) Init(sess *Session)

type DbfAchieve

type DbfAchieve struct {
	ID          int32
	AchType     string
	Triggered   string
	AchQuota    int
	Race        int
	Reward      string
	RewardData1 int
	RewardData2 int
	CardSet     int
	Event       string
	NameEnus    string
}

type DbfCard

type DbfCard struct {
	ID            int32
	NoteMiniGuid  string
	IsCollectible bool
	NameEnus      string
	ClassID       int32
	Rarity        int32
	CardSet       int32
	BuyPrice      int32
	SellPrice     int32
	GoldBuyPrice  int32
	GoldSellPrice int32
}

type DbfCardBack

type DbfCardBack struct {
	ID    int32
	Data1 int

	NameEnus string
	// contains filtered or unexported fields
}

type DbfScenario

type DbfScenario struct {
	ID                int
	NoteDesc          string
	Players           int
	Player1HeroCardID int
	Player2HeroCardID int
	IsTutorial        bool
	IsExpert          bool
	AdventureID       int
	ModeID            int
	NameEnus          string
	ShortNameEnus     string
	DescriptionEnus   string
	WingID            int
}

type Deck

type Deck struct {
	ID           int64
	AccountID    int64
	DeckType     int
	Name         string
	HeroID       int32
	HeroPremium  int32
	CardBackID   int32
	LastModified time.Time
	Cards        []DeckCard
}

type DeckCard

type DeckCard struct {
	ID      int64
	DeckID  int64
	CardID  int32
	Premium int32
	Num     int32
}

type Draft

type Draft struct {
	ID          int64
	AccountID   int64
	DeckID      int64
	Wins        int32
	Losses      int32
	CreatedAt   time.Time
	EndedAt     time.Time
	Ended       bool
	Choices     []DraftChoice
	CurrentSlot int32
}

func (*Draft) Init

func (s *Draft) Init(sess *Session)

type DraftChoice

type DraftChoice struct {
	ID          int
	DraftID     int64
	CardID      int32
	ChoiceIndex int
	Slot        int32
}

func MakeCardChoices

func MakeCardChoices(slot int32) (choices []DraftChoice)

func MakeHeroChoices

func MakeHeroChoices() (choices []DraftChoice)

type FavoriteHero

type FavoriteHero struct {
	ID        int64
	AccountID int64
	ClassID   int32
	CardID    int32
	Premium   int32
}

type License

type License struct {
	ID        int64
	ProductID int
}

type Packet

type Packet struct {
	Body   []byte
	ID     int32
	System int32
}

func EncodePacket

func EncodePacket(x interface{}, msg proto.Message) *Packet

EncodePacket builds a Packet with the protobuf message and packet id.

func MakeFakeOptions

func MakeFakeOptions() *Packet

func OnAckAchieveProgress

func OnAckAchieveProgress(s *Session, body []byte) *Packet

func OnAckCardSeen

func OnAckCardSeen(s *Session, body []byte) *Packet

func OnAssetsVersion

func OnAssetsVersion(s *Session, body []byte) *Packet

func OnCancelQuest

func OnCancelQuest(s *Session, body []byte) *Packet

func OnCheckAccountLicenses

func OnCheckAccountLicenses(s *Session, body []byte) *Packet

func OnCheckGameLicenses

func OnCheckGameLicenses(s *Session, body []byte) *Packet

func OnCraft

func OnCraft(s *Session, body []byte) *Packet

func OnCreateDeck

func OnCreateDeck(s *Session, body []byte) *Packet

func OnDeckSetData

func OnDeckSetData(s *Session, body []byte) *Packet

func OnDeleteDeck

func OnDeleteDeck(s *Session, body []byte) *Packet

func OnDraftAckRewards

func OnDraftAckRewards(s *Session, body []byte) *Packet

func OnDraftBegin

func OnDraftBegin(s *Session, body []byte) *Packet

func OnDraftGetPicksAndContents

func OnDraftGetPicksAndContents(s *Session, body []byte) *Packet

func OnDraftMakePick

func OnDraftMakePick(s *Session, body []byte) *Packet

func OnDraftRetire

func OnDraftRetire(s *Session, body []byte) *Packet

func OnGenericRequest

func OnGenericRequest(s *Session, body []byte) *Packet

func OnGetAccountInfo

func OnGetAccountInfo(s *Session, body []byte) *Packet

func OnGetAchieves

func OnGetAchieves(s *Session, body []byte) *Packet

func OnGetAdventureProgress

func OnGetAdventureProgress(s *Session, body []byte) *Packet

func OnGetBattlePayConfig

func OnGetBattlePayConfig(s *Session, body []byte) *Packet

func OnGetBattlePayStatus

func OnGetBattlePayStatus(s *Session, body []byte) *Packet

func OnGetDeck

func OnGetDeck(s *Session, body []byte) *Packet

func OnGetOptions

func OnGetOptions(s *Session, body []byte) *Packet

func OnMassDisenchant

func OnMassDisenchant(s *Session, body []byte) *Packet

func OnOpenBooster

func OnOpenBooster(s *Session, body []byte) *Packet

func OnPurchaseWithGold

func OnPurchaseWithGold(s *Session, body []byte) *Packet

func OnRenameDeck

func OnRenameDeck(s *Session, body []byte) *Packet

func OnSetCardBack

func OnSetCardBack(s *Session, body []byte) *Packet

func OnSetFavoriteHero

func OnSetFavoriteHero(s *Session, body []byte) *Packet

func OnSetOptions

func OnSetOptions(s *Session, body []byte) *Packet

func OnUpdateLogin

func OnUpdateLogin(s *Session, body []byte) *Packet

func OnUtilSubscribe

func OnUtilSubscribe(s *Session, body []byte) *Packet

Handle a client's subscribe request. The response may specify a timeout, after which an active client must resubscribe to renew their session.

func OnValidateAchieve

func OnValidateAchieve(s *Session, body []byte) *Packet

type PacketID

type PacketID struct {
	ID     int32
	System int32
}

type Product

type Product struct {
	ID          int64
	ProductType int
	ProductData int32
	Quantity    int32
}

type ProductGoldCost

type ProductGoldCost struct {
	ID          int64
	ProductType int
	PackType    int32
	Cost        int64
}

type SeasonProgress

type SeasonProgress struct {
	ID        int
	AccountID int64

	StarLevel            int
	Stars                int
	LevelStart, LevelEnd int
	LegendRank           int
	SeasonWins           int
	Streak               int
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(serv *bnet.Server) *Server

func (*Server) Connect

func (s *Server) Connect(sess *bnet.Session)

type Session

type Session struct {
	Account
	Draft
	Store
	Subscription
	Version
	Crafting
	// contains filtered or unexported fields
}

func (*Session) GetBoosterInfo

func (s *Session) GetBoosterInfo(kind int32) *shared.BoosterInfo

func (*Session) HandleAccountInfoRequest

func (s *Session) HandleAccountInfoRequest(req util.GetAccountInfo_Request) *Packet

func (*Session) HandleFindGame

func (s *Session) HandleFindGame(req map[string]interface{})

func (*Session) HandleNotifications

func (s *Session) HandleNotifications()

func (*Session) HandleUtilRequest

func (s *Session) HandleUtilRequest(req []*attribute.Attribute)

HandleUtilRequest processes an encoded client request from GameUtilities, possibly returning an encoded response.

func (*Session) RegisterPacket

func (s *Session) RegisterPacket(packetId interface{}, handler UtilHandler)

func (*Session) SendUtilPacket

func (s *Session) SendUtilPacket(p *Packet)

func (*Session) UnregisterPacket

func (s *Session) UnregisterPacket(packetId interface{}, handler UtilHandler)

type Store

type Store struct{}

func (*Store) Init

func (s *Store) Init(sess *Session)

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

The subscription system is a way to reduce the server resource usage of idling players.

func (*Subscription) Init

func (s *Subscription) Init(sess *Session)

func (*Subscription) IsValid

func (s *Subscription) IsValid() bool

type UtilHandler

type UtilHandler func(sess *Session, req []byte) *Packet

type Version

type Version struct{}

func (*Version) Init

func (v *Version) Init(sess *Session)

Directories

Path Synopsis
util server interacts with game server as: util -> game: CreateGame(* GameStartInfo) game -> util: <Status{Ready, []PlayerJoinInfo} util -> each client: PlayerJoinInfo any client -> game: JoinInfo{} game <==> client: PowerHistory, Options, GameUI, etc.
util server interacts with game server as: util -> game: CreateGame(* GameStartInfo) game -> util: <Status{Ready, []PlayerJoinInfo} util -> each client: PlayerJoinInfo any client -> game: JoinInfo{} game <==> client: PowerHistory, Options, GameUI, etc.

Jump to

Keyboard shortcuts

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