Documentation ¶
Index ¶
- Constants
- Variables
- func AccountKey(userID string) []byte
- func AddressToPendingCardAmountChangeItemsKey(address loom.Address) []byte
- func CardCollectionKey(userID string) []byte
- func DecksKey(userID string) []byte
- func GameStateKey(gameStateID int64) []byte
- func InitialGameStateKey(gameStateID int64) []byte
- func MakeAddressToUserIdLinkKey(address loom.Address) []byte
- func MakeVersionedKey(version string, key []byte) []byte
- func MatchKey(matchID int64) []byte
- func NewAdditionalDamgeToHeavyInAttack(card *CardInstance, ...) *additionalDamgeToHeavyInAttack
- func NewAttackOverlord(card *CardInstance, cardAbility *zb_data.CardAbilityAttackOverlord) *attackOverlord
- func NewChangeState(card *CardInstance, cardAbility *zb_data.CardAbilityChangeStat, ...) *changeStat
- func NewDealDamageToThisAndAdjacentUnits(card *CardInstance, ...) *dealDamageToThisAndAdjacentUnits
- func NewDevourZombieAndCombineStats(card *CardInstance, ...) *devourZombieAndCombineStats
- func NewPriorityAttack(card *CardInstance, cardAbility *zb_data.CardAbilityPriorityAttack) *priorityAttack
- func NewRage(card *CardInstance, cardAbility *zb_data.CardAbilityRage) *rage
- func NewReanimate(card *CardInstance, cardAbility *zb_data.CardAbilityReanimate) *reanimate
- func NewReplaceUnitsWithTypeOnStrongerOnes(card *CardInstance, ...) *replaceUnitsWithTypeOnStrongerOnes
- func OverlordsUserDataKey(userID string) []byte
- func PendingMintingTransactionReceiptCollectionKey(userID string) []byte
- func UserMatchKey(userID string) []byte
- func UserNotificationsKey(userID string) []byte
- func UserPersistentDataKey(userID string) []byte
- type Ability
- type CardAmountChangeItem
- type CardInstance
- func (c *CardInstance) AfterAttacking(target *zb_data.InstanceId) error
- func (c *CardInstance) Attack(target *CardInstance) error
- func (c *CardInstance) AttackOverlord(target *zb_data.PlayerState, attacker *zb_data.PlayerState) error
- func (c *CardInstance) MoveZone(from, to zb_enums.ZoneType) error
- func (c *CardInstance) Mulligan() error
- func (c *CardInstance) OnAbilityUsed(targets []*CardInstance) error
- func (c *CardInstance) OnAttack(target *CardInstance) error
- func (c *CardInstance) OnBeingAttacked(attacker *CardInstance) error
- func (c *CardInstance) OnDeath(attacker *CardInstance) error
- func (c *CardInstance) OnPlay() error
- func (c *CardInstance) Play() error
- func (c *CardInstance) Player() *zb_data.PlayerState
- func (c *CardInstance) UseAbility(targets []*CardInstance) error
- type CustomGameMode
- func (c *CustomGameMode) CallFunction(ctx contract.Context, abiInput []byte) (err error)
- func (c *CustomGameMode) CallHookAfterInitialDraw(ctx contract.Context, gameplay *Gameplay) (err error)
- func (c *CustomGameMode) CallHookBeforeMatchStart(ctx contract.Context, gameplay *Gameplay) (err error)
- func (c *CustomGameMode) GetCustomUi(ctx contract.StaticContext) (uiElements []*zb_data.CustomGameModeCustomUiElement, err error)
- type ErrBufferOverrun
- type Gameplay
- type MatchMakingFunc
- type MintingContext
- type MintingReceipt
- type MintingReceiptGenerator
- type PanicReaderWriterProxy
- type PlayerScore
- type ReverseBuffer
- type SimpleCardInstance
- type VerifySignResult
- type ZombieBattleground
- func (z *ZombieBattleground) AcceptMatch(ctx contract.Context, req *zb_calls.AcceptMatchRequest) (*zb_calls.AcceptMatchResponse, error)
- func (z *ZombieBattleground) AddGameMode(ctx contract.Context, req *zb_calls.GameModeRequest) (*zb_data.GameMode, error)
- func (z *ZombieBattleground) AddSoloExperience(ctx contract.Context, req *zb_calls.AddSoloExperienceRequest) (*zb_calls.AddSoloExperienceResponse, error)
- func (z *ZombieBattleground) CallCustomGameModeFunction(ctx contract.Context, req *zb_calls.CallCustomGameModeFunctionRequest) error
- func (z *ZombieBattleground) CancelFindMatch(ctx contract.Context, req *zb_calls.CancelFindMatchRequest) (*zb_calls.CancelFindMatchResponse, error)
- func (z *ZombieBattleground) ClearNotifications(ctx contract.Context, req *zb_calls.ClearNotificationsRequest) (*zb_calls.ClearNotificationsResponse, error)
- func (z *ZombieBattleground) ConfirmPendingMintingTransactionReceipt(ctx contract.Context, ...) error
- func (z *ZombieBattleground) CreateAccount(ctx contract.Context, req *zb_calls.UpsertAccountRequest) error
- func (z *ZombieBattleground) CreateDeck(ctx contract.Context, req *zb_calls.CreateDeckRequest) (*zb_calls.CreateDeckResponse, error)
- func (z *ZombieBattleground) DebugCheatSetFullCardCollection(ctx contract.Context, req *zb_calls.DebugCheatSetFullCardCollectionRequest) (*zb_calls.EmptyResponse, error)
- func (z *ZombieBattleground) DebugGetPendingCardAmountChangeItems(ctx contract.StaticContext, ...) (*zb_calls.DebugGetPendingCardAmountChangeItemsResponse, error)
- func (z *ZombieBattleground) DebugGetUserIdByAddress(ctx contract.StaticContext, req *zb_calls.DebugGetUserIdByAddressRequest) (*zb_data.UserIdContainer, error)
- func (z *ZombieBattleground) DebugMintBoosterPackReceipt(ctx contract.Context, req *zb_calls.DebugMintBoosterPackReceiptRequest) (*zb_calls.DebugMintBoosterPackReceiptResponse, error)
- func (z *ZombieBattleground) DeleteDeck(ctx contract.Context, req *zb_calls.DeleteDeckRequest) error
- func (z *ZombieBattleground) DeleteGameMode(ctx contract.Context, req *zb_calls.DeleteGameModeRequest) error
- func (z *ZombieBattleground) EditDeck(ctx contract.Context, req *zb_calls.EditDeckRequest) error
- func (z *ZombieBattleground) EndMatch(ctx contract.Context, req *zb_calls.EndMatchRequest) (*zb_calls.EndMatchResponse, error)
- func (z *ZombieBattleground) FindMatch(ctx contract.Context, req *zb_calls.FindMatchRequest) (*zb_calls.FindMatchResponse, error)
- func (z *ZombieBattleground) GetAIDecks(ctx contract.StaticContext, req *zb_calls.GetAIDecksRequest) (*zb_calls.GetAIDecksResponse, error)
- func (z *ZombieBattleground) GetAccount(ctx contract.StaticContext, req *zb_calls.GetAccountRequest) (*zb_data.Account, error)
- func (z *ZombieBattleground) GetCardList(ctx contract.StaticContext, req *zb_calls.GetCardListRequest) (*zb_calls.GetCardListResponse, error)
- func (z *ZombieBattleground) GetCollection(ctx contract.Context, req *zb_calls.GetCollectionRequest) (*zb_calls.GetCollectionResponse, error)
- func (z *ZombieBattleground) GetContractBuildMetadata(ctx contract.StaticContext, req *zb_calls.GetContractBuildMetadataRequest) (*zb_calls.GetContractBuildMetadataResponse, error)
- func (z *ZombieBattleground) GetContractConfiguration(ctx contract.StaticContext, req *zb_calls.EmptyRequest) (*zb_calls.GetContractConfigurationResponse, error)
- func (z *ZombieBattleground) GetContractState(ctx contract.StaticContext, req *zb_calls.EmptyRequest) (*zb_calls.GetContractStateResponse, error)
- func (z *ZombieBattleground) GetDeck(ctx contract.Context, req *zb_calls.GetDeckRequest) (*zb_calls.GetDeckResponse, error)
- func (z *ZombieBattleground) GetGameMode(ctx contract.StaticContext, req *zb_calls.GetGameModeRequest) (*zb_data.GameMode, error)
- func (z *ZombieBattleground) GetGameModeCustomUi(ctx contract.StaticContext, req *zb_calls.GetCustomGameModeCustomUiRequest) (*zb_calls.GetCustomGameModeCustomUiResponse, error)
- func (z *ZombieBattleground) GetGameState(ctx contract.StaticContext, req *zb_calls.GetGameStateRequest) (*zb_calls.GetGameStateResponse, error)
- func (z *ZombieBattleground) GetInit(ctx contract.StaticContext, req *zb_calls.GetInitRequest) (*zb_calls.GetInitResponse, error)
- func (z *ZombieBattleground) GetInitialGameState(ctx contract.StaticContext, req *zb_calls.GetGameStateRequest) (*zb_calls.GetGameStateResponse, error)
- func (z *ZombieBattleground) GetMatch(ctx contract.StaticContext, req *zb_calls.GetMatchRequest) (*zb_calls.GetMatchResponse, error)
- func (z *ZombieBattleground) GetNotifications(ctx contract.StaticContext, req *zb_calls.GetNotificationsRequest) (*zb_calls.GetNotificationsResponse, error)
- func (z *ZombieBattleground) GetOracleCommandRequestList(ctx contract.StaticContext, req *orctype.GetOracleCommandRequestListRequest) (*orctype.GetOracleCommandRequestListResponse, error)
- func (z *ZombieBattleground) GetOverlordLevelingData(ctx contract.StaticContext, req *zb_calls.GetOverlordLevelingDataRequest) (*zb_calls.GetOverlordLevelingDataResponse, error)
- func (z *ZombieBattleground) GetOverlordUserInstance(ctx contract.StaticContext, req *zb_calls.GetOverlordUserInstanceRequest) (*zb_calls.GetOverlordUserInstanceResponse, error)
- func (z *ZombieBattleground) GetPendingMintingTransactionReceipts(ctx contract.StaticContext, ...) (*zb_calls.GetPendingMintingTransactionReceiptsResponse, error)
- func (z *ZombieBattleground) GetPlayerPool(ctx contract.Context, req *zb_calls.PlayerPoolRequest) (*zb_calls.PlayerPoolResponse, error)
- func (z *ZombieBattleground) GetTaggedPlayerPool(ctx contract.Context, req *zb_calls.PlayerPoolRequest) (*zb_calls.PlayerPoolResponse, error)
- func (z *ZombieBattleground) Init(ctx contract.Context, req *zb_calls.InitRequest) error
- func (z *ZombieBattleground) KeepAlive(ctx contract.Context, req *zb_calls.KeepAliveRequest) (*zb_calls.KeepAliveResponse, error)
- func (z *ZombieBattleground) ListCardLibrary(ctx contract.StaticContext, req *zb_calls.ListCardLibraryRequest) (*zb_calls.ListCardLibraryResponse, error)
- func (z *ZombieBattleground) ListDecks(ctx contract.Context, req *zb_calls.ListDecksRequest) (*zb_calls.ListDecksResponse, error)
- func (z *ZombieBattleground) ListGameModes(ctx contract.StaticContext, req *zb_calls.ListGameModesRequest) (*zb_data.GameModeList, error)
- func (z *ZombieBattleground) ListOverlordLibrary(ctx contract.StaticContext, req *zb_calls.ListOverlordLibraryRequest) (*zb_calls.ListOverlordLibraryResponse, error)
- func (z *ZombieBattleground) ListOverlordUserInstances(ctx contract.StaticContext, req *zb_calls.ListOverlordUserInstancesRequest) (*zb_calls.ListOverlordUserInstancesResponse, error)
- func (z *ZombieBattleground) Login(ctx contract.Context, req *zb_calls.LoginRequest) (*zb_calls.LoginResponse, error)
- func (z *ZombieBattleground) Meta() (plugin.Meta, error)
- func (z *ZombieBattleground) ProcessOracleCommandResponseBatch(ctx contract.Context, req *orctype.ProcessOracleCommandResponseBatchRequest) (*zb_calls.EmptyResponse, error)
- func (z *ZombieBattleground) ProcessOracleEventBatch(ctx contract.Context, req *orctype.ProcessOracleEventBatchRequest) error
- func (z *ZombieBattleground) RegisterPlayerPool(ctx contract.Context, req *zb_calls.RegisterPlayerPoolRequest) (*zb_calls.RegisterPlayerPoolResponse, error)
- func (z *ZombieBattleground) ReplayGame(ctx contract.Context, req *zb_calls.ReplayGameRequest) (*zb_calls.ReplayGameResponse, error)
- func (z *ZombieBattleground) RequestUserFullCardCollectionSync(ctx contract.Context, req *zb_calls.RequestUserFullCardCollectionSyncRequest) (*zb_calls.EmptyResponse, error)
- func (z *ZombieBattleground) SendBundlePlayerAction(ctx contract.Context, req *zb_calls.BundlePlayerActionRequest) (*zb_calls.BundlePlayerActionResponse, error)
- func (z *ZombieBattleground) SendPlayerAction(ctx contract.Context, req *zb_calls.PlayerActionRequest) (*zb_calls.PlayerActionResponse, error)
- func (z *ZombieBattleground) SetLastPlasmaBlockNumber(ctx contract.Context, req *zb_calls.SetLastPlasmaBlockNumberRequest) error
- func (z *ZombieBattleground) UpdateAccount(ctx contract.Context, req *zb_calls.UpsertAccountRequest) (*zb_data.Account, error)
- func (z *ZombieBattleground) UpdateContractConfiguration(ctx contract.Context, req *zb_calls.UpdateContractConfigurationRequest) error
- func (z *ZombieBattleground) UpdateGameMode(ctx contract.Context, req *zb_calls.UpdateGameModeRequest) (*zb_data.GameMode, error)
- func (z *ZombieBattleground) UpdateInit(ctx contract.Context, req *zb_calls.UpdateInitRequest) error
- func (z *ZombieBattleground) UpdateOracle(ctx contract.Context, req *zb_calls.UpdateOracleRequest) error
- func (z *ZombieBattleground) UpdateUserElo(ctx contract.Context, req *zb_calls.UpdateUserEloRequest) error
Constants ¶
const ( // MMRetries defines how many times the player keep retrying on match making MMRetries = 3 // MMWaitTime defines how long the player will wait if there is no other player in player pool MMWaitTime = 3000 * time.Millisecond // MMTimeout determines how long the player should be in the player pool MMTimeout = 120 * time.Second )
const ( MaxGameModeNameChar = 48 MaxGameModeDescriptionChar = 255 MaxGameModeVersionChar = 16 TurnTimeout = 120 * time.Second KeepAliveTimeout = 60 * time.Second // client keeps sending keepalive every 30 second. have to make sure we have some buffer for network delays )
const ( TopicCreateAccountEvent = "createaccount" TopicUpdateAccountEvent = "updateaccount" TopicCreateDeckEvent = "createdeck" TopicEditDeckEvent = "editdeck" TopicDeleteDeckEvent = "deletedeck" TopicAddOverlordExpEvent = "addheroexperience" TopicRegisterPlayerPoolEvent = "registerplayerpool" TopicFindMatchEvent = "findmatch" TopicAcceptMatchEvent = "acceptmatch" // match pattern match:id e.g. match:1, match:2, ... TopicMatchEventPrefix = "match:" TopicUserEventPrefix = "user:" )
const ( OracleRole = "oracle" OwnerRole = "user" )
const (
MaxDeckNameChar = 48
)
Variables ¶
var ( BuildDate = "" BuildGitSha = "" BuildNumber = "" )
var ( ErrDeckNameExists = errors.New("deck name already exists") ErrDeckNameEmpty = errors.New("deck name cannot be empty") ErrDeckMustNotNil = errors.New("deck must not be nil") ErrDeckNameTooLong = fmt.Errorf("deck name is more than %d characters", MaxDeckNameChar) )
var ( ErrNotFound = errors.New("not found") ErrUserNotVerified = errors.New("user is not verified") ErrNotOwnerOrOracleNotVerified = errors.New("sender is not user owner or oracle") )
var ( // Error list ErrOracleNotSpecified = errors.New("oracle not specified") ErrOracleNotVerified = errors.New("oracle not verified") ErrInvalidEventBatch = errors.New("invalid event batch") ErrVersionNotSet = errors.New("data version not set") ErrDebugNotEnabled = errors.New("debug mode not enabled") )
var Contract plugin.Contract = contract.MakePluginContract(&ZombieBattleground{})
Functions ¶
func AccountKey ¶
func AddressToPendingCardAmountChangeItemsKey ¶
func AddressToPendingCardAmountChangeItemsKey(address loom.Address) []byte
func CardCollectionKey ¶
func GameStateKey ¶
func InitialGameStateKey ¶
func MakeAddressToUserIdLinkKey ¶
func MakeAddressToUserIdLinkKey(address loom.Address) []byte
func MakeVersionedKey ¶
func NewAdditionalDamgeToHeavyInAttack ¶
func NewAdditionalDamgeToHeavyInAttack(card *CardInstance, cardAbility *zb_data.CardAbilityAdditionalDamageToHeavyInAttack, target *CardInstance) *additionalDamgeToHeavyInAttack
func NewAttackOverlord ¶
func NewAttackOverlord(card *CardInstance, cardAbility *zb_data.CardAbilityAttackOverlord) *attackOverlord
func NewChangeState ¶
func NewChangeState(card *CardInstance, cardAbility *zb_data.CardAbilityChangeStat, target *zb_data.InstanceId) *changeStat
func NewDealDamageToThisAndAdjacentUnits ¶
func NewDealDamageToThisAndAdjacentUnits(card *CardInstance, cardAbility *zb_data.CardAbilityDealDamageToThisAndAdjacentUnits, target *CardInstance) *dealDamageToThisAndAdjacentUnits
func NewDevourZombieAndCombineStats ¶
func NewDevourZombieAndCombineStats(card *CardInstance, cardAbility *zb_data.CardAbilityDevourZombieAndCombineStats, targets []*CardInstance) *devourZombieAndCombineStats
func NewPriorityAttack ¶
func NewPriorityAttack(card *CardInstance, cardAbility *zb_data.CardAbilityPriorityAttack) *priorityAttack
func NewRage ¶
func NewRage(card *CardInstance, cardAbility *zb_data.CardAbilityRage) *rage
func NewReanimate ¶
func NewReanimate(card *CardInstance, cardAbility *zb_data.CardAbilityReanimate) *reanimate
func NewReplaceUnitsWithTypeOnStrongerOnes ¶
func NewReplaceUnitsWithTypeOnStrongerOnes(card *CardInstance, cardAbility *zb_data.CardAbilityReplaceUnitsWithTypeOnStrongerOnes, cardlibrary *zb_data.CardList) *replaceUnitsWithTypeOnStrongerOnes
func OverlordsUserDataKey ¶
func UserMatchKey ¶
func UserNotificationsKey ¶
func UserPersistentDataKey ¶
Types ¶
type CardAmountChangeItem ¶
type CardAmountChangeItem struct { CardKey battleground_proto.CardKey AmountChange int64 }
type CardInstance ¶
type CardInstance struct { *zb_data.CardInstance Gameplay *Gameplay }
func NewCardInstance ¶
func NewCardInstance(instance *zb_data.CardInstance, gameplay *Gameplay) *CardInstance
func (*CardInstance) AfterAttacking ¶
func (c *CardInstance) AfterAttacking(target *zb_data.InstanceId) error
func (*CardInstance) Attack ¶
func (c *CardInstance) Attack(target *CardInstance) error
func (*CardInstance) AttackOverlord ¶
func (c *CardInstance) AttackOverlord(target *zb_data.PlayerState, attacker *zb_data.PlayerState) error
func (*CardInstance) Mulligan ¶
func (c *CardInstance) Mulligan() error
func (*CardInstance) OnAbilityUsed ¶
func (c *CardInstance) OnAbilityUsed(targets []*CardInstance) error
func (*CardInstance) OnAttack ¶
func (c *CardInstance) OnAttack(target *CardInstance) error
OnAttack trigger ability when the card attacks a target
func (*CardInstance) OnBeingAttacked ¶
func (c *CardInstance) OnBeingAttacked(attacker *CardInstance) error
func (*CardInstance) OnDeath ¶
func (c *CardInstance) OnDeath(attacker *CardInstance) error
func (*CardInstance) OnPlay ¶
func (c *CardInstance) OnPlay() error
func (*CardInstance) Play ¶
func (c *CardInstance) Play() error
func (*CardInstance) Player ¶
func (c *CardInstance) Player() *zb_data.PlayerState
func (*CardInstance) UseAbility ¶
func (c *CardInstance) UseAbility(targets []*CardInstance) error
type CustomGameMode ¶
type CustomGameMode struct {
// contains filtered or unexported fields
}
We will create one instance of this per deployed game mode
func NewCustomGameMode ¶
func NewCustomGameMode(tokenAddr loom.Address) *CustomGameMode
func (*CustomGameMode) CallFunction ¶
func (c *CustomGameMode) CallFunction(ctx contract.Context, abiInput []byte) (err error)
func (*CustomGameMode) CallHookAfterInitialDraw ¶
func (c *CustomGameMode) CallHookAfterInitialDraw(ctx contract.Context, gameplay *Gameplay) (err error)
func (*CustomGameMode) CallHookBeforeMatchStart ¶
func (c *CustomGameMode) CallHookBeforeMatchStart(ctx contract.Context, gameplay *Gameplay) (err error)
func (*CustomGameMode) GetCustomUi ¶
func (c *CustomGameMode) GetCustomUi(ctx contract.StaticContext) (uiElements []*zb_data.CustomGameModeCustomUiElement, err error)
type ErrBufferOverrun ¶
type ErrBufferOverrun struct {
// contains filtered or unexported fields
}
func (ErrBufferOverrun) Error ¶
func (e ErrBufferOverrun) Error() string
type Gameplay ¶
func GamePlayFrom ¶
func GamePlayFrom(state *zb_data.GameState, useBackendGameLogic bool, playersDebugCheats []*zb_data.DebugCheatsConfiguration) (*Gameplay, error)
GamePlayFrom initializes and run game to the latest state
func NewGamePlay ¶
func NewGamePlay(ctx contract.Context, id int64, version string, players []*zb_data.PlayerState, seed int64, customGameAddress *loom.Address, useBackendGameLogic bool, playersDebugCheats []*zb_data.DebugCheatsConfiguration, ) (*Gameplay, error)
NewGamePlay initializes GamePlay with default game state and run to the latest state
func (*Gameplay) AddAction ¶
func (g *Gameplay) AddAction(action *zb_data.PlayerAction) error
AddAction adds the given action and reruns the game state
func (*Gameplay) AddBundleAction ¶
func (g *Gameplay) AddBundleAction(actions ...*zb_data.PlayerAction) error
func (*Gameplay) DebugState ¶
func (g *Gameplay) DebugState()
func (*Gameplay) PrintState ¶
func (g *Gameplay) PrintState()
type MatchMakingFunc ¶
type MatchMakingFunc func(target *zb_data.PlayerProfile, candidate *zb_data.PlayerProfile) float64
MatchMakingFunc calculates the score based on the given profile target and candidate
type MintingContext ¶
type MintingContext struct {
// contains filtered or unexported fields
}
func NewMintingContext ¶
func NewMintingContext(ctx contract.Context) (MintingContext, error)
func (*MintingContext) MintBoosterPacksReceipt ¶
func (m *MintingContext) MintBoosterPacksReceipt(userId *big.Int, boosterPackAmount uint) (*MintingReceipt, error)
func (*MintingContext) MintGenericPacksReceipt ¶
func (m *MintingContext) MintGenericPacksReceipt( userId *big.Int, boosterPackAmount uint, superPackAmount uint, airPackAmount uint, earthPackAmount uint, firePackAmount uint, lifePackAmount uint, toxicPackAmount uint, waterPackAmount uint, smallPackAmount uint, minionPackAmount uint, binancePackAmount uint, ) (*MintingReceipt, error)
func (*MintingContext) SaveState ¶
func (m *MintingContext) SaveState() error
type MintingReceipt ¶
type MintingReceipt struct { VerifyHash *VerifySignResult UserId *big.Int Booster uint Super uint Air uint Earth uint Fire uint Life uint Toxic uint Water uint Small uint Minion uint Binance uint TxID *big.Int }
func (*MintingReceipt) MarshalPB ¶
func (t *MintingReceipt) MarshalPB() *zb_data.MintingTransactionReceipt
type MintingReceiptGenerator ¶
type MintingReceiptGenerator struct {
// contains filtered or unexported fields
}
func NewMintingReceiptGenerator ¶
func NewMintingReceiptGenerator(gatewayPrivateKey *ecdsa.PrivateKey, contractVersion uint) (MintingReceiptGenerator, error)
func (*MintingReceiptGenerator) CreateGenericPackReceipt ¶
type PanicReaderWriterProxy ¶
type PanicReaderWriterProxy struct {
// contains filtered or unexported fields
}
type PlayerScore ¶
type PlayerScore struct {
// contains filtered or unexported fields
}
PlayerScore simply maintains the player id and score tuple
type ReverseBuffer ¶
type ReverseBuffer struct {
// contains filtered or unexported fields
}
func NewReverseBuffer ¶
func NewReverseBuffer(buffer []byte) *ReverseBuffer
func (*ReverseBuffer) GetFilledSlice ¶
func (rb *ReverseBuffer) GetFilledSlice() []byte
type SimpleCardInstance ¶
type SimpleCardInstance struct {
// contains filtered or unexported fields
}
type VerifySignResult ¶
type ZombieBattleground ¶
type ZombieBattleground struct { }
func (*ZombieBattleground) AcceptMatch ¶
func (z *ZombieBattleground) AcceptMatch(ctx contract.Context, req *zb_calls.AcceptMatchRequest) (*zb_calls.AcceptMatchResponse, error)
func (*ZombieBattleground) AddGameMode ¶
func (z *ZombieBattleground) AddGameMode(ctx contract.Context, req *zb_calls.GameModeRequest) (*zb_data.GameMode, error)
func (*ZombieBattleground) AddSoloExperience ¶
func (z *ZombieBattleground) AddSoloExperience(ctx contract.Context, req *zb_calls.AddSoloExperienceRequest) (*zb_calls.AddSoloExperienceResponse, error)
func (*ZombieBattleground) CallCustomGameModeFunction ¶
func (z *ZombieBattleground) CallCustomGameModeFunction(ctx contract.Context, req *zb_calls.CallCustomGameModeFunctionRequest) error
func (*ZombieBattleground) CancelFindMatch ¶
func (z *ZombieBattleground) CancelFindMatch(ctx contract.Context, req *zb_calls.CancelFindMatchRequest) (*zb_calls.CancelFindMatchResponse, error)
func (*ZombieBattleground) ClearNotifications ¶
func (z *ZombieBattleground) ClearNotifications(ctx contract.Context, req *zb_calls.ClearNotificationsRequest) (*zb_calls.ClearNotificationsResponse, error)
func (*ZombieBattleground) ConfirmPendingMintingTransactionReceipt ¶
func (z *ZombieBattleground) ConfirmPendingMintingTransactionReceipt(ctx contract.Context, req *zb_calls.ConfirmPendingMintingTransactionReceiptRequest) error
func (*ZombieBattleground) CreateAccount ¶
func (z *ZombieBattleground) CreateAccount(ctx contract.Context, req *zb_calls.UpsertAccountRequest) error
func (*ZombieBattleground) CreateDeck ¶
func (z *ZombieBattleground) CreateDeck(ctx contract.Context, req *zb_calls.CreateDeckRequest) (*zb_calls.CreateDeckResponse, error)
CreateDeck appends the given deck to user's deck list
func (*ZombieBattleground) DebugCheatSetFullCardCollection ¶
func (z *ZombieBattleground) DebugCheatSetFullCardCollection(ctx contract.Context, req *zb_calls.DebugCheatSetFullCardCollectionRequest) (*zb_calls.EmptyResponse, error)
func (*ZombieBattleground) DebugGetPendingCardAmountChangeItems ¶
func (z *ZombieBattleground) DebugGetPendingCardAmountChangeItems(ctx contract.StaticContext, req *zb_calls.DebugGetPendingCardAmountChangeItemsRequest) (*zb_calls.DebugGetPendingCardAmountChangeItemsResponse, error)
func (*ZombieBattleground) DebugGetUserIdByAddress ¶
func (z *ZombieBattleground) DebugGetUserIdByAddress(ctx contract.StaticContext, req *zb_calls.DebugGetUserIdByAddressRequest) (*zb_data.UserIdContainer, error)
func (*ZombieBattleground) DebugMintBoosterPackReceipt ¶
func (z *ZombieBattleground) DebugMintBoosterPackReceipt(ctx contract.Context, req *zb_calls.DebugMintBoosterPackReceiptRequest) (*zb_calls.DebugMintBoosterPackReceiptResponse, error)
func (*ZombieBattleground) DeleteDeck ¶
func (z *ZombieBattleground) DeleteDeck(ctx contract.Context, req *zb_calls.DeleteDeckRequest) error
DeleteDeck deletes a user's deck by id
func (*ZombieBattleground) DeleteGameMode ¶
func (z *ZombieBattleground) DeleteGameMode(ctx contract.Context, req *zb_calls.DeleteGameModeRequest) error
func (*ZombieBattleground) EditDeck ¶
func (z *ZombieBattleground) EditDeck(ctx contract.Context, req *zb_calls.EditDeckRequest) error
EditDeck edits the deck by id
func (*ZombieBattleground) EndMatch ¶
func (z *ZombieBattleground) EndMatch(ctx contract.Context, req *zb_calls.EndMatchRequest) (*zb_calls.EndMatchResponse, error)
func (*ZombieBattleground) FindMatch ¶
func (z *ZombieBattleground) FindMatch(ctx contract.Context, req *zb_calls.FindMatchRequest) (*zb_calls.FindMatchResponse, error)
func (*ZombieBattleground) GetAIDecks ¶
func (z *ZombieBattleground) GetAIDecks(ctx contract.StaticContext, req *zb_calls.GetAIDecksRequest) (*zb_calls.GetAIDecksResponse, error)
func (*ZombieBattleground) GetAccount ¶
func (z *ZombieBattleground) GetAccount(ctx contract.StaticContext, req *zb_calls.GetAccountRequest) (*zb_data.Account, error)
func (*ZombieBattleground) GetCardList ¶
func (z *ZombieBattleground) GetCardList(ctx contract.StaticContext, req *zb_calls.GetCardListRequest) (*zb_calls.GetCardListResponse, error)
FIXME: duplicate of ListCardLibrary
func (*ZombieBattleground) GetCollection ¶
func (z *ZombieBattleground) GetCollection(ctx contract.Context, req *zb_calls.GetCollectionRequest) (*zb_calls.GetCollectionResponse, error)
GetCollection returns the collection of the card own by the user
func (*ZombieBattleground) GetContractBuildMetadata ¶
func (z *ZombieBattleground) GetContractBuildMetadata(ctx contract.StaticContext, req *zb_calls.GetContractBuildMetadataRequest) (*zb_calls.GetContractBuildMetadataResponse, error)
func (*ZombieBattleground) GetContractConfiguration ¶
func (z *ZombieBattleground) GetContractConfiguration(ctx contract.StaticContext, req *zb_calls.EmptyRequest) (*zb_calls.GetContractConfigurationResponse, error)
func (*ZombieBattleground) GetContractState ¶
func (z *ZombieBattleground) GetContractState(ctx contract.StaticContext, req *zb_calls.EmptyRequest) (*zb_calls.GetContractStateResponse, error)
func (*ZombieBattleground) GetDeck ¶
func (z *ZombieBattleground) GetDeck(ctx contract.Context, req *zb_calls.GetDeckRequest) (*zb_calls.GetDeckResponse, error)
GetDeck returns the deck by given id
func (*ZombieBattleground) GetGameMode ¶
func (z *ZombieBattleground) GetGameMode(ctx contract.StaticContext, req *zb_calls.GetGameModeRequest) (*zb_data.GameMode, error)
func (*ZombieBattleground) GetGameModeCustomUi ¶
func (z *ZombieBattleground) GetGameModeCustomUi(ctx contract.StaticContext, req *zb_calls.GetCustomGameModeCustomUiRequest) (*zb_calls.GetCustomGameModeCustomUiResponse, error)
func (*ZombieBattleground) GetGameState ¶
func (z *ZombieBattleground) GetGameState(ctx contract.StaticContext, req *zb_calls.GetGameStateRequest) (*zb_calls.GetGameStateResponse, error)
func (*ZombieBattleground) GetInit ¶
func (z *ZombieBattleground) GetInit(ctx contract.StaticContext, req *zb_calls.GetInitRequest) (*zb_calls.GetInitResponse, error)
func (*ZombieBattleground) GetInitialGameState ¶
func (z *ZombieBattleground) GetInitialGameState(ctx contract.StaticContext, req *zb_calls.GetGameStateRequest) (*zb_calls.GetGameStateResponse, error)
func (*ZombieBattleground) GetMatch ¶
func (z *ZombieBattleground) GetMatch(ctx contract.StaticContext, req *zb_calls.GetMatchRequest) (*zb_calls.GetMatchResponse, error)
func (*ZombieBattleground) GetNotifications ¶
func (z *ZombieBattleground) GetNotifications(ctx contract.StaticContext, req *zb_calls.GetNotificationsRequest) (*zb_calls.GetNotificationsResponse, error)
func (*ZombieBattleground) GetOracleCommandRequestList ¶
func (z *ZombieBattleground) GetOracleCommandRequestList(ctx contract.StaticContext, req *orctype.GetOracleCommandRequestListRequest) (*orctype.GetOracleCommandRequestListResponse, error)
func (*ZombieBattleground) GetOverlordLevelingData ¶
func (z *ZombieBattleground) GetOverlordLevelingData(ctx contract.StaticContext, req *zb_calls.GetOverlordLevelingDataRequest) (*zb_calls.GetOverlordLevelingDataResponse, error)
func (*ZombieBattleground) GetOverlordUserInstance ¶
func (z *ZombieBattleground) GetOverlordUserInstance(ctx contract.StaticContext, req *zb_calls.GetOverlordUserInstanceRequest) (*zb_calls.GetOverlordUserInstanceResponse, error)
func (*ZombieBattleground) GetPendingMintingTransactionReceipts ¶
func (z *ZombieBattleground) GetPendingMintingTransactionReceipts(ctx contract.StaticContext, req *zb_calls.GetPendingMintingTransactionReceiptsRequest) (*zb_calls.GetPendingMintingTransactionReceiptsResponse, error)
func (*ZombieBattleground) GetPlayerPool ¶
func (z *ZombieBattleground) GetPlayerPool(ctx contract.Context, req *zb_calls.PlayerPoolRequest) (*zb_calls.PlayerPoolResponse, error)
TODO remove this
func (*ZombieBattleground) GetTaggedPlayerPool ¶
func (z *ZombieBattleground) GetTaggedPlayerPool(ctx contract.Context, req *zb_calls.PlayerPoolRequest) (*zb_calls.PlayerPoolResponse, error)
TODO remove this
func (*ZombieBattleground) Init ¶
func (z *ZombieBattleground) Init(ctx contract.Context, req *zb_calls.InitRequest) error
func (*ZombieBattleground) KeepAlive ¶
func (z *ZombieBattleground) KeepAlive(ctx contract.Context, req *zb_calls.KeepAliveRequest) (*zb_calls.KeepAliveResponse, error)
func (*ZombieBattleground) ListCardLibrary ¶
func (z *ZombieBattleground) ListCardLibrary(ctx contract.StaticContext, req *zb_calls.ListCardLibraryRequest) (*zb_calls.ListCardLibraryResponse, error)
ListCardLibrary list all the card library data
func (*ZombieBattleground) ListDecks ¶
func (z *ZombieBattleground) ListDecks(ctx contract.Context, req *zb_calls.ListDecksRequest) (*zb_calls.ListDecksResponse, error)
ListDecks returns the user's decks
func (*ZombieBattleground) ListGameModes ¶
func (z *ZombieBattleground) ListGameModes(ctx contract.StaticContext, req *zb_calls.ListGameModesRequest) (*zb_data.GameModeList, error)
func (*ZombieBattleground) ListOverlordLibrary ¶
func (z *ZombieBattleground) ListOverlordLibrary(ctx contract.StaticContext, req *zb_calls.ListOverlordLibraryRequest) (*zb_calls.ListOverlordLibraryResponse, error)
func (*ZombieBattleground) ListOverlordUserInstances ¶
func (z *ZombieBattleground) ListOverlordUserInstances(ctx contract.StaticContext, req *zb_calls.ListOverlordUserInstancesRequest) (*zb_calls.ListOverlordUserInstancesResponse, error)
func (*ZombieBattleground) Login ¶
func (z *ZombieBattleground) Login(ctx contract.Context, req *zb_calls.LoginRequest) (*zb_calls.LoginResponse, error)
func (*ZombieBattleground) ProcessOracleCommandResponseBatch ¶
func (z *ZombieBattleground) ProcessOracleCommandResponseBatch(ctx contract.Context, req *orctype.ProcessOracleCommandResponseBatchRequest) (*zb_calls.EmptyResponse, error)
func (*ZombieBattleground) ProcessOracleEventBatch ¶
func (z *ZombieBattleground) ProcessOracleEventBatch(ctx contract.Context, req *orctype.ProcessOracleEventBatchRequest) error
func (*ZombieBattleground) RegisterPlayerPool ¶
func (z *ZombieBattleground) RegisterPlayerPool(ctx contract.Context, req *zb_calls.RegisterPlayerPoolRequest) (*zb_calls.RegisterPlayerPoolResponse, error)
func (*ZombieBattleground) ReplayGame ¶
func (z *ZombieBattleground) ReplayGame(ctx contract.Context, req *zb_calls.ReplayGameRequest) (*zb_calls.ReplayGameResponse, error)
ReplayGame simulate the game that has been created by initializing game from start and apply actions to from the current gamestate. ReplayGame does not save any gamestate.
func (*ZombieBattleground) RequestUserFullCardCollectionSync ¶
func (z *ZombieBattleground) RequestUserFullCardCollectionSync(ctx contract.Context, req *zb_calls.RequestUserFullCardCollectionSyncRequest) (*zb_calls.EmptyResponse, error)
func (*ZombieBattleground) SendBundlePlayerAction ¶
func (z *ZombieBattleground) SendBundlePlayerAction(ctx contract.Context, req *zb_calls.BundlePlayerActionRequest) (*zb_calls.BundlePlayerActionResponse, error)
func (*ZombieBattleground) SendPlayerAction ¶
func (z *ZombieBattleground) SendPlayerAction(ctx contract.Context, req *zb_calls.PlayerActionRequest) (*zb_calls.PlayerActionResponse, error)
func (*ZombieBattleground) SetLastPlasmaBlockNumber ¶
func (z *ZombieBattleground) SetLastPlasmaBlockNumber(ctx contract.Context, req *zb_calls.SetLastPlasmaBlockNumberRequest) error
func (*ZombieBattleground) UpdateAccount ¶
func (z *ZombieBattleground) UpdateAccount(ctx contract.Context, req *zb_calls.UpsertAccountRequest) (*zb_data.Account, error)
func (*ZombieBattleground) UpdateContractConfiguration ¶
func (z *ZombieBattleground) UpdateContractConfiguration(ctx contract.Context, req *zb_calls.UpdateContractConfigurationRequest) error
func (*ZombieBattleground) UpdateGameMode ¶
func (z *ZombieBattleground) UpdateGameMode(ctx contract.Context, req *zb_calls.UpdateGameModeRequest) (*zb_data.GameMode, error)
func (*ZombieBattleground) UpdateInit ¶
func (z *ZombieBattleground) UpdateInit(ctx contract.Context, req *zb_calls.UpdateInitRequest) error
func (*ZombieBattleground) UpdateOracle ¶
func (z *ZombieBattleground) UpdateOracle(ctx contract.Context, req *zb_calls.UpdateOracleRequest) error
func (*ZombieBattleground) UpdateUserElo ¶
func (z *ZombieBattleground) UpdateUserElo(ctx contract.Context, req *zb_calls.UpdateUserEloRequest) error
Source Files ¶
- ability.go
- ability_additional_damage_to_heavy_in_attack.go
- ability_attack_overlord.go
- ability_change_stat.go
- ability_deal_damage_to_this_and_adjacent_units.go
- ability_devour_zombie_and_combine_stats.go
- ability_priority_attack.go
- ability_rage.go
- ability_reanimate.go
- ability_replace_units_with_type_on_stronger.go
- build_metadata.go
- card.go
- collection.go
- custom_game.go
- custom_game_serialization.go
- events.go
- game.go
- matchmaking.go
- minting_receipt_generator.go
- notifications.go
- oracle_commands.go
- reverse_buffer.go
- rewards.go
- seriality_serialization.go
- storage.go
- zombie_battleground.go