hiro

package module
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

Hiro

The server interface for the Hiro game framework.

Hiro is a client and server framework built on top of Nakama server to rapidly build high performance, flexible, and composable gameplay systems like Achievements, Energies, Event Leaderboards, and much more.

The code is divided into a Go package of interfaces and a C# DLL which is packaged with utilities (such as UnityPurchasing, Unity Mobile Notifications, etc) for Unity Engine.

This repository maintains the public interfaces which make it easy to use the library from inside a Nakama game server project to extend and build additional gameplay systems.

To learn more about Hiro and integrate it into your Unity game project, have a look at these resources:

Reach out to Heroic Labs for more information about how to license Hiro as a developer or as part of a game studio.

Setup
  1. Set up the Go toolchain.

  2. Set up your Nakama project with Go.

  3. Add Hiro to your project as a dependency:

    go get "github.com/heroiclabs/hiro@latest"
    
  4. Sign up to the Heroic Cloud and contact us to obtain licenses to Hiro.

  5. Download and unzip the package. Add "hiro.bin" to your codebase.

  6. Follow the usage instructions for how to get started.

Usage

The game framework initializes and returns the configured gameplay systems with Init:

func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
	systems, err := hiro.Init(ctx, logger, nk, initializer, "hiro.bin", "LicenseKey"
		hiro.WithEconomySystem("economy.json", true),
		hiro.WithEnergySystem("energy.json", true),
		hiro.WithInventorySystem("inventory.json", true))
	if err != nil {
		return err
	}

	// systems.GetEnergySystem().Get(...)
	// ...

	return nil
}

For examples on how to write data definitions for the gameplay systems have a look at the documentation.

License

This codebase is licensed under the Apache-2 License.

Documentation

Index

Constants

View Source
const (
	StoragePersonalizerCollectionDefault = "hiro_datadefinitions"
)

Variables

View Source
var (
	ErrInternal           = runtime.NewError("internal error occurred", 13) // INTERNAL
	ErrBadInput           = runtime.NewError("bad input", 3)                // INVALID_ARGUMENT
	ErrFileNotFound       = runtime.NewError("file not found", 3)
	ErrNoSessionUser      = runtime.NewError("no user ID in session", 3)       // INVALID_ARGUMENT
	ErrNoSessionUsername  = runtime.NewError("no username in session", 3)      // INVALID_ARGUMENT
	ErrPayloadDecode      = runtime.NewError("cannot decode json", 13)         // INTERNAL
	ErrPayloadEmpty       = runtime.NewError("payload should not be empty", 3) // INVALID_ARGUMENT
	ErrPayloadEncode      = runtime.NewError("cannot encode json", 13)         // INTERNAL
	ErrPayloadInvalid     = runtime.NewError("payload is invalid", 3)          // INVALID_ARGUMENT
	ErrSessionUser        = runtime.NewError("user ID in session", 3)          // INVALID_ARGUMENT
	ErrSystemNotAvailable = runtime.NewError("system not available", 13)       // INTERNAL
	ErrSystemNotFound     = runtime.NewError("system not found", 13)           // INTERNAL
)
View Source
var (
	ErrEconomyNoItem            = runtime.NewError("item not found", 3)                        // INVALID_ARGUMENT
	ErrEconomyNoSku             = runtime.NewError("sku not found", 3)                         // INVALID_ARGUMENT
	ErrEconomySkuInvalid        = runtime.NewError("invalid sku", 3)                           // INVALID_ARGUMENT
	ErrEconomyNotEnoughCurrency = runtime.NewError("not enough currency for purchase", 3)      // INVALID_ARGUMENT
	ErrEconomyNotEnoughItem     = runtime.NewError("not enough item", 3)                       // INVALID_ARGUMENT
	ErrEconomyReceiptInvalid    = runtime.NewError("invalid receipt", 3)                       // INVALID_ARGUMENT
	ErrEconomyReceiptDuplicate  = runtime.NewError("duplicate receipt", 3)                     // INVALID_ARGUMENT
	ErrEconomyReceiptMismatch   = runtime.NewError("mismatched product receipt", 3)            // INVALID_ARGUMENT
	ErrEconomyNoPlacement       = runtime.NewError("placement not found", 3)                   // INVALID_ARGUMENT
	ErrEconomyNoDonation        = runtime.NewError("donation not found", 3)                    // INVALID_ARGUMENT
	ErrEconomyMaxDonation       = runtime.NewError("donation maximum contribution reached", 3) // INVALID_ARGUMENT
	ErrEconomyClaimedDonation   = runtime.NewError("donation already claimed", 3)              // INVALID_ARGUMENT

	ErrInventoryNotInitialized = runtime.NewError("inventory not initialized for batch", 13) // INTERNAL
	ErrItemsNotConsumable      = runtime.NewError("items not consumable", 3)                 // INVALID_ARGUMENT
	ErrItemsInsufficient       = runtime.NewError("insufficient items", 9)                   // FAILED_PRECONDITION
	ErrCurrencyInsufficient    = runtime.NewError("insufficient currency", 9)                // FAILED_PRECONDITION
)
View Source
var (
	RpcId_name = map[int32]string{
		0:    "RPC_ID_UNSPECIFIED",
		1:    "RPC_ID_INVENTORY_LIST",
		2:    "RPC_ID_INVENTORY_LIST_INVENTORY",
		3:    "RPC_ID_INVENTORY_CONSUME",
		4:    "RPC_ID_INVENTORY_GRANT",
		5:    "RPC_ID_INVENTORY_UPDATE",
		6:    "RPC_ID_ECONOMY_DONATION_CLAIM",
		7:    "RPC_ID_ECONOMY_DONATION_GIVE",
		8:    "RPC_ID_ECONOMY_DONATION_GET",
		9:    "RPC_ID_ECONOMY_DONATION_REQUEST",
		10:   "RPC_ID_ECONOMY_STORE_GET",
		11:   "RPC_ID_ECONOMY_GRANT",
		12:   "RPC_ID_ECONOMY_PURCHASE_INTENT",
		13:   "RPC_ID_ECONOMY_PURCHASE_ITEM",
		59:   "RPC_ID_ECONOMY_PURCHASE_RESTORE",
		14:   "RPC_ID_ECONOMY_PLACEMENT_STATUS",
		15:   "RPC_ID_ECONOMY_PLACEMENT_START",
		16:   "RPC_ID_ACHIEVEMENTS_CLAIM",
		17:   "RPC_ID_ACHIEVEMENTS_GET",
		18:   "RPC_ID_ACHIEVEMENTS_UPDATE",
		19:   "RPC_ID_ENERGY_GET",
		20:   "RPC_ID_ENERGY_SPEND",
		21:   "RPC_ID_TUTORIALS_GET",
		22:   "RPC_ID_TUTORIALS_ACCEPT",
		23:   "RPC_ID_TUTORIALS_DECLINE",
		24:   "RPC_ID_TUTORIALS_ABANDON",
		25:   "RPC_ID_TUTORIALS_UPDATE",
		26:   "RPC_ID_TEAMS_CREATE",
		27:   "RPC_ID_TEAMS_LIST",
		28:   "RPC_ID_TEAMS_SEARCH",
		29:   "RPC_ID_TEAMS_WRITE_CHAT_MESSAGE",
		30:   "RPC_ID_UNLOCKABLES_CREATE",
		31:   "RPC_ID_UNLOCKABLES_GET",
		32:   "RPC_ID_UNLOCKABLES_UNLOCK_START",
		33:   "RPC_ID_UNLOCKABLES_PURCHASE_UNLOCK",
		34:   "RPC_ID_UNLOCKABLES_PURCHASE_SLOT",
		35:   "RPC_ID_UNLOCKABLES_CLAIM",
		36:   "RPC_ID_BASE_RATE_APP",
		37:   "RPC_ID_BASE_SET_DEVICE_PREFS",
		58:   "RPC_ID_BASE_SYNC",
		38:   "RPC_ID_LEADERBOARDS_CONFIG_GET",
		42:   "RPC_ID_EVENT_LEADERBOARD_GET",
		43:   "RPC_ID_EVENT_LEADERBOARD_UPDATE",
		44:   "RPC_ID_EVENT_LEADERBOARD_CLAIM",
		45:   "RPC_ID_EVENT_LEADERBOARD_ROLL",
		46:   "RPC_ID_STATS_GET",
		47:   "RPC_ID_STATS_UPDATE",
		48:   "RPC_ID_PROGRESSIONS_GET",
		49:   "RPC_ID_PROGRESSIONS_PURCHASE",
		50:   "RPC_ID_PROGRESSIONS_UPDATE",
		51:   "RPC_ID_INCENTIVES_SENDER_LIST",
		52:   "RPC_ID_INCENTIVES_SENDER_CREATE",
		53:   "RPC_ID_INCENTIVES_SENDER_DELETE",
		54:   "RPC_ID_INCENTIVES_SENDER_CLAIM",
		55:   "RPC_ID_INCENTIVES_RECIPIENT_GET",
		56:   "RPC_ID_INCENTIVES_RECIPIENT_CLAIM",
		57:   "RPC_ID_PROGRESSIONS_RESET",
		1001: "RPC_ID_ECONOMY_PLACEMENT_SUCCESS",
		1002: "RPC_ID_ECONOMY_PLACEMENT_FAIL",
		1003: "RPC_ID_STORAGE_PERSONALIZER_UPLOAD",
	}
	RpcId_value = map[string]int32{
		"RPC_ID_UNSPECIFIED":                 0,
		"RPC_ID_INVENTORY_LIST":              1,
		"RPC_ID_INVENTORY_LIST_INVENTORY":    2,
		"RPC_ID_INVENTORY_CONSUME":           3,
		"RPC_ID_INVENTORY_GRANT":             4,
		"RPC_ID_INVENTORY_UPDATE":            5,
		"RPC_ID_ECONOMY_DONATION_CLAIM":      6,
		"RPC_ID_ECONOMY_DONATION_GIVE":       7,
		"RPC_ID_ECONOMY_DONATION_GET":        8,
		"RPC_ID_ECONOMY_DONATION_REQUEST":    9,
		"RPC_ID_ECONOMY_STORE_GET":           10,
		"RPC_ID_ECONOMY_GRANT":               11,
		"RPC_ID_ECONOMY_PURCHASE_INTENT":     12,
		"RPC_ID_ECONOMY_PURCHASE_ITEM":       13,
		"RPC_ID_ECONOMY_PURCHASE_RESTORE":    59,
		"RPC_ID_ECONOMY_PLACEMENT_STATUS":    14,
		"RPC_ID_ECONOMY_PLACEMENT_START":     15,
		"RPC_ID_ACHIEVEMENTS_CLAIM":          16,
		"RPC_ID_ACHIEVEMENTS_GET":            17,
		"RPC_ID_ACHIEVEMENTS_UPDATE":         18,
		"RPC_ID_ENERGY_GET":                  19,
		"RPC_ID_ENERGY_SPEND":                20,
		"RPC_ID_TUTORIALS_GET":               21,
		"RPC_ID_TUTORIALS_ACCEPT":            22,
		"RPC_ID_TUTORIALS_DECLINE":           23,
		"RPC_ID_TUTORIALS_ABANDON":           24,
		"RPC_ID_TUTORIALS_UPDATE":            25,
		"RPC_ID_TEAMS_CREATE":                26,
		"RPC_ID_TEAMS_LIST":                  27,
		"RPC_ID_TEAMS_SEARCH":                28,
		"RPC_ID_TEAMS_WRITE_CHAT_MESSAGE":    29,
		"RPC_ID_UNLOCKABLES_CREATE":          30,
		"RPC_ID_UNLOCKABLES_GET":             31,
		"RPC_ID_UNLOCKABLES_UNLOCK_START":    32,
		"RPC_ID_UNLOCKABLES_PURCHASE_UNLOCK": 33,
		"RPC_ID_UNLOCKABLES_PURCHASE_SLOT":   34,
		"RPC_ID_UNLOCKABLES_CLAIM":           35,
		"RPC_ID_BASE_RATE_APP":               36,
		"RPC_ID_BASE_SET_DEVICE_PREFS":       37,
		"RPC_ID_BASE_SYNC":                   58,
		"RPC_ID_LEADERBOARDS_CONFIG_GET":     38,
		"RPC_ID_EVENT_LEADERBOARD_GET":       42,
		"RPC_ID_EVENT_LEADERBOARD_UPDATE":    43,
		"RPC_ID_EVENT_LEADERBOARD_CLAIM":     44,
		"RPC_ID_EVENT_LEADERBOARD_ROLL":      45,
		"RPC_ID_STATS_GET":                   46,
		"RPC_ID_STATS_UPDATE":                47,
		"RPC_ID_PROGRESSIONS_GET":            48,
		"RPC_ID_PROGRESSIONS_PURCHASE":       49,
		"RPC_ID_PROGRESSIONS_UPDATE":         50,
		"RPC_ID_INCENTIVES_SENDER_LIST":      51,
		"RPC_ID_INCENTIVES_SENDER_CREATE":    52,
		"RPC_ID_INCENTIVES_SENDER_DELETE":    53,
		"RPC_ID_INCENTIVES_SENDER_CLAIM":     54,
		"RPC_ID_INCENTIVES_RECIPIENT_GET":    55,
		"RPC_ID_INCENTIVES_RECIPIENT_CLAIM":  56,
		"RPC_ID_PROGRESSIONS_RESET":          57,
		"RPC_ID_ECONOMY_PLACEMENT_SUCCESS":   1001,
		"RPC_ID_ECONOMY_PLACEMENT_FAIL":      1002,
		"RPC_ID_STORAGE_PERSONALIZER_UPLOAD": 1003,
	}
)

Enum value maps for RpcId.

View Source
var (
	ProgressionPreconditionsOperator_name = map[int32]string{
		0: "PROGRESSION_PRECONDITIONS_OPERATOR_UNSPECIFIED",
		1: "PROGRESSION_PRECONDITIONS_OPERATOR_AND",
		2: "PROGRESSION_PRECONDITIONS_OPERATOR_OR",
		3: "PROGRESSION_PRECONDITIONS_OPERATOR_XOR",
		4: "PROGRESSION_PRECONDITIONS_OPERATOR_NOT",
	}
	ProgressionPreconditionsOperator_value = map[string]int32{
		"PROGRESSION_PRECONDITIONS_OPERATOR_UNSPECIFIED": 0,
		"PROGRESSION_PRECONDITIONS_OPERATOR_AND":         1,
		"PROGRESSION_PRECONDITIONS_OPERATOR_OR":          2,
		"PROGRESSION_PRECONDITIONS_OPERATOR_XOR":         3,
		"PROGRESSION_PRECONDITIONS_OPERATOR_NOT":         4,
	}
)

Enum value maps for ProgressionPreconditionsOperator.

View Source
var (
	ProgressionDeltaState_name = map[int32]string{
		0: "PROGRESSION_DELTA_STATE_UNSPECIFIED",
		1: "PROGRESSION_DELTA_STATE_UNCHANGED",
		2: "PROGRESSION_DELTA_STATE_UNLOCKED",
		3: "PROGRESSION_DELTA_STATE_LOCKED",
	}
	ProgressionDeltaState_value = map[string]int32{
		"PROGRESSION_DELTA_STATE_UNSPECIFIED": 0,
		"PROGRESSION_DELTA_STATE_UNCHANGED":   1,
		"PROGRESSION_DELTA_STATE_UNLOCKED":    2,
		"PROGRESSION_DELTA_STATE_LOCKED":      3,
	}
)

Enum value maps for ProgressionDeltaState.

View Source
var (
	StatUpdateOperator_name = map[int32]string{
		0: "STAT_UPDATE_OPERATOR_UNSPECIFIED",
		1: "STAT_UPDATE_OPERATOR_SET",
		2: "STAT_UPDATE_OPERATOR_DELTA",
		3: "STAT_UPDATE_OPERATOR_MIN",
		4: "STAT_UPDATE_OPERATOR_MAX",
	}
	StatUpdateOperator_value = map[string]int32{
		"STAT_UPDATE_OPERATOR_UNSPECIFIED": 0,
		"STAT_UPDATE_OPERATOR_SET":         1,
		"STAT_UPDATE_OPERATOR_DELTA":       2,
		"STAT_UPDATE_OPERATOR_MIN":         3,
		"STAT_UPDATE_OPERATOR_MAX":         4,
	}
)

Enum value maps for StatUpdateOperator.

View Source
var (
	EconomyStoreType_name = map[int32]string{
		0: "ECONOMY_STORE_TYPE_UNSPECIFIED",
		1: "ECONOMY_STORE_TYPE_APPLE_APPSTORE",
		2: "ECONOMY_STORE_TYPE_GOOGLE_PLAY",
		3: "ECONOMY_STORE_TYPE_FBINSTANT",
	}
	EconomyStoreType_value = map[string]int32{
		"ECONOMY_STORE_TYPE_UNSPECIFIED":    0,
		"ECONOMY_STORE_TYPE_APPLE_APPSTORE": 1,
		"ECONOMY_STORE_TYPE_GOOGLE_PLAY":    2,
		"ECONOMY_STORE_TYPE_FBINSTANT":      3,
	}
)

Enum value maps for EconomyStoreType.

View Source
var (
	IncentiveType_name = map[int32]string{
		0: "INCENTIVE_TYPE_UNSPECIFIED",
		1: "INCENTIVE_TYPE_INVITE",
	}
	IncentiveType_value = map[string]int32{
		"INCENTIVE_TYPE_UNSPECIFIED": 0,
		"INCENTIVE_TYPE_INVITE":      1,
	}
)

Enum value maps for IncentiveType.

View Source
var (
	TutorialState_name = map[int32]string{
		0: "TUTORIAL_STATE_NONE",
		1: "TUTORIAL_STATE_ACCEPTED",
		2: "TUTORIAL_STATE_DECLINED",
		3: "TUTORIAL_STATE_IN_PROGRESS",
		4: "TUTORIAL_STATE_COMPLETED",
		5: "TUTORIAL_STATE_ABANDONED",
	}
	TutorialState_value = map[string]int32{
		"TUTORIAL_STATE_NONE":        0,
		"TUTORIAL_STATE_ACCEPTED":    1,
		"TUTORIAL_STATE_DECLINED":    2,
		"TUTORIAL_STATE_IN_PROGRESS": 3,
		"TUTORIAL_STATE_COMPLETED":   4,
		"TUTORIAL_STATE_ABANDONED":   5,
	}
)

Enum value maps for TutorialState.

View Source
var (
	// The input proto message to the Nakama RPC.
	//
	// optional string input = 1000;
	E_Input = &file_hiro_proto_extTypes[0]
	// The output proto message of the Nakama RPC.
	//
	// optional string output = 1001;
	E_Output = &file_hiro_proto_extTypes[1]
)

Extension fields to descriptorpb.EnumValueOptions.

View Source
var (
	ErrProgressionNotFound             = runtime.NewError("progression not found", 3)                 // INVALID_ARGUMENT
	ErrProgressionNotAvailablePurchase = runtime.NewError("progression not available to purchase", 3) // INVALID_ARGUMENT
	ErrProgressionNotAvailableUpdate   = runtime.NewError("progression not available to update", 3)   // INVALID_ARGUMENT
	ErrProgressionNoCost               = runtime.NewError("progression no cost associated", 3)        // INVALID_ARGUMENT
	ErrProgressionNoCount              = runtime.NewError("progression no count associated", 3)       // INVALID_ARGUMENT
	ErrProgressionAlreadyUnlocked      = runtime.NewError("progression already unlocked", 3)          // INVALID_ARGUMENT
)

Functions

This section is empty.

Types

type Achievement

type Achievement struct {

	// The category to group the achievement together with others.
	Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"`
	// The UNIX timestamp for when the achievement reward was claimed, or zero if unclaimed.
	ClaimTimeSec int64 `protobuf:"varint,2,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// The UNIX timestamp for when the achievement total reward was claimed, or zero if unclaimed.
	TotalClaimTimeSec int64 `protobuf:"varint,3,opt,name=total_claim_time_sec,json=totalClaimTimeSec,proto3" json:"total_claim_time_sec,omitempty"`
	// The count of the achievement.
	Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
	// The UNIX timestamp for the current server time.
	CurrentTimeSec int64 `protobuf:"varint,5,opt,name=current_time_sec,json=currentTimeSec,proto3" json:"current_time_sec,omitempty"`
	// A description of the achievement. May be an i18n code.
	Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	// The UNIX timestamp when this achievement will expire. This may be before its next reset. A zero means it does not expire.
	ExpireTimeSec int64 `protobuf:"varint,7,opt,name=expire_time_sec,json=expireTimeSec,proto3" json:"expire_time_sec,omitempty"`
	// The ID of the achievement.
	Id string `protobuf:"bytes,8,opt,name=id,proto3" json:"id,omitempty"`
	// The maximum count of the achievement.
	MaxCount int64 `protobuf:"varint,9,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// The name of the achievement. May be an i18n code.
	Name string `protobuf:"bytes,10,opt,name=name,proto3" json:"name,omitempty"`
	// The IDs which are a precondition on the progress to be made on this achievement.
	PreconditionIds []string `protobuf:"bytes,11,rep,name=precondition_ids,json=preconditionIds,proto3" json:"precondition_ids,omitempty"`
	// The UNIX timestamp when this achievement will reset.
	ResetTimeSec int64 `protobuf:"varint,12,opt,name=reset_time_sec,json=resetTimeSec,proto3" json:"reset_time_sec,omitempty"`
	// The available reward and its probabilities.
	AvailableRewards *AvailableRewards `protobuf:"bytes,13,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// The outcome (rolled) reward for the achievement.
	Reward *Reward `protobuf:"bytes,14,opt,name=reward,proto3" json:"reward,omitempty"`
	// The available reward and its probabilities for the total completion of the achievement, if any.
	AvailableTotalReward *AvailableRewards `protobuf:"bytes,15,opt,name=available_total_reward,json=availableTotalReward,proto3" json:"available_total_reward,omitempty"`
	// The outcome (rolled) reward for the total completion of the achievement, if any.
	TotalReward *Reward `protobuf:"bytes,16,opt,name=total_reward,json=totalReward,proto3" json:"total_reward,omitempty"`
	// The sub-achievements for this achievement, if any.
	SubAchievements map[string]*SubAchievement `` /* 195-byte string literal not displayed */
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// contains filtered or unexported fields
}

An achievement which is a numeric task which can be unlocked and has an optional reward.

func (*Achievement) Descriptor deprecated

func (*Achievement) Descriptor() ([]byte, []int)

Deprecated: Use Achievement.ProtoReflect.Descriptor instead.

func (*Achievement) GetAdditionalProperties

func (x *Achievement) GetAdditionalProperties() map[string]string

func (*Achievement) GetAvailableRewards

func (x *Achievement) GetAvailableRewards() *AvailableRewards

func (*Achievement) GetAvailableTotalReward

func (x *Achievement) GetAvailableTotalReward() *AvailableRewards

func (*Achievement) GetCategory

func (x *Achievement) GetCategory() string

func (*Achievement) GetClaimTimeSec

func (x *Achievement) GetClaimTimeSec() int64

func (*Achievement) GetCount

func (x *Achievement) GetCount() int64

func (*Achievement) GetCurrentTimeSec

func (x *Achievement) GetCurrentTimeSec() int64

func (*Achievement) GetDescription

func (x *Achievement) GetDescription() string

func (*Achievement) GetExpireTimeSec

func (x *Achievement) GetExpireTimeSec() int64

func (*Achievement) GetId

func (x *Achievement) GetId() string

func (*Achievement) GetMaxCount

func (x *Achievement) GetMaxCount() int64

func (*Achievement) GetName

func (x *Achievement) GetName() string

func (*Achievement) GetPreconditionIds

func (x *Achievement) GetPreconditionIds() []string

func (*Achievement) GetResetTimeSec

func (x *Achievement) GetResetTimeSec() int64

func (*Achievement) GetReward

func (x *Achievement) GetReward() *Reward

func (*Achievement) GetSubAchievements

func (x *Achievement) GetSubAchievements() map[string]*SubAchievement

func (*Achievement) GetTotalClaimTimeSec

func (x *Achievement) GetTotalClaimTimeSec() int64

func (*Achievement) GetTotalReward

func (x *Achievement) GetTotalReward() *Reward

func (*Achievement) ProtoMessage

func (*Achievement) ProtoMessage()

func (*Achievement) ProtoReflect

func (x *Achievement) ProtoReflect() protoreflect.Message

func (*Achievement) Reset

func (x *Achievement) Reset()

func (*Achievement) String

func (x *Achievement) String() string

type AchievementList

type AchievementList struct {

	// The one off achievements which can be progressed or are unlocked by the user alongside all on the server.
	Achievements map[string]*Achievement `` /* 165-byte string literal not displayed */
	// The repeat achievements which can be progressed or are unlocked by the user alongside all on the server.
	RepeatAchievements map[string]*Achievement `` /* 203-byte string literal not displayed */
	// contains filtered or unexported fields
}

The achievements returned by the server.

func (*AchievementList) Descriptor deprecated

func (*AchievementList) Descriptor() ([]byte, []int)

Deprecated: Use AchievementList.ProtoReflect.Descriptor instead.

func (*AchievementList) GetAchievements

func (x *AchievementList) GetAchievements() map[string]*Achievement

func (*AchievementList) GetRepeatAchievements

func (x *AchievementList) GetRepeatAchievements() map[string]*Achievement

func (*AchievementList) ProtoMessage

func (*AchievementList) ProtoMessage()

func (*AchievementList) ProtoReflect

func (x *AchievementList) ProtoReflect() protoreflect.Message

func (*AchievementList) Reset

func (x *AchievementList) Reset()

func (*AchievementList) String

func (x *AchievementList) String() string

type AchievementsClaimRequest

type AchievementsClaimRequest struct {

	// The set of achievement IDs to claim.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// Whether or not to claim the total reward as well, if available.
	ClaimTotalReward bool `protobuf:"varint,2,opt,name=claim_total_reward,json=claimTotalReward,proto3" json:"claim_total_reward,omitempty"`
	// contains filtered or unexported fields
}

Claim rewards with one or more achievement on the server.

func (*AchievementsClaimRequest) Descriptor deprecated

func (*AchievementsClaimRequest) Descriptor() ([]byte, []int)

Deprecated: Use AchievementsClaimRequest.ProtoReflect.Descriptor instead.

func (*AchievementsClaimRequest) GetClaimTotalReward

func (x *AchievementsClaimRequest) GetClaimTotalReward() bool

func (*AchievementsClaimRequest) GetIds

func (x *AchievementsClaimRequest) GetIds() []string

func (*AchievementsClaimRequest) ProtoMessage

func (*AchievementsClaimRequest) ProtoMessage()

func (*AchievementsClaimRequest) ProtoReflect

func (x *AchievementsClaimRequest) ProtoReflect() protoreflect.Message

func (*AchievementsClaimRequest) Reset

func (x *AchievementsClaimRequest) Reset()

func (*AchievementsClaimRequest) String

func (x *AchievementsClaimRequest) String() string

type AchievementsConfig

type AchievementsConfig struct {
	Achievements map[string]*AchievementsConfigAchievement `json:"achievements,omitempty"`
}

AchievementsConfig is the data definition for the TutorialsSystem type.

type AchievementsConfigAchievement

type AchievementsConfigAchievement struct {
	AutoClaim            bool                                         `json:"auto_claim,omitempty"`
	AutoClaimTotal       bool                                         `json:"auto_claim_total,omitempty"`
	AutoReset            bool                                         `json:"auto_reset,omitempty"`
	Category             string                                       `json:"category,omitempty"`
	Count                int64                                        `json:"count,omitempty"`
	Description          string                                       `json:"description,omitempty"`
	ResetCronexpr        string                                       `json:"reset_cronexpr,omitempty"`
	DurationSec          int64                                        `json:"duration_sec,omitempty"`
	MaxCount             int64                                        `json:"max_count,omitempty"`
	Name                 string                                       `json:"name,omitempty"`
	PreconditionIDs      []string                                     `json:"precondition_ids,omitempty"`
	Reward               *EconomyConfigReward                         `json:"reward,omitempty"`
	TotalReward          *EconomyConfigReward                         `json:"total_reward,omitempty"`
	SubAchievements      map[string]*AchievementsConfigSubAchievement `json:"sub_achievements,omitempty"`
	AdditionalProperties map[string]string                            `json:"additional_properties,omitempty"`
}

type AchievementsConfigSubAchievement

type AchievementsConfigSubAchievement struct {
	AutoClaim            bool                 `json:"auto_claim,omitempty"`
	AutoReset            bool                 `json:"auto_reset,omitempty"`
	Category             string               `json:"category,omitempty"`
	Count                int64                `json:"count,omitempty"`
	Description          string               `json:"description,omitempty"`
	ResetCronexpr        string               `json:"reset_cronexpr,omitempty"`
	DurationSec          int64                `json:"duration_sec,omitempty"`
	MaxCount             int64                `json:"max_count,omitempty"`
	Name                 string               `json:"name,omitempty"`
	PreconditionIDs      []string             `json:"precondition_ids,omitempty"`
	Reward               *EconomyConfigReward `json:"reward,omitempty"`
	AdditionalProperties map[string]string    `json:"additional_properties,omitempty"`
}

type AchievementsGetRequest

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

Get all achievements for the user alongside all on the server.

func (*AchievementsGetRequest) Descriptor deprecated

func (*AchievementsGetRequest) Descriptor() ([]byte, []int)

Deprecated: Use AchievementsGetRequest.ProtoReflect.Descriptor instead.

func (*AchievementsGetRequest) ProtoMessage

func (*AchievementsGetRequest) ProtoMessage()

func (*AchievementsGetRequest) ProtoReflect

func (x *AchievementsGetRequest) ProtoReflect() protoreflect.Message

func (*AchievementsGetRequest) Reset

func (x *AchievementsGetRequest) Reset()

func (*AchievementsGetRequest) String

func (x *AchievementsGetRequest) String() string

type AchievementsSystem

type AchievementsSystem interface {
	System

	// ClaimAchievements when one or more achievements whose progress has completed by their IDs.
	ClaimAchievements(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, achievementIDs []string, claimTotal bool) (map[string]*Achievement, map[string]*Achievement, error)

	// GetAchievements returns all achievements available to the user and progress on them.
	GetAchievements(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (map[string]*Achievement, map[string]*Achievement, error)

	// UpdateAchievements updates progress on one or more achievements by the same amount.
	UpdateAchievements(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, achievementUpdates map[string]int64) (map[string]*Achievement, map[string]*Achievement, error)

	// SetOnAchievementReward sets a custom reward function which will run after an achievement's reward is rolled.
	SetOnAchievementReward(fn OnReward[*AchievementsConfigAchievement])

	// SetOnSubAchievementReward sets a custom reward function which will run after a sub-achievement's reward is
	// rolled.
	SetOnSubAchievementReward(fn OnReward[*AchievementsConfigSubAchievement])

	// SetOnAchievementTotalReward sets a custom reward function which will run after an achievement's total reward is
	// rolled.
	SetOnAchievementTotalReward(fn OnReward[*AchievementsConfigAchievement])
}

An AchievementsSystem is a gameplay system which represents one-off, repeat, preconditioned, and sub-achievements.

type AchievementsUpdateAck

type AchievementsUpdateAck struct {

	// The one off achievements which can be progressed or are unlocked by the user.
	Achievements map[string]*Achievement `` /* 165-byte string literal not displayed */
	// The repeat achievements which can be progressed or are unlocked by the user.
	RepeatAchievements map[string]*Achievement `` /* 203-byte string literal not displayed */
	// contains filtered or unexported fields
}

A response when an achievements update is acknowledged by the server.

func (*AchievementsUpdateAck) Descriptor deprecated

func (*AchievementsUpdateAck) Descriptor() ([]byte, []int)

Deprecated: Use AchievementsUpdateAck.ProtoReflect.Descriptor instead.

func (*AchievementsUpdateAck) GetAchievements

func (x *AchievementsUpdateAck) GetAchievements() map[string]*Achievement

func (*AchievementsUpdateAck) GetRepeatAchievements

func (x *AchievementsUpdateAck) GetRepeatAchievements() map[string]*Achievement

func (*AchievementsUpdateAck) ProtoMessage

func (*AchievementsUpdateAck) ProtoMessage()

func (*AchievementsUpdateAck) ProtoReflect

func (x *AchievementsUpdateAck) ProtoReflect() protoreflect.Message

func (*AchievementsUpdateAck) Reset

func (x *AchievementsUpdateAck) Reset()

func (*AchievementsUpdateAck) String

func (x *AchievementsUpdateAck) String() string

type AchievementsUpdateRequest

type AchievementsUpdateRequest struct {

	// The set of achievement IDs to progress.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// The amount of progress to increment on the achievements.
	Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// Achievements with different amounts.
	Achievements map[string]int64 `` /* 166-byte string literal not displayed */
	// contains filtered or unexported fields
}

Update progress on one or more achievements on the server.

func (*AchievementsUpdateRequest) Descriptor deprecated

func (*AchievementsUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use AchievementsUpdateRequest.ProtoReflect.Descriptor instead.

func (*AchievementsUpdateRequest) GetAchievements added in v1.8.0

func (x *AchievementsUpdateRequest) GetAchievements() map[string]int64

func (*AchievementsUpdateRequest) GetAmount

func (x *AchievementsUpdateRequest) GetAmount() int64

func (*AchievementsUpdateRequest) GetIds

func (x *AchievementsUpdateRequest) GetIds() []string

func (*AchievementsUpdateRequest) ProtoMessage

func (*AchievementsUpdateRequest) ProtoMessage()

func (*AchievementsUpdateRequest) ProtoReflect

func (*AchievementsUpdateRequest) Reset

func (x *AchievementsUpdateRequest) Reset()

func (*AchievementsUpdateRequest) String

func (x *AchievementsUpdateRequest) String() string

type AfterAuthenticateFn added in v1.3.0

type AfterAuthenticateFn func(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, session *api.Session) error

type AvailableRewards

type AvailableRewards struct {

	// The guaranteed contents to grant.
	Guaranteed *AvailableRewardsContents `protobuf:"bytes,1,opt,name=guaranteed,proto3" json:"guaranteed,omitempty"`
	// The weighted contents to grant.
	Weighted []*AvailableRewardsContents `protobuf:"bytes,2,rep,name=weighted,proto3" json:"weighted,omitempty"`
	// The number of weighted reward contents to select from among the possibilities.
	MaxRolls int64 `protobuf:"varint,3,opt,name=max_rolls,json=maxRolls,proto3" json:"max_rolls,omitempty"`
	// The total weight that all weighted reward contents are calculated against. Auto calculated if set to 0 but can be
	// set to a higher value to introduce a chance of a "none" reward.
	TotalWeight int64 `protobuf:"varint,4,opt,name=total_weight,json=totalWeight,proto3" json:"total_weight,omitempty"`
	// The maximum number of repeats of any given weighted reward.
	MaxRepeatRolls int64 `protobuf:"varint,5,opt,name=max_repeat_rolls,json=maxRepeatRolls,proto3" json:"max_repeat_rolls,omitempty"`
	// contains filtered or unexported fields
}

The available rewards and their probabilistic weights.

func (*AvailableRewards) Descriptor deprecated

func (*AvailableRewards) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewards.ProtoReflect.Descriptor instead.

func (*AvailableRewards) GetGuaranteed

func (x *AvailableRewards) GetGuaranteed() *AvailableRewardsContents

func (*AvailableRewards) GetMaxRepeatRolls added in v1.10.0

func (x *AvailableRewards) GetMaxRepeatRolls() int64

func (*AvailableRewards) GetMaxRolls

func (x *AvailableRewards) GetMaxRolls() int64

func (*AvailableRewards) GetTotalWeight

func (x *AvailableRewards) GetTotalWeight() int64

func (*AvailableRewards) GetWeighted

func (x *AvailableRewards) GetWeighted() []*AvailableRewardsContents

func (*AvailableRewards) ProtoMessage

func (*AvailableRewards) ProtoMessage()

func (*AvailableRewards) ProtoReflect

func (x *AvailableRewards) ProtoReflect() protoreflect.Message

func (*AvailableRewards) Reset

func (x *AvailableRewards) Reset()

func (*AvailableRewards) String

func (x *AvailableRewards) String() string

type AvailableRewardsContents

type AvailableRewardsContents struct {

	// All possible items from this particular reward.
	Items map[string]*AvailableRewardsItem `` /* 151-byte string literal not displayed */
	// All possible item sets from this particular reward.
	ItemSets []*AvailableRewardsItemSet `protobuf:"bytes,2,rep,name=item_sets,json=itemSets,proto3" json:"item_sets,omitempty"`
	// All possible currencies from this particular reward.
	Currencies map[string]*AvailableRewardsCurrency `` /* 161-byte string literal not displayed */
	// All possible energies from this particular reward.
	Energies map[string]*AvailableRewardsEnergy `` /* 157-byte string literal not displayed */
	// All possible energy reward modifiers from this particular reward.
	EnergyModifiers []*AvailableRewardsEnergyModifier `protobuf:"bytes,5,rep,name=energy_modifiers,json=energyModifiers,proto3" json:"energy_modifiers,omitempty"`
	// All reward modifiers from this particular reward.
	RewardModifiers []*AvailableRewardsRewardModifier `protobuf:"bytes,6,rep,name=reward_modifiers,json=rewardModifiers,proto3" json:"reward_modifiers,omitempty"`
	// The weight of the reward contents.
	Weight int64 `protobuf:"varint,7,opt,name=weight,proto3" json:"weight,omitempty"`
	// contains filtered or unexported fields
}

The reward contents for available rewards.

func (*AvailableRewardsContents) Descriptor deprecated

func (*AvailableRewardsContents) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsContents.ProtoReflect.Descriptor instead.

func (*AvailableRewardsContents) GetCurrencies

func (*AvailableRewardsContents) GetEnergies

func (*AvailableRewardsContents) GetEnergyModifiers

func (x *AvailableRewardsContents) GetEnergyModifiers() []*AvailableRewardsEnergyModifier

func (*AvailableRewardsContents) GetItemSets

func (*AvailableRewardsContents) GetItems

func (*AvailableRewardsContents) GetRewardModifiers

func (x *AvailableRewardsContents) GetRewardModifiers() []*AvailableRewardsRewardModifier

func (*AvailableRewardsContents) GetWeight

func (x *AvailableRewardsContents) GetWeight() int64

func (*AvailableRewardsContents) ProtoMessage

func (*AvailableRewardsContents) ProtoMessage()

func (*AvailableRewardsContents) ProtoReflect

func (x *AvailableRewardsContents) ProtoReflect() protoreflect.Message

func (*AvailableRewardsContents) Reset

func (x *AvailableRewardsContents) Reset()

func (*AvailableRewardsContents) String

func (x *AvailableRewardsContents) String() string

type AvailableRewardsCurrency

type AvailableRewardsCurrency struct {

	// The possible count of the currency.
	Count *RewardRangeInt64 `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

A possible currency reward.

func (*AvailableRewardsCurrency) Descriptor deprecated

func (*AvailableRewardsCurrency) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsCurrency.ProtoReflect.Descriptor instead.

func (*AvailableRewardsCurrency) GetCount

func (*AvailableRewardsCurrency) ProtoMessage

func (*AvailableRewardsCurrency) ProtoMessage()

func (*AvailableRewardsCurrency) ProtoReflect

func (x *AvailableRewardsCurrency) ProtoReflect() protoreflect.Message

func (*AvailableRewardsCurrency) Reset

func (x *AvailableRewardsCurrency) Reset()

func (*AvailableRewardsCurrency) String

func (x *AvailableRewardsCurrency) String() string

type AvailableRewardsEnergy

type AvailableRewardsEnergy struct {

	// The possible count of the energy.
	Count *RewardRangeInt32 `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

A possible energy reward.

func (*AvailableRewardsEnergy) Descriptor deprecated

func (*AvailableRewardsEnergy) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsEnergy.ProtoReflect.Descriptor instead.

func (*AvailableRewardsEnergy) GetCount

func (*AvailableRewardsEnergy) ProtoMessage

func (*AvailableRewardsEnergy) ProtoMessage()

func (*AvailableRewardsEnergy) ProtoReflect

func (x *AvailableRewardsEnergy) ProtoReflect() protoreflect.Message

func (*AvailableRewardsEnergy) Reset

func (x *AvailableRewardsEnergy) Reset()

func (*AvailableRewardsEnergy) String

func (x *AvailableRewardsEnergy) String() string

type AvailableRewardsEnergyModifier

type AvailableRewardsEnergyModifier struct {

	// The ID of the energy to modify.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The operator of the energy modifier.
	Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"`
	// The value of the energy modifier.
	Value *RewardRangeInt64 `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// The possible duration of the modifier.
	DurationSec *RewardRangeUInt64 `protobuf:"bytes,4,opt,name=duration_sec,json=durationSec,proto3" json:"duration_sec,omitempty"`
	// contains filtered or unexported fields
}

A possible energy reward.

func (*AvailableRewardsEnergyModifier) Descriptor deprecated

func (*AvailableRewardsEnergyModifier) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsEnergyModifier.ProtoReflect.Descriptor instead.

func (*AvailableRewardsEnergyModifier) GetDurationSec

func (*AvailableRewardsEnergyModifier) GetId

func (*AvailableRewardsEnergyModifier) GetOperator

func (x *AvailableRewardsEnergyModifier) GetOperator() string

func (*AvailableRewardsEnergyModifier) GetValue

func (*AvailableRewardsEnergyModifier) ProtoMessage

func (*AvailableRewardsEnergyModifier) ProtoMessage()

func (*AvailableRewardsEnergyModifier) ProtoReflect

func (*AvailableRewardsEnergyModifier) Reset

func (x *AvailableRewardsEnergyModifier) Reset()

func (*AvailableRewardsEnergyModifier) String

type AvailableRewardsItem

type AvailableRewardsItem struct {

	// The possible count of the reward.
	Count *RewardRangeInt64 `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
	// The possible numeric properties of the reward.
	NumericProperties map[string]*RewardRangeDouble `` /* 200-byte string literal not displayed */
	// The possible string properties of the reward.
	StringProperties map[string]*AvailableRewardsStringProperty `` /* 197-byte string literal not displayed */
	// contains filtered or unexported fields
}

A possible item reward.

func (*AvailableRewardsItem) Descriptor deprecated

func (*AvailableRewardsItem) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsItem.ProtoReflect.Descriptor instead.

func (*AvailableRewardsItem) GetCount

func (x *AvailableRewardsItem) GetCount() *RewardRangeInt64

func (*AvailableRewardsItem) GetNumericProperties added in v1.10.0

func (x *AvailableRewardsItem) GetNumericProperties() map[string]*RewardRangeDouble

func (*AvailableRewardsItem) GetStringProperties added in v1.10.0

func (x *AvailableRewardsItem) GetStringProperties() map[string]*AvailableRewardsStringProperty

func (*AvailableRewardsItem) ProtoMessage

func (*AvailableRewardsItem) ProtoMessage()

func (*AvailableRewardsItem) ProtoReflect

func (x *AvailableRewardsItem) ProtoReflect() protoreflect.Message

func (*AvailableRewardsItem) Reset

func (x *AvailableRewardsItem) Reset()

func (*AvailableRewardsItem) String

func (x *AvailableRewardsItem) String() string

type AvailableRewardsItemSet

type AvailableRewardsItemSet struct {

	// The number of items to draw from the set.
	Count *RewardRangeInt64 `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
	// The number of repeat items that may be drawn from the set. Also includes the user's inventory.
	MaxRepeats int64 `protobuf:"varint,2,opt,name=max_repeats,json=maxRepeats,proto3" json:"max_repeats,omitempty"`
	// Drawn items must exist in the intersection of these sets.
	Set []string `protobuf:"bytes,3,rep,name=set,proto3" json:"set,omitempty"`
	// contains filtered or unexported fields
}

A possible item reward.

func (*AvailableRewardsItemSet) Descriptor deprecated

func (*AvailableRewardsItemSet) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsItemSet.ProtoReflect.Descriptor instead.

func (*AvailableRewardsItemSet) GetCount

func (*AvailableRewardsItemSet) GetMaxRepeats

func (x *AvailableRewardsItemSet) GetMaxRepeats() int64

func (*AvailableRewardsItemSet) GetSet

func (x *AvailableRewardsItemSet) GetSet() []string

func (*AvailableRewardsItemSet) ProtoMessage

func (*AvailableRewardsItemSet) ProtoMessage()

func (*AvailableRewardsItemSet) ProtoReflect

func (x *AvailableRewardsItemSet) ProtoReflect() protoreflect.Message

func (*AvailableRewardsItemSet) Reset

func (x *AvailableRewardsItemSet) Reset()

func (*AvailableRewardsItemSet) String

func (x *AvailableRewardsItemSet) String() string

type AvailableRewardsRewardModifier

type AvailableRewardsRewardModifier struct {

	// The ID of the reward item, currency, energy, or energy modifier to modify.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The type of reward content to modify.
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// The operator of the modifier.
	Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"`
	// The value of the modifier.
	Value *RewardRangeInt64 `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	// The possible duration of the modifier.
	DurationSec *RewardRangeUInt64 `protobuf:"bytes,5,opt,name=duration_sec,json=durationSec,proto3" json:"duration_sec,omitempty"`
	// contains filtered or unexported fields
}

A possible modifier reward.

func (*AvailableRewardsRewardModifier) Descriptor deprecated

func (*AvailableRewardsRewardModifier) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsRewardModifier.ProtoReflect.Descriptor instead.

func (*AvailableRewardsRewardModifier) GetDurationSec

func (*AvailableRewardsRewardModifier) GetId

func (*AvailableRewardsRewardModifier) GetOperator

func (x *AvailableRewardsRewardModifier) GetOperator() string

func (*AvailableRewardsRewardModifier) GetType

func (*AvailableRewardsRewardModifier) GetValue

func (*AvailableRewardsRewardModifier) ProtoMessage

func (*AvailableRewardsRewardModifier) ProtoMessage()

func (*AvailableRewardsRewardModifier) ProtoReflect

func (*AvailableRewardsRewardModifier) Reset

func (x *AvailableRewardsRewardModifier) Reset()

func (*AvailableRewardsRewardModifier) String

type AvailableRewardsStringProperty added in v1.10.0

type AvailableRewardsStringProperty struct {

	// The available string property options.
	Options map[string]*AvailableRewardsStringPropertyOption `` /* 155-byte string literal not displayed */
	// The total weight from which the options are selected.
	TotalWeight int64 `protobuf:"varint,2,opt,name=total_weight,json=totalWeight,proto3" json:"total_weight,omitempty"`
	// contains filtered or unexported fields
}

A possible string property.

func (*AvailableRewardsStringProperty) Descriptor deprecated added in v1.10.0

func (*AvailableRewardsStringProperty) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsStringProperty.ProtoReflect.Descriptor instead.

func (*AvailableRewardsStringProperty) GetOptions added in v1.10.0

func (*AvailableRewardsStringProperty) GetTotalWeight added in v1.10.0

func (x *AvailableRewardsStringProperty) GetTotalWeight() int64

func (*AvailableRewardsStringProperty) ProtoMessage added in v1.10.0

func (*AvailableRewardsStringProperty) ProtoMessage()

func (*AvailableRewardsStringProperty) ProtoReflect added in v1.10.0

func (*AvailableRewardsStringProperty) Reset added in v1.10.0

func (x *AvailableRewardsStringProperty) Reset()

func (*AvailableRewardsStringProperty) String added in v1.10.0

type AvailableRewardsStringPropertyOption added in v1.10.0

type AvailableRewardsStringPropertyOption struct {

	// The option weight.
	Weight int64 `protobuf:"varint,1,opt,name=weight,proto3" json:"weight,omitempty"`
	// contains filtered or unexported fields
}

A possible string property option.

func (*AvailableRewardsStringPropertyOption) Descriptor deprecated added in v1.10.0

func (*AvailableRewardsStringPropertyOption) Descriptor() ([]byte, []int)

Deprecated: Use AvailableRewardsStringPropertyOption.ProtoReflect.Descriptor instead.

func (*AvailableRewardsStringPropertyOption) GetWeight added in v1.10.0

func (*AvailableRewardsStringPropertyOption) ProtoMessage added in v1.10.0

func (*AvailableRewardsStringPropertyOption) ProtoMessage()

func (*AvailableRewardsStringPropertyOption) ProtoReflect added in v1.10.0

func (*AvailableRewardsStringPropertyOption) Reset added in v1.10.0

func (*AvailableRewardsStringPropertyOption) String added in v1.10.0

type BaseSystem

type BaseSystem interface {
	System

	// RateApp uses the SMTP configuration to receive feedback from players via email.
	RateApp(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, username string, score uint32, message string) error

	// SetDevicePrefs sets push notification tokens on a user's account so push messages can be received.
	SetDevicePrefs(ctx context.Context, logger runtime.Logger, db *sql.DB, userID, deviceID, pushTokenAndroid, pushTokenIos string, preferences map[string]bool) error

	// Sync processes an operation to update the server with offline state changes.
	Sync(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, req *SyncRequest) (*SyncResponse, error)
}

The BaseSystem provides various small features which aren't large enough to be in their own gameplay systems.

type BaseSystemConfig

type BaseSystemConfig struct {
	RateAppSmtpAddr          string `json:"rate_app_smtp_addr,omitempty"`            // "smtp.gmail.com"
	RateAppSmtpUsername      string `json:"rate_app_smtp_username,omitempty"`        // "email@domain"
	RateAppSmtpPassword      string `json:"rate_app_smtp_password,omitempty"`        // "password"
	RateAppSmtpEmailFrom     string `json:"rate_app_smtp_email_from,omitempty"`      // "gamename-server@mmygamecompany.com"
	RateAppSmtpEmailFromName string `json:"rate_app_smtp_email_from_name,omitempty"` // My Game Company
	RateAppSmtpEmailSubject  string `json:"rate_app_smtp_email_subject,omitempty"`   // "RateApp Feedback"
	RateAppSmtpEmailTo       string `json:"rate_app_smtp_email_to,omitempty"`        // "gamename-rateapp@mygamecompany.com"
	RateAppSmtpPort          int    `json:"rate_app_smtp_port,omitempty"`            // 587

	RateAppTemplate string `json:"rate_app_template"` // HTML email template
}

BaseSystemConfig is the data definition for the BaseSystem type.

type ChannelMessageAck added in v1.0.4

type ChannelMessageAck struct {

	// The channel the message was sent to.
	ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	// The unique ID assigned to the message.
	MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// The code representing a message type or category.
	Code int32 `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"`
	// Username of the message sender.
	Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
	// The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was created.
	CreateTime int64 `protobuf:"varint,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was last updated.
	UpdateTime int64 `protobuf:"varint,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// True if the message was persisted to the channel's history, false otherwise.
	Persistent bool `protobuf:"varint,7,opt,name=persistent,proto3" json:"persistent,omitempty"`
	// The name of the chat room, or an empty string if this message was not sent through a chat room.
	RoomName string `protobuf:"bytes,8,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"`
	// The ID of the group, or an empty string if this message was not sent through a group channel.
	GroupId string `protobuf:"bytes,9,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// The ID of the first DM user, or an empty string if this message was not sent through a DM chat.
	UserIdOne string `protobuf:"bytes,10,opt,name=user_id_one,json=userIdOne,proto3" json:"user_id_one,omitempty"`
	// The ID of the second DM user, or an empty string if this message was not sent through a DM chat.
	UserIdTwo string `protobuf:"bytes,11,opt,name=user_id_two,json=userIdTwo,proto3" json:"user_id_two,omitempty"`
	// contains filtered or unexported fields
}

A receipt reply from a channel message send operation.

func (*ChannelMessageAck) Descriptor deprecated added in v1.0.4

func (*ChannelMessageAck) Descriptor() ([]byte, []int)

Deprecated: Use ChannelMessageAck.ProtoReflect.Descriptor instead.

func (*ChannelMessageAck) GetChannelId added in v1.0.4

func (x *ChannelMessageAck) GetChannelId() string

func (*ChannelMessageAck) GetCode added in v1.0.4

func (x *ChannelMessageAck) GetCode() int32

func (*ChannelMessageAck) GetCreateTime added in v1.0.4

func (x *ChannelMessageAck) GetCreateTime() int64

func (*ChannelMessageAck) GetGroupId added in v1.0.4

func (x *ChannelMessageAck) GetGroupId() string

func (*ChannelMessageAck) GetMessageId added in v1.0.4

func (x *ChannelMessageAck) GetMessageId() string

func (*ChannelMessageAck) GetPersistent added in v1.0.4

func (x *ChannelMessageAck) GetPersistent() bool

func (*ChannelMessageAck) GetRoomName added in v1.0.4

func (x *ChannelMessageAck) GetRoomName() string

func (*ChannelMessageAck) GetUpdateTime added in v1.0.4

func (x *ChannelMessageAck) GetUpdateTime() int64

func (*ChannelMessageAck) GetUserIdOne added in v1.0.4

func (x *ChannelMessageAck) GetUserIdOne() string

func (*ChannelMessageAck) GetUserIdTwo added in v1.0.4

func (x *ChannelMessageAck) GetUserIdTwo() string

func (*ChannelMessageAck) GetUsername added in v1.0.4

func (x *ChannelMessageAck) GetUsername() string

func (*ChannelMessageAck) ProtoMessage added in v1.0.4

func (*ChannelMessageAck) ProtoMessage()

func (*ChannelMessageAck) ProtoReflect added in v1.0.4

func (x *ChannelMessageAck) ProtoReflect() protoreflect.Message

func (*ChannelMessageAck) Reset added in v1.0.4

func (x *ChannelMessageAck) Reset()

func (*ChannelMessageAck) String added in v1.0.4

func (x *ChannelMessageAck) String() string

type DevicePrefsRequest

type DevicePrefsRequest struct {

	// The device ID to set.
	DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	// The push token from the Android device. This or 'push_token_ios' must be set.
	PushTokenAndroid string `protobuf:"bytes,2,opt,name=push_token_android,json=pushTokenAndroid,proto3" json:"push_token_android,omitempty"`
	// The push token from the iOS device. This or 'push_token_android' must be set.
	PushTokenIos string `protobuf:"bytes,3,opt,name=push_token_ios,json=pushTokenIos,proto3" json:"push_token_ios,omitempty"`
	// Additional device preferences for push events. Must be owned by the user.
	Preferences map[string]bool `` /* 164-byte string literal not displayed */
	// contains filtered or unexported fields
}

Update or create the mobile push device tokens and preferences.

func (*DevicePrefsRequest) Descriptor deprecated

func (*DevicePrefsRequest) Descriptor() ([]byte, []int)

Deprecated: Use DevicePrefsRequest.ProtoReflect.Descriptor instead.

func (*DevicePrefsRequest) GetDeviceId

func (x *DevicePrefsRequest) GetDeviceId() string

func (*DevicePrefsRequest) GetPreferences

func (x *DevicePrefsRequest) GetPreferences() map[string]bool

func (*DevicePrefsRequest) GetPushTokenAndroid

func (x *DevicePrefsRequest) GetPushTokenAndroid() string

func (*DevicePrefsRequest) GetPushTokenIos

func (x *DevicePrefsRequest) GetPushTokenIos() string

func (*DevicePrefsRequest) ProtoMessage

func (*DevicePrefsRequest) ProtoMessage()

func (*DevicePrefsRequest) ProtoReflect

func (x *DevicePrefsRequest) ProtoReflect() protoreflect.Message

func (*DevicePrefsRequest) Reset

func (x *DevicePrefsRequest) Reset()

func (*DevicePrefsRequest) String

func (x *DevicePrefsRequest) String() string

type EconomyConfig

type EconomyConfig struct {
	InitializeUser *EconomyConfigInitializeUser       `json:"initialize_user,omitempty"`
	Donations      map[string]*EconomyConfigDonation  `json:"donations,omitempty"`
	StoreItems     map[string]*EconomyConfigStoreItem `json:"store_items,omitempty"`
	Placements     map[string]*EconomyConfigPlacement `json:"placements,omitempty"`
}

EconomyConfig is the data definition for the EconomySystem type.

type EconomyConfigDonation

type EconomyConfigDonation struct {
	Cost                     *EconomyConfigDonationCost `json:"cost,omitempty"`
	Count                    int64                      `json:"count,omitempty"`
	Description              string                     `json:"description,omitempty"`
	DurationSec              int64                      `json:"duration_sec,omitempty"`
	MaxCount                 int64                      `json:"max_count,omitempty"`
	Name                     string                     `json:"name,omitempty"`
	RecipientReward          *EconomyConfigReward       `json:"recipient_reward,omitempty"`
	ContributorReward        *EconomyConfigReward       `json:"contributor_reward,omitempty"`
	UserContributionMaxCount int64                      `json:"user_contribution_max_count,omitempty"`
	AdditionalProperties     map[string]string          `json:"additional_properties,omitempty"`
}

type EconomyConfigDonationCost

type EconomyConfigDonationCost struct {
	Currencies map[string]int64 `json:"currencies,omitempty"`
	Items      map[string]int64 `json:"items,omitempty"`
}

type EconomyConfigInitializeUser

type EconomyConfigInitializeUser struct {
	Currencies map[string]int64 `json:"currencies,omitempty"`
	Items      map[string]int64 `json:"items,omitempty"`
}

type EconomyConfigPlacement

type EconomyConfigPlacement struct {
	Reward               *EconomyConfigReward `json:"reward,omitempty"`
	AdditionalProperties map[string]string    `json:"additional_properties,omitempty"`
}

type EconomyConfigReward

type EconomyConfigReward struct {
	Guaranteed     *EconomyConfigRewardContents   `json:"guaranteed,omitempty"`
	Weighted       []*EconomyConfigRewardContents `json:"weighted,omitempty"`
	MaxRolls       int64                          `json:"max_rolls,omitempty"`
	MaxRepeatRolls int64                          `json:"max_repeat_rolls,omitempty"`
	TotalWeight    int64                          `json:"total_weight,omitempty"`
}

type EconomyConfigRewardContents

type EconomyConfigRewardContents struct {
	Items           map[string]*EconomyConfigRewardItem     `json:"items,omitempty"`
	ItemSets        []*EconomyConfigRewardItemSet           `json:"item_sets,omitempty"`
	Currencies      map[string]*EconomyConfigRewardCurrency `json:"currencies,omitempty"`
	Energies        map[string]*EconomyConfigRewardEnergy   `json:"energies,omitempty"`
	EnergyModifiers []*EconomyConfigRewardEnergyModifier    `json:"energy_modifiers,omitempty"`
	RewardModifiers []*EconomyConfigRewardRewardModifier    `json:"reward_modifiers,omitempty"`
	Weight          int64                                   `json:"weight,omitempty"`
}

type EconomyConfigRewardCurrency

type EconomyConfigRewardCurrency struct {
	EconomyConfigRewardRangeInt64
}

type EconomyConfigRewardEnergy

type EconomyConfigRewardEnergy struct {
	EconomyConfigRewardRangeInt32
}

type EconomyConfigRewardEnergyModifier

type EconomyConfigRewardEnergyModifier struct {
	Id          string                          `json:"id,omitempty"`
	Operator    string                          `json:"operator,omitempty"`
	Value       *EconomyConfigRewardRangeInt64  `json:"value,omitempty"`
	DurationSec *EconomyConfigRewardRangeUInt64 `json:"duration_sec,omitempty"`
}

type EconomyConfigRewardItem

type EconomyConfigRewardItem struct {
	EconomyConfigRewardRangeInt64
	StringProperties  map[string]*EconomyConfigRewardStringProperty `json:"string_properties,omitempty"`
	NumericProperties map[string]*EconomyConfigRewardRangeFloat64   `json:"numeric_properties,omitempty"`
}

type EconomyConfigRewardItemSet

type EconomyConfigRewardItemSet struct {
	EconomyConfigRewardRangeInt64

	MaxRepeats int64    `json:"max_repeats,omitempty"`
	Set        []string `json:"set,omitempty"`
}

type EconomyConfigRewardRangeFloat64 added in v1.10.0

type EconomyConfigRewardRangeFloat64 struct {
	Min      float64 `json:"min,omitempty"`
	Max      float64 `json:"max,omitempty"`
	Multiple float64 `json:"multiple,omitempty"`
}

type EconomyConfigRewardRangeInt32

type EconomyConfigRewardRangeInt32 struct {
	Min      int32 `json:"min,omitempty"`
	Max      int32 `json:"max,omitempty"`
	Multiple int32 `json:"multiple,omitempty"`
}

type EconomyConfigRewardRangeInt64

type EconomyConfigRewardRangeInt64 struct {
	Min      int64 `json:"min,omitempty"`
	Max      int64 `json:"max,omitempty"`
	Multiple int64 `json:"multiple,omitempty"`
}

type EconomyConfigRewardRangeUInt64 added in v1.10.0

type EconomyConfigRewardRangeUInt64 struct {
	Min      uint64 `json:"min,omitempty"`
	Max      uint64 `json:"max,omitempty"`
	Multiple uint64 `json:"multiple,omitempty"`
}

type EconomyConfigRewardRewardModifier

type EconomyConfigRewardRewardModifier struct {
	Id          string                          `json:"id,omitempty"`
	Type        string                          `json:"type,omitempty"`
	Operator    string                          `json:"operator,omitempty"`
	Value       *EconomyConfigRewardRangeInt64  `json:"value,omitempty"`
	DurationSec *EconomyConfigRewardRangeUInt64 `json:"duration_sec,omitempty"`
}

type EconomyConfigRewardStringProperty added in v1.10.0

type EconomyConfigRewardStringProperty struct {
	TotalWeight int64                                               `json:"total_weight,omitempty"`
	Options     map[string]*EconomyConfigRewardStringPropertyOption `json:"options,omitempty"`
}

type EconomyConfigRewardStringPropertyOption added in v1.10.0

type EconomyConfigRewardStringPropertyOption struct {
	Weight int64 `json:"weight,omitempty"`
}

type EconomyConfigStoreItem

type EconomyConfigStoreItem struct {
	Category             string                      `json:"category,omitempty"`
	Cost                 *EconomyConfigStoreItemCost `json:"cost,omitempty"`
	Description          string                      `json:"description,omitempty"`
	Name                 string                      `json:"name,omitempty"`
	Reward               *EconomyConfigReward        `json:"reward,omitempty"`
	AdditionalProperties map[string]string           `json:"additional_properties,omitempty"`
}

type EconomyConfigStoreItemCost

type EconomyConfigStoreItemCost struct {
	Currencies map[string]int64 `json:"currencies,omitempty"`
	Sku        string           `json:"sku,omitempty"`
}

type EconomyDonation

type EconomyDonation struct {

	// The user that owns this donation.
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// The count of how much of the donation has already been claimed.
	ClaimCount int64 `protobuf:"varint,2,opt,name=claim_count,json=claimCount,proto3" json:"claim_count,omitempty"`
	// The count of how much has been contributed by users.
	Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// The UNIX timestamp for the current time.
	CurrentTimeSec int64 `protobuf:"varint,4,opt,name=current_time_sec,json=currentTimeSec,proto3" json:"current_time_sec,omitempty"`
	// The description for the donation, if any. May be an i18n code.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// The UNIX timestamp when the donation expires.
	ExpireTimeSec int64 `protobuf:"varint,6,opt,name=expire_time_sec,json=expireTimeSec,proto3" json:"expire_time_sec,omitempty"`
	// The ID of the donation.
	Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"`
	// The maximum "units" which can be collected.
	MaxCount int64 `protobuf:"varint,8,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// The name for the donation, if any. May be an i18n code.
	Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"`
	// The configuration for rewards granted to the recipient of the donation.
	RecipientAvailableRewards *AvailableRewards `` /* 139-byte string literal not displayed */
	// The maximum number of donations per contributor.
	UserContributionMaxCount int64 `` /* 139-byte string literal not displayed */
	// The contributors to this donation, if any.
	Contributors []*EconomyDonationContributor `protobuf:"bytes,12,rep,name=contributors,proto3" json:"contributors,omitempty"`
	// The configuration for rewards granted to the contributor of the donation.
	ContributorAvailableRewards *AvailableRewards `` /* 145-byte string literal not displayed */
	// All rewards claimed by the recipient of this donation.
	RecipientRewards []*Reward `protobuf:"bytes,14,rep,name=recipient_rewards,json=recipientRewards,proto3" json:"recipient_rewards,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// contains filtered or unexported fields
}

A donation for a user.

func (*EconomyDonation) Descriptor deprecated

func (*EconomyDonation) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonation.ProtoReflect.Descriptor instead.

func (*EconomyDonation) GetAdditionalProperties

func (x *EconomyDonation) GetAdditionalProperties() map[string]string

func (*EconomyDonation) GetClaimCount

func (x *EconomyDonation) GetClaimCount() int64

func (*EconomyDonation) GetContributorAvailableRewards

func (x *EconomyDonation) GetContributorAvailableRewards() *AvailableRewards

func (*EconomyDonation) GetContributors

func (x *EconomyDonation) GetContributors() []*EconomyDonationContributor

func (*EconomyDonation) GetCount

func (x *EconomyDonation) GetCount() int64

func (*EconomyDonation) GetCurrentTimeSec

func (x *EconomyDonation) GetCurrentTimeSec() int64

func (*EconomyDonation) GetDescription

func (x *EconomyDonation) GetDescription() string

func (*EconomyDonation) GetExpireTimeSec

func (x *EconomyDonation) GetExpireTimeSec() int64

func (*EconomyDonation) GetId

func (x *EconomyDonation) GetId() string

func (*EconomyDonation) GetMaxCount

func (x *EconomyDonation) GetMaxCount() int64

func (*EconomyDonation) GetName

func (x *EconomyDonation) GetName() string

func (*EconomyDonation) GetRecipientAvailableRewards

func (x *EconomyDonation) GetRecipientAvailableRewards() *AvailableRewards

func (*EconomyDonation) GetRecipientRewards

func (x *EconomyDonation) GetRecipientRewards() []*Reward

func (*EconomyDonation) GetUserContributionMaxCount

func (x *EconomyDonation) GetUserContributionMaxCount() int64

func (*EconomyDonation) GetUserId

func (x *EconomyDonation) GetUserId() string

func (*EconomyDonation) ProtoMessage

func (*EconomyDonation) ProtoMessage()

func (*EconomyDonation) ProtoReflect

func (x *EconomyDonation) ProtoReflect() protoreflect.Message

func (*EconomyDonation) Reset

func (x *EconomyDonation) Reset()

func (*EconomyDonation) String

func (x *EconomyDonation) String() string

type EconomyDonationAck

type EconomyDonationAck struct {

	// True if the donation is newly created.
	Created bool `protobuf:"varint,1,opt,name=created,proto3" json:"created,omitempty"`
	// The donation requested which may already be active or newly created.
	Donation *EconomyDonation `protobuf:"bytes,2,opt,name=donation,proto3" json:"donation,omitempty"`
	// contains filtered or unexported fields
}

An acknowledgement of the idempotent creation of a donation for a user.

func (*EconomyDonationAck) Descriptor deprecated

func (*EconomyDonationAck) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationAck.ProtoReflect.Descriptor instead.

func (*EconomyDonationAck) GetCreated

func (x *EconomyDonationAck) GetCreated() bool

func (*EconomyDonationAck) GetDonation

func (x *EconomyDonationAck) GetDonation() *EconomyDonation

func (*EconomyDonationAck) ProtoMessage

func (*EconomyDonationAck) ProtoMessage()

func (*EconomyDonationAck) ProtoReflect

func (x *EconomyDonationAck) ProtoReflect() protoreflect.Message

func (*EconomyDonationAck) Reset

func (x *EconomyDonationAck) Reset()

func (*EconomyDonationAck) String

func (x *EconomyDonationAck) String() string

type EconomyDonationClaimRequest

type EconomyDonationClaimRequest struct {

	// The donation IDs to claim.
	DonationIds []string `protobuf:"bytes,1,rep,name=donation_ids,json=donationIds,proto3" json:"donation_ids,omitempty"`
	// contains filtered or unexported fields
}

Request to claim one or more donations.

func (*EconomyDonationClaimRequest) Descriptor deprecated

func (*EconomyDonationClaimRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationClaimRequest.ProtoReflect.Descriptor instead.

func (*EconomyDonationClaimRequest) GetDonationIds

func (x *EconomyDonationClaimRequest) GetDonationIds() []string

func (*EconomyDonationClaimRequest) ProtoMessage

func (*EconomyDonationClaimRequest) ProtoMessage()

func (*EconomyDonationClaimRequest) ProtoReflect

func (*EconomyDonationClaimRequest) Reset

func (x *EconomyDonationClaimRequest) Reset()

func (*EconomyDonationClaimRequest) String

func (x *EconomyDonationClaimRequest) String() string

type EconomyDonationClaimRewards

type EconomyDonationClaimRewards struct {

	// All active donations for the user.
	Donations *EconomyDonationsList `protobuf:"bytes,1,opt,name=donations,proto3" json:"donations,omitempty"`
	// The rewards from this particular claim.
	ClaimedRewards map[string]*RewardList `` /* 191-byte string literal not displayed */
	// contains filtered or unexported fields
}

Response to claiming one or more donations.

func (*EconomyDonationClaimRewards) Descriptor deprecated

func (*EconomyDonationClaimRewards) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationClaimRewards.ProtoReflect.Descriptor instead.

func (*EconomyDonationClaimRewards) GetClaimedRewards

func (x *EconomyDonationClaimRewards) GetClaimedRewards() map[string]*RewardList

func (*EconomyDonationClaimRewards) GetDonations

func (*EconomyDonationClaimRewards) ProtoMessage

func (*EconomyDonationClaimRewards) ProtoMessage()

func (*EconomyDonationClaimRewards) ProtoReflect

func (*EconomyDonationClaimRewards) Reset

func (x *EconomyDonationClaimRewards) Reset()

func (*EconomyDonationClaimRewards) String

func (x *EconomyDonationClaimRewards) String() string

type EconomyDonationContributor

type EconomyDonationContributor struct {

	// The user ID that contributed.
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// The amount they've donated.
	Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

A contributor to this donation.

func (*EconomyDonationContributor) Descriptor deprecated

func (*EconomyDonationContributor) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationContributor.ProtoReflect.Descriptor instead.

func (*EconomyDonationContributor) GetCount

func (x *EconomyDonationContributor) GetCount() int64

func (*EconomyDonationContributor) GetUserId

func (x *EconomyDonationContributor) GetUserId() string

func (*EconomyDonationContributor) ProtoMessage

func (*EconomyDonationContributor) ProtoMessage()

func (*EconomyDonationContributor) ProtoReflect

func (*EconomyDonationContributor) Reset

func (x *EconomyDonationContributor) Reset()

func (*EconomyDonationContributor) String

func (x *EconomyDonationContributor) String() string

type EconomyDonationGetRequest

type EconomyDonationGetRequest struct {

	// The user IDs to get donations for.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

Request to get donations for one or more users.

func (*EconomyDonationGetRequest) Descriptor deprecated

func (*EconomyDonationGetRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationGetRequest.ProtoReflect.Descriptor instead.

func (*EconomyDonationGetRequest) GetIds

func (x *EconomyDonationGetRequest) GetIds() []string

func (*EconomyDonationGetRequest) ProtoMessage

func (*EconomyDonationGetRequest) ProtoMessage()

func (*EconomyDonationGetRequest) ProtoReflect

func (*EconomyDonationGetRequest) Reset

func (x *EconomyDonationGetRequest) Reset()

func (*EconomyDonationGetRequest) String

func (x *EconomyDonationGetRequest) String() string

type EconomyDonationGiveRequest

type EconomyDonationGiveRequest struct {

	// The user ID who receives the donation.
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// The donation ID to give into.
	DonationId string `protobuf:"bytes,2,opt,name=donation_id,json=donationId,proto3" json:"donation_id,omitempty"`
	// contains filtered or unexported fields
}

Request to give a donation to a user.

func (*EconomyDonationGiveRequest) Descriptor deprecated

func (*EconomyDonationGiveRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationGiveRequest.ProtoReflect.Descriptor instead.

func (*EconomyDonationGiveRequest) GetDonationId

func (x *EconomyDonationGiveRequest) GetDonationId() string

func (*EconomyDonationGiveRequest) GetUserId

func (x *EconomyDonationGiveRequest) GetUserId() string

func (*EconomyDonationGiveRequest) ProtoMessage

func (*EconomyDonationGiveRequest) ProtoMessage()

func (*EconomyDonationGiveRequest) ProtoReflect

func (*EconomyDonationGiveRequest) Reset

func (x *EconomyDonationGiveRequest) Reset()

func (*EconomyDonationGiveRequest) String

func (x *EconomyDonationGiveRequest) String() string

type EconomyDonationRequest

type EconomyDonationRequest struct {

	// The donation ID to request, defined on the server.
	DonationId string `protobuf:"bytes,1,opt,name=donation_id,json=donationId,proto3" json:"donation_id,omitempty"`
	// contains filtered or unexported fields
}

Request a new donation.

func (*EconomyDonationRequest) Descriptor deprecated

func (*EconomyDonationRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationRequest.ProtoReflect.Descriptor instead.

func (*EconomyDonationRequest) GetDonationId

func (x *EconomyDonationRequest) GetDonationId() string

func (*EconomyDonationRequest) ProtoMessage

func (*EconomyDonationRequest) ProtoMessage()

func (*EconomyDonationRequest) ProtoReflect

func (x *EconomyDonationRequest) ProtoReflect() protoreflect.Message

func (*EconomyDonationRequest) Reset

func (x *EconomyDonationRequest) Reset()

func (*EconomyDonationRequest) String

func (x *EconomyDonationRequest) String() string

type EconomyDonationsByUserList

type EconomyDonationsByUserList struct {

	// The active donations grouped by user ID.
	UserDonations map[string]*EconomyDonationsList `` /* 188-byte string literal not displayed */
	// contains filtered or unexported fields
}

A map of active donations keyed by user ID.

func (*EconomyDonationsByUserList) Descriptor deprecated

func (*EconomyDonationsByUserList) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationsByUserList.ProtoReflect.Descriptor instead.

func (*EconomyDonationsByUserList) GetUserDonations

func (x *EconomyDonationsByUserList) GetUserDonations() map[string]*EconomyDonationsList

func (*EconomyDonationsByUserList) ProtoMessage

func (*EconomyDonationsByUserList) ProtoMessage()

func (*EconomyDonationsByUserList) ProtoReflect

func (*EconomyDonationsByUserList) Reset

func (x *EconomyDonationsByUserList) Reset()

func (*EconomyDonationsByUserList) String

func (x *EconomyDonationsByUserList) String() string

type EconomyDonationsList

type EconomyDonationsList struct {

	// The active donations for a set of users.
	Donations []*EconomyDonation `protobuf:"bytes,1,rep,name=donations,proto3" json:"donations,omitempty"`
	// contains filtered or unexported fields
}

A list of active donations returned for some set of users.

func (*EconomyDonationsList) Descriptor deprecated

func (*EconomyDonationsList) Descriptor() ([]byte, []int)

Deprecated: Use EconomyDonationsList.ProtoReflect.Descriptor instead.

func (*EconomyDonationsList) GetDonations

func (x *EconomyDonationsList) GetDonations() []*EconomyDonation

func (*EconomyDonationsList) ProtoMessage

func (*EconomyDonationsList) ProtoMessage()

func (*EconomyDonationsList) ProtoReflect

func (x *EconomyDonationsList) ProtoReflect() protoreflect.Message

func (*EconomyDonationsList) Reset

func (x *EconomyDonationsList) Reset()

func (*EconomyDonationsList) String

func (x *EconomyDonationsList) String() string

type EconomyGrantRequest

type EconomyGrantRequest struct {

	// The currencies to grant.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// The reward modifiers to grant.
	RewardModifiers []*RewardModifier `protobuf:"bytes,2,rep,name=reward_modifiers,json=rewardModifiers,proto3" json:"reward_modifiers,omitempty"`
	// Any items to grant.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a request to grant rewards to the user.

func (*EconomyGrantRequest) Descriptor deprecated

func (*EconomyGrantRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyGrantRequest.ProtoReflect.Descriptor instead.

func (*EconomyGrantRequest) GetCurrencies

func (x *EconomyGrantRequest) GetCurrencies() map[string]int64

func (*EconomyGrantRequest) GetItems added in v1.3.0

func (x *EconomyGrantRequest) GetItems() map[string]int64

func (*EconomyGrantRequest) GetRewardModifiers

func (x *EconomyGrantRequest) GetRewardModifiers() []*RewardModifier

func (*EconomyGrantRequest) ProtoMessage

func (*EconomyGrantRequest) ProtoMessage()

func (*EconomyGrantRequest) ProtoReflect

func (x *EconomyGrantRequest) ProtoReflect() protoreflect.Message

func (*EconomyGrantRequest) Reset

func (x *EconomyGrantRequest) Reset()

func (*EconomyGrantRequest) String

func (x *EconomyGrantRequest) String() string

type EconomyList

type EconomyList struct {

	// The list of store items.
	StoreItems []*EconomyListStoreItem `protobuf:"bytes,1,rep,name=store_items,json=storeItems,proto3" json:"store_items,omitempty"`
	// The list of placements.
	Placements []*EconomyListPlacement `protobuf:"bytes,2,rep,name=placements,proto3" json:"placements,omitempty"`
	// The set of active donations for the current user.
	Donations map[string]*EconomyDonation `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

The response data with the available store items.

func (*EconomyList) Descriptor deprecated

func (*EconomyList) Descriptor() ([]byte, []int)

Deprecated: Use EconomyList.ProtoReflect.Descriptor instead.

func (*EconomyList) GetDonations

func (x *EconomyList) GetDonations() map[string]*EconomyDonation

func (*EconomyList) GetPlacements

func (x *EconomyList) GetPlacements() []*EconomyListPlacement

func (*EconomyList) GetStoreItems

func (x *EconomyList) GetStoreItems() []*EconomyListStoreItem

func (*EconomyList) ProtoMessage

func (*EconomyList) ProtoMessage()

func (*EconomyList) ProtoReflect

func (x *EconomyList) ProtoReflect() protoreflect.Message

func (*EconomyList) Reset

func (x *EconomyList) Reset()

func (*EconomyList) String

func (x *EconomyList) String() string

type EconomyListPlacement

type EconomyListPlacement struct {

	// The ID of the placement.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The reward obtained from this placement.
	Reward *Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"`
	// The available rewards obtained from this placement.
	AvailableRewards *AvailableRewards `protobuf:"bytes,3,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 209-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents an available ad placement.

func (*EconomyListPlacement) Descriptor deprecated

func (*EconomyListPlacement) Descriptor() ([]byte, []int)

Deprecated: Use EconomyListPlacement.ProtoReflect.Descriptor instead.

func (*EconomyListPlacement) GetAdditionalProperties

func (x *EconomyListPlacement) GetAdditionalProperties() map[string]string

func (*EconomyListPlacement) GetAvailableRewards

func (x *EconomyListPlacement) GetAvailableRewards() *AvailableRewards

func (*EconomyListPlacement) GetId

func (x *EconomyListPlacement) GetId() string

func (*EconomyListPlacement) GetReward

func (x *EconomyListPlacement) GetReward() *Reward

func (*EconomyListPlacement) ProtoMessage

func (*EconomyListPlacement) ProtoMessage()

func (*EconomyListPlacement) ProtoReflect

func (x *EconomyListPlacement) ProtoReflect() protoreflect.Message

func (*EconomyListPlacement) Reset

func (x *EconomyListPlacement) Reset()

func (*EconomyListPlacement) String

func (x *EconomyListPlacement) String() string

type EconomyListRequest

type EconomyListRequest struct {

	// The game client's store type.
	StoreType EconomyStoreType `protobuf:"varint,1,opt,name=store_type,json=storeType,proto3,enum=hiro.EconomyStoreType" json:"store_type,omitempty"`
	// contains filtered or unexported fields
}

Represents a request to retrieve available store items.

func (*EconomyListRequest) Descriptor deprecated

func (*EconomyListRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyListRequest.ProtoReflect.Descriptor instead.

func (*EconomyListRequest) GetStoreType

func (x *EconomyListRequest) GetStoreType() EconomyStoreType

func (*EconomyListRequest) ProtoMessage

func (*EconomyListRequest) ProtoMessage()

func (*EconomyListRequest) ProtoReflect

func (x *EconomyListRequest) ProtoReflect() protoreflect.Message

func (*EconomyListRequest) Reset

func (x *EconomyListRequest) Reset()

func (*EconomyListRequest) String

func (x *EconomyListRequest) String() string

type EconomyListStoreItem

type EconomyListStoreItem struct {

	// The category to group the item together with others.
	Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"`
	// The cost of the item.
	Cost *EconomyListStoreItemCost `protobuf:"bytes,2,opt,name=cost,proto3" json:"cost,omitempty"`
	// A description of the item. May be an i18n code.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The ID of the item.
	Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"`
	// The name of the item. May be an i18n code.
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	// The available rewards in this store item.
	AvailableRewards *AvailableRewards `protobuf:"bytes,6,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 209-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents an individual available store items.

func (*EconomyListStoreItem) Descriptor deprecated

func (*EconomyListStoreItem) Descriptor() ([]byte, []int)

Deprecated: Use EconomyListStoreItem.ProtoReflect.Descriptor instead.

func (*EconomyListStoreItem) GetAdditionalProperties

func (x *EconomyListStoreItem) GetAdditionalProperties() map[string]string

func (*EconomyListStoreItem) GetAvailableRewards

func (x *EconomyListStoreItem) GetAvailableRewards() *AvailableRewards

func (*EconomyListStoreItem) GetCategory

func (x *EconomyListStoreItem) GetCategory() string

func (*EconomyListStoreItem) GetCost

func (*EconomyListStoreItem) GetDescription

func (x *EconomyListStoreItem) GetDescription() string

func (*EconomyListStoreItem) GetId

func (x *EconomyListStoreItem) GetId() string

func (*EconomyListStoreItem) GetName

func (x *EconomyListStoreItem) GetName() string

func (*EconomyListStoreItem) ProtoMessage

func (*EconomyListStoreItem) ProtoMessage()

func (*EconomyListStoreItem) ProtoReflect

func (x *EconomyListStoreItem) ProtoReflect() protoreflect.Message

func (*EconomyListStoreItem) Reset

func (x *EconomyListStoreItem) Reset()

func (*EconomyListStoreItem) String

func (x *EconomyListStoreItem) String() string

type EconomyListStoreItemCost

type EconomyListStoreItemCost struct {

	// The virtual currencies, if any.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// The required purchase SKU, if any.
	Sku string `protobuf:"bytes,2,opt,name=sku,proto3" json:"sku,omitempty"`
	// contains filtered or unexported fields
}

The cost(s) associated with a store item.

func (*EconomyListStoreItemCost) Descriptor deprecated

func (*EconomyListStoreItemCost) Descriptor() ([]byte, []int)

Deprecated: Use EconomyListStoreItemCost.ProtoReflect.Descriptor instead.

func (*EconomyListStoreItemCost) GetCurrencies

func (x *EconomyListStoreItemCost) GetCurrencies() map[string]int64

func (*EconomyListStoreItemCost) GetSku

func (x *EconomyListStoreItemCost) GetSku() string

func (*EconomyListStoreItemCost) ProtoMessage

func (*EconomyListStoreItemCost) ProtoMessage()

func (*EconomyListStoreItemCost) ProtoReflect

func (x *EconomyListStoreItemCost) ProtoReflect() protoreflect.Message

func (*EconomyListStoreItemCost) Reset

func (x *EconomyListStoreItemCost) Reset()

func (*EconomyListStoreItemCost) String

func (x *EconomyListStoreItemCost) String() string

type EconomyPlacementStartRequest

type EconomyPlacementStartRequest struct {

	// The identifier to start a reward for.
	PlacementId string `protobuf:"bytes,1,opt,name=placement_id,json=placementId,proto3" json:"placement_id,omitempty"`
	// contains filtered or unexported fields
}

Request to start a placement reward.

func (*EconomyPlacementStartRequest) Descriptor deprecated

func (*EconomyPlacementStartRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPlacementStartRequest.ProtoReflect.Descriptor instead.

func (*EconomyPlacementStartRequest) GetPlacementId

func (x *EconomyPlacementStartRequest) GetPlacementId() string

func (*EconomyPlacementStartRequest) ProtoMessage

func (*EconomyPlacementStartRequest) ProtoMessage()

func (*EconomyPlacementStartRequest) ProtoReflect

func (*EconomyPlacementStartRequest) Reset

func (x *EconomyPlacementStartRequest) Reset()

func (*EconomyPlacementStartRequest) String

type EconomyPlacementStatus

type EconomyPlacementStatus struct {

	// The reward ID.
	RewardId string `protobuf:"bytes,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"`
	// The placement ID.
	PlacementId string `protobuf:"bytes,2,opt,name=placement_id,json=placementId,proto3" json:"placement_id,omitempty"`
	// The UNIX timestamp when the placement was created.
	CreateTimeSec int64 `protobuf:"varint,3,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// The UNIX timestamp when the placement was completed.
	CompleteTimeSec int64 `protobuf:"varint,4,opt,name=complete_time_sec,json=completeTimeSec,proto3" json:"complete_time_sec,omitempty"`
	// If completed, was it successful.
	Success bool `protobuf:"varint,5,opt,name=success,proto3" json:"success,omitempty"`
	// The reward for completing the placement, if it was autocompleted as part of the status request.
	Reward *Reward `protobuf:"bytes,6,opt,name=reward,proto3" json:"reward,omitempty"`
	// contains filtered or unexported fields
}

The current status of a placement reward.

func (*EconomyPlacementStatus) Descriptor deprecated

func (*EconomyPlacementStatus) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPlacementStatus.ProtoReflect.Descriptor instead.

func (*EconomyPlacementStatus) GetCompleteTimeSec

func (x *EconomyPlacementStatus) GetCompleteTimeSec() int64

func (*EconomyPlacementStatus) GetCreateTimeSec

func (x *EconomyPlacementStatus) GetCreateTimeSec() int64

func (*EconomyPlacementStatus) GetPlacementId

func (x *EconomyPlacementStatus) GetPlacementId() string

func (*EconomyPlacementStatus) GetReward

func (x *EconomyPlacementStatus) GetReward() *Reward

func (*EconomyPlacementStatus) GetRewardId

func (x *EconomyPlacementStatus) GetRewardId() string

func (*EconomyPlacementStatus) GetSuccess

func (x *EconomyPlacementStatus) GetSuccess() bool

func (*EconomyPlacementStatus) ProtoMessage

func (*EconomyPlacementStatus) ProtoMessage()

func (*EconomyPlacementStatus) ProtoReflect

func (x *EconomyPlacementStatus) ProtoReflect() protoreflect.Message

func (*EconomyPlacementStatus) Reset

func (x *EconomyPlacementStatus) Reset()

func (*EconomyPlacementStatus) String

func (x *EconomyPlacementStatus) String() string

type EconomyPlacementStatusRequest

type EconomyPlacementStatusRequest struct {

	// The reward ID to check.
	RewardId string `protobuf:"bytes,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"`
	// The placement ID to check, will be used if reward ID is not supplied.
	PlacementId string `protobuf:"bytes,2,opt,name=placement_id,json=placementId,proto3" json:"placement_id,omitempty"`
	// The check attempt counter, optional.
	Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

Request to retrieve status af a specific placement instance by reward ID.

func (*EconomyPlacementStatusRequest) Descriptor deprecated

func (*EconomyPlacementStatusRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPlacementStatusRequest.ProtoReflect.Descriptor instead.

func (*EconomyPlacementStatusRequest) GetCount

func (x *EconomyPlacementStatusRequest) GetCount() int32

func (*EconomyPlacementStatusRequest) GetPlacementId

func (x *EconomyPlacementStatusRequest) GetPlacementId() string

func (*EconomyPlacementStatusRequest) GetRewardId

func (x *EconomyPlacementStatusRequest) GetRewardId() string

func (*EconomyPlacementStatusRequest) ProtoMessage

func (*EconomyPlacementStatusRequest) ProtoMessage()

func (*EconomyPlacementStatusRequest) ProtoReflect

func (*EconomyPlacementStatusRequest) Reset

func (x *EconomyPlacementStatusRequest) Reset()

func (*EconomyPlacementStatusRequest) String

type EconomyPurchaseAck

type EconomyPurchaseAck struct {

	// Updated wallet data, if changed.
	Wallet map[string]int64 `` /* 154-byte string literal not displayed */
	// Update inventory data, if changed.
	Inventory *Inventory `protobuf:"bytes,2,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Reward, if any.
	Reward *Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"`
	// Was the purchase a sandbox purchase?
	IsSandboxPurchase bool `protobuf:"varint,4,opt,name=is_sandbox_purchase,json=isSandboxPurchase,proto3" json:"is_sandbox_purchase,omitempty"`
	// contains filtered or unexported fields
}

Response from purchasing currencies and/or items. Contains updated wallet and inventory data, if changed. Contains reward granted, if any. Contains indication of whether or not the purchase was a sandbox purchase.

func (*EconomyPurchaseAck) Descriptor deprecated

func (*EconomyPurchaseAck) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPurchaseAck.ProtoReflect.Descriptor instead.

func (*EconomyPurchaseAck) GetInventory

func (x *EconomyPurchaseAck) GetInventory() *Inventory

func (*EconomyPurchaseAck) GetIsSandboxPurchase

func (x *EconomyPurchaseAck) GetIsSandboxPurchase() bool

func (*EconomyPurchaseAck) GetReward

func (x *EconomyPurchaseAck) GetReward() *Reward

func (*EconomyPurchaseAck) GetWallet

func (x *EconomyPurchaseAck) GetWallet() map[string]int64

func (*EconomyPurchaseAck) ProtoMessage

func (*EconomyPurchaseAck) ProtoMessage()

func (*EconomyPurchaseAck) ProtoReflect

func (x *EconomyPurchaseAck) ProtoReflect() protoreflect.Message

func (*EconomyPurchaseAck) Reset

func (x *EconomyPurchaseAck) Reset()

func (*EconomyPurchaseAck) String

func (x *EconomyPurchaseAck) String() string

type EconomyPurchaseIntentRequest

type EconomyPurchaseIntentRequest struct {

	// An item's ID.
	ItemId string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	// The store type.
	StoreType EconomyStoreType `protobuf:"varint,2,opt,name=store_type,json=storeType,proto3,enum=hiro.EconomyStoreType" json:"store_type,omitempty"`
	// The SKU code, if any.
	Sku string `protobuf:"bytes,3,opt,name=sku,proto3" json:"sku,omitempty"`
	// contains filtered or unexported fields
}

Request to create a store item purchase intent.

func (*EconomyPurchaseIntentRequest) Descriptor deprecated

func (*EconomyPurchaseIntentRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPurchaseIntentRequest.ProtoReflect.Descriptor instead.

func (*EconomyPurchaseIntentRequest) GetItemId

func (x *EconomyPurchaseIntentRequest) GetItemId() string

func (*EconomyPurchaseIntentRequest) GetSku

func (*EconomyPurchaseIntentRequest) GetStoreType

func (*EconomyPurchaseIntentRequest) ProtoMessage

func (*EconomyPurchaseIntentRequest) ProtoMessage()

func (*EconomyPurchaseIntentRequest) ProtoReflect

func (*EconomyPurchaseIntentRequest) Reset

func (x *EconomyPurchaseIntentRequest) Reset()

func (*EconomyPurchaseIntentRequest) String

type EconomyPurchaseRequest

type EconomyPurchaseRequest struct {

	// An item's ID.
	ItemId string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	// The store type.
	StoreType EconomyStoreType `protobuf:"varint,2,opt,name=store_type,json=storeType,proto3,enum=hiro.EconomyStoreType" json:"store_type,omitempty"`
	// The IAP receipt purchased.
	Receipt string `protobuf:"bytes,3,opt,name=receipt,proto3" json:"receipt,omitempty"`
	// contains filtered or unexported fields
}

Request to purchase a particular store item.

func (*EconomyPurchaseRequest) Descriptor deprecated

func (*EconomyPurchaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPurchaseRequest.ProtoReflect.Descriptor instead.

func (*EconomyPurchaseRequest) GetItemId

func (x *EconomyPurchaseRequest) GetItemId() string

func (*EconomyPurchaseRequest) GetReceipt

func (x *EconomyPurchaseRequest) GetReceipt() string

func (*EconomyPurchaseRequest) GetStoreType

func (x *EconomyPurchaseRequest) GetStoreType() EconomyStoreType

func (*EconomyPurchaseRequest) ProtoMessage

func (*EconomyPurchaseRequest) ProtoMessage()

func (*EconomyPurchaseRequest) ProtoReflect

func (x *EconomyPurchaseRequest) ProtoReflect() protoreflect.Message

func (*EconomyPurchaseRequest) Reset

func (x *EconomyPurchaseRequest) Reset()

func (*EconomyPurchaseRequest) String

func (x *EconomyPurchaseRequest) String() string

type EconomyPurchaseRestoreRequest added in v1.10.0

type EconomyPurchaseRestoreRequest struct {

	// The store type.
	StoreType EconomyStoreType `protobuf:"varint,1,opt,name=store_type,json=storeType,proto3,enum=hiro.EconomyStoreType" json:"store_type,omitempty"`
	// The IAP receipts to restore.
	Receipts []string `protobuf:"bytes,2,rep,name=receipts,proto3" json:"receipts,omitempty"`
	// contains filtered or unexported fields
}

Request to restore a set of purchases.

func (*EconomyPurchaseRestoreRequest) Descriptor deprecated added in v1.10.0

func (*EconomyPurchaseRestoreRequest) Descriptor() ([]byte, []int)

Deprecated: Use EconomyPurchaseRestoreRequest.ProtoReflect.Descriptor instead.

func (*EconomyPurchaseRestoreRequest) GetReceipts added in v1.10.0

func (x *EconomyPurchaseRestoreRequest) GetReceipts() []string

func (*EconomyPurchaseRestoreRequest) GetStoreType added in v1.10.0

func (*EconomyPurchaseRestoreRequest) ProtoMessage added in v1.10.0

func (*EconomyPurchaseRestoreRequest) ProtoMessage()

func (*EconomyPurchaseRestoreRequest) ProtoReflect added in v1.10.0

func (*EconomyPurchaseRestoreRequest) Reset added in v1.10.0

func (x *EconomyPurchaseRestoreRequest) Reset()

func (*EconomyPurchaseRestoreRequest) String added in v1.10.0

type EconomyStoreType

type EconomyStoreType int32

The store types supported by the Economy system.

const (
	// Unspecified. Defaults to Apple.
	EconomyStoreType_ECONOMY_STORE_TYPE_UNSPECIFIED EconomyStoreType = 0
	// Apple App Store.
	EconomyStoreType_ECONOMY_STORE_TYPE_APPLE_APPSTORE EconomyStoreType = 1
	// Google Play.
	EconomyStoreType_ECONOMY_STORE_TYPE_GOOGLE_PLAY EconomyStoreType = 2
	// Facebook Instant games.
	EconomyStoreType_ECONOMY_STORE_TYPE_FBINSTANT EconomyStoreType = 3
)

func (EconomyStoreType) Descriptor

func (EconomyStoreType) Enum

func (EconomyStoreType) EnumDescriptor deprecated

func (EconomyStoreType) EnumDescriptor() ([]byte, []int)

Deprecated: Use EconomyStoreType.Descriptor instead.

func (EconomyStoreType) Number

func (EconomyStoreType) String

func (x EconomyStoreType) String() string

func (EconomyStoreType) Type

type EconomySystem

type EconomySystem interface {
	System

	// RewardCreate prepares a new reward configuration to be filled in and used later.
	RewardCreate() *EconomyConfigReward

	// RewardRoll takes a reward configuration and rolls an actual reward from it, applying all appropriate rules.
	RewardRoll(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, rewardConfig *EconomyConfigReward) (*Reward, error)

	// RewardGrant updates a user's economy, inventory, and/or energy models with the contents of a rolled reward.
	RewardGrant(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, reward *Reward, metadata map[string]interface{}) error

	// DonationClaim will claim donation rewards for a user and the given donation IDs.
	DonationClaim(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, donationIDs []string) (*EconomyDonationsList, error)

	// DonationGet will get all donations for the given list of user IDs.
	DonationGet(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userIDs []string) (*EconomyDonationsByUserList, error)

	// DonationGive will contribute to a particular donation for a user ID.
	DonationGive(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, donationID, fromUserID string) (map[string]int64, *Inventory, *Reward, error)

	// DonationRequest will create a donation request for a given donation ID and user ID.
	DonationRequest(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, donationID string) (*EconomyDonation, bool, error)

	// List will get the defined store items and placements within the economy system.
	List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (map[string]*EconomyConfigStoreItem, map[string]*EconomyConfigPlacement, error)

	// Grant will add currencies, and reward modifiers to a user's economy by ID.
	Grant(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, currencies map[string]int64, items map[string]int64, modifiers []*RewardModifier, walletMetadata map[string]interface{}) (map[string]int64, error)

	// UnmarshalWallet unmarshals and returns the account's wallet as a map[string]int64.
	UnmarshalWallet(account *api.Account) (map[string]int64, error)

	// PurchaseIntent will create a purchase intent for a particular store item for a user ID.
	PurchaseIntent(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, itemID string, store EconomyStoreType, sku string) error

	// PurchaseItem will validate a purchase and give the user ID the appropriate rewards.
	PurchaseItem(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, itemID string, store EconomyStoreType, receipt string) (map[string]int64, *Inventory, *Reward, bool, error)

	// PurchaseRestore will process a restore attempt for the given user, based on a set of restore receipts.
	PurchaseRestore(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, store EconomyStoreType, receipts []string) error

	// PlacementStatus will get the status of a specified placement.
	PlacementStatus(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, rewardID, placementID string, retryCount int) (*EconomyPlacementStatus, error)

	// PlacementStart will indicate that a user ID has begun viewing an ad placement.
	PlacementStart(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, placementID string) (*EconomyPlacementStatus, error)

	// PlacementSuccess will indicate that the user ID has successfully viewed an ad placement and provide the appropriate reward.
	PlacementSuccess(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, rewardID, placementID string) (*Reward, error)

	// PlacementFail will indicate that the user ID has failed to successfully view the ad placement.
	PlacementFail(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, rewardID, placementID string) error

	// SetOnDonationClaimReward sets a custom reward function which will run after a donation's reward is rolled.
	SetOnDonationClaimReward(fn OnReward[*EconomyConfigDonation])

	// SetOnDonationContributorReward sets a custom reward function which will run after a donation's sender reward is rolled.
	SetOnDonationContributorReward(fn OnReward[*EconomyConfigDonation])

	// SetOnPlacementReward sets a custom reward function which will run after a placement's reward is rolled.
	SetOnPlacementReward(fn OnReward[*EconomyConfigPlacement])

	// SetOnStoreItemReward sets a custom reward function which will run after store item's reward is rolled.
	SetOnStoreItemReward(fn OnReward[*EconomyConfigStoreItem])
}

The EconomySystem is the foundation of a game's economy.

It provides functionality for 4 different reward types: basic, gacha, weighted table, and custom. These rolled rewards are available to generate in all other gameplay systems and can be generated manually as well.

type EconomyUpdateAck

type EconomyUpdateAck struct {

	// Updated wallet data, if changed.
	Wallet map[string]int64 `` /* 154-byte string literal not displayed */
	// Update inventory data, if changed.
	Inventory *Inventory `protobuf:"bytes,2,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Reward, if any.
	Reward *Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"`
	// contains filtered or unexported fields
}

Response from granting currencies and/or items. Contains updated wallet and inventory data, if changed. Contains reward granted, if any.

func (*EconomyUpdateAck) Descriptor deprecated

func (*EconomyUpdateAck) Descriptor() ([]byte, []int)

Deprecated: Use EconomyUpdateAck.ProtoReflect.Descriptor instead.

func (*EconomyUpdateAck) GetInventory

func (x *EconomyUpdateAck) GetInventory() *Inventory

func (*EconomyUpdateAck) GetReward

func (x *EconomyUpdateAck) GetReward() *Reward

func (*EconomyUpdateAck) GetWallet

func (x *EconomyUpdateAck) GetWallet() map[string]int64

func (*EconomyUpdateAck) ProtoMessage

func (*EconomyUpdateAck) ProtoMessage()

func (*EconomyUpdateAck) ProtoReflect

func (x *EconomyUpdateAck) ProtoReflect() protoreflect.Message

func (*EconomyUpdateAck) Reset

func (x *EconomyUpdateAck) Reset()

func (*EconomyUpdateAck) String

func (x *EconomyUpdateAck) String() string

type Energy

type Energy struct {

	// The unique energy identifier.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The current amount.
	Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"`
	// The maximum amount.
	Max int32 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
	// Amount of energy granted per refill.
	Refill int32 `protobuf:"varint,4,opt,name=refill,proto3" json:"refill,omitempty"`
	// Number of seconds between refills.
	RefillSec int64 `protobuf:"varint,5,opt,name=refill_sec,json=refillSec,proto3" json:"refill_sec,omitempty"`
	// The UNIX timestamp when the count will increase, if it is not at max already.
	NextRefillTimeSec int64 `protobuf:"varint,6,opt,name=next_refill_time_sec,json=nextRefillTimeSec,proto3" json:"next_refill_time_sec,omitempty"`
	// The UNIX timestamp when the count will reach max, if it is not at max already.
	MaxRefillTimeSec int64 `protobuf:"varint,7,opt,name=max_refill_time_sec,json=maxRefillTimeSec,proto3" json:"max_refill_time_sec,omitempty"`
	// The UNIX timestamp when the count started filling, if it is not at max already.
	StartRefillTimeSec int64 `protobuf:"varint,8,opt,name=start_refill_time_sec,json=startRefillTimeSec,proto3" json:"start_refill_time_sec,omitempty"`
	// The modifiers, if any.
	Modifiers []*EnergyModifier `protobuf:"bytes,9,rep,name=modifiers,proto3" json:"modifiers,omitempty"`
	// The available rewards, if any.
	AvailableRewards *AvailableRewards `protobuf:"bytes,10,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// The current UNIX timestamp in seconds.
	CurrentTimeSec int64 `protobuf:"varint,12,opt,name=current_time_sec,json=currentTimeSec,proto3" json:"current_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Information about a single energy type.

func (*Energy) Descriptor deprecated

func (*Energy) Descriptor() ([]byte, []int)

Deprecated: Use Energy.ProtoReflect.Descriptor instead.

func (*Energy) GetAdditionalProperties

func (x *Energy) GetAdditionalProperties() map[string]string

func (*Energy) GetAvailableRewards

func (x *Energy) GetAvailableRewards() *AvailableRewards

func (*Energy) GetCurrent

func (x *Energy) GetCurrent() int32

func (*Energy) GetCurrentTimeSec

func (x *Energy) GetCurrentTimeSec() int64

func (*Energy) GetId

func (x *Energy) GetId() string

func (*Energy) GetMax

func (x *Energy) GetMax() int32

func (*Energy) GetMaxRefillTimeSec

func (x *Energy) GetMaxRefillTimeSec() int64

func (*Energy) GetModifiers

func (x *Energy) GetModifiers() []*EnergyModifier

func (*Energy) GetNextRefillTimeSec

func (x *Energy) GetNextRefillTimeSec() int64

func (*Energy) GetRefill

func (x *Energy) GetRefill() int32

func (*Energy) GetRefillSec

func (x *Energy) GetRefillSec() int64

func (*Energy) GetStartRefillTimeSec

func (x *Energy) GetStartRefillTimeSec() int64

func (*Energy) ProtoMessage

func (*Energy) ProtoMessage()

func (*Energy) ProtoReflect

func (x *Energy) ProtoReflect() protoreflect.Message

func (*Energy) Reset

func (x *Energy) Reset()

func (*Energy) String

func (x *Energy) String() string

type EnergyConfig

type EnergyConfig struct {
	Energies map[string]*EnergyConfigEnergy `json:"energies,omitempty"`
}

EnergyConfig is the data definition for the EnergySystem type.

type EnergyConfigEnergy

type EnergyConfigEnergy struct {
	StartCount           int32                `json:"start_count,omitempty"`
	MaxCount             int32                `json:"max_count,omitempty"`
	MaxOverfill          int32                `json:"max_overfill,omitempty"`
	RefillCount          int32                `json:"refill_count,omitempty"`
	RefillTimeSec        int64                `json:"refill_time_sec,omitempty"`
	Implicit             bool                 `json:"implicit,omitempty"`
	Reward               *EconomyConfigReward `json:"reward,omitempty"`
	AdditionalProperties map[string]string    `json:"additional_properties,omitempty"`
}

type EnergyList

type EnergyList struct {

	// Energy types keyed on the energy identifier.
	Energies map[string]*Energy `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

One or more energy values for a user.

func (*EnergyList) Descriptor deprecated

func (*EnergyList) Descriptor() ([]byte, []int)

Deprecated: Use EnergyList.ProtoReflect.Descriptor instead.

func (*EnergyList) GetEnergies

func (x *EnergyList) GetEnergies() map[string]*Energy

func (*EnergyList) ProtoMessage

func (*EnergyList) ProtoMessage()

func (*EnergyList) ProtoReflect

func (x *EnergyList) ProtoReflect() protoreflect.Message

func (*EnergyList) Reset

func (x *EnergyList) Reset()

func (*EnergyList) String

func (x *EnergyList) String() string

type EnergyModifier

type EnergyModifier struct {

	// The modifier operator.
	Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"`
	// The modifier value, if applicable.
	Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// The UNIX timestamp when the modifier became active.
	StartTimeSec int64 `protobuf:"varint,3,opt,name=start_time_sec,json=startTimeSec,proto3" json:"start_time_sec,omitempty"`
	// The UNIX timestamp when the modifier ends.
	EndTimeSec int64 `protobuf:"varint,4,opt,name=end_time_sec,json=endTimeSec,proto3" json:"end_time_sec,omitempty"`
	// contains filtered or unexported fields
}

A modifier that may change energy behaviour.

func (*EnergyModifier) Descriptor deprecated

func (*EnergyModifier) Descriptor() ([]byte, []int)

Deprecated: Use EnergyModifier.ProtoReflect.Descriptor instead.

func (*EnergyModifier) GetEndTimeSec

func (x *EnergyModifier) GetEndTimeSec() int64

func (*EnergyModifier) GetOperator

func (x *EnergyModifier) GetOperator() string

func (*EnergyModifier) GetStartTimeSec

func (x *EnergyModifier) GetStartTimeSec() int64

func (*EnergyModifier) GetValue

func (x *EnergyModifier) GetValue() int32

func (*EnergyModifier) ProtoMessage

func (*EnergyModifier) ProtoMessage()

func (*EnergyModifier) ProtoReflect

func (x *EnergyModifier) ProtoReflect() protoreflect.Message

func (*EnergyModifier) Reset

func (x *EnergyModifier) Reset()

func (*EnergyModifier) String

func (x *EnergyModifier) String() string

type EnergySpendRequest

type EnergySpendRequest struct {

	// Energy amounts to spend.
	Amounts map[string]int32 `` /* 156-byte string literal not displayed */
	// contains filtered or unexported fields
}

Request to spend one or more energy amounts.

func (*EnergySpendRequest) Descriptor deprecated

func (*EnergySpendRequest) Descriptor() ([]byte, []int)

Deprecated: Use EnergySpendRequest.ProtoReflect.Descriptor instead.

func (*EnergySpendRequest) GetAmounts

func (x *EnergySpendRequest) GetAmounts() map[string]int32

func (*EnergySpendRequest) ProtoMessage

func (*EnergySpendRequest) ProtoMessage()

func (*EnergySpendRequest) ProtoReflect

func (x *EnergySpendRequest) ProtoReflect() protoreflect.Message

func (*EnergySpendRequest) Reset

func (x *EnergySpendRequest) Reset()

func (*EnergySpendRequest) String

func (x *EnergySpendRequest) String() string

type EnergySpendReward

type EnergySpendReward struct {

	// The updated list of energy.
	Energies *EnergyList `protobuf:"bytes,1,opt,name=energies,proto3" json:"energies,omitempty"`
	// The cumulative reward of spending the energies.
	Reward *Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"`
	// contains filtered or unexported fields
}

Request to spend one or more energy amounts.

func (*EnergySpendReward) Descriptor deprecated

func (*EnergySpendReward) Descriptor() ([]byte, []int)

Deprecated: Use EnergySpendReward.ProtoReflect.Descriptor instead.

func (*EnergySpendReward) GetEnergies

func (x *EnergySpendReward) GetEnergies() *EnergyList

func (*EnergySpendReward) GetReward

func (x *EnergySpendReward) GetReward() *Reward

func (*EnergySpendReward) ProtoMessage

func (*EnergySpendReward) ProtoMessage()

func (*EnergySpendReward) ProtoReflect

func (x *EnergySpendReward) ProtoReflect() protoreflect.Message

func (*EnergySpendReward) Reset

func (x *EnergySpendReward) Reset()

func (*EnergySpendReward) String

func (x *EnergySpendReward) String() string

type EnergySystem

type EnergySystem interface {
	System

	// Get returns all energies defined and the values a user currently owns by ID.
	Get(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (map[string]*Energy, error)

	// Spend will deduct the amounts from each energy for a user by ID.
	Spend(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, amounts map[string]int32) (map[string]*Energy, *Reward, error)

	// Grant will add the amounts to each energy (while applying any energy modifiers) for a user by ID.
	Grant(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, amounts map[string]int32, modifiers []*RewardEnergyModifier) (map[string]*Energy, error)

	// SetOnSpendReward sets a custom reward function which will run after an energy reward's value has been rolled.
	SetOnSpendReward(fn OnReward[*EnergyConfigEnergy])
}

The EnergySystem provides a gameplay system for Energy timers.

An energy is a gameplay mechanic used to reward or limit progress which a player can make through the gameplay content.

type EventLeaderboard added in v1.1.0

type EventLeaderboard struct {

	// Event leaderboard ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The name of the event leaderboard. May be an i18n code.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// A description of the event leaderboard. May be an i18n code.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The category to group the event leaderboard together with others.
	Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
	// Score ordering.
	Ascending bool `protobuf:"varint,5,opt,name=ascending,proto3" json:"ascending,omitempty"`
	// Score submission operator.
	Operator string `protobuf:"bytes,6,opt,name=operator,proto3" json:"operator,omitempty"`
	// The tier of this instance of the event leaderboard.
	Tier int32 `protobuf:"varint,7,opt,name=tier,proto3" json:"tier,omitempty"`
	// Time when the event starts.
	StartTimeSec int64 `protobuf:"varint,8,opt,name=start_time_sec,json=startTimeSec,proto3" json:"start_time_sec,omitempty"`
	// Time when the event ends.
	EndTimeSec int64 `protobuf:"varint,9,opt,name=end_time_sec,json=endTimeSec,proto3" json:"end_time_sec,omitempty"`
	// Time when the event expires.
	ExpiryTimeSec int64 `protobuf:"varint,10,opt,name=expiry_time_sec,json=expiryTimeSec,proto3" json:"expiry_time_sec,omitempty"`
	// The available reward and its probabilities.
	AvailableRewards *AvailableRewards `protobuf:"bytes,11,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// The possible reward tiers for this instance of the event leaderboard, based on its current tier.
	RewardTiers map[int32]*EventLeaderboardRewardTiers `` /* 184-byte string literal not displayed */
	// Per-tier promotion/demotion change zones, if configured.
	ChangeZones map[int32]*EventLeaderboardChangeZone `` /* 184-byte string literal not displayed */
	// Claim time, if any.
	ClaimTimeSec int64 `protobuf:"varint,14,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// The outcome (rolled) reward for the event leaderboard.
	Reward *Reward `protobuf:"bytes,15,opt,name=reward,proto3" json:"reward,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// Current participant count.
	Count int64 `protobuf:"varint,17,opt,name=count,proto3" json:"count,omitempty"`
	// Maximum participant count.
	MaxCount int64 `protobuf:"varint,18,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// Maximum number of score submissions per participant.
	MaxNumScore int64 `protobuf:"varint,19,opt,name=max_num_score,json=maxNumScore,proto3" json:"max_num_score,omitempty"`
	// Participants and their scores.
	Scores []*EventLeaderboardScore `protobuf:"bytes,20,rep,name=scores,proto3" json:"scores,omitempty"`
	// Indicates if the event is still active, and scores can be submitted.
	IsActive bool `protobuf:"varint,21,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
	// Indicates if the event is over and its reward can be claimed.
	CanClaim bool `protobuf:"varint,22,opt,name=can_claim,json=canClaim,proto3" json:"can_claim,omitempty"`
	// Indicates if the event can be rolled to get a new set of opponents.
	CanRoll bool `protobuf:"varint,23,opt,name=can_roll,json=canRoll,proto3" json:"can_roll,omitempty"`
	// contains filtered or unexported fields
}

Details about a specific event leaderboard.

func (*EventLeaderboard) Descriptor deprecated added in v1.1.0

func (*EventLeaderboard) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboard.ProtoReflect.Descriptor instead.

func (*EventLeaderboard) GetAdditionalProperties added in v1.1.0

func (x *EventLeaderboard) GetAdditionalProperties() map[string]string

func (*EventLeaderboard) GetAscending added in v1.1.0

func (x *EventLeaderboard) GetAscending() bool

func (*EventLeaderboard) GetAvailableRewards added in v1.1.0

func (x *EventLeaderboard) GetAvailableRewards() *AvailableRewards

func (*EventLeaderboard) GetCanClaim added in v1.1.0

func (x *EventLeaderboard) GetCanClaim() bool

func (*EventLeaderboard) GetCanRoll added in v1.6.0

func (x *EventLeaderboard) GetCanRoll() bool

func (*EventLeaderboard) GetCategory added in v1.1.0

func (x *EventLeaderboard) GetCategory() string

func (*EventLeaderboard) GetChangeZones added in v1.3.0

func (x *EventLeaderboard) GetChangeZones() map[int32]*EventLeaderboardChangeZone

func (*EventLeaderboard) GetClaimTimeSec added in v1.1.0

func (x *EventLeaderboard) GetClaimTimeSec() int64

func (*EventLeaderboard) GetCount added in v1.1.0

func (x *EventLeaderboard) GetCount() int64

func (*EventLeaderboard) GetDescription added in v1.1.0

func (x *EventLeaderboard) GetDescription() string

func (*EventLeaderboard) GetEndTimeSec added in v1.1.0

func (x *EventLeaderboard) GetEndTimeSec() int64

func (*EventLeaderboard) GetExpiryTimeSec added in v1.1.0

func (x *EventLeaderboard) GetExpiryTimeSec() int64

func (*EventLeaderboard) GetId added in v1.1.0

func (x *EventLeaderboard) GetId() string

func (*EventLeaderboard) GetIsActive added in v1.1.0

func (x *EventLeaderboard) GetIsActive() bool

func (*EventLeaderboard) GetMaxCount added in v1.1.0

func (x *EventLeaderboard) GetMaxCount() int64

func (*EventLeaderboard) GetMaxNumScore added in v1.1.0

func (x *EventLeaderboard) GetMaxNumScore() int64

func (*EventLeaderboard) GetName added in v1.1.0

func (x *EventLeaderboard) GetName() string

func (*EventLeaderboard) GetOperator added in v1.1.0

func (x *EventLeaderboard) GetOperator() string

func (*EventLeaderboard) GetReward added in v1.1.0

func (x *EventLeaderboard) GetReward() *Reward

func (*EventLeaderboard) GetRewardTiers added in v1.1.0

func (x *EventLeaderboard) GetRewardTiers() map[int32]*EventLeaderboardRewardTiers

func (*EventLeaderboard) GetScores added in v1.1.0

func (x *EventLeaderboard) GetScores() []*EventLeaderboardScore

func (*EventLeaderboard) GetStartTimeSec added in v1.1.0

func (x *EventLeaderboard) GetStartTimeSec() int64

func (*EventLeaderboard) GetTier added in v1.1.0

func (x *EventLeaderboard) GetTier() int32

func (*EventLeaderboard) ProtoMessage added in v1.1.0

func (*EventLeaderboard) ProtoMessage()

func (*EventLeaderboard) ProtoReflect added in v1.1.0

func (x *EventLeaderboard) ProtoReflect() protoreflect.Message

func (*EventLeaderboard) Reset added in v1.1.0

func (x *EventLeaderboard) Reset()

func (*EventLeaderboard) String added in v1.1.0

func (x *EventLeaderboard) String() string

type EventLeaderboardChangeZone added in v1.3.0

type EventLeaderboardChangeZone struct {

	// Percentage of cohort to promote, expressed in the range of 0.0 to 1.0.
	Promotion float64 `protobuf:"fixed64,1,opt,name=promotion,proto3" json:"promotion,omitempty"`
	// Percentage of cohort to demote, expressed in the range of 0.0 to 1.0.
	Demotion float64 `protobuf:"fixed64,2,opt,name=demotion,proto3" json:"demotion,omitempty"`
	// Whether or not to always demote players that failed to submit a score at all.
	DemoteIdle bool `protobuf:"varint,3,opt,name=demote_idle,json=demoteIdle,proto3" json:"demote_idle,omitempty"`
	// contains filtered or unexported fields
}

An event leaderboard's tier-specific promotion/demotion zones.

func (*EventLeaderboardChangeZone) Descriptor deprecated added in v1.3.0

func (*EventLeaderboardChangeZone) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardChangeZone.ProtoReflect.Descriptor instead.

func (*EventLeaderboardChangeZone) GetDemoteIdle added in v1.3.0

func (x *EventLeaderboardChangeZone) GetDemoteIdle() bool

func (*EventLeaderboardChangeZone) GetDemotion added in v1.3.0

func (x *EventLeaderboardChangeZone) GetDemotion() float64

func (*EventLeaderboardChangeZone) GetPromotion added in v1.3.0

func (x *EventLeaderboardChangeZone) GetPromotion() float64

func (*EventLeaderboardChangeZone) ProtoMessage added in v1.3.0

func (*EventLeaderboardChangeZone) ProtoMessage()

func (*EventLeaderboardChangeZone) ProtoReflect added in v1.3.0

func (*EventLeaderboardChangeZone) Reset added in v1.3.0

func (x *EventLeaderboardChangeZone) Reset()

func (*EventLeaderboardChangeZone) String added in v1.3.0

func (x *EventLeaderboardChangeZone) String() string

type EventLeaderboardClaim added in v1.1.0

type EventLeaderboardClaim struct {

	// Event leaderboard ID to claim.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Claim the available reward for an event leaderboard by ID.

func (*EventLeaderboardClaim) Descriptor deprecated added in v1.1.0

func (*EventLeaderboardClaim) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardClaim.ProtoReflect.Descriptor instead.

func (*EventLeaderboardClaim) GetId added in v1.1.0

func (x *EventLeaderboardClaim) GetId() string

func (*EventLeaderboardClaim) ProtoMessage added in v1.1.0

func (*EventLeaderboardClaim) ProtoMessage()

func (*EventLeaderboardClaim) ProtoReflect added in v1.1.0

func (x *EventLeaderboardClaim) ProtoReflect() protoreflect.Message

func (*EventLeaderboardClaim) Reset added in v1.1.0

func (x *EventLeaderboardClaim) Reset()

func (*EventLeaderboardClaim) String added in v1.1.0

func (x *EventLeaderboardClaim) String() string

type EventLeaderboardGet added in v1.1.0

type EventLeaderboardGet struct {

	// Event leaderboard ID to get, and join if necessary/possible.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Find and retrieve an event leaderboard by ID, automatically joining the event if necessary.

func (*EventLeaderboardGet) Descriptor deprecated added in v1.1.0

func (*EventLeaderboardGet) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardGet.ProtoReflect.Descriptor instead.

func (*EventLeaderboardGet) GetId added in v1.1.0

func (x *EventLeaderboardGet) GetId() string

func (*EventLeaderboardGet) ProtoMessage added in v1.1.0

func (*EventLeaderboardGet) ProtoMessage()

func (*EventLeaderboardGet) ProtoReflect added in v1.1.0

func (x *EventLeaderboardGet) ProtoReflect() protoreflect.Message

func (*EventLeaderboardGet) Reset added in v1.1.0

func (x *EventLeaderboardGet) Reset()

func (*EventLeaderboardGet) String added in v1.1.0

func (x *EventLeaderboardGet) String() string

type EventLeaderboardRewardTier added in v1.1.0

type EventLeaderboardRewardTier struct {

	// Name for this tier.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The maximum rank (inclusive).
	RankMax int32 `protobuf:"varint,2,opt,name=rank_max,json=rankMax,proto3" json:"rank_max,omitempty"`
	// The minimum rank (inclusive).
	RankMin int32 `protobuf:"varint,3,opt,name=rank_min,json=rankMin,proto3" json:"rank_min,omitempty"`
	// The available rewards for this range.
	AvailableRewards *AvailableRewards `protobuf:"bytes,4,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Change in tier for this rank range.
	TierChange int32 `protobuf:"varint,5,opt,name=tier_change,json=tierChange,proto3" json:"tier_change,omitempty"`
	// contains filtered or unexported fields
}

A reward range within a specific tier based on ranks.

func (*EventLeaderboardRewardTier) Descriptor deprecated added in v1.1.0

func (*EventLeaderboardRewardTier) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardRewardTier.ProtoReflect.Descriptor instead.

func (*EventLeaderboardRewardTier) GetAvailableRewards added in v1.1.0

func (x *EventLeaderboardRewardTier) GetAvailableRewards() *AvailableRewards

func (*EventLeaderboardRewardTier) GetName added in v1.6.0

func (x *EventLeaderboardRewardTier) GetName() string

func (*EventLeaderboardRewardTier) GetRankMax added in v1.1.0

func (x *EventLeaderboardRewardTier) GetRankMax() int32

func (*EventLeaderboardRewardTier) GetRankMin added in v1.1.0

func (x *EventLeaderboardRewardTier) GetRankMin() int32

func (*EventLeaderboardRewardTier) GetTierChange added in v1.1.0

func (x *EventLeaderboardRewardTier) GetTierChange() int32

func (*EventLeaderboardRewardTier) ProtoMessage added in v1.1.0

func (*EventLeaderboardRewardTier) ProtoMessage()

func (*EventLeaderboardRewardTier) ProtoReflect added in v1.1.0

func (*EventLeaderboardRewardTier) Reset added in v1.1.0

func (x *EventLeaderboardRewardTier) Reset()

func (*EventLeaderboardRewardTier) String added in v1.1.0

func (x *EventLeaderboardRewardTier) String() string

type EventLeaderboardRewardTiers added in v1.2.0

type EventLeaderboardRewardTiers struct {

	// Possible reward tiers.
	RewardTiers []*EventLeaderboardRewardTier `protobuf:"bytes,1,rep,name=reward_tiers,json=rewardTiers,proto3" json:"reward_tiers,omitempty"`
	// contains filtered or unexported fields
}

An event leaderboard's tier-specific set of rewards.

func (*EventLeaderboardRewardTiers) Descriptor deprecated added in v1.2.0

func (*EventLeaderboardRewardTiers) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardRewardTiers.ProtoReflect.Descriptor instead.

func (*EventLeaderboardRewardTiers) GetRewardTiers added in v1.2.0

func (*EventLeaderboardRewardTiers) ProtoMessage added in v1.2.0

func (*EventLeaderboardRewardTiers) ProtoMessage()

func (*EventLeaderboardRewardTiers) ProtoReflect added in v1.2.0

func (*EventLeaderboardRewardTiers) Reset added in v1.2.0

func (x *EventLeaderboardRewardTiers) Reset()

func (*EventLeaderboardRewardTiers) String added in v1.2.0

func (x *EventLeaderboardRewardTiers) String() string

type EventLeaderboardRoll added in v1.4.0

type EventLeaderboardRoll struct {

	// Event leaderboard ID to roll.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Roll a new cohort for the specified event leaderboard.

func (*EventLeaderboardRoll) Descriptor deprecated added in v1.4.0

func (*EventLeaderboardRoll) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardRoll.ProtoReflect.Descriptor instead.

func (*EventLeaderboardRoll) GetId added in v1.4.0

func (x *EventLeaderboardRoll) GetId() string

func (*EventLeaderboardRoll) ProtoMessage added in v1.4.0

func (*EventLeaderboardRoll) ProtoMessage()

func (*EventLeaderboardRoll) ProtoReflect added in v1.4.0

func (x *EventLeaderboardRoll) ProtoReflect() protoreflect.Message

func (*EventLeaderboardRoll) Reset added in v1.4.0

func (x *EventLeaderboardRoll) Reset()

func (*EventLeaderboardRoll) String added in v1.4.0

func (x *EventLeaderboardRoll) String() string

type EventLeaderboardScore added in v1.1.0

type EventLeaderboardScore struct {

	// User ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Username.
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// Display name.
	DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// Avatar URL.
	AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
	// Time when the user joined the event leaderboard.
	CreateTimeSec int64 `protobuf:"varint,5,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Time when the user last submitted a score.
	UpdateTimeSec int64 `protobuf:"varint,6,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Rank within the event leaderboard.
	Rank int64 `protobuf:"varint,7,opt,name=rank,proto3" json:"rank,omitempty"`
	// Score.
	Score int64 `protobuf:"varint,8,opt,name=score,proto3" json:"score,omitempty"`
	// Subscore.
	Subscore int64 `protobuf:"varint,9,opt,name=subscore,proto3" json:"subscore,omitempty"`
	// Number of score submissions.
	NumScores int64 `protobuf:"varint,10,opt,name=num_scores,json=numScores,proto3" json:"num_scores,omitempty"`
	// contains filtered or unexported fields
}

A single participant entry to an event leaderboard.

func (*EventLeaderboardScore) Descriptor deprecated added in v1.1.0

func (*EventLeaderboardScore) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardScore.ProtoReflect.Descriptor instead.

func (*EventLeaderboardScore) GetAvatarUrl added in v1.6.0

func (x *EventLeaderboardScore) GetAvatarUrl() string

func (*EventLeaderboardScore) GetCreateTimeSec added in v1.1.0

func (x *EventLeaderboardScore) GetCreateTimeSec() int64

func (*EventLeaderboardScore) GetDisplayName added in v1.6.0

func (x *EventLeaderboardScore) GetDisplayName() string

func (*EventLeaderboardScore) GetId added in v1.1.0

func (x *EventLeaderboardScore) GetId() string

func (*EventLeaderboardScore) GetNumScores added in v1.1.0

func (x *EventLeaderboardScore) GetNumScores() int64

func (*EventLeaderboardScore) GetRank added in v1.1.0

func (x *EventLeaderboardScore) GetRank() int64

func (*EventLeaderboardScore) GetScore added in v1.1.0

func (x *EventLeaderboardScore) GetScore() int64

func (*EventLeaderboardScore) GetSubscore added in v1.1.0

func (x *EventLeaderboardScore) GetSubscore() int64

func (*EventLeaderboardScore) GetUpdateTimeSec added in v1.1.0

func (x *EventLeaderboardScore) GetUpdateTimeSec() int64

func (*EventLeaderboardScore) GetUsername added in v1.1.0

func (x *EventLeaderboardScore) GetUsername() string

func (*EventLeaderboardScore) ProtoMessage added in v1.1.0

func (*EventLeaderboardScore) ProtoMessage()

func (*EventLeaderboardScore) ProtoReflect added in v1.1.0

func (x *EventLeaderboardScore) ProtoReflect() protoreflect.Message

func (*EventLeaderboardScore) Reset added in v1.1.0

func (x *EventLeaderboardScore) Reset()

func (*EventLeaderboardScore) String added in v1.1.0

func (x *EventLeaderboardScore) String() string

type EventLeaderboardUpdate added in v1.1.0

type EventLeaderboardUpdate struct {

	// Event leaderboard ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Score.
	Score int64 `protobuf:"varint,2,opt,name=score,proto3" json:"score,omitempty"`
	// Subscore.
	Subscore int64 `protobuf:"varint,3,opt,name=subscore,proto3" json:"subscore,omitempty"`
	// contains filtered or unexported fields
}

Submit a score to an event leaderboard.

func (*EventLeaderboardUpdate) Descriptor deprecated added in v1.1.0

func (*EventLeaderboardUpdate) Descriptor() ([]byte, []int)

Deprecated: Use EventLeaderboardUpdate.ProtoReflect.Descriptor instead.

func (*EventLeaderboardUpdate) GetId added in v1.1.0

func (x *EventLeaderboardUpdate) GetId() string

func (*EventLeaderboardUpdate) GetScore added in v1.1.0

func (x *EventLeaderboardUpdate) GetScore() int64

func (*EventLeaderboardUpdate) GetSubscore added in v1.1.0

func (x *EventLeaderboardUpdate) GetSubscore() int64

func (*EventLeaderboardUpdate) ProtoMessage added in v1.1.0

func (*EventLeaderboardUpdate) ProtoMessage()

func (*EventLeaderboardUpdate) ProtoReflect added in v1.1.0

func (x *EventLeaderboardUpdate) ProtoReflect() protoreflect.Message

func (*EventLeaderboardUpdate) Reset added in v1.1.0

func (x *EventLeaderboardUpdate) Reset()

func (*EventLeaderboardUpdate) String added in v1.1.0

func (x *EventLeaderboardUpdate) String() string

type EventLeaderboardsConfig added in v1.1.0

type EventLeaderboardsConfig struct {
	EventLeaderboards map[string]*EventLeaderboardsConfigLeaderboard `json:"event_leaderboards,omitempty"`
}

EventLeaderboardsConfig is the data definition for the EventLeaderboardsSystem type.

type EventLeaderboardsConfigChangeZone added in v1.3.0

type EventLeaderboardsConfigChangeZone struct {
	Promotion  float64 `json:"promotion,omitempty"`
	Demotion   float64 `json:"demotion,omitempty"`
	DemoteIdle bool    `json:"demote_idle,omitempty"`
}

type EventLeaderboardsConfigLeaderboard added in v1.1.0

type EventLeaderboardsConfigLeaderboard struct {
	Name                 string                                                     `json:"name,omitempty"`
	Description          string                                                     `json:"description,omitempty"`
	Category             string                                                     `json:"category,omitempty"`
	Ascending            bool                                                       `json:"ascending,omitempty"`
	Operator             string                                                     `json:"operator,omitempty"`
	ResetSchedule        string                                                     `json:"reset_schedule,omitempty"`
	CohortSize           int                                                        `json:"cohort_size,omitempty"`
	AdditionalProperties map[string]string                                          `json:"additional_properties,omitempty"`
	MaxNumScore          int                                                        `json:"max_num_score,omitempty"`
	RewardTiers          map[string][]*EventLeaderboardsConfigLeaderboardRewardTier `json:"reward_tiers,omitempty"`
	ChangeZones          map[string]*EventLeaderboardsConfigChangeZone              `json:"change_zones,omitempty"`
	Tiers                int                                                        `json:"tiers,omitempty"`
	MaxIdleTierDrop      int                                                        `json:"max_idle_tier_drop,omitempty"`
	StartTimeSec         int64                                                      `json:"start_time_sec,omitempty"`
	EndTimeSec           int64                                                      `json:"end_time_sec,omitempty"`
	Duration             int64                                                      `json:"duration,omitempty"`
}

type EventLeaderboardsConfigLeaderboardRewardTier added in v1.1.0

type EventLeaderboardsConfigLeaderboardRewardTier struct {
	Name       string               `json:"name,omitempty"`
	RankMax    int                  `json:"rank_max,omitempty"`
	RankMin    int                  `json:"rank_min,omitempty"`
	Reward     *EconomyConfigReward `json:"reward,omitempty"`
	TierChange int                  `json:"tier_change,omitempty"`
}

type EventLeaderboardsSystem added in v1.1.0

type EventLeaderboardsSystem interface {
	System

	// GetEventLeaderboard returns a specified event leaderboard's cohort for the user.
	GetEventLeaderboard(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, eventLeaderboardID string) (*EventLeaderboard, error)

	// RollEventLeaderboard places the user into a new cohort for the specified event leaderboard if possible.
	RollEventLeaderboard(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, eventLeaderboardID string) (*EventLeaderboard, error)

	// UpdateEventLeaderboard updates the user's score in the specified event leaderboard, and returns the user's updated cohort information.
	UpdateEventLeaderboard(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, username, eventLeaderboardID string, score, subscore int64) (*EventLeaderboard, error)

	// ClaimEventLeaderboard claims the user's reward for the given event leaderboard.
	ClaimEventLeaderboard(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, eventLeaderboardID string) (*EventLeaderboard, error)

	// SetOnEventLeaderboardsReward sets a custom reward function which will run after an event leaderboard's reward is rolled.
	SetOnEventLeaderboardsReward(fn OnReward[*EventLeaderboardsConfigLeaderboard])

	// SetOnEventLeaderboardCohortSelection sets a custom function that can replace the cohort or opponent selection feature of event leaderboards.
	SetOnEventLeaderboardCohortSelection(fn OnEventLeaderboardCohortSelection)
}

An EventLeaderboardsSystem is a gameplay system which represents cohort-segmented, tier-based event leaderboards.

type Hiro

type Hiro interface {
	// SetPersonalizer is deprecated in favor of AddPersonalizer function to compose a chain of configuration personalization.
	SetPersonalizer(Personalizer)
	AddPersonalizer(personalizer Personalizer)

	SetAfterAuthenticate(fn AfterAuthenticateFn)

	GetAchievementsSystem() AchievementsSystem
	GetBaseSystem() BaseSystem
	GetEconomySystem() EconomySystem
	GetEnergySystem() EnergySystem
	GetInventorySystem() InventorySystem
	GetLeaderboardsSystem() LeaderboardsSystem
	GetStatsSystem() StatsSystem
	GetTeamsSystem() TeamsSystem
	GetTutorialsSystem() TutorialsSystem
	GetUnlockablesSystem() UnlockablesSystem
	GetEventLeaderboardsSystem() EventLeaderboardsSystem
	GetProgressionSystem() ProgressionSystem
	GetIncentivesSystem() IncentivesSystem
}

Hiro provides a type which combines all gameplay systems.

func Init

func Init(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, initializer runtime.Initializer, binPath string, licenseKey string, configs ...SystemConfig) (Hiro, error)

Init initializes a Hiro type with the configurations provided.

type Incentive added in v1.5.0

type Incentive struct {

	// The ID of the incentive.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Shareable incentive code.
	Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"`
	// The type of the incentive.
	Type IncentiveType `protobuf:"varint,5,opt,name=type,proto3,enum=hiro.IncentiveType" json:"type,omitempty"`
	// Create time in UTC seconds.
	CreateTimeSec int64 `protobuf:"varint,6,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Update time in UTC seconds.
	UpdateTimeSec int64 `protobuf:"varint,7,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Expiry time in UTC seconds.
	ExpiryTimeSec int64 `protobuf:"varint,8,opt,name=expiry_time_sec,json=expiryTimeSec,proto3" json:"expiry_time_sec,omitempty"`
	// Available reward.
	RecipientRewards *AvailableRewards `protobuf:"bytes,9,opt,name=recipient_rewards,json=recipientRewards,proto3" json:"recipient_rewards,omitempty"`
	// Sender reward.
	SenderRewards *AvailableRewards `protobuf:"bytes,10,opt,name=sender_rewards,json=senderRewards,proto3" json:"sender_rewards,omitempty"`
	// Recipient user IDs for which the owner of the incentive has not yet claimed their sender reward.
	UnclaimedRecipients []string `protobuf:"bytes,11,rep,name=unclaimed_recipients,json=unclaimedRecipients,proto3" json:"unclaimed_recipients,omitempty"`
	// Sender rewards so far collected for this incentive.
	Rewards []*Reward `protobuf:"bytes,12,rep,name=rewards,proto3" json:"rewards,omitempty"`
	// Max claims.
	MaxClaims int64 `protobuf:"varint,13,opt,name=max_claims,json=maxClaims,proto3" json:"max_claims,omitempty"`
	// Current user IDs that have claimed, and their outcomes.
	Claims map[string]*IncentiveClaim `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

An incentive set up by a user.

func (*Incentive) Descriptor deprecated added in v1.5.0

func (*Incentive) Descriptor() ([]byte, []int)

Deprecated: Use Incentive.ProtoReflect.Descriptor instead.

func (*Incentive) GetClaims added in v1.5.0

func (x *Incentive) GetClaims() map[string]*IncentiveClaim

func (*Incentive) GetCode added in v1.5.0

func (x *Incentive) GetCode() string

func (*Incentive) GetCreateTimeSec added in v1.5.0

func (x *Incentive) GetCreateTimeSec() int64

func (*Incentive) GetDescription added in v1.5.0

func (x *Incentive) GetDescription() string

func (*Incentive) GetExpiryTimeSec added in v1.5.0

func (x *Incentive) GetExpiryTimeSec() int64

func (*Incentive) GetId added in v1.5.0

func (x *Incentive) GetId() string

func (*Incentive) GetMaxClaims added in v1.5.0

func (x *Incentive) GetMaxClaims() int64

func (*Incentive) GetName added in v1.5.0

func (x *Incentive) GetName() string

func (*Incentive) GetRecipientRewards added in v1.5.0

func (x *Incentive) GetRecipientRewards() *AvailableRewards

func (*Incentive) GetRewards added in v1.5.0

func (x *Incentive) GetRewards() []*Reward

func (*Incentive) GetSenderRewards added in v1.5.0

func (x *Incentive) GetSenderRewards() *AvailableRewards

func (*Incentive) GetType added in v1.5.0

func (x *Incentive) GetType() IncentiveType

func (*Incentive) GetUnclaimedRecipients added in v1.5.0

func (x *Incentive) GetUnclaimedRecipients() []string

func (*Incentive) GetUpdateTimeSec added in v1.5.0

func (x *Incentive) GetUpdateTimeSec() int64

func (*Incentive) ProtoMessage added in v1.5.0

func (*Incentive) ProtoMessage()

func (*Incentive) ProtoReflect added in v1.5.0

func (x *Incentive) ProtoReflect() protoreflect.Message

func (*Incentive) Reset added in v1.5.0

func (x *Incentive) Reset()

func (*Incentive) String added in v1.5.0

func (x *Incentive) String() string

type IncentiveClaim added in v1.5.0

type IncentiveClaim struct {

	// Reward granted.
	Reward *Reward `protobuf:"bytes,1,opt,name=reward,proto3" json:"reward,omitempty"`
	// Claim time in UTC seconds.
	ClaimTimeSec int64 `protobuf:"varint,2,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// contains filtered or unexported fields
}

The result of claiming an incentive.

func (*IncentiveClaim) Descriptor deprecated added in v1.5.0

func (*IncentiveClaim) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveClaim.ProtoReflect.Descriptor instead.

func (*IncentiveClaim) GetClaimTimeSec added in v1.5.0

func (x *IncentiveClaim) GetClaimTimeSec() int64

func (*IncentiveClaim) GetReward added in v1.5.0

func (x *IncentiveClaim) GetReward() *Reward

func (*IncentiveClaim) ProtoMessage added in v1.5.0

func (*IncentiveClaim) ProtoMessage()

func (*IncentiveClaim) ProtoReflect added in v1.5.0

func (x *IncentiveClaim) ProtoReflect() protoreflect.Message

func (*IncentiveClaim) Reset added in v1.5.0

func (x *IncentiveClaim) Reset()

func (*IncentiveClaim) String added in v1.5.0

func (x *IncentiveClaim) String() string

type IncentiveInfo added in v1.5.0

type IncentiveInfo struct {

	// The ID of the incentive.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Unique shareable incentive code.
	Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"`
	// The type of the incentive.
	Type IncentiveType `protobuf:"varint,5,opt,name=type,proto3,enum=hiro.IncentiveType" json:"type,omitempty"`
	// Incentive sender user ID.
	Sender string `protobuf:"bytes,6,opt,name=sender,proto3" json:"sender,omitempty"`
	// Available rewards that the caller can claim.
	AvailableRewards *AvailableRewards `protobuf:"bytes,7,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Indicator if the caller can claim rewards.
	CanClaim bool `protobuf:"varint,8,opt,name=can_claim,json=canClaim,proto3" json:"can_claim,omitempty"`
	// Reward that was granted.
	Reward *Reward `protobuf:"bytes,9,opt,name=reward,proto3" json:"reward,omitempty"`
	// Create time in UTC seconds.
	CreateTimeSec int64 `protobuf:"varint,10,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Update time in UTC seconds.
	UpdateTimeSec int64 `protobuf:"varint,11,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Expiry time in UTC seconds.
	ExpiryTimeSec int64 `protobuf:"varint,12,opt,name=expiry_time_sec,json=expiryTimeSec,proto3" json:"expiry_time_sec,omitempty"`
	// Claim time in UTC seconds.
	ClaimTimeSec int64 `protobuf:"varint,13,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// contains filtered or unexported fields
}

An incentive claimant's view of a single incentive.

func (*IncentiveInfo) Descriptor deprecated added in v1.5.0

func (*IncentiveInfo) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveInfo.ProtoReflect.Descriptor instead.

func (*IncentiveInfo) GetAvailableRewards added in v1.5.0

func (x *IncentiveInfo) GetAvailableRewards() *AvailableRewards

func (*IncentiveInfo) GetCanClaim added in v1.5.0

func (x *IncentiveInfo) GetCanClaim() bool

func (*IncentiveInfo) GetClaimTimeSec added in v1.5.0

func (x *IncentiveInfo) GetClaimTimeSec() int64

func (*IncentiveInfo) GetCode added in v1.5.0

func (x *IncentiveInfo) GetCode() string

func (*IncentiveInfo) GetCreateTimeSec added in v1.5.0

func (x *IncentiveInfo) GetCreateTimeSec() int64

func (*IncentiveInfo) GetDescription added in v1.5.0

func (x *IncentiveInfo) GetDescription() string

func (*IncentiveInfo) GetExpiryTimeSec added in v1.5.0

func (x *IncentiveInfo) GetExpiryTimeSec() int64

func (*IncentiveInfo) GetId added in v1.5.0

func (x *IncentiveInfo) GetId() string

func (*IncentiveInfo) GetName added in v1.5.0

func (x *IncentiveInfo) GetName() string

func (*IncentiveInfo) GetReward added in v1.5.0

func (x *IncentiveInfo) GetReward() *Reward

func (*IncentiveInfo) GetSender added in v1.5.0

func (x *IncentiveInfo) GetSender() string

func (*IncentiveInfo) GetType added in v1.5.0

func (x *IncentiveInfo) GetType() IncentiveType

func (*IncentiveInfo) GetUpdateTimeSec added in v1.5.0

func (x *IncentiveInfo) GetUpdateTimeSec() int64

func (*IncentiveInfo) ProtoMessage added in v1.5.0

func (*IncentiveInfo) ProtoMessage()

func (*IncentiveInfo) ProtoReflect added in v1.5.0

func (x *IncentiveInfo) ProtoReflect() protoreflect.Message

func (*IncentiveInfo) Reset added in v1.5.0

func (x *IncentiveInfo) Reset()

func (*IncentiveInfo) String added in v1.5.0

func (x *IncentiveInfo) String() string

type IncentiveList added in v1.5.0

type IncentiveList struct {

	// Incentives set up by a single user.
	Incentives []*Incentive `protobuf:"bytes,1,rep,name=incentives,proto3" json:"incentives,omitempty"`
	// contains filtered or unexported fields
}

A list of incentives set up by a user.

func (*IncentiveList) Descriptor deprecated added in v1.5.0

func (*IncentiveList) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveList.ProtoReflect.Descriptor instead.

func (*IncentiveList) GetIncentives added in v1.5.0

func (x *IncentiveList) GetIncentives() []*Incentive

func (*IncentiveList) ProtoMessage added in v1.5.0

func (*IncentiveList) ProtoMessage()

func (*IncentiveList) ProtoReflect added in v1.5.0

func (x *IncentiveList) ProtoReflect() protoreflect.Message

func (*IncentiveList) Reset added in v1.5.0

func (x *IncentiveList) Reset()

func (*IncentiveList) String added in v1.5.0

func (x *IncentiveList) String() string

type IncentiveRecipientClaimRequest added in v1.5.0

type IncentiveRecipientClaimRequest struct {

	// The unique incentive code.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

Request by a potential incentive claimant to claim an incentive.

func (*IncentiveRecipientClaimRequest) Descriptor deprecated added in v1.5.0

func (*IncentiveRecipientClaimRequest) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveRecipientClaimRequest.ProtoReflect.Descriptor instead.

func (*IncentiveRecipientClaimRequest) GetCode added in v1.5.0

func (*IncentiveRecipientClaimRequest) ProtoMessage added in v1.5.0

func (*IncentiveRecipientClaimRequest) ProtoMessage()

func (*IncentiveRecipientClaimRequest) ProtoReflect added in v1.5.0

func (*IncentiveRecipientClaimRequest) Reset added in v1.5.0

func (x *IncentiveRecipientClaimRequest) Reset()

func (*IncentiveRecipientClaimRequest) String added in v1.5.0

type IncentiveRecipientGetRequest added in v1.5.0

type IncentiveRecipientGetRequest struct {

	// The unique incentive code.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

Request by a potential incentive claimant to view incentive information.

func (*IncentiveRecipientGetRequest) Descriptor deprecated added in v1.5.0

func (*IncentiveRecipientGetRequest) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveRecipientGetRequest.ProtoReflect.Descriptor instead.

func (*IncentiveRecipientGetRequest) GetCode added in v1.5.0

func (x *IncentiveRecipientGetRequest) GetCode() string

func (*IncentiveRecipientGetRequest) ProtoMessage added in v1.5.0

func (*IncentiveRecipientGetRequest) ProtoMessage()

func (*IncentiveRecipientGetRequest) ProtoReflect added in v1.5.0

func (*IncentiveRecipientGetRequest) Reset added in v1.5.0

func (x *IncentiveRecipientGetRequest) Reset()

func (*IncentiveRecipientGetRequest) String added in v1.5.0

type IncentiveSenderClaimRequest added in v1.5.0

type IncentiveSenderClaimRequest struct {

	// The unique incentive code.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// The recipient ID(s) to claim for, or empty for all.
	RecipientIds []string `protobuf:"bytes,2,rep,name=recipient_ids,json=recipientIds,proto3" json:"recipient_ids,omitempty"`
	// contains filtered or unexported fields
}

Request by a user to claim rewards from an incentive they had set up.

func (*IncentiveSenderClaimRequest) Descriptor deprecated added in v1.5.0

func (*IncentiveSenderClaimRequest) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveSenderClaimRequest.ProtoReflect.Descriptor instead.

func (*IncentiveSenderClaimRequest) GetCode added in v1.5.0

func (x *IncentiveSenderClaimRequest) GetCode() string

func (*IncentiveSenderClaimRequest) GetRecipientIds added in v1.5.0

func (x *IncentiveSenderClaimRequest) GetRecipientIds() []string

func (*IncentiveSenderClaimRequest) ProtoMessage added in v1.5.0

func (*IncentiveSenderClaimRequest) ProtoMessage()

func (*IncentiveSenderClaimRequest) ProtoReflect added in v1.5.0

func (*IncentiveSenderClaimRequest) Reset added in v1.5.0

func (x *IncentiveSenderClaimRequest) Reset()

func (*IncentiveSenderClaimRequest) String added in v1.5.0

func (x *IncentiveSenderClaimRequest) String() string

type IncentiveSenderCreateRequest added in v1.5.0

type IncentiveSenderCreateRequest struct {

	// The incentive configuration ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Request by a user to set up a new incentive.

func (*IncentiveSenderCreateRequest) Descriptor deprecated added in v1.5.0

func (*IncentiveSenderCreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveSenderCreateRequest.ProtoReflect.Descriptor instead.

func (*IncentiveSenderCreateRequest) GetId added in v1.5.0

func (*IncentiveSenderCreateRequest) ProtoMessage added in v1.5.0

func (*IncentiveSenderCreateRequest) ProtoMessage()

func (*IncentiveSenderCreateRequest) ProtoReflect added in v1.5.0

func (*IncentiveSenderCreateRequest) Reset added in v1.5.0

func (x *IncentiveSenderCreateRequest) Reset()

func (*IncentiveSenderCreateRequest) String added in v1.5.0

type IncentiveSenderDeleteRequest added in v1.5.0

type IncentiveSenderDeleteRequest struct {

	// The unique incentive code.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

Request by a user to delete an incentive they had set up.

func (*IncentiveSenderDeleteRequest) Descriptor deprecated added in v1.5.0

func (*IncentiveSenderDeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use IncentiveSenderDeleteRequest.ProtoReflect.Descriptor instead.

func (*IncentiveSenderDeleteRequest) GetCode added in v1.5.0

func (x *IncentiveSenderDeleteRequest) GetCode() string

func (*IncentiveSenderDeleteRequest) ProtoMessage added in v1.5.0

func (*IncentiveSenderDeleteRequest) ProtoMessage()

func (*IncentiveSenderDeleteRequest) ProtoReflect added in v1.5.0

func (*IncentiveSenderDeleteRequest) Reset added in v1.5.0

func (x *IncentiveSenderDeleteRequest) Reset()

func (*IncentiveSenderDeleteRequest) String added in v1.5.0

type IncentiveType added in v1.5.0

type IncentiveType int32

Types of incentives.

const (
	// Unspecified. Defaults to INVITE.
	IncentiveType_INCENTIVE_TYPE_UNSPECIFIED IncentiveType = 0
	// An invite with an associated incentive reward.
	IncentiveType_INCENTIVE_TYPE_INVITE IncentiveType = 1
)

func (IncentiveType) Descriptor added in v1.5.0

func (IncentiveType) Enum added in v1.5.0

func (x IncentiveType) Enum() *IncentiveType

func (IncentiveType) EnumDescriptor deprecated added in v1.5.0

func (IncentiveType) EnumDescriptor() ([]byte, []int)

Deprecated: Use IncentiveType.Descriptor instead.

func (IncentiveType) Number added in v1.5.0

func (IncentiveType) String added in v1.5.0

func (x IncentiveType) String() string

func (IncentiveType) Type added in v1.5.0

type IncentivesConfig added in v1.5.0

type IncentivesConfig struct {
	Incentives map[string]*IncentivesConfigIncentive `json:"incentives,omitempty"`
}

type IncentivesConfigIncentive added in v1.5.0

type IncentivesConfigIncentive struct {
	Type               IncentiveType        `json:"type,omitempty"`
	Name               string               `json:"name,omitempty"`
	Description        string               `json:"description,omitempty"`
	MaxClaims          int                  `json:"max_claims,omitempty"`
	MaxGlobalClaims    int                  `json:"max_global_claims,omitempty"`
	MaxRecipientAgeSec int64                `json:"max_recipient_age_sec,omitempty"`
	RecipientReward    *EconomyConfigReward `json:"recipient_reward,omitempty"`
	SenderReward       *EconomyConfigReward `json:"sender_reward,omitempty"`
	MaxConcurrent      int                  `json:"max_concurrent,omitempty"`
	ExpiryDurationSec  int64                `json:"expiry_duration_sec,omitempty"`
}

type IncentivesSystem added in v1.5.0

type IncentivesSystem interface {
	System

	SenderList(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) ([]*Incentive, error)

	SenderCreate(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, incentiveID string) ([]*Incentive, error)

	SenderDelete(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, code string) ([]*Incentive, error)

	SenderClaim(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, code string, claimantIDs []string) ([]*Incentive, error)

	RecipientGet(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, code string) (*IncentiveInfo, error)

	RecipientClaim(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, code string) (*IncentiveInfo, error)

	// SetOnSenderReward sets a custom reward function which will run after an incentive sender's reward is rolled.
	SetOnSenderReward(fn OnReward[*IncentivesConfigIncentive])

	// SetOnRecipientReward sets a custom reward function which will run after an incentive recipient's reward is rolled.
	SetOnRecipientReward(fn OnReward[*IncentivesConfigIncentive])
}

The IncentivesSystem provides a gameplay system which can create and claim incentives and their associated rewards.

type Inventory

type Inventory struct {

	// The items in the player's inventory.
	Items map[string]*InventoryItem `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

The inventory in the economy or owned by user.

func (*Inventory) Descriptor deprecated

func (*Inventory) Descriptor() ([]byte, []int)

Deprecated: Use Inventory.ProtoReflect.Descriptor instead.

func (*Inventory) GetItems

func (x *Inventory) GetItems() map[string]*InventoryItem

func (*Inventory) ProtoMessage

func (*Inventory) ProtoMessage()

func (*Inventory) ProtoReflect

func (x *Inventory) ProtoReflect() protoreflect.Message

func (*Inventory) Reset

func (x *Inventory) Reset()

func (*Inventory) String

func (x *Inventory) String() string

type InventoryConfig

type InventoryConfig struct {
	Items    map[string]*InventoryConfigItem `json:"items,omitempty"`
	ItemSets map[string]map[string]bool      `json:"-"` // Auto-computed when the config is read or personalized.
}

type InventoryConfigItem

type InventoryConfigItem struct {
	Name              string               `json:"name,omitempty"`
	Description       string               `json:"description,omitempty"`
	Category          string               `json:"category,omitempty"`
	ItemSets          []string             `json:"item_sets,omitempty"`
	MaxCount          int64                `json:"max_count,omitempty"`
	Stackable         bool                 `json:"stackable,omitempty"`
	Consumable        bool                 `json:"consumable,omitempty"`
	ConsumeReward     *EconomyConfigReward `json:"consume_reward,omitempty"`
	StringProperties  map[string]string    `json:"string_properties,omitempty"`
	NumericProperties map[string]float64   `json:"numeric_properties,omitempty"`
}

type InventoryConsumeRequest

type InventoryConsumeRequest struct {

	// Item ID amounts to consume, if any.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// Whether or not to allow overconsumption.
	Overconsume bool `protobuf:"varint,2,opt,name=overconsume,proto3" json:"overconsume,omitempty"`
	// Instance ID amounts to consume, if any.
	Instances map[string]int64 `` /* 160-byte string literal not displayed */
	// contains filtered or unexported fields
}

Request to consume some amount of items.

func (*InventoryConsumeRequest) Descriptor deprecated

func (*InventoryConsumeRequest) Descriptor() ([]byte, []int)

Deprecated: Use InventoryConsumeRequest.ProtoReflect.Descriptor instead.

func (*InventoryConsumeRequest) GetInstances added in v1.8.0

func (x *InventoryConsumeRequest) GetInstances() map[string]int64

func (*InventoryConsumeRequest) GetItems

func (x *InventoryConsumeRequest) GetItems() map[string]int64

func (*InventoryConsumeRequest) GetOverconsume

func (x *InventoryConsumeRequest) GetOverconsume() bool

func (*InventoryConsumeRequest) ProtoMessage

func (*InventoryConsumeRequest) ProtoMessage()

func (*InventoryConsumeRequest) ProtoReflect

func (x *InventoryConsumeRequest) ProtoReflect() protoreflect.Message

func (*InventoryConsumeRequest) Reset

func (x *InventoryConsumeRequest) Reset()

func (*InventoryConsumeRequest) String

func (x *InventoryConsumeRequest) String() string

type InventoryConsumeRewards

type InventoryConsumeRewards struct {

	// Updated inventory data, if changed.
	Inventory *Inventory `protobuf:"bytes,1,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Consume rewards by item ID, if any.
	Rewards map[string]*RewardList `` /* 155-byte string literal not displayed */
	// Consume rewards by instance ID, if any.
	InstanceRewards map[string]*RewardList `` /* 194-byte string literal not displayed */
	// contains filtered or unexported fields
}

Updated inventory and rewards granted from consumption.

func (*InventoryConsumeRewards) Descriptor deprecated

func (*InventoryConsumeRewards) Descriptor() ([]byte, []int)

Deprecated: Use InventoryConsumeRewards.ProtoReflect.Descriptor instead.

func (*InventoryConsumeRewards) GetInstanceRewards added in v1.8.0

func (x *InventoryConsumeRewards) GetInstanceRewards() map[string]*RewardList

func (*InventoryConsumeRewards) GetInventory

func (x *InventoryConsumeRewards) GetInventory() *Inventory

func (*InventoryConsumeRewards) GetRewards

func (x *InventoryConsumeRewards) GetRewards() map[string]*RewardList

func (*InventoryConsumeRewards) ProtoMessage

func (*InventoryConsumeRewards) ProtoMessage()

func (*InventoryConsumeRewards) ProtoReflect

func (x *InventoryConsumeRewards) ProtoReflect() protoreflect.Message

func (*InventoryConsumeRewards) Reset

func (x *InventoryConsumeRewards) Reset()

func (*InventoryConsumeRewards) String

func (x *InventoryConsumeRewards) String() string

type InventoryGrantRequest

type InventoryGrantRequest struct {

	// The items to grant.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a request to grant items to the user.

func (*InventoryGrantRequest) Descriptor deprecated

func (*InventoryGrantRequest) Descriptor() ([]byte, []int)

Deprecated: Use InventoryGrantRequest.ProtoReflect.Descriptor instead.

func (*InventoryGrantRequest) GetItems

func (x *InventoryGrantRequest) GetItems() map[string]int64

func (*InventoryGrantRequest) ProtoMessage

func (*InventoryGrantRequest) ProtoMessage()

func (*InventoryGrantRequest) ProtoReflect

func (x *InventoryGrantRequest) ProtoReflect() protoreflect.Message

func (*InventoryGrantRequest) Reset

func (x *InventoryGrantRequest) Reset()

func (*InventoryGrantRequest) String

func (x *InventoryGrantRequest) String() string

type InventoryItem

type InventoryItem struct {

	// The ID of the item.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The name of the item. May be an i18n code.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// A description of the item. May be an i18n code.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The category to group the item together with others.
	Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
	// The sets the item is grouped into.
	ItemSets []string `protobuf:"bytes,5,rep,name=item_sets,json=itemSets,proto3" json:"item_sets,omitempty"`
	// The current count of the item.
	Count int64 `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"`
	// The maximum count which can be owned for this item.
	MaxCount int64 `protobuf:"varint,7,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// Whether or not the item is stackable.
	Stackable bool `protobuf:"varint,8,opt,name=stackable,proto3" json:"stackable,omitempty"`
	// Whether or not the item is consumable.
	Consumable bool `protobuf:"varint,9,opt,name=consumable,proto3" json:"consumable,omitempty"`
	// The configuration for the reward to grant for consumption.
	ConsumeAvailableRewards *AvailableRewards `` /* 133-byte string literal not displayed */
	// The properties with string values.
	StringProperties map[string]string `` /* 198-byte string literal not displayed */
	// The properties with numeric values.
	NumericProperties map[string]float64 `` /* 203-byte string literal not displayed */
	// A UNIX timestamp when the user acquired this item.
	OwnedTimeSec int64 `protobuf:"varint,13,opt,name=owned_time_sec,json=ownedTimeSec,proto3" json:"owned_time_sec,omitempty"`
	// A UNIX timestamp when the item was updated.
	UpdateTimeSec int64 `protobuf:"varint,14,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// The instance ID of the item, if any.
	InstanceId string `protobuf:"bytes,15,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// contains filtered or unexported fields
}

A item owned by the current user.

func (*InventoryItem) Descriptor deprecated

func (*InventoryItem) Descriptor() ([]byte, []int)

Deprecated: Use InventoryItem.ProtoReflect.Descriptor instead.

func (*InventoryItem) GetCategory

func (x *InventoryItem) GetCategory() string

func (*InventoryItem) GetConsumable

func (x *InventoryItem) GetConsumable() bool

func (*InventoryItem) GetConsumeAvailableRewards

func (x *InventoryItem) GetConsumeAvailableRewards() *AvailableRewards

func (*InventoryItem) GetCount

func (x *InventoryItem) GetCount() int64

func (*InventoryItem) GetDescription

func (x *InventoryItem) GetDescription() string

func (*InventoryItem) GetId

func (x *InventoryItem) GetId() string

func (*InventoryItem) GetInstanceId added in v1.8.0

func (x *InventoryItem) GetInstanceId() string

func (*InventoryItem) GetItemSets

func (x *InventoryItem) GetItemSets() []string

func (*InventoryItem) GetMaxCount

func (x *InventoryItem) GetMaxCount() int64

func (*InventoryItem) GetName

func (x *InventoryItem) GetName() string

func (*InventoryItem) GetNumericProperties

func (x *InventoryItem) GetNumericProperties() map[string]float64

func (*InventoryItem) GetOwnedTimeSec

func (x *InventoryItem) GetOwnedTimeSec() int64

func (*InventoryItem) GetStackable

func (x *InventoryItem) GetStackable() bool

func (*InventoryItem) GetStringProperties

func (x *InventoryItem) GetStringProperties() map[string]string

func (*InventoryItem) GetUpdateTimeSec

func (x *InventoryItem) GetUpdateTimeSec() int64

func (*InventoryItem) ProtoMessage

func (*InventoryItem) ProtoMessage()

func (*InventoryItem) ProtoReflect

func (x *InventoryItem) ProtoReflect() protoreflect.Message

func (*InventoryItem) Reset

func (x *InventoryItem) Reset()

func (*InventoryItem) String

func (x *InventoryItem) String() string

type InventoryList

type InventoryList struct {

	// The inventory items from definitions and the user.
	Items map[string]*InventoryItem `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

Response for retrieving Inventory system data definitions.

func (*InventoryList) Descriptor deprecated

func (*InventoryList) Descriptor() ([]byte, []int)

Deprecated: Use InventoryList.ProtoReflect.Descriptor instead.

func (*InventoryList) GetItems

func (x *InventoryList) GetItems() map[string]*InventoryItem

func (*InventoryList) ProtoMessage

func (*InventoryList) ProtoMessage()

func (*InventoryList) ProtoReflect

func (x *InventoryList) ProtoReflect() protoreflect.Message

func (*InventoryList) Reset

func (x *InventoryList) Reset()

func (*InventoryList) String

func (x *InventoryList) String() string

type InventoryListRequest

type InventoryListRequest struct {

	// The category for the items to filter for, or empty for all.
	ItemCategory string `protobuf:"bytes,1,opt,name=item_category,json=itemCategory,proto3" json:"item_category,omitempty"`
	// contains filtered or unexported fields
}

Request all inventory items in the economy.

func (*InventoryListRequest) Descriptor deprecated

func (*InventoryListRequest) Descriptor() ([]byte, []int)

Deprecated: Use InventoryListRequest.ProtoReflect.Descriptor instead.

func (*InventoryListRequest) GetItemCategory

func (x *InventoryListRequest) GetItemCategory() string

func (*InventoryListRequest) ProtoMessage

func (*InventoryListRequest) ProtoMessage()

func (*InventoryListRequest) ProtoReflect

func (x *InventoryListRequest) ProtoReflect() protoreflect.Message

func (*InventoryListRequest) Reset

func (x *InventoryListRequest) Reset()

func (*InventoryListRequest) String

func (x *InventoryListRequest) String() string

type InventorySystem

type InventorySystem interface {
	System

	// List will return the items defined as well as the computed item sets for the user by ID.
	List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (map[string]*InventoryConfigItem, map[string][]string, error)

	// ListInventoryItems will return the items which are part of a user's inventory by ID.
	ListInventoryItems(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, category string) (*Inventory, error)

	// ConsumeItems will deduct the item(s) from the user's inventory and run the consume reward for each one, if defined.
	ConsumeItems(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, itemIDs, instanceIDs map[string]int64, overConsume bool) (*Inventory, map[string][]*Reward, map[string][]*Reward, error)

	// GrantItems will add the item(s) to a user's inventory by ID.
	GrantItems(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, itemIDs map[string]int64) (*Inventory, map[string]*InventoryItem, error)

	// UpdateItems will update the properties which are stored on each item by instance ID for a user.
	UpdateItems(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, instanceIDs map[string]*InventoryUpdateItemProperties) (*Inventory, error)

	// SetOnConsumeReward sets a custom reward function which will run after an inventory items' consume reward is rolled.
	SetOnConsumeReward(fn OnReward[*InventoryConfigItem])
}

The InventorySystem provides a gameplay system which can manage a player's inventory.

A player can have items added via economy rewards, or directly.

type InventoryUpdateAck

type InventoryUpdateAck struct {

	// Update inventory data, if changed.
	Inventory *Inventory `protobuf:"bytes,1,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// contains filtered or unexported fields
}

Response from granting or purchasing items. This contains updated inventory data, if changed.

func (*InventoryUpdateAck) Descriptor deprecated

func (*InventoryUpdateAck) Descriptor() ([]byte, []int)

Deprecated: Use InventoryUpdateAck.ProtoReflect.Descriptor instead.

func (*InventoryUpdateAck) GetInventory

func (x *InventoryUpdateAck) GetInventory() *Inventory

func (*InventoryUpdateAck) ProtoMessage

func (*InventoryUpdateAck) ProtoMessage()

func (*InventoryUpdateAck) ProtoReflect

func (x *InventoryUpdateAck) ProtoReflect() protoreflect.Message

func (*InventoryUpdateAck) Reset

func (x *InventoryUpdateAck) Reset()

func (*InventoryUpdateAck) String

func (x *InventoryUpdateAck) String() string

type InventoryUpdateItemProperties

type InventoryUpdateItemProperties struct {

	// The properties with string values.
	StringProperties map[string]string `` /* 197-byte string literal not displayed */
	// The properties with numeric values.
	NumericProperties map[string]float64 `` /* 202-byte string literal not displayed */
	// contains filtered or unexported fields
}

The typed properties to update in an instanced inventory item.

func (*InventoryUpdateItemProperties) Descriptor deprecated

func (*InventoryUpdateItemProperties) Descriptor() ([]byte, []int)

Deprecated: Use InventoryUpdateItemProperties.ProtoReflect.Descriptor instead.

func (*InventoryUpdateItemProperties) GetNumericProperties

func (x *InventoryUpdateItemProperties) GetNumericProperties() map[string]float64

func (*InventoryUpdateItemProperties) GetStringProperties

func (x *InventoryUpdateItemProperties) GetStringProperties() map[string]string

func (*InventoryUpdateItemProperties) ProtoMessage

func (*InventoryUpdateItemProperties) ProtoMessage()

func (*InventoryUpdateItemProperties) ProtoReflect

func (*InventoryUpdateItemProperties) Reset

func (x *InventoryUpdateItemProperties) Reset()

func (*InventoryUpdateItemProperties) String

type InventoryUpdateItemsRequest

type InventoryUpdateItemsRequest struct {

	// The item updates to action, keyed by item instance ID.
	ItemUpdates map[string]*InventoryUpdateItemProperties `` /* 182-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a request to update properties of instanced items.

func (*InventoryUpdateItemsRequest) Descriptor deprecated

func (*InventoryUpdateItemsRequest) Descriptor() ([]byte, []int)

Deprecated: Use InventoryUpdateItemsRequest.ProtoReflect.Descriptor instead.

func (*InventoryUpdateItemsRequest) GetItemUpdates

func (*InventoryUpdateItemsRequest) ProtoMessage

func (*InventoryUpdateItemsRequest) ProtoMessage()

func (*InventoryUpdateItemsRequest) ProtoReflect

func (*InventoryUpdateItemsRequest) Reset

func (x *InventoryUpdateItemsRequest) Reset()

func (*InventoryUpdateItemsRequest) String

func (x *InventoryUpdateItemsRequest) String() string

type LeaderboardConfig

type LeaderboardConfig struct {

	// The leaderboard id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The leaderboard sort order.
	SortOrder string `protobuf:"bytes,2,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"`
	// The leaderboard operator.
	Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"`
	// The leaderboard reset schedule.
	ResetSchedule string `protobuf:"bytes,4,opt,name=reset_schedule,json=resetSchedule,proto3" json:"reset_schedule,omitempty"`
	// Whether the leaderboard is authoritative or not.
	Authoritative bool `protobuf:"varint,5,opt,name=authoritative,proto3" json:"authoritative,omitempty"`
	// List of regional leaderboards of the leaderboard, if any.
	Regions []string `protobuf:"bytes,6,rep,name=regions,proto3" json:"regions,omitempty"`
	// contains filtered or unexported fields
}

A leaderboard configuration.

func (*LeaderboardConfig) Descriptor deprecated

func (*LeaderboardConfig) Descriptor() ([]byte, []int)

Deprecated: Use LeaderboardConfig.ProtoReflect.Descriptor instead.

func (*LeaderboardConfig) GetAuthoritative

func (x *LeaderboardConfig) GetAuthoritative() bool

func (*LeaderboardConfig) GetId

func (x *LeaderboardConfig) GetId() string

func (*LeaderboardConfig) GetOperator

func (x *LeaderboardConfig) GetOperator() string

func (*LeaderboardConfig) GetRegions

func (x *LeaderboardConfig) GetRegions() []string

func (*LeaderboardConfig) GetResetSchedule

func (x *LeaderboardConfig) GetResetSchedule() string

func (*LeaderboardConfig) GetSortOrder

func (x *LeaderboardConfig) GetSortOrder() string

func (*LeaderboardConfig) ProtoMessage

func (*LeaderboardConfig) ProtoMessage()

func (*LeaderboardConfig) ProtoReflect

func (x *LeaderboardConfig) ProtoReflect() protoreflect.Message

func (*LeaderboardConfig) Reset

func (x *LeaderboardConfig) Reset()

func (*LeaderboardConfig) String

func (x *LeaderboardConfig) String() string

type LeaderboardConfigList

type LeaderboardConfigList struct {

	// The list of leaderboard configurations.
	LeaderboardConfigs []*LeaderboardConfig `protobuf:"bytes,1,rep,name=leaderboard_configs,json=leaderboardConfigs,proto3" json:"leaderboard_configs,omitempty"`
	// contains filtered or unexported fields
}

A list of leaderboard configurations.

func (*LeaderboardConfigList) Descriptor deprecated

func (*LeaderboardConfigList) Descriptor() ([]byte, []int)

Deprecated: Use LeaderboardConfigList.ProtoReflect.Descriptor instead.

func (*LeaderboardConfigList) GetLeaderboardConfigs

func (x *LeaderboardConfigList) GetLeaderboardConfigs() []*LeaderboardConfig

func (*LeaderboardConfigList) ProtoMessage

func (*LeaderboardConfigList) ProtoMessage()

func (*LeaderboardConfigList) ProtoReflect

func (x *LeaderboardConfigList) ProtoReflect() protoreflect.Message

func (*LeaderboardConfigList) Reset

func (x *LeaderboardConfigList) Reset()

func (*LeaderboardConfigList) String

func (x *LeaderboardConfigList) String() string

type LeaderboardsConfig

type LeaderboardsConfig struct {
	Leaderboards []*LeaderboardsConfigLeaderboard `json:"leaderboards,omitempty"`
}

LeaderboardsConfig is the data definition for the LeaderboardsSystem type.

type LeaderboardsConfigLeaderboard

type LeaderboardsConfigLeaderboard struct {
	Id            string   `json:"id,omitempty"`
	SortOrder     string   `json:"sort_order,omitempty"`
	Operator      string   `json:"operator,omitempty"`
	ResetSchedule string   `json:"reset_schedule,omitempty"`
	Authoritative bool     `json:"authoritative,omitempty"`
	Regions       []string `json:"regions,omitempty"`
}

type LeaderboardsSystem

type LeaderboardsSystem interface {
	System
}

The LeaderboardsSystem defines a collection of leaderboards which can be defined as global or regional with Nakama server.

type OnEventLeaderboardCohortSelection added in v1.5.0

type OnEventLeaderboardCohortSelection func(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, eventID string, config *EventLeaderboardsConfigLeaderboard, userID string, tier int) (cohortID string, cohortUserIDs []string, err error)

type OnReward

type OnReward[T any] func(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, source T, rewardConfig *EconomyConfigReward, reward *Reward) (*Reward, error)

OnReward is a function which can be used by each gameplay system to provide an override reward.

type Personalizer

type Personalizer interface {
	// GetValue returns a config which has been modified for a gameplay system,
	// or nil if the config is not being adjusted by this personalizer.
	GetValue(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, system System, identity string) (any, error)
}

The Personalizer describes an intermediate server or service which can be used to personalize the base data definitions defined for the gameplay systems.

type Progression added in v1.3.0

type Progression struct {

	// The ID of the progression.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The name of the progression. May be an i18n code.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// A description of the progression. May be an i18n code.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The category to group the progression together with others.
	Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
	// Current count, if any.
	Counts map[string]int64 `` /* 154-byte string literal not displayed */
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 209-byte string literal not displayed */
	// Flag indicating unlock status.
	Unlocked bool `protobuf:"varint,7,opt,name=unlocked,proto3" json:"unlocked,omitempty"`
	// All preconditions.
	Preconditions *ProgressionPreconditionsBlock `protobuf:"bytes,8,opt,name=preconditions,proto3" json:"preconditions,omitempty"`
	// Unmet preconditions.
	UnmetPreconditions *ProgressionPreconditionsBlock `protobuf:"bytes,9,opt,name=unmet_preconditions,json=unmetPreconditions,proto3" json:"unmet_preconditions,omitempty"`
	// contains filtered or unexported fields
}

A progression element which can be unlocked to access further progressions.

func (*Progression) Descriptor deprecated added in v1.3.0

func (*Progression) Descriptor() ([]byte, []int)

Deprecated: Use Progression.ProtoReflect.Descriptor instead.

func (*Progression) GetAdditionalProperties added in v1.3.0

func (x *Progression) GetAdditionalProperties() map[string]string

func (*Progression) GetCategory added in v1.3.0

func (x *Progression) GetCategory() string

func (*Progression) GetCounts added in v1.4.0

func (x *Progression) GetCounts() map[string]int64

func (*Progression) GetDescription added in v1.3.0

func (x *Progression) GetDescription() string

func (*Progression) GetId added in v1.3.0

func (x *Progression) GetId() string

func (*Progression) GetName added in v1.3.0

func (x *Progression) GetName() string

func (*Progression) GetPreconditions added in v1.3.0

func (x *Progression) GetPreconditions() *ProgressionPreconditionsBlock

func (*Progression) GetUnlocked added in v1.3.0

func (x *Progression) GetUnlocked() bool

func (*Progression) GetUnmetPreconditions added in v1.3.0

func (x *Progression) GetUnmetPreconditions() *ProgressionPreconditionsBlock

func (*Progression) ProtoMessage added in v1.3.0

func (*Progression) ProtoMessage()

func (*Progression) ProtoReflect added in v1.3.0

func (x *Progression) ProtoReflect() protoreflect.Message

func (*Progression) Reset added in v1.3.0

func (x *Progression) Reset()

func (*Progression) String added in v1.3.0

func (x *Progression) String() string

type ProgressionConfig added in v1.3.0

type ProgressionConfig struct {
	Progressions map[string]*ProgressionConfigProgression `json:"progressions,omitempty"`
}

ProgressionConfig is the data definition for a ProgressionSystem type.

type ProgressionConfigProgression added in v1.3.0

type ProgressionConfigProgression struct {
	Name                 string                         `json:"name,omitempty"`
	Description          string                         `json:"description,omitempty"`
	Category             string                         `json:"category,omitempty"`
	AdditionalProperties map[string]string              `json:"additional_properties,omitempty"`
	Preconditions        *ProgressionPreconditionsBlock `json:"preconditions,omitempty"`
	ResetSchedule        string                         `json:"reset_schedule,omitempty"`
}

type ProgressionCost added in v1.3.0

type ProgressionCost struct {

	// The items which will be deducted.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// The currencies which will be deducted.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

The cost(s) associated with permanently unlocking a progression.

func (*ProgressionCost) Descriptor deprecated added in v1.3.0

func (*ProgressionCost) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionCost.ProtoReflect.Descriptor instead.

func (*ProgressionCost) GetCurrencies added in v1.3.0

func (x *ProgressionCost) GetCurrencies() map[string]int64

func (*ProgressionCost) GetItems added in v1.3.0

func (x *ProgressionCost) GetItems() map[string]int64

func (*ProgressionCost) ProtoMessage added in v1.3.0

func (*ProgressionCost) ProtoMessage()

func (*ProgressionCost) ProtoReflect added in v1.3.0

func (x *ProgressionCost) ProtoReflect() protoreflect.Message

func (*ProgressionCost) Reset added in v1.3.0

func (x *ProgressionCost) Reset()

func (*ProgressionCost) String added in v1.3.0

func (x *ProgressionCost) String() string

type ProgressionDelta added in v1.5.0

type ProgressionDelta struct {

	// The ID of the progression.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Potential state change.
	State ProgressionDeltaState `protobuf:"varint,2,opt,name=state,proto3,enum=hiro.ProgressionDeltaState" json:"state,omitempty"`
	// Changes to counts, if any.
	Counts map[string]int64 `` /* 154-byte string literal not displayed */
	// Changes to preconditions, if any.
	Preconditions *ProgressionPreconditionsBlock `protobuf:"bytes,4,opt,name=preconditions,proto3" json:"preconditions,omitempty"`
	// contains filtered or unexported fields
}

A change in a given progression, compared to a previously known state.

func (*ProgressionDelta) Descriptor deprecated added in v1.5.0

func (*ProgressionDelta) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionDelta.ProtoReflect.Descriptor instead.

func (*ProgressionDelta) GetCounts added in v1.5.0

func (x *ProgressionDelta) GetCounts() map[string]int64

func (*ProgressionDelta) GetId added in v1.5.0

func (x *ProgressionDelta) GetId() string

func (*ProgressionDelta) GetPreconditions added in v1.5.0

func (x *ProgressionDelta) GetPreconditions() *ProgressionPreconditionsBlock

func (*ProgressionDelta) GetState added in v1.5.0

func (*ProgressionDelta) ProtoMessage added in v1.5.0

func (*ProgressionDelta) ProtoMessage()

func (*ProgressionDelta) ProtoReflect added in v1.5.0

func (x *ProgressionDelta) ProtoReflect() protoreflect.Message

func (*ProgressionDelta) Reset added in v1.5.0

func (x *ProgressionDelta) Reset()

func (*ProgressionDelta) String added in v1.5.0

func (x *ProgressionDelta) String() string

type ProgressionDeltaState added in v1.5.0

type ProgressionDeltaState int32
const (
	// Unspecified. Defaults to UNCHANGED.
	ProgressionDeltaState_PROGRESSION_DELTA_STATE_UNSPECIFIED ProgressionDeltaState = 0
	// Progression unlock state has not changed.
	ProgressionDeltaState_PROGRESSION_DELTA_STATE_UNCHANGED ProgressionDeltaState = 1
	// Progression was locked, it is now unlocked.
	ProgressionDeltaState_PROGRESSION_DELTA_STATE_UNLOCKED ProgressionDeltaState = 2
	// Progression was unlocked, it is now locked.
	ProgressionDeltaState_PROGRESSION_DELTA_STATE_LOCKED ProgressionDeltaState = 3
)

func (ProgressionDeltaState) Descriptor added in v1.5.0

func (ProgressionDeltaState) Enum added in v1.5.0

func (ProgressionDeltaState) EnumDescriptor deprecated added in v1.5.0

func (ProgressionDeltaState) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProgressionDeltaState.Descriptor instead.

func (ProgressionDeltaState) Number added in v1.5.0

func (ProgressionDeltaState) String added in v1.5.0

func (x ProgressionDeltaState) String() string

func (ProgressionDeltaState) Type added in v1.5.0

type ProgressionGetRequest added in v1.5.0

type ProgressionGetRequest struct {

	// Optional last known progressions state, keyed by progression ID.
	Progressions map[string]*Progression `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

Request progressions for a user, optionally including previously seen state for delta calculations.

func (*ProgressionGetRequest) Descriptor deprecated added in v1.5.0

func (*ProgressionGetRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionGetRequest.ProtoReflect.Descriptor instead.

func (*ProgressionGetRequest) GetProgressions added in v1.5.0

func (x *ProgressionGetRequest) GetProgressions() map[string]*Progression

func (*ProgressionGetRequest) ProtoMessage added in v1.5.0

func (*ProgressionGetRequest) ProtoMessage()

func (*ProgressionGetRequest) ProtoReflect added in v1.5.0

func (x *ProgressionGetRequest) ProtoReflect() protoreflect.Message

func (*ProgressionGetRequest) Reset added in v1.5.0

func (x *ProgressionGetRequest) Reset()

func (*ProgressionGetRequest) String added in v1.5.0

func (x *ProgressionGetRequest) String() string

type ProgressionList added in v1.3.0

type ProgressionList struct {

	// Progressions keyed by progression ID.
	Progressions map[string]*Progression `` /* 165-byte string literal not displayed */
	// Progression deltas keyed by progression ID.
	Deltas map[string]*ProgressionDelta `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

All or a filtered list of progressions for a user.

func (*ProgressionList) Descriptor deprecated added in v1.3.0

func (*ProgressionList) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionList.ProtoReflect.Descriptor instead.

func (*ProgressionList) GetDeltas added in v1.5.0

func (x *ProgressionList) GetDeltas() map[string]*ProgressionDelta

func (*ProgressionList) GetProgressions added in v1.3.0

func (x *ProgressionList) GetProgressions() map[string]*Progression

func (*ProgressionList) ProtoMessage added in v1.3.0

func (*ProgressionList) ProtoMessage()

func (*ProgressionList) ProtoReflect added in v1.3.0

func (x *ProgressionList) ProtoReflect() protoreflect.Message

func (*ProgressionList) Reset added in v1.3.0

func (x *ProgressionList) Reset()

func (*ProgressionList) String added in v1.3.0

func (x *ProgressionList) String() string

type ProgressionPreconditions added in v1.3.0

type ProgressionPreconditions struct {

	// Counts required.
	Counts map[string]int64 `` /* 154-byte string literal not displayed */
	// Purchase cost paid.
	Cost *ProgressionCost `protobuf:"bytes,2,opt,name=cost,proto3" json:"cost,omitempty"`
	// Other progressions.
	Progressions []string `protobuf:"bytes,3,rep,name=progressions,proto3" json:"progressions,omitempty"`
	// Achievements.
	Achievements []string `protobuf:"bytes,4,rep,name=achievements,proto3" json:"achievements,omitempty"`
	// Items with associated minimum counts.
	ItemsMin map[string]int64 `` /* 174-byte string literal not displayed */
	// Items with associated maximum counts.
	ItemsMax map[string]int64 `` /* 174-byte string literal not displayed */
	// Stats with associated minimum values.
	StatsMin map[string]int64 `` /* 174-byte string literal not displayed */
	// Stats with associated maximum values.
	StatsMax map[string]int64 `` /* 174-byte string literal not displayed */
	// Energies with associated minimum counts.
	EnergyMin map[string]int64 `` /* 177-byte string literal not displayed */
	// Energies with associated maximum counts.
	EnergyMax map[string]int64 `` /* 178-byte string literal not displayed */
	// Currencies with associated minimum counts.
	CurrencyMin map[string]int64 `` /* 184-byte string literal not displayed */
	// Currencies with associated maximum counts.
	CurrencyMax map[string]int64 `` /* 184-byte string literal not displayed */
	// contains filtered or unexported fields
}

Preconditions associated with a progression.

func (*ProgressionPreconditions) Descriptor deprecated added in v1.3.0

func (*ProgressionPreconditions) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionPreconditions.ProtoReflect.Descriptor instead.

func (*ProgressionPreconditions) GetAchievements added in v1.3.0

func (x *ProgressionPreconditions) GetAchievements() []string

func (*ProgressionPreconditions) GetCost added in v1.3.0

func (*ProgressionPreconditions) GetCounts added in v1.4.0

func (x *ProgressionPreconditions) GetCounts() map[string]int64

func (*ProgressionPreconditions) GetCurrencyMax added in v1.3.0

func (x *ProgressionPreconditions) GetCurrencyMax() map[string]int64

func (*ProgressionPreconditions) GetCurrencyMin added in v1.3.0

func (x *ProgressionPreconditions) GetCurrencyMin() map[string]int64

func (*ProgressionPreconditions) GetEnergyMax added in v1.3.0

func (x *ProgressionPreconditions) GetEnergyMax() map[string]int64

func (*ProgressionPreconditions) GetEnergyMin added in v1.3.0

func (x *ProgressionPreconditions) GetEnergyMin() map[string]int64

func (*ProgressionPreconditions) GetItemsMax added in v1.3.0

func (x *ProgressionPreconditions) GetItemsMax() map[string]int64

func (*ProgressionPreconditions) GetItemsMin added in v1.3.0

func (x *ProgressionPreconditions) GetItemsMin() map[string]int64

func (*ProgressionPreconditions) GetProgressions added in v1.3.0

func (x *ProgressionPreconditions) GetProgressions() []string

func (*ProgressionPreconditions) GetStatsMax added in v1.3.0

func (x *ProgressionPreconditions) GetStatsMax() map[string]int64

func (*ProgressionPreconditions) GetStatsMin added in v1.3.0

func (x *ProgressionPreconditions) GetStatsMin() map[string]int64

func (*ProgressionPreconditions) ProtoMessage added in v1.3.0

func (*ProgressionPreconditions) ProtoMessage()

func (*ProgressionPreconditions) ProtoReflect added in v1.3.0

func (x *ProgressionPreconditions) ProtoReflect() protoreflect.Message

func (*ProgressionPreconditions) Reset added in v1.3.0

func (x *ProgressionPreconditions) Reset()

func (*ProgressionPreconditions) String added in v1.3.0

func (x *ProgressionPreconditions) String() string

type ProgressionPreconditionsBlock added in v1.3.0

type ProgressionPreconditionsBlock struct {

	// Direct preconditions.
	Direct *ProgressionPreconditions `protobuf:"bytes,1,opt,name=direct,proto3" json:"direct,omitempty"`
	// Operator for any nested block.
	Operator ProgressionPreconditionsOperator `protobuf:"varint,2,opt,name=operator,proto3,enum=hiro.ProgressionPreconditionsOperator" json:"operator,omitempty"`
	// Nested block of preconditions, if any.
	Nested *ProgressionPreconditionsBlock `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"`
	// contains filtered or unexported fields
}

A complex set of progression preconditions.

func (*ProgressionPreconditionsBlock) Descriptor deprecated added in v1.3.0

func (*ProgressionPreconditionsBlock) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionPreconditionsBlock.ProtoReflect.Descriptor instead.

func (*ProgressionPreconditionsBlock) GetDirect added in v1.3.0

func (*ProgressionPreconditionsBlock) GetNested added in v1.3.0

func (*ProgressionPreconditionsBlock) GetOperator added in v1.3.0

func (*ProgressionPreconditionsBlock) ProtoMessage added in v1.3.0

func (*ProgressionPreconditionsBlock) ProtoMessage()

func (*ProgressionPreconditionsBlock) ProtoReflect added in v1.3.0

func (*ProgressionPreconditionsBlock) Reset added in v1.3.0

func (x *ProgressionPreconditionsBlock) Reset()

func (*ProgressionPreconditionsBlock) String added in v1.3.0

type ProgressionPreconditionsOperator added in v1.3.0

type ProgressionPreconditionsOperator int32
const (
	// Unspecified. Defaults to AND.
	ProgressionPreconditionsOperator_PROGRESSION_PRECONDITIONS_OPERATOR_UNSPECIFIED ProgressionPreconditionsOperator = 0
	// Both the direct preconditions and the nested block must be true.
	ProgressionPreconditionsOperator_PROGRESSION_PRECONDITIONS_OPERATOR_AND ProgressionPreconditionsOperator = 1
	// Either the direct preconditions or the nested block must be true.
	ProgressionPreconditionsOperator_PROGRESSION_PRECONDITIONS_OPERATOR_OR ProgressionPreconditionsOperator = 2
	// Either the direct preconditions or the nested block must be true, but not both.
	ProgressionPreconditionsOperator_PROGRESSION_PRECONDITIONS_OPERATOR_XOR ProgressionPreconditionsOperator = 3
	// The direct preconditions must be true, but the nested block must not be.
	ProgressionPreconditionsOperator_PROGRESSION_PRECONDITIONS_OPERATOR_NOT ProgressionPreconditionsOperator = 4
)

func (ProgressionPreconditionsOperator) Descriptor added in v1.3.0

func (ProgressionPreconditionsOperator) Enum added in v1.3.0

func (ProgressionPreconditionsOperator) EnumDescriptor deprecated added in v1.3.0

func (ProgressionPreconditionsOperator) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProgressionPreconditionsOperator.Descriptor instead.

func (ProgressionPreconditionsOperator) Number added in v1.3.0

func (ProgressionPreconditionsOperator) String added in v1.3.0

func (ProgressionPreconditionsOperator) Type added in v1.3.0

type ProgressionPurchaseRequest added in v1.3.0

type ProgressionPurchaseRequest struct {

	// ID of the progression to permanently unlock.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Request to permanently unlock a progression, if supported by that specific progression.

func (*ProgressionPurchaseRequest) Descriptor deprecated added in v1.3.0

func (*ProgressionPurchaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionPurchaseRequest.ProtoReflect.Descriptor instead.

func (*ProgressionPurchaseRequest) GetId added in v1.3.0

func (*ProgressionPurchaseRequest) ProtoMessage added in v1.3.0

func (*ProgressionPurchaseRequest) ProtoMessage()

func (*ProgressionPurchaseRequest) ProtoReflect added in v1.3.0

func (*ProgressionPurchaseRequest) Reset added in v1.3.0

func (x *ProgressionPurchaseRequest) Reset()

func (*ProgressionPurchaseRequest) String added in v1.3.0

func (x *ProgressionPurchaseRequest) String() string

type ProgressionResetRequest added in v1.9.0

type ProgressionResetRequest struct {

	// The progression IDs to reset.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

Request to reset progression progress.

func (*ProgressionResetRequest) Descriptor deprecated added in v1.9.0

func (*ProgressionResetRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionResetRequest.ProtoReflect.Descriptor instead.

func (*ProgressionResetRequest) GetIds added in v1.9.0

func (x *ProgressionResetRequest) GetIds() []string

func (*ProgressionResetRequest) ProtoMessage added in v1.9.0

func (*ProgressionResetRequest) ProtoMessage()

func (*ProgressionResetRequest) ProtoReflect added in v1.9.0

func (x *ProgressionResetRequest) ProtoReflect() protoreflect.Message

func (*ProgressionResetRequest) Reset added in v1.9.0

func (x *ProgressionResetRequest) Reset()

func (*ProgressionResetRequest) String added in v1.9.0

func (x *ProgressionResetRequest) String() string

type ProgressionSystem added in v1.3.0

type ProgressionSystem interface {
	System

	// Get returns all or an optionally-filtered set of progressions for the given user.
	Get(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, lastKnownProgressions map[string]*Progression) (map[string]*Progression, map[string]*ProgressionDelta, error)

	// Purchase permanently unlocks a specified progression, if that progression supports this operation.
	Purchase(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, progressionID string) (map[string]*Progression, error)

	// Update a specified progression, if that progression supports this operation.
	Update(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, progressionID string, counts map[string]int64) (map[string]*Progression, error)

	// Reset one or more progressions to clear their progress. Only applies to progression counts and unlock costs.
	Reset(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, progressionIDs []string) (map[string]*Progression, error)
}

A ProgressionSystem is a gameplay system which represents a sequence of progression steps.

type ProgressionUpdateRequest added in v1.4.0

type ProgressionUpdateRequest struct {

	// ID of the progression to update.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// One or more counts to add to the progression.
	Counts map[string]int64 `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

Request to update a progression, if supported by that specific progression.

func (*ProgressionUpdateRequest) Descriptor deprecated added in v1.4.0

func (*ProgressionUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProgressionUpdateRequest.ProtoReflect.Descriptor instead.

func (*ProgressionUpdateRequest) GetCounts added in v1.4.0

func (x *ProgressionUpdateRequest) GetCounts() map[string]int64

func (*ProgressionUpdateRequest) GetId added in v1.4.0

func (x *ProgressionUpdateRequest) GetId() string

func (*ProgressionUpdateRequest) ProtoMessage added in v1.4.0

func (*ProgressionUpdateRequest) ProtoMessage()

func (*ProgressionUpdateRequest) ProtoReflect added in v1.4.0

func (x *ProgressionUpdateRequest) ProtoReflect() protoreflect.Message

func (*ProgressionUpdateRequest) Reset added in v1.4.0

func (x *ProgressionUpdateRequest) Reset()

func (*ProgressionUpdateRequest) String added in v1.4.0

func (x *ProgressionUpdateRequest) String() string

type RateAppRequest

type RateAppRequest struct {

	// The score given by the user. Above zero values indicate a positive review.
	Score uint32 `protobuf:"varint,1,opt,name=score,proto3" json:"score,omitempty"`
	// The message about the reason for their score. May be blank.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

The input message when the user rates the app.

func (*RateAppRequest) Descriptor deprecated

func (*RateAppRequest) Descriptor() ([]byte, []int)

Deprecated: Use RateAppRequest.ProtoReflect.Descriptor instead.

func (*RateAppRequest) GetMessage

func (x *RateAppRequest) GetMessage() string

func (*RateAppRequest) GetScore

func (x *RateAppRequest) GetScore() uint32

func (*RateAppRequest) ProtoMessage

func (*RateAppRequest) ProtoMessage()

func (*RateAppRequest) ProtoReflect

func (x *RateAppRequest) ProtoReflect() protoreflect.Message

func (*RateAppRequest) Reset

func (x *RateAppRequest) Reset()

func (*RateAppRequest) String

func (x *RateAppRequest) String() string

type Reward

type Reward struct {

	// The items granted. Indexed by item ID.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// The currencies granted.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// The energy granted.
	Energies map[string]int32 `` /* 158-byte string literal not displayed */
	// The energy modifier granted.
	EnergyModifiers []*RewardEnergyModifier `protobuf:"bytes,4,rep,name=energy_modifiers,json=energyModifiers,proto3" json:"energy_modifiers,omitempty"`
	// The reward modifiers granted.
	RewardModifiers []*RewardModifier `protobuf:"bytes,5,rep,name=reward_modifiers,json=rewardModifiers,proto3" json:"reward_modifiers,omitempty"`
	// When the reward was granted, in UNIX time.
	GrantTimeSec int64 `protobuf:"varint,6,opt,name=grant_time_sec,json=grantTimeSec,proto3" json:"grant_time_sec,omitempty"`
	// The item instances granted. Indexed by item instance ID.
	ItemInstances map[string]*RewardInventoryItem `` /* 188-byte string literal not displayed */
	// contains filtered or unexported fields
}

Rewards granted to the player.

func (*Reward) Descriptor deprecated

func (*Reward) Descriptor() ([]byte, []int)

Deprecated: Use Reward.ProtoReflect.Descriptor instead.

func (*Reward) GetCurrencies

func (x *Reward) GetCurrencies() map[string]int64

func (*Reward) GetEnergies

func (x *Reward) GetEnergies() map[string]int32

func (*Reward) GetEnergyModifiers

func (x *Reward) GetEnergyModifiers() []*RewardEnergyModifier

func (*Reward) GetGrantTimeSec

func (x *Reward) GetGrantTimeSec() int64

func (*Reward) GetItemInstances added in v1.10.0

func (x *Reward) GetItemInstances() map[string]*RewardInventoryItem

func (*Reward) GetItems

func (x *Reward) GetItems() map[string]int64

func (*Reward) GetRewardModifiers

func (x *Reward) GetRewardModifiers() []*RewardModifier

func (*Reward) ProtoMessage

func (*Reward) ProtoMessage()

func (*Reward) ProtoReflect

func (x *Reward) ProtoReflect() protoreflect.Message

func (*Reward) Reset

func (x *Reward) Reset()

func (*Reward) String

func (x *Reward) String() string

type RewardEnergyModifier

type RewardEnergyModifier struct {

	// The ID of they modifier granted.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The energy modifier operator.
	Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"`
	// The value to apply. Its behavior depends on the operator.
	Value int64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"`
	// The duration of the energy modifier in seconds.
	DurationSec uint64 `protobuf:"varint,4,opt,name=duration_sec,json=durationSec,proto3" json:"duration_sec,omitempty"`
	// The weight of the energy modifier, if weighted. Otherwise, -1.
	Weight int64 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight,omitempty"`
	// contains filtered or unexported fields
}

Energy modifier granted.

func (*RewardEnergyModifier) Descriptor deprecated

func (*RewardEnergyModifier) Descriptor() ([]byte, []int)

Deprecated: Use RewardEnergyModifier.ProtoReflect.Descriptor instead.

func (*RewardEnergyModifier) GetDurationSec

func (x *RewardEnergyModifier) GetDurationSec() uint64

func (*RewardEnergyModifier) GetId

func (x *RewardEnergyModifier) GetId() string

func (*RewardEnergyModifier) GetOperator

func (x *RewardEnergyModifier) GetOperator() string

func (*RewardEnergyModifier) GetValue

func (x *RewardEnergyModifier) GetValue() int64

func (*RewardEnergyModifier) GetWeight

func (x *RewardEnergyModifier) GetWeight() int64

func (*RewardEnergyModifier) ProtoMessage

func (*RewardEnergyModifier) ProtoMessage()

func (*RewardEnergyModifier) ProtoReflect

func (x *RewardEnergyModifier) ProtoReflect() protoreflect.Message

func (*RewardEnergyModifier) Reset

func (x *RewardEnergyModifier) Reset()

func (*RewardEnergyModifier) String

func (x *RewardEnergyModifier) String() string

type RewardInventoryItem added in v1.10.0

type RewardInventoryItem struct {

	// The ID of the item.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The count granted of the item.
	Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// The properties with string values.
	StringProperties map[string]string `` /* 197-byte string literal not displayed */
	// The properties with numeric values.
	NumericProperties map[string]float64 `` /* 202-byte string literal not displayed */
	// The instance ID of the item.
	InstanceId string `protobuf:"bytes,5,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// contains filtered or unexported fields
}

Inventory item granted.

func (*RewardInventoryItem) Descriptor deprecated added in v1.10.0

func (*RewardInventoryItem) Descriptor() ([]byte, []int)

Deprecated: Use RewardInventoryItem.ProtoReflect.Descriptor instead.

func (*RewardInventoryItem) GetCount added in v1.10.0

func (x *RewardInventoryItem) GetCount() int64

func (*RewardInventoryItem) GetId added in v1.10.0

func (x *RewardInventoryItem) GetId() string

func (*RewardInventoryItem) GetInstanceId added in v1.10.0

func (x *RewardInventoryItem) GetInstanceId() string

func (*RewardInventoryItem) GetNumericProperties added in v1.10.0

func (x *RewardInventoryItem) GetNumericProperties() map[string]float64

func (*RewardInventoryItem) GetStringProperties added in v1.10.0

func (x *RewardInventoryItem) GetStringProperties() map[string]string

func (*RewardInventoryItem) ProtoMessage added in v1.10.0

func (*RewardInventoryItem) ProtoMessage()

func (*RewardInventoryItem) ProtoReflect added in v1.10.0

func (x *RewardInventoryItem) ProtoReflect() protoreflect.Message

func (*RewardInventoryItem) Reset added in v1.10.0

func (x *RewardInventoryItem) Reset()

func (*RewardInventoryItem) String added in v1.10.0

func (x *RewardInventoryItem) String() string

type RewardList

type RewardList struct {

	// The rewards granted.
	Rewards []*Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"`
	// contains filtered or unexported fields
}

A list of rewards granted to the player.

func (*RewardList) Descriptor deprecated

func (*RewardList) Descriptor() ([]byte, []int)

Deprecated: Use RewardList.ProtoReflect.Descriptor instead.

func (*RewardList) GetRewards

func (x *RewardList) GetRewards() []*Reward

func (*RewardList) ProtoMessage

func (*RewardList) ProtoMessage()

func (*RewardList) ProtoReflect

func (x *RewardList) ProtoReflect() protoreflect.Message

func (*RewardList) Reset

func (x *RewardList) Reset()

func (*RewardList) String

func (x *RewardList) String() string

type RewardModifier

type RewardModifier struct {

	// The ID of the reward content to modify.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The type of reward content to modify.
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// The operator to apply.
	Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"`
	// The value to apply. Its behavior depends on the operator.
	Value int64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"`
	// The duration of the item modifier in seconds.
	DurationSec uint64 `protobuf:"varint,5,opt,name=duration_sec,json=durationSec,proto3" json:"duration_sec,omitempty"`
	// contains filtered or unexported fields
}

A reward modifier temporally adjusts the way all rewards are handled in the economy.

func (*RewardModifier) Descriptor deprecated

func (*RewardModifier) Descriptor() ([]byte, []int)

Deprecated: Use RewardModifier.ProtoReflect.Descriptor instead.

func (*RewardModifier) GetDurationSec

func (x *RewardModifier) GetDurationSec() uint64

func (*RewardModifier) GetId

func (x *RewardModifier) GetId() string

func (*RewardModifier) GetOperator

func (x *RewardModifier) GetOperator() string

func (*RewardModifier) GetType

func (x *RewardModifier) GetType() string

func (*RewardModifier) GetValue

func (x *RewardModifier) GetValue() int64

func (*RewardModifier) ProtoMessage

func (*RewardModifier) ProtoMessage()

func (*RewardModifier) ProtoReflect

func (x *RewardModifier) ProtoReflect() protoreflect.Message

func (*RewardModifier) Reset

func (x *RewardModifier) Reset()

func (*RewardModifier) String

func (x *RewardModifier) String() string

type RewardRangeDouble added in v1.10.0

type RewardRangeDouble struct {

	// The minimum bound of the range.
	Min float64 `protobuf:"fixed64,1,opt,name=min,proto3" json:"min,omitempty"`
	// The maximum bound of the range.
	Max float64 `protobuf:"fixed64,2,opt,name=max,proto3" json:"max,omitempty"`
	// A number that the result must be a multiple of.
	Multiple float64 `protobuf:"fixed64,3,opt,name=multiple,proto3" json:"multiple,omitempty"`
	// contains filtered or unexported fields
}

A range of possible values.

func (*RewardRangeDouble) Descriptor deprecated added in v1.10.0

func (*RewardRangeDouble) Descriptor() ([]byte, []int)

Deprecated: Use RewardRangeDouble.ProtoReflect.Descriptor instead.

func (*RewardRangeDouble) GetMax added in v1.10.0

func (x *RewardRangeDouble) GetMax() float64

func (*RewardRangeDouble) GetMin added in v1.10.0

func (x *RewardRangeDouble) GetMin() float64

func (*RewardRangeDouble) GetMultiple added in v1.10.0

func (x *RewardRangeDouble) GetMultiple() float64

func (*RewardRangeDouble) ProtoMessage added in v1.10.0

func (*RewardRangeDouble) ProtoMessage()

func (*RewardRangeDouble) ProtoReflect added in v1.10.0

func (x *RewardRangeDouble) ProtoReflect() protoreflect.Message

func (*RewardRangeDouble) Reset added in v1.10.0

func (x *RewardRangeDouble) Reset()

func (*RewardRangeDouble) String added in v1.10.0

func (x *RewardRangeDouble) String() string

type RewardRangeInt32

type RewardRangeInt32 struct {

	// The minimum bound of the range.
	Min int32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// The maximum bound of the range.
	Max int32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// A number that the result must be a multiple of.
	Multiple int32 `protobuf:"varint,3,opt,name=multiple,proto3" json:"multiple,omitempty"`
	// contains filtered or unexported fields
}

A range of possible values.

func (*RewardRangeInt32) Descriptor deprecated

func (*RewardRangeInt32) Descriptor() ([]byte, []int)

Deprecated: Use RewardRangeInt32.ProtoReflect.Descriptor instead.

func (*RewardRangeInt32) GetMax

func (x *RewardRangeInt32) GetMax() int32

func (*RewardRangeInt32) GetMin

func (x *RewardRangeInt32) GetMin() int32

func (*RewardRangeInt32) GetMultiple

func (x *RewardRangeInt32) GetMultiple() int32

func (*RewardRangeInt32) ProtoMessage

func (*RewardRangeInt32) ProtoMessage()

func (*RewardRangeInt32) ProtoReflect

func (x *RewardRangeInt32) ProtoReflect() protoreflect.Message

func (*RewardRangeInt32) Reset

func (x *RewardRangeInt32) Reset()

func (*RewardRangeInt32) String

func (x *RewardRangeInt32) String() string

type RewardRangeInt64

type RewardRangeInt64 struct {

	// The minimum bound of the range.
	Min int64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// The maximum bound of the range.
	Max int64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// A number that the result must be a multiple of.
	Multiple int64 `protobuf:"varint,3,opt,name=multiple,proto3" json:"multiple,omitempty"`
	// contains filtered or unexported fields
}

A range of possible values.

func (*RewardRangeInt64) Descriptor deprecated

func (*RewardRangeInt64) Descriptor() ([]byte, []int)

Deprecated: Use RewardRangeInt64.ProtoReflect.Descriptor instead.

func (*RewardRangeInt64) GetMax

func (x *RewardRangeInt64) GetMax() int64

func (*RewardRangeInt64) GetMin

func (x *RewardRangeInt64) GetMin() int64

func (*RewardRangeInt64) GetMultiple

func (x *RewardRangeInt64) GetMultiple() int64

func (*RewardRangeInt64) ProtoMessage

func (*RewardRangeInt64) ProtoMessage()

func (*RewardRangeInt64) ProtoReflect

func (x *RewardRangeInt64) ProtoReflect() protoreflect.Message

func (*RewardRangeInt64) Reset

func (x *RewardRangeInt64) Reset()

func (*RewardRangeInt64) String

func (x *RewardRangeInt64) String() string

type RewardRangeUInt64 added in v1.10.0

type RewardRangeUInt64 struct {

	// The minimum bound of the range.
	Min uint64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// The maximum bound of the range.
	Max uint64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// A number that the result must be a multiple of.
	Multiple uint64 `protobuf:"varint,3,opt,name=multiple,proto3" json:"multiple,omitempty"`
	// contains filtered or unexported fields
}

A range of possible values.

func (*RewardRangeUInt64) Descriptor deprecated added in v1.10.0

func (*RewardRangeUInt64) Descriptor() ([]byte, []int)

Deprecated: Use RewardRangeUInt64.ProtoReflect.Descriptor instead.

func (*RewardRangeUInt64) GetMax added in v1.10.0

func (x *RewardRangeUInt64) GetMax() uint64

func (*RewardRangeUInt64) GetMin added in v1.10.0

func (x *RewardRangeUInt64) GetMin() uint64

func (*RewardRangeUInt64) GetMultiple added in v1.10.0

func (x *RewardRangeUInt64) GetMultiple() uint64

func (*RewardRangeUInt64) ProtoMessage added in v1.10.0

func (*RewardRangeUInt64) ProtoMessage()

func (*RewardRangeUInt64) ProtoReflect added in v1.10.0

func (x *RewardRangeUInt64) ProtoReflect() protoreflect.Message

func (*RewardRangeUInt64) Reset added in v1.10.0

func (x *RewardRangeUInt64) Reset()

func (*RewardRangeUInt64) String added in v1.10.0

func (x *RewardRangeUInt64) String() string

type RpcId

type RpcId int32
const (
	RpcId_RPC_ID_UNSPECIFIED RpcId = 0
	// List all inventory items defined in the codex.
	RpcId_RPC_ID_INVENTORY_LIST RpcId = 1
	// List all inventory items owned by the player.
	RpcId_RPC_ID_INVENTORY_LIST_INVENTORY RpcId = 2
	// Consume one or more inventory items owned by the player.
	RpcId_RPC_ID_INVENTORY_CONSUME RpcId = 3
	// Grant one or more inventory items to the player.
	RpcId_RPC_ID_INVENTORY_GRANT RpcId = 4
	// Update the properties on one or more inventory items owned by the player.
	RpcId_RPC_ID_INVENTORY_UPDATE RpcId = 5
	// Claim one or more rewards which are partially or full donated by other players.
	RpcId_RPC_ID_ECONOMY_DONATION_CLAIM RpcId = 6
	// Donate some resource (currencies, items, etc.) to a user by donation ID.
	RpcId_RPC_ID_ECONOMY_DONATION_GIVE RpcId = 7
	// Get progress on one or more donations for a set of players by their IDs.
	RpcId_RPC_ID_ECONOMY_DONATION_GET RpcId = 8
	// Request a donation which other players can contribute into.
	RpcId_RPC_ID_ECONOMY_DONATION_REQUEST RpcId = 9
	// Get all store items defined in the Virtual Store.
	RpcId_RPC_ID_ECONOMY_STORE_GET RpcId = 10
	// Grant one or more currencies or reward modifiers to te player.
	RpcId_RPC_ID_ECONOMY_GRANT RpcId = 11
	// Send a marker of intent to purchase by the player.
	RpcId_RPC_ID_ECONOMY_PURCHASE_INTENT RpcId = 12
	// Purchase a store item by the player.
	RpcId_RPC_ID_ECONOMY_PURCHASE_ITEM RpcId = 13
	// Restore a set of purchases.
	RpcId_RPC_ID_ECONOMY_PURCHASE_RESTORE RpcId = 59
	// Get the current status on an Ad placement which may have been rewarded.
	RpcId_RPC_ID_ECONOMY_PLACEMENT_STATUS RpcId = 14
	// Start a new Ad placement by placement ID.
	RpcId_RPC_ID_ECONOMY_PLACEMENT_START RpcId = 15
	// Claim one or more achievements which have completed their progress.
	RpcId_RPC_ID_ACHIEVEMENTS_CLAIM RpcId = 16
	// Get all achievements with progress accumulated by the player.
	RpcId_RPC_ID_ACHIEVEMENTS_GET RpcId = 17
	// Update one or more achievements with the same progress amount.
	RpcId_RPC_ID_ACHIEVEMENTS_UPDATE RpcId = 18
	// Get the energies and their current timers for the player.
	RpcId_RPC_ID_ENERGY_GET RpcId = 19
	// Spend one or more energies for the player.
	RpcId_RPC_ID_ENERGY_SPEND RpcId = 20
	// Get the tutorials and current progress step for the player.
	RpcId_RPC_ID_TUTORIALS_GET RpcId = 21
	// Accept an offer to step through a tutorial.
	RpcId_RPC_ID_TUTORIALS_ACCEPT RpcId = 22
	// Decline an offer to start a tutorial.
	RpcId_RPC_ID_TUTORIALS_DECLINE RpcId = 23
	// Abandon progress on a tutorial.
	RpcId_RPC_ID_TUTORIALS_ABANDON RpcId = 24
	// Update the current progress step in the tutorial by ID.
	RpcId_RPC_ID_TUTORIALS_UPDATE RpcId = 25
	// Create a team which other players can join.
	RpcId_RPC_ID_TEAMS_CREATE RpcId = 26
	// List one or more teams which the player can join.
	RpcId_RPC_ID_TEAMS_LIST RpcId = 27
	// Search for a team by name or optional short code.
	RpcId_RPC_ID_TEAMS_SEARCH RpcId = 28
	// Write a chat message to the Team's chat channel.
	RpcId_RPC_ID_TEAMS_WRITE_CHAT_MESSAGE RpcId = 29
	// Create a random unlockable to assign to a slot (or overflow) unless there are no slots.
	RpcId_RPC_ID_UNLOCKABLES_CREATE RpcId = 30
	// Get the unlockables which are currently in progress for the player.
	RpcId_RPC_ID_UNLOCKABLES_GET RpcId = 31
	// Start the unlock timer for an unlockable in the specified slot.
	RpcId_RPC_ID_UNLOCKABLES_UNLOCK_START RpcId = 32
	// Purchase an unlockable with soft currency based on the remainder cost calculated by the offset left to wait.
	RpcId_RPC_ID_UNLOCKABLES_PURCHASE_UNLOCK RpcId = 33
	// Purchase a new slot to be used to store unlockables.
	RpcId_RPC_ID_UNLOCKABLES_PURCHASE_SLOT RpcId = 34
	// Claim an unlockable whose start timer has completed or completion was fast tracked with a purchase.
	RpcId_RPC_ID_UNLOCKABLES_CLAIM RpcId = 35
	// Send feedback to the game's developers over email.
	RpcId_RPC_ID_BASE_RATE_APP RpcId = 36
	// Update or create the mobile push device tokens and preferences for the player.
	RpcId_RPC_ID_BASE_SET_DEVICE_PREFS RpcId = 37
	// Sync offline state.
	RpcId_RPC_ID_BASE_SYNC RpcId = 58
	// Get the leaderboards defined for the game.
	RpcId_RPC_ID_LEADERBOARDS_CONFIG_GET RpcId = 38
	// Get a specified event leaderboard defined for the game.
	RpcId_RPC_ID_EVENT_LEADERBOARD_GET RpcId = 42
	// Update an event leaderboard record for a user.
	RpcId_RPC_ID_EVENT_LEADERBOARD_UPDATE RpcId = 43
	// Claim an event leaderboard reward for a user.
	RpcId_RPC_ID_EVENT_LEADERBOARD_CLAIM RpcId = 44
	// Roll a new cohort for the specified event leaderboard.
	RpcId_RPC_ID_EVENT_LEADERBOARD_ROLL RpcId = 45
	// Get all stats.
	RpcId_RPC_ID_STATS_GET RpcId = 46
	// Update private stats.
	RpcId_RPC_ID_STATS_UPDATE RpcId = 47
	// Get progressions.
	RpcId_RPC_ID_PROGRESSIONS_GET RpcId = 48
	// Purchase a progression for permanent unlock, if supported.
	RpcId_RPC_ID_PROGRESSIONS_PURCHASE RpcId = 49
	// Update a progression to change its count, if supported.
	RpcId_RPC_ID_PROGRESSIONS_UPDATE RpcId = 50
	// List incentives set up by the user.
	RpcId_RPC_ID_INCENTIVES_SENDER_LIST RpcId = 51
	// Create a new incentive set up by the user.
	RpcId_RPC_ID_INCENTIVES_SENDER_CREATE RpcId = 52
	// Delete an existing incentive set up by the user.
	RpcId_RPC_ID_INCENTIVES_SENDER_DELETE RpcId = 53
	// Claim rewards for an existing incentive after it has been used by some recipient(s).
	RpcId_RPC_ID_INCENTIVES_SENDER_CLAIM RpcId = 54
	// Get information about an existing incentive from a recipient's perspective.
	RpcId_RPC_ID_INCENTIVES_RECIPIENT_GET RpcId = 55
	// Claim an existing incentive and receive associated rewards.
	RpcId_RPC_ID_INCENTIVES_RECIPIENT_CLAIM RpcId = 56
	// Reset progression progress.
	RpcId_RPC_ID_PROGRESSIONS_RESET RpcId = 57
	// Webhook RPC to handle Rewarded Video Ad placement success callbacks.
	RpcId_RPC_ID_ECONOMY_PLACEMENT_SUCCESS RpcId = 1001
	// Webhook RPC to handle Rewarded Video Ad placement failure callbacks.
	RpcId_RPC_ID_ECONOMY_PLACEMENT_FAIL RpcId = 1002
	// RPC to upload Hiro system configurations for the storage personalizer.
	RpcId_RPC_ID_STORAGE_PERSONALIZER_UPLOAD RpcId = 1003
)

func (RpcId) Descriptor

func (RpcId) Descriptor() protoreflect.EnumDescriptor

func (RpcId) Enum

func (x RpcId) Enum() *RpcId

func (RpcId) EnumDescriptor deprecated

func (RpcId) EnumDescriptor() ([]byte, []int)

Deprecated: Use RpcId.Descriptor instead.

func (RpcId) Number

func (x RpcId) Number() protoreflect.EnumNumber

func (RpcId) String

func (x RpcId) String() string

func (RpcId) Type

func (RpcId) Type() protoreflect.EnumType

type SatoriPersonalizer

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

func NewSatoriPersonalizer added in v1.8.0

func NewSatoriPersonalizer(opts ...SatoriPersonalizerOption) *SatoriPersonalizer

func (*SatoriPersonalizer) GetValue

func (p *SatoriPersonalizer) GetValue(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, system System, userID string) (any, error)

func (*SatoriPersonalizer) IsPublishAchievementsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishAchievementsEvents() bool

func (*SatoriPersonalizer) IsPublishAuthenticateRequest added in v1.8.0

func (p *SatoriPersonalizer) IsPublishAuthenticateRequest() bool

func (*SatoriPersonalizer) IsPublishBaseEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishBaseEvents() bool

func (*SatoriPersonalizer) IsPublishEconomyEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishEconomyEvents() bool

func (*SatoriPersonalizer) IsPublishEnergyEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishEnergyEvents() bool

func (*SatoriPersonalizer) IsPublishEventLeaderboardsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishEventLeaderboardsEvents() bool

func (*SatoriPersonalizer) IsPublishIncentivesEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishIncentivesEvents() bool

func (*SatoriPersonalizer) IsPublishInventoryEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishInventoryEvents() bool

func (*SatoriPersonalizer) IsPublishLeaderboardsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishLeaderboardsEvents() bool

func (*SatoriPersonalizer) IsPublishProgressionEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishProgressionEvents() bool

func (*SatoriPersonalizer) IsPublishStatsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishStatsEvents() bool

func (*SatoriPersonalizer) IsPublishTeamsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishTeamsEvents() bool

func (*SatoriPersonalizer) IsPublishTutorialsEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishTutorialsEvents() bool

func (*SatoriPersonalizer) IsPublishUnlockablesEvents added in v1.9.0

func (p *SatoriPersonalizer) IsPublishUnlockablesEvents() bool

type SatoriPersonalizerOption added in v1.9.0

type SatoriPersonalizerOption interface {
	// contains filtered or unexported methods
}

func SatoriPersonalizerPublishAchievementsEvents added in v1.9.0

func SatoriPersonalizerPublishAchievementsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishAuthenticateEvents added in v1.9.0

func SatoriPersonalizerPublishAuthenticateEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishBaseEvents added in v1.9.0

func SatoriPersonalizerPublishBaseEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishEconomyEvents added in v1.9.0

func SatoriPersonalizerPublishEconomyEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishEnergyEvents added in v1.9.0

func SatoriPersonalizerPublishEnergyEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishEventLeaderboardsEvents added in v1.9.0

func SatoriPersonalizerPublishEventLeaderboardsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishIncentivesEvents added in v1.9.0

func SatoriPersonalizerPublishIncentivesEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishInventoryEvents added in v1.9.0

func SatoriPersonalizerPublishInventoryEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishLeaderboardsEvents added in v1.9.0

func SatoriPersonalizerPublishLeaderboardsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishProgressionEvents added in v1.9.0

func SatoriPersonalizerPublishProgressionEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishStatsEvents added in v1.9.0

func SatoriPersonalizerPublishStatsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishTeamsEvents added in v1.9.0

func SatoriPersonalizerPublishTeamsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishTutorialsEvents added in v1.9.0

func SatoriPersonalizerPublishTutorialsEvents() SatoriPersonalizerOption

func SatoriPersonalizerPublishUnlockablesEvents added in v1.9.0

func SatoriPersonalizerPublishUnlockablesEvents() SatoriPersonalizerOption

type Stat added in v1.2.0

type Stat struct {

	// Name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Indicator if this belongs to public or private stats.
	Public bool `protobuf:"varint,2,opt,name=public,proto3" json:"public,omitempty"`
	// Update time in UTC seconds.
	UpdateTimeSec int64 `protobuf:"varint,3,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Current value.
	Value int64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"`
	// Number of values submitted.
	Count int64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"`
	// Total of all submitted values.
	Total int64 `protobuf:"varint,6,opt,name=total,proto3" json:"total,omitempty"`
	// Smallest value submitted.
	Min int64 `protobuf:"varint,7,opt,name=min,proto3" json:"min,omitempty"`
	// Largest value submitted.
	Max int64 `protobuf:"varint,8,opt,name=max,proto3" json:"max,omitempty"`
	// First value submitted.
	First int64 `protobuf:"varint,9,opt,name=first,proto3" json:"first,omitempty"`
	// Latest value submitted.
	Last int64 `protobuf:"varint,10,opt,name=last,proto3" json:"last,omitempty"`
	// contains filtered or unexported fields
}

A single stat with associated information.

func (*Stat) Descriptor deprecated added in v1.2.0

func (*Stat) Descriptor() ([]byte, []int)

Deprecated: Use Stat.ProtoReflect.Descriptor instead.

func (*Stat) GetCount added in v1.2.0

func (x *Stat) GetCount() int64

func (*Stat) GetFirst added in v1.2.0

func (x *Stat) GetFirst() int64

func (*Stat) GetLast added in v1.2.0

func (x *Stat) GetLast() int64

func (*Stat) GetMax added in v1.2.0

func (x *Stat) GetMax() int64

func (*Stat) GetMin added in v1.2.0

func (x *Stat) GetMin() int64

func (*Stat) GetName added in v1.2.0

func (x *Stat) GetName() string

func (*Stat) GetPublic added in v1.2.0

func (x *Stat) GetPublic() bool

func (*Stat) GetTotal added in v1.2.0

func (x *Stat) GetTotal() int64

func (*Stat) GetUpdateTimeSec added in v1.2.0

func (x *Stat) GetUpdateTimeSec() int64

func (*Stat) GetValue added in v1.2.0

func (x *Stat) GetValue() int64

func (*Stat) ProtoMessage added in v1.2.0

func (*Stat) ProtoMessage()

func (*Stat) ProtoReflect added in v1.2.0

func (x *Stat) ProtoReflect() protoreflect.Message

func (*Stat) Reset added in v1.2.0

func (x *Stat) Reset()

func (*Stat) String added in v1.2.0

func (x *Stat) String() string

type StatList added in v1.2.0

type StatList struct {

	// Public stat names and their associated data.
	Public map[string]*Stat `` /* 153-byte string literal not displayed */
	// Private stat names and their associated data.
	Private map[string]*Stat `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

A list of stats all belonging to one user.

func (*StatList) Descriptor deprecated added in v1.2.0

func (*StatList) Descriptor() ([]byte, []int)

Deprecated: Use StatList.ProtoReflect.Descriptor instead.

func (*StatList) GetPrivate added in v1.2.0

func (x *StatList) GetPrivate() map[string]*Stat

func (*StatList) GetPublic added in v1.2.0

func (x *StatList) GetPublic() map[string]*Stat

func (*StatList) ProtoMessage added in v1.2.0

func (*StatList) ProtoMessage()

func (*StatList) ProtoReflect added in v1.2.0

func (x *StatList) ProtoReflect() protoreflect.Message

func (*StatList) Reset added in v1.2.0

func (x *StatList) Reset()

func (*StatList) String added in v1.2.0

func (x *StatList) String() string

type StatUpdate added in v1.2.0

type StatUpdate struct {

	// Name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Value.
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// Operator.
	Operator StatUpdateOperator `protobuf:"varint,3,opt,name=operator,proto3,enum=hiro.StatUpdateOperator" json:"operator,omitempty"`
	// contains filtered or unexported fields
}

Describes a single stat update.

func (*StatUpdate) Descriptor deprecated added in v1.2.0

func (*StatUpdate) Descriptor() ([]byte, []int)

Deprecated: Use StatUpdate.ProtoReflect.Descriptor instead.

func (*StatUpdate) GetName added in v1.2.0

func (x *StatUpdate) GetName() string

func (*StatUpdate) GetOperator added in v1.2.0

func (x *StatUpdate) GetOperator() StatUpdateOperator

func (*StatUpdate) GetValue added in v1.2.0

func (x *StatUpdate) GetValue() int64

func (*StatUpdate) ProtoMessage added in v1.2.0

func (*StatUpdate) ProtoMessage()

func (*StatUpdate) ProtoReflect added in v1.2.0

func (x *StatUpdate) ProtoReflect() protoreflect.Message

func (*StatUpdate) Reset added in v1.2.0

func (x *StatUpdate) Reset()

func (*StatUpdate) String added in v1.2.0

func (x *StatUpdate) String() string

type StatUpdateOperator added in v1.2.0

type StatUpdateOperator int32

Indicate how a stats update should be handled.

const (
	// Unspecified. Defaults to Set.
	StatUpdateOperator_STAT_UPDATE_OPERATOR_UNSPECIFIED StatUpdateOperator = 0
	// Set the given value, overwriting any previous one.
	StatUpdateOperator_STAT_UPDATE_OPERATOR_SET StatUpdateOperator = 1
	// Increment or decrement the existing value by the given amount. Equivalent to Set if no previous value existed.
	StatUpdateOperator_STAT_UPDATE_OPERATOR_DELTA StatUpdateOperator = 2
	// Use the new value if it's lower than the existing one. Equivalent to Set if no previous value existed.
	StatUpdateOperator_STAT_UPDATE_OPERATOR_MIN StatUpdateOperator = 3
	// Use the new value if it's higher than the existing one. Equivalent to Set if no previous value existed.
	StatUpdateOperator_STAT_UPDATE_OPERATOR_MAX StatUpdateOperator = 4
)

func (StatUpdateOperator) Descriptor added in v1.2.0

func (StatUpdateOperator) Enum added in v1.2.0

func (StatUpdateOperator) EnumDescriptor deprecated added in v1.2.0

func (StatUpdateOperator) EnumDescriptor() ([]byte, []int)

Deprecated: Use StatUpdateOperator.Descriptor instead.

func (StatUpdateOperator) Number added in v1.2.0

func (StatUpdateOperator) String added in v1.2.0

func (x StatUpdateOperator) String() string

func (StatUpdateOperator) Type added in v1.2.0

type StatUpdateRequest added in v1.2.0

type StatUpdateRequest struct {

	// Public stat updates.
	Public []*StatUpdate `protobuf:"bytes,1,rep,name=public,proto3" json:"public,omitempty"`
	// Private stat updates.
	Private []*StatUpdate `protobuf:"bytes,2,rep,name=private,proto3" json:"private,omitempty"`
	// contains filtered or unexported fields
}

Request an optionally batched stats update.

func (*StatUpdateRequest) Descriptor deprecated added in v1.2.0

func (*StatUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use StatUpdateRequest.ProtoReflect.Descriptor instead.

func (*StatUpdateRequest) GetPrivate added in v1.2.0

func (x *StatUpdateRequest) GetPrivate() []*StatUpdate

func (*StatUpdateRequest) GetPublic added in v1.2.0

func (x *StatUpdateRequest) GetPublic() []*StatUpdate

func (*StatUpdateRequest) ProtoMessage added in v1.2.0

func (*StatUpdateRequest) ProtoMessage()

func (*StatUpdateRequest) ProtoReflect added in v1.2.0

func (x *StatUpdateRequest) ProtoReflect() protoreflect.Message

func (*StatUpdateRequest) Reset added in v1.2.0

func (x *StatUpdateRequest) Reset()

func (*StatUpdateRequest) String added in v1.2.0

func (x *StatUpdateRequest) String() string

type StatsConfig added in v1.2.0

type StatsConfig struct {
	Whitelist []string `json:"whitelist,omitempty"`
}

StatsConfig is the data definition for a StatsSystem type.

type StatsSystem

type StatsSystem interface {
	System

	// List all private stats for one or more users.
	List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userIDs []string) (map[string]*StatList, error)

	// Update private stats for a particular user.
	Update(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, publicStats []*StatUpdate, privateStats []*StatUpdate) (*StatList, error)
}

type StoragePersonalizer added in v1.8.0

type StoragePersonalizer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStoragePersonalizer added in v1.8.0

func NewStoragePersonalizer(logger runtime.Logger, cacheExpirySec int, collection string, initializer runtime.Initializer, register bool) *StoragePersonalizer

func NewStoragePersonalizerDefault added in v1.8.0

func NewStoragePersonalizerDefault(logger runtime.Logger, initializer runtime.Initializer, register bool) *StoragePersonalizer

func (*StoragePersonalizer) GetValue added in v1.8.0

func (p *StoragePersonalizer) GetValue(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, system System, userID string) (any, error)

type StoragePersonalizerCachedStorageObject added in v1.8.0

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

type SubAchievement

type SubAchievement struct {

	// The category to group the sub-achievement together with others.
	Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"`
	// The UNIX timestamp for when the sub-achievement reward was claimed, or zero if unclaimed.
	ClaimTimeSec int64 `protobuf:"varint,2,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// The count of the sub-achievement.
	Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// The UNIX timestamp for the current server time.
	CurrentTimeSec int64 `protobuf:"varint,4,opt,name=current_time_sec,json=currentTimeSec,proto3" json:"current_time_sec,omitempty"`
	// A description of the sub-achievement. May be an i18n code.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// The UNIX timestamp when this sub-achievement will expire. This may be before its next reset. A zero means it does not expire.
	ExpireTimeSec int64 `protobuf:"varint,6,opt,name=expire_time_sec,json=expireTimeSec,proto3" json:"expire_time_sec,omitempty"`
	// The ID of the sub-achievement.
	Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"`
	// The maximum count of the sub-achievement.
	MaxCount int64 `protobuf:"varint,8,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// The name of the sub-achievement. May be an i18n code.
	Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"`
	// The IDs which are a precondition on the progress to be made on this sub-achievement.
	PreconditionIds []string `protobuf:"bytes,10,rep,name=precondition_ids,json=preconditionIds,proto3" json:"precondition_ids,omitempty"`
	// The UNIX timestamp when this sub-achievement will reset.
	ResetTimeSec int64 `protobuf:"varint,11,opt,name=reset_time_sec,json=resetTimeSec,proto3" json:"reset_time_sec,omitempty"`
	// The outcome (rolled) reward for the achievement, if any.
	Reward *Reward `protobuf:"bytes,12,opt,name=reward,proto3" json:"reward,omitempty"`
	// The available reward and its probabilities.
	AvailableRewards *AvailableRewards `protobuf:"bytes,13,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// contains filtered or unexported fields
}

A sub-achievement is an achievement which belongs as part of a parent achievement.

func (*SubAchievement) Descriptor deprecated

func (*SubAchievement) Descriptor() ([]byte, []int)

Deprecated: Use SubAchievement.ProtoReflect.Descriptor instead.

func (*SubAchievement) GetAdditionalProperties

func (x *SubAchievement) GetAdditionalProperties() map[string]string

func (*SubAchievement) GetAvailableRewards

func (x *SubAchievement) GetAvailableRewards() *AvailableRewards

func (*SubAchievement) GetCategory

func (x *SubAchievement) GetCategory() string

func (*SubAchievement) GetClaimTimeSec

func (x *SubAchievement) GetClaimTimeSec() int64

func (*SubAchievement) GetCount

func (x *SubAchievement) GetCount() int64

func (*SubAchievement) GetCurrentTimeSec

func (x *SubAchievement) GetCurrentTimeSec() int64

func (*SubAchievement) GetDescription

func (x *SubAchievement) GetDescription() string

func (*SubAchievement) GetExpireTimeSec

func (x *SubAchievement) GetExpireTimeSec() int64

func (*SubAchievement) GetId

func (x *SubAchievement) GetId() string

func (*SubAchievement) GetMaxCount

func (x *SubAchievement) GetMaxCount() int64

func (*SubAchievement) GetName

func (x *SubAchievement) GetName() string

func (*SubAchievement) GetPreconditionIds

func (x *SubAchievement) GetPreconditionIds() []string

func (*SubAchievement) GetResetTimeSec

func (x *SubAchievement) GetResetTimeSec() int64

func (*SubAchievement) GetReward

func (x *SubAchievement) GetReward() *Reward

func (*SubAchievement) ProtoMessage

func (*SubAchievement) ProtoMessage()

func (*SubAchievement) ProtoReflect

func (x *SubAchievement) ProtoReflect() protoreflect.Message

func (*SubAchievement) Reset

func (x *SubAchievement) Reset()

func (*SubAchievement) String

func (x *SubAchievement) String() string

type SyncAchievements added in v1.10.0

type SyncAchievements struct {

	// Achievement updates and associated metadata.
	Achievements map[string]*SyncAchievementsUpdate `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync operation for the achievements system.

func (*SyncAchievements) Descriptor deprecated added in v1.10.0

func (*SyncAchievements) Descriptor() ([]byte, []int)

Deprecated: Use SyncAchievements.ProtoReflect.Descriptor instead.

func (*SyncAchievements) GetAchievements added in v1.10.0

func (x *SyncAchievements) GetAchievements() map[string]*SyncAchievementsUpdate

func (*SyncAchievements) ProtoMessage added in v1.10.0

func (*SyncAchievements) ProtoMessage()

func (*SyncAchievements) ProtoReflect added in v1.10.0

func (x *SyncAchievements) ProtoReflect() protoreflect.Message

func (*SyncAchievements) Reset added in v1.10.0

func (x *SyncAchievements) Reset()

func (*SyncAchievements) String added in v1.10.0

func (x *SyncAchievements) String() string

type SyncAchievementsUpdate added in v1.10.0

type SyncAchievementsUpdate struct {

	// Count to add.
	Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// Time when the achievement first recorded progress.
	CreateTimeSec int64 `protobuf:"varint,2,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Time when the achievement update was generated on the client.
	UpdateTimeSec int64 `protobuf:"varint,3,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Claim time, if claimed offline.
	ClaimTimeSec int64 `protobuf:"varint,4,opt,name=claim_time_sec,json=claimTimeSec,proto3" json:"claim_time_sec,omitempty"`
	// Total claim time, if claimed offline.
	TotalClaimTimeSec int64 `protobuf:"varint,5,opt,name=total_claim_time_sec,json=totalClaimTimeSec,proto3" json:"total_claim_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Sync operation for a single achievement.

func (*SyncAchievementsUpdate) Descriptor deprecated added in v1.10.0

func (*SyncAchievementsUpdate) Descriptor() ([]byte, []int)

Deprecated: Use SyncAchievementsUpdate.ProtoReflect.Descriptor instead.

func (*SyncAchievementsUpdate) GetClaimTimeSec added in v1.10.0

func (x *SyncAchievementsUpdate) GetClaimTimeSec() int64

func (*SyncAchievementsUpdate) GetCount added in v1.10.0

func (x *SyncAchievementsUpdate) GetCount() int64

func (*SyncAchievementsUpdate) GetCreateTimeSec added in v1.10.0

func (x *SyncAchievementsUpdate) GetCreateTimeSec() int64

func (*SyncAchievementsUpdate) GetTotalClaimTimeSec added in v1.10.0

func (x *SyncAchievementsUpdate) GetTotalClaimTimeSec() int64

func (*SyncAchievementsUpdate) GetUpdateTimeSec added in v1.10.0

func (x *SyncAchievementsUpdate) GetUpdateTimeSec() int64

func (*SyncAchievementsUpdate) ProtoMessage added in v1.10.0

func (*SyncAchievementsUpdate) ProtoMessage()

func (*SyncAchievementsUpdate) ProtoReflect added in v1.10.0

func (x *SyncAchievementsUpdate) ProtoReflect() protoreflect.Message

func (*SyncAchievementsUpdate) Reset added in v1.10.0

func (x *SyncAchievementsUpdate) Reset()

func (*SyncAchievementsUpdate) String added in v1.10.0

func (x *SyncAchievementsUpdate) String() string

type SyncEconomy added in v1.10.0

type SyncEconomy struct {

	// Currencies deltas.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// Economy modifiers to add.
	Modifiers []*SyncEconomyModifier `protobuf:"bytes,2,rep,name=modifiers,proto3" json:"modifiers,omitempty"`
	// contains filtered or unexported fields
}

Input for an offline state sync operation for the economy system.

func (*SyncEconomy) Descriptor deprecated added in v1.10.0

func (*SyncEconomy) Descriptor() ([]byte, []int)

Deprecated: Use SyncEconomy.ProtoReflect.Descriptor instead.

func (*SyncEconomy) GetCurrencies added in v1.10.0

func (x *SyncEconomy) GetCurrencies() map[string]int64

func (*SyncEconomy) GetModifiers added in v1.10.0

func (x *SyncEconomy) GetModifiers() []*SyncEconomyModifier

func (*SyncEconomy) ProtoMessage added in v1.10.0

func (*SyncEconomy) ProtoMessage()

func (*SyncEconomy) ProtoReflect added in v1.10.0

func (x *SyncEconomy) ProtoReflect() protoreflect.Message

func (*SyncEconomy) Reset added in v1.10.0

func (x *SyncEconomy) Reset()

func (*SyncEconomy) String added in v1.10.0

func (x *SyncEconomy) String() string

type SyncEconomyModifier added in v1.10.0

type SyncEconomyModifier struct {

	// The full reward modifier to apply.
	Modifier *RewardModifier `protobuf:"bytes,1,opt,name=modifier,proto3" json:"modifier,omitempty"`
	// Time when this applied from.
	CreateTimeSec int64 `protobuf:"varint,2,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Single economy reward modifier data.

func (*SyncEconomyModifier) Descriptor deprecated added in v1.10.0

func (*SyncEconomyModifier) Descriptor() ([]byte, []int)

Deprecated: Use SyncEconomyModifier.ProtoReflect.Descriptor instead.

func (*SyncEconomyModifier) GetCreateTimeSec added in v1.10.0

func (x *SyncEconomyModifier) GetCreateTimeSec() int64

func (*SyncEconomyModifier) GetModifier added in v1.10.0

func (x *SyncEconomyModifier) GetModifier() *RewardModifier

func (*SyncEconomyModifier) ProtoMessage added in v1.10.0

func (*SyncEconomyModifier) ProtoMessage()

func (*SyncEconomyModifier) ProtoReflect added in v1.10.0

func (x *SyncEconomyModifier) ProtoReflect() protoreflect.Message

func (*SyncEconomyModifier) Reset added in v1.10.0

func (x *SyncEconomyModifier) Reset()

func (*SyncEconomyModifier) String added in v1.10.0

func (x *SyncEconomyModifier) String() string

type SyncEnergy added in v1.10.0

type SyncEnergy struct {

	// Energies and associated full sync data.
	Energies map[string]*SyncEnergyState `` /* 157-byte string literal not displayed */
	// Energy modifiers to add.
	Modifiers []*EnergyModifier `protobuf:"bytes,2,rep,name=modifiers,proto3" json:"modifiers,omitempty"`
	// contains filtered or unexported fields
}

Input for an offline state sync operation for the energy system.

func (*SyncEnergy) Descriptor deprecated added in v1.10.0

func (*SyncEnergy) Descriptor() ([]byte, []int)

Deprecated: Use SyncEnergy.ProtoReflect.Descriptor instead.

func (*SyncEnergy) GetEnergies added in v1.10.0

func (x *SyncEnergy) GetEnergies() map[string]*SyncEnergyState

func (*SyncEnergy) GetModifiers added in v1.10.0

func (x *SyncEnergy) GetModifiers() []*EnergyModifier

func (*SyncEnergy) ProtoMessage added in v1.10.0

func (*SyncEnergy) ProtoMessage()

func (*SyncEnergy) ProtoReflect added in v1.10.0

func (x *SyncEnergy) ProtoReflect() protoreflect.Message

func (*SyncEnergy) Reset added in v1.10.0

func (x *SyncEnergy) Reset()

func (*SyncEnergy) String added in v1.10.0

func (x *SyncEnergy) String() string

type SyncEnergyState added in v1.10.0

type SyncEnergyState struct {

	// Current count.
	Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// Last spend time.
	LastSpendTimeSec int64 `protobuf:"varint,2,opt,name=last_spend_time_sec,json=lastSpendTimeSec,proto3" json:"last_spend_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Full state (not delta) for an energy.

func (*SyncEnergyState) Descriptor deprecated added in v1.10.0

func (*SyncEnergyState) Descriptor() ([]byte, []int)

Deprecated: Use SyncEnergyState.ProtoReflect.Descriptor instead.

func (*SyncEnergyState) GetCount added in v1.10.0

func (x *SyncEnergyState) GetCount() int64

func (*SyncEnergyState) GetLastSpendTimeSec added in v1.10.0

func (x *SyncEnergyState) GetLastSpendTimeSec() int64

func (*SyncEnergyState) ProtoMessage added in v1.10.0

func (*SyncEnergyState) ProtoMessage()

func (*SyncEnergyState) ProtoReflect added in v1.10.0

func (x *SyncEnergyState) ProtoReflect() protoreflect.Message

func (*SyncEnergyState) Reset added in v1.10.0

func (x *SyncEnergyState) Reset()

func (*SyncEnergyState) String added in v1.10.0

func (x *SyncEnergyState) String() string

type SyncEventLeaderboardUpdate added in v1.10.0

type SyncEventLeaderboardUpdate struct {

	// Score.
	Score int64 `protobuf:"varint,1,opt,name=score,proto3" json:"score,omitempty"`
	// Subscore.
	Subscore int64 `protobuf:"varint,2,opt,name=subscore,proto3" json:"subscore,omitempty"`
	// Time when the score was generated on the client.
	UpdateTimeSec int64 `protobuf:"varint,3,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Single event leaderboard update.

func (*SyncEventLeaderboardUpdate) Descriptor deprecated added in v1.10.0

func (*SyncEventLeaderboardUpdate) Descriptor() ([]byte, []int)

Deprecated: Use SyncEventLeaderboardUpdate.ProtoReflect.Descriptor instead.

func (*SyncEventLeaderboardUpdate) GetScore added in v1.10.0

func (x *SyncEventLeaderboardUpdate) GetScore() int64

func (*SyncEventLeaderboardUpdate) GetSubscore added in v1.10.0

func (x *SyncEventLeaderboardUpdate) GetSubscore() int64

func (*SyncEventLeaderboardUpdate) GetUpdateTimeSec added in v1.10.0

func (x *SyncEventLeaderboardUpdate) GetUpdateTimeSec() int64

func (*SyncEventLeaderboardUpdate) ProtoMessage added in v1.10.0

func (*SyncEventLeaderboardUpdate) ProtoMessage()

func (*SyncEventLeaderboardUpdate) ProtoReflect added in v1.10.0

func (*SyncEventLeaderboardUpdate) Reset added in v1.10.0

func (x *SyncEventLeaderboardUpdate) Reset()

func (*SyncEventLeaderboardUpdate) String added in v1.10.0

func (x *SyncEventLeaderboardUpdate) String() string

type SyncEventLeaderboards added in v1.10.0

type SyncEventLeaderboards struct {

	// Updates for various event leaderboards, keyed by event leaderboard identifier.
	EventLeaderboards map[string]*SyncEventLeaderboardUpdate `` /* 200-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync of event leaderboard updates.

func (*SyncEventLeaderboards) Descriptor deprecated added in v1.10.0

func (*SyncEventLeaderboards) Descriptor() ([]byte, []int)

Deprecated: Use SyncEventLeaderboards.ProtoReflect.Descriptor instead.

func (*SyncEventLeaderboards) GetEventLeaderboards added in v1.10.0

func (x *SyncEventLeaderboards) GetEventLeaderboards() map[string]*SyncEventLeaderboardUpdate

func (*SyncEventLeaderboards) ProtoMessage added in v1.10.0

func (*SyncEventLeaderboards) ProtoMessage()

func (*SyncEventLeaderboards) ProtoReflect added in v1.10.0

func (x *SyncEventLeaderboards) ProtoReflect() protoreflect.Message

func (*SyncEventLeaderboards) Reset added in v1.10.0

func (x *SyncEventLeaderboards) Reset()

func (*SyncEventLeaderboards) String added in v1.10.0

func (x *SyncEventLeaderboards) String() string

type SyncInventory added in v1.10.0

type SyncInventory struct {

	// Map of instance IDs to update operation data.
	Items map[string]*SyncInventoryItem `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync operation for the inventory system.

func (*SyncInventory) Descriptor deprecated added in v1.10.0

func (*SyncInventory) Descriptor() ([]byte, []int)

Deprecated: Use SyncInventory.ProtoReflect.Descriptor instead.

func (*SyncInventory) GetItems added in v1.10.0

func (x *SyncInventory) GetItems() map[string]*SyncInventoryItem

func (*SyncInventory) ProtoMessage added in v1.10.0

func (*SyncInventory) ProtoMessage()

func (*SyncInventory) ProtoReflect added in v1.10.0

func (x *SyncInventory) ProtoReflect() protoreflect.Message

func (*SyncInventory) Reset added in v1.10.0

func (x *SyncInventory) Reset()

func (*SyncInventory) String added in v1.10.0

func (x *SyncInventory) String() string

type SyncInventoryItem added in v1.10.0

type SyncInventoryItem struct {

	// Item identifier from config mapping.
	ItemId string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	// Number of items to add or remove.
	Delta int64 `protobuf:"varint,2,opt,name=delta,proto3" json:"delta,omitempty"`
	// Item properties with string values.
	StringProperties map[string]string `` /* 197-byte string literal not displayed */
	// Item properties with numeric values.
	NumericProperties map[string]float64 `` /* 202-byte string literal not displayed */
	// contains filtered or unexported fields
}

Sync operation for a single inventory item.

func (*SyncInventoryItem) Descriptor deprecated added in v1.10.0

func (*SyncInventoryItem) Descriptor() ([]byte, []int)

Deprecated: Use SyncInventoryItem.ProtoReflect.Descriptor instead.

func (*SyncInventoryItem) GetDelta added in v1.10.0

func (x *SyncInventoryItem) GetDelta() int64

func (*SyncInventoryItem) GetItemId added in v1.10.0

func (x *SyncInventoryItem) GetItemId() string

func (*SyncInventoryItem) GetNumericProperties added in v1.10.0

func (x *SyncInventoryItem) GetNumericProperties() map[string]float64

func (*SyncInventoryItem) GetStringProperties added in v1.10.0

func (x *SyncInventoryItem) GetStringProperties() map[string]string

func (*SyncInventoryItem) ProtoMessage added in v1.10.0

func (*SyncInventoryItem) ProtoMessage()

func (*SyncInventoryItem) ProtoReflect added in v1.10.0

func (x *SyncInventoryItem) ProtoReflect() protoreflect.Message

func (*SyncInventoryItem) Reset added in v1.10.0

func (x *SyncInventoryItem) Reset()

func (*SyncInventoryItem) String added in v1.10.0

func (x *SyncInventoryItem) String() string

type SyncProgressionUpdate added in v1.10.0

type SyncProgressionUpdate struct {

	// The counts to set.
	Counts map[string]int64 `` /* 154-byte string literal not displayed */
	// Time when the progression was first updated on the client, if new.
	CreateTimeSec int64 `protobuf:"varint,2,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Time when the progression update was generated on the client.
	UpdateTimeSec int64 `protobuf:"varint,3,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// Cost paid to unlock the progression.
	Cost *ProgressionCost `protobuf:"bytes,4,opt,name=cost,proto3" json:"cost,omitempty"`
	// contains filtered or unexported fields
}

Single progression update.

func (*SyncProgressionUpdate) Descriptor deprecated added in v1.10.0

func (*SyncProgressionUpdate) Descriptor() ([]byte, []int)

Deprecated: Use SyncProgressionUpdate.ProtoReflect.Descriptor instead.

func (*SyncProgressionUpdate) GetCost added in v1.10.0

func (x *SyncProgressionUpdate) GetCost() *ProgressionCost

func (*SyncProgressionUpdate) GetCounts added in v1.10.0

func (x *SyncProgressionUpdate) GetCounts() map[string]int64

func (*SyncProgressionUpdate) GetCreateTimeSec added in v1.10.0

func (x *SyncProgressionUpdate) GetCreateTimeSec() int64

func (*SyncProgressionUpdate) GetUpdateTimeSec added in v1.10.0

func (x *SyncProgressionUpdate) GetUpdateTimeSec() int64

func (*SyncProgressionUpdate) ProtoMessage added in v1.10.0

func (*SyncProgressionUpdate) ProtoMessage()

func (*SyncProgressionUpdate) ProtoReflect added in v1.10.0

func (x *SyncProgressionUpdate) ProtoReflect() protoreflect.Message

func (*SyncProgressionUpdate) Reset added in v1.10.0

func (x *SyncProgressionUpdate) Reset()

func (*SyncProgressionUpdate) String added in v1.10.0

func (x *SyncProgressionUpdate) String() string

type SyncProgressions added in v1.10.0

type SyncProgressions struct {

	// Updates for various progressions, keyed by progression identifier.
	Progressions map[string]*SyncProgressionUpdate `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync of progressions updates.

func (*SyncProgressions) Descriptor deprecated added in v1.10.0

func (*SyncProgressions) Descriptor() ([]byte, []int)

Deprecated: Use SyncProgressions.ProtoReflect.Descriptor instead.

func (*SyncProgressions) GetProgressions added in v1.10.0

func (x *SyncProgressions) GetProgressions() map[string]*SyncProgressionUpdate

func (*SyncProgressions) ProtoMessage added in v1.10.0

func (*SyncProgressions) ProtoMessage()

func (*SyncProgressions) ProtoReflect added in v1.10.0

func (x *SyncProgressions) ProtoReflect() protoreflect.Message

func (*SyncProgressions) Reset added in v1.10.0

func (x *SyncProgressions) Reset()

func (*SyncProgressions) String added in v1.10.0

func (x *SyncProgressions) String() string

type SyncRequest added in v1.10.0

type SyncRequest struct {

	// Inventory.
	Inventory *SyncInventory `protobuf:"bytes,1,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Economy.
	Economy *SyncEconomy `protobuf:"bytes,2,opt,name=economy,proto3" json:"economy,omitempty"`
	// Achievements.
	Achievements *SyncAchievements `protobuf:"bytes,3,opt,name=achievements,proto3" json:"achievements,omitempty"`
	// Energy.
	Energy *SyncEnergy `protobuf:"bytes,4,opt,name=energy,proto3" json:"energy,omitempty"`
	// Event leaderboards.
	EventLeaderboards *SyncEventLeaderboards `protobuf:"bytes,5,opt,name=event_leaderboards,json=eventLeaderboards,proto3" json:"event_leaderboards,omitempty"`
	// Progressions.
	Progressions *SyncProgressions `protobuf:"bytes,6,opt,name=progressions,proto3" json:"progressions,omitempty"`
	// Stats. Message reused from standard synchronous stats updates.
	Stats *StatUpdateRequest `protobuf:"bytes,7,opt,name=stats,proto3" json:"stats,omitempty"`
	// Tutorials.
	Tutorials *SyncTutorials `protobuf:"bytes,8,opt,name=tutorials,proto3" json:"tutorials,omitempty"`
	// Unlockables.
	Unlockables *SyncUnlockables `protobuf:"bytes,9,opt,name=unlockables,proto3" json:"unlockables,omitempty"`
	// contains filtered or unexported fields
}

Input for an offline state sync operation.

func (*SyncRequest) Descriptor deprecated added in v1.10.0

func (*SyncRequest) Descriptor() ([]byte, []int)

Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.

func (*SyncRequest) GetAchievements added in v1.10.0

func (x *SyncRequest) GetAchievements() *SyncAchievements

func (*SyncRequest) GetEconomy added in v1.10.0

func (x *SyncRequest) GetEconomy() *SyncEconomy

func (*SyncRequest) GetEnergy added in v1.10.0

func (x *SyncRequest) GetEnergy() *SyncEnergy

func (*SyncRequest) GetEventLeaderboards added in v1.10.0

func (x *SyncRequest) GetEventLeaderboards() *SyncEventLeaderboards

func (*SyncRequest) GetInventory added in v1.10.0

func (x *SyncRequest) GetInventory() *SyncInventory

func (*SyncRequest) GetProgressions added in v1.10.0

func (x *SyncRequest) GetProgressions() *SyncProgressions

func (*SyncRequest) GetStats added in v1.10.0

func (x *SyncRequest) GetStats() *StatUpdateRequest

func (*SyncRequest) GetTutorials added in v1.10.0

func (x *SyncRequest) GetTutorials() *SyncTutorials

func (*SyncRequest) GetUnlockables added in v1.10.0

func (x *SyncRequest) GetUnlockables() *SyncUnlockables

func (*SyncRequest) ProtoMessage added in v1.10.0

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) ProtoReflect added in v1.10.0

func (x *SyncRequest) ProtoReflect() protoreflect.Message

func (*SyncRequest) Reset added in v1.10.0

func (x *SyncRequest) Reset()

func (*SyncRequest) String added in v1.10.0

func (x *SyncRequest) String() string

type SyncResponse added in v1.10.0

type SyncResponse struct {

	// Updated wallet data, if any.
	Wallet map[string]int64 `` /* 154-byte string literal not displayed */
	// Inventory.
	Inventory *Inventory `protobuf:"bytes,2,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Achievements.
	Achievements *AchievementList `protobuf:"bytes,3,opt,name=achievements,proto3" json:"achievements,omitempty"`
	// Energies.
	Energy *EnergyList `protobuf:"bytes,4,opt,name=energy,proto3" json:"energy,omitempty"`
	// Event leaderboards.
	EventLeaderboards []*EventLeaderboard `protobuf:"bytes,5,rep,name=event_leaderboards,json=eventLeaderboards,proto3" json:"event_leaderboards,omitempty"`
	// Progressions.
	Progressions *ProgressionList `protobuf:"bytes,6,opt,name=progressions,proto3" json:"progressions,omitempty"`
	// Stats.
	Stats *StatList `protobuf:"bytes,7,opt,name=stats,proto3" json:"stats,omitempty"`
	// Tutorials.
	Tutorials *TutorialList `protobuf:"bytes,8,opt,name=tutorials,proto3" json:"tutorials,omitempty"`
	// Unlockables.
	Unlockables *UnlockablesList `protobuf:"bytes,9,opt,name=unlockables,proto3" json:"unlockables,omitempty"`
	// contains filtered or unexported fields
}

Resulting updates after an offline state sync operation. Fields are only populated if the corresponding updated was requested via the sync.

func (*SyncResponse) Descriptor deprecated added in v1.10.0

func (*SyncResponse) Descriptor() ([]byte, []int)

Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.

func (*SyncResponse) GetAchievements added in v1.10.0

func (x *SyncResponse) GetAchievements() *AchievementList

func (*SyncResponse) GetEnergy added in v1.10.0

func (x *SyncResponse) GetEnergy() *EnergyList

func (*SyncResponse) GetEventLeaderboards added in v1.10.0

func (x *SyncResponse) GetEventLeaderboards() []*EventLeaderboard

func (*SyncResponse) GetInventory added in v1.10.0

func (x *SyncResponse) GetInventory() *Inventory

func (*SyncResponse) GetProgressions added in v1.10.0

func (x *SyncResponse) GetProgressions() *ProgressionList

func (*SyncResponse) GetStats added in v1.10.0

func (x *SyncResponse) GetStats() *StatList

func (*SyncResponse) GetTutorials added in v1.10.0

func (x *SyncResponse) GetTutorials() *TutorialList

func (*SyncResponse) GetUnlockables added in v1.10.0

func (x *SyncResponse) GetUnlockables() *UnlockablesList

func (*SyncResponse) GetWallet added in v1.10.0

func (x *SyncResponse) GetWallet() map[string]int64

func (*SyncResponse) ProtoMessage added in v1.10.0

func (*SyncResponse) ProtoMessage()

func (*SyncResponse) ProtoReflect added in v1.10.0

func (x *SyncResponse) ProtoReflect() protoreflect.Message

func (*SyncResponse) Reset added in v1.10.0

func (x *SyncResponse) Reset()

func (*SyncResponse) String added in v1.10.0

func (x *SyncResponse) String() string

type SyncTutorials added in v1.10.0

type SyncTutorials struct {

	// Accept list.
	Accepts []string `protobuf:"bytes,1,rep,name=accepts,proto3" json:"accepts,omitempty"`
	// Decline list.
	Declines []string `protobuf:"bytes,2,rep,name=declines,proto3" json:"declines,omitempty"`
	// Abandon list.
	Abandons []string `protobuf:"bytes,3,rep,name=abandons,proto3" json:"abandons,omitempty"`
	// Updates to tutorial steps. Implicitly counts as accepting these tutorials, if not accepted already.
	Updates map[string]int64 `` /* 156-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync of tutorials updates.

func (*SyncTutorials) Descriptor deprecated added in v1.10.0

func (*SyncTutorials) Descriptor() ([]byte, []int)

Deprecated: Use SyncTutorials.ProtoReflect.Descriptor instead.

func (*SyncTutorials) GetAbandons added in v1.10.0

func (x *SyncTutorials) GetAbandons() []string

func (*SyncTutorials) GetAccepts added in v1.10.0

func (x *SyncTutorials) GetAccepts() []string

func (*SyncTutorials) GetDeclines added in v1.10.0

func (x *SyncTutorials) GetDeclines() []string

func (*SyncTutorials) GetUpdates added in v1.10.0

func (x *SyncTutorials) GetUpdates() map[string]int64

func (*SyncTutorials) ProtoMessage added in v1.10.0

func (*SyncTutorials) ProtoMessage()

func (*SyncTutorials) ProtoReflect added in v1.10.0

func (x *SyncTutorials) ProtoReflect() protoreflect.Message

func (*SyncTutorials) Reset added in v1.10.0

func (x *SyncTutorials) Reset()

func (*SyncTutorials) String added in v1.10.0

func (x *SyncTutorials) String() string

type SyncUnlockableUpdate added in v1.10.0

type SyncUnlockableUpdate struct {

	// Unlockable identifier from config.
	UnlockableId string `protobuf:"bytes,1,opt,name=unlockable_id,json=unlockableId,proto3" json:"unlockable_id,omitempty"`
	// Time this unlockabled was granted.
	CreateTimeSec int64 `protobuf:"varint,2,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// Unlock start time, if any.
	StartTimeSec int64 `protobuf:"varint,3,opt,name=start_time_sec,json=startTimeSec,proto3" json:"start_time_sec,omitempty"`
	// Unlock completion time, if any.
	UnlockTimeSec int64 `protobuf:"varint,4,opt,name=unlock_time_sec,json=unlockTimeSec,proto3" json:"unlock_time_sec,omitempty"`
	// contains filtered or unexported fields
}

Single unlockable update, either grant or unlock start.

func (*SyncUnlockableUpdate) Descriptor deprecated added in v1.10.0

func (*SyncUnlockableUpdate) Descriptor() ([]byte, []int)

Deprecated: Use SyncUnlockableUpdate.ProtoReflect.Descriptor instead.

func (*SyncUnlockableUpdate) GetCreateTimeSec added in v1.10.0

func (x *SyncUnlockableUpdate) GetCreateTimeSec() int64

func (*SyncUnlockableUpdate) GetStartTimeSec added in v1.10.0

func (x *SyncUnlockableUpdate) GetStartTimeSec() int64

func (*SyncUnlockableUpdate) GetUnlockTimeSec added in v1.10.0

func (x *SyncUnlockableUpdate) GetUnlockTimeSec() int64

func (*SyncUnlockableUpdate) GetUnlockableId added in v1.10.0

func (x *SyncUnlockableUpdate) GetUnlockableId() string

func (*SyncUnlockableUpdate) ProtoMessage added in v1.10.0

func (*SyncUnlockableUpdate) ProtoMessage()

func (*SyncUnlockableUpdate) ProtoReflect added in v1.10.0

func (x *SyncUnlockableUpdate) ProtoReflect() protoreflect.Message

func (*SyncUnlockableUpdate) Reset added in v1.10.0

func (x *SyncUnlockableUpdate) Reset()

func (*SyncUnlockableUpdate) String added in v1.10.0

func (x *SyncUnlockableUpdate) String() string

type SyncUnlockables added in v1.10.0

type SyncUnlockables struct {

	// Unlockable instance IDs to remove.
	Removes []string `protobuf:"bytes,1,rep,name=removes,proto3" json:"removes,omitempty"`
	// Unlockable updates keyed by instance identifier, such as new grants or unlock starts.
	Updates map[string]*SyncUnlockableUpdate `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

Input for an offline state sync of unlockables updates.

func (*SyncUnlockables) Descriptor deprecated added in v1.10.0

func (*SyncUnlockables) Descriptor() ([]byte, []int)

Deprecated: Use SyncUnlockables.ProtoReflect.Descriptor instead.

func (*SyncUnlockables) GetRemoves added in v1.10.0

func (x *SyncUnlockables) GetRemoves() []string

func (*SyncUnlockables) GetUpdates added in v1.10.0

func (x *SyncUnlockables) GetUpdates() map[string]*SyncUnlockableUpdate

func (*SyncUnlockables) ProtoMessage added in v1.10.0

func (*SyncUnlockables) ProtoMessage()

func (*SyncUnlockables) ProtoReflect added in v1.10.0

func (x *SyncUnlockables) ProtoReflect() protoreflect.Message

func (*SyncUnlockables) Reset added in v1.10.0

func (x *SyncUnlockables) Reset()

func (*SyncUnlockables) String added in v1.10.0

func (x *SyncUnlockables) String() string

type System

type System interface {
	// GetType provides the runtime type of the gameplay system.
	GetType() SystemType

	// GetConfig returns the configuration type of the gameplay system.
	GetConfig() any
}

A System is a base type for a gameplay system.

type SystemConfig

type SystemConfig interface {
	// GetType returns the runtime type of the gameplay system.
	GetType() SystemType

	// GetConfigFile returns the configuration file used for the data definitions in the gameplay system.
	GetConfigFile() string

	// GetRegister returns true if the gameplay system's RPCs should be registered with the game server.
	GetRegister() bool

	// GetExtra returns the extra parameter used to configure the gameplay system.
	GetExtra() any
}

The SystemConfig describes the configuration that each gameplay system must use to configure itself.

func WithAchievementsSystem

func WithAchievementsSystem(configFile string, register bool) SystemConfig

WithAchievementsSystem configures an AchievementsSystem type and optionally registers its RPCs with the game server.

func WithBaseSystem

func WithBaseSystem(configFile string, register bool, usernameOverride ...UsernameOverrideFn) SystemConfig

WithBaseSystem configures a BaseSystem type and optionally registers its RPCs with the game server.

func WithEconomySystem

func WithEconomySystem(configFile string, register bool, ironSrcPrivKey ...string) SystemConfig

WithEconomySystem configures an EconomySystem type and optionally registers its RPCs with the game server.

func WithEnergySystem

func WithEnergySystem(configFile string, register bool) SystemConfig

WithEnergySystem configures an EnergySystem type and optionally registers its RPCs with the game server.

func WithEventLeaderboardsSystem added in v1.1.0

func WithEventLeaderboardsSystem(configFile string, register bool) SystemConfig

WithEventLeaderboardsSystem configures an EventLeaderboardsSystem type and optionally registers its RPCs with the game server.

func WithIncentivesSystem added in v1.5.0

func WithIncentivesSystem(configFile string, register bool) SystemConfig

WithIncentivesSystem configures a IncentivesSystem type and optionally registers its RPCs with the game server.

func WithInventorySystem

func WithInventorySystem(configFile string, register bool) SystemConfig

WithInventorySystem configures an InventorySystem type and optionally registers its RPCs with the game server.

func WithLeaderboardsSystem

func WithLeaderboardsSystem(configFile string, register bool, validateWriteScore ...ValidateWriteScoreFn) SystemConfig

WithLeaderboardsSystem configures a LeaderboardsSystem type.

func WithProgressionSystem added in v1.3.0

func WithProgressionSystem(configFile string, register bool) SystemConfig

WithProgressionSystem configures a ProgressionSystem type and optionally registers its RPCs with the game server.

func WithStatsSystem

func WithStatsSystem(configFile string, register bool) SystemConfig

WithStatsSystem configures a StatsSystem type and optionally registers its RPCs with the game server.

func WithTeamsSystem

func WithTeamsSystem(configFile string, register bool, validateCreateTeam ...ValidateCreateTeamFn) SystemConfig

WithTeamsSystem configures a TeamsSystem type and optionally registers its RPCs with the game server.

func WithTutorialsSystem

func WithTutorialsSystem(configFile string, register bool) SystemConfig

WithTutorialsSystem configures a TutorialsSystem type and optionally registers its RPCs with the game server.

func WithUnlockablesSystem

func WithUnlockablesSystem(configFile string, register bool) SystemConfig

WithUnlockablesSystem configures an UnlockablesSystem type and optionally registers its RPCs with the game server.

type SystemType

type SystemType uint

The SystemType identifies each of the gameplay systems.

const (
	SystemTypeUnknown SystemType = iota
	SystemTypeBase
	SystemTypeEnergy
	SystemTypeUnlockables
	SystemTypeTutorials
	SystemTypeLeaderboards
	SystemTypeStats
	SystemTypeTeams
	SystemTypeInventory
	SystemTypeAchievements
	SystemTypeEconomy
	SystemTypeEventLeaderboards
	SystemTypeProgression
	SystemTypeIncentives
)

type Team

type Team struct {

	// The ID of a team.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The ID of the user who created the team.
	CreatorId string `protobuf:"bytes,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
	// The unique name of the team.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// A description for the team.
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	// The language expected to be a tag which follows the BCP-47 spec.
	LangTag string `protobuf:"bytes,5,opt,name=lang_tag,json=langTag,proto3" json:"lang_tag,omitempty"`
	// Additional information stored as a JSON object.
	Metadata string `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// A URL for an avatar image.
	AvatarUrl string `protobuf:"bytes,7,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
	// Anyone can join open groups, otherwise only admins can accept members.
	Open bool `protobuf:"varint,8,opt,name=open,proto3" json:"open,omitempty"`
	// The current count of all members in the group.
	EdgeCount int32 `protobuf:"varint,9,opt,name=edge_count,json=edgeCount,proto3" json:"edge_count,omitempty"`
	// The maximum number of members allowed.
	MaxCount int32 `protobuf:"varint,10,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"`
	// The UNIX timestamp when the group was created.
	CreateTimeSec int64 `protobuf:"varint,11,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// The UNIX timestamp when the group was last updated.
	UpdateTimeSec int64 `protobuf:"varint,12,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// The icon artwork reference ID for the team, if any.
	Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"`
	// contains filtered or unexported fields
}

A Team represents a group of users who play together.

func (*Team) Descriptor deprecated

func (*Team) Descriptor() ([]byte, []int)

Deprecated: Use Team.ProtoReflect.Descriptor instead.

func (*Team) GetAvatarUrl

func (x *Team) GetAvatarUrl() string

func (*Team) GetCreateTimeSec

func (x *Team) GetCreateTimeSec() int64

func (*Team) GetCreatorId

func (x *Team) GetCreatorId() string

func (*Team) GetDescription

func (x *Team) GetDescription() string

func (*Team) GetEdgeCount

func (x *Team) GetEdgeCount() int32

func (*Team) GetIcon

func (x *Team) GetIcon() string

func (*Team) GetId

func (x *Team) GetId() string

func (*Team) GetLangTag

func (x *Team) GetLangTag() string

func (*Team) GetMaxCount

func (x *Team) GetMaxCount() int32

func (*Team) GetMetadata

func (x *Team) GetMetadata() string

func (*Team) GetName

func (x *Team) GetName() string

func (*Team) GetOpen

func (x *Team) GetOpen() bool

func (*Team) GetUpdateTimeSec

func (x *Team) GetUpdateTimeSec() int64

func (*Team) ProtoMessage

func (*Team) ProtoMessage()

func (*Team) ProtoReflect

func (x *Team) ProtoReflect() protoreflect.Message

func (*Team) Reset

func (x *Team) Reset()

func (*Team) String

func (x *Team) String() string

type TeamCreateRequest

type TeamCreateRequest struct {

	// The name of the team to be created.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The description of the team to be created.
	Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"`
	// True if the team is open to join by any user.
	Open bool `protobuf:"varint,3,opt,name=open,proto3" json:"open,omitempty"`
	// The icon artwork reference ID for the team, if any.
	Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"`
	// The language expected to be a tag which follows the BCP-47 spec.
	LangTag string `protobuf:"bytes,5,opt,name=lang_tag,json=langTag,proto3" json:"lang_tag,omitempty"`
	// The starting metadata passed in as part of creating the team.
	SetupMetadata string `protobuf:"bytes,6,opt,name=setup_metadata,json=setupMetadata,proto3" json:"setup_metadata,omitempty"`
	// contains filtered or unexported fields
}

A request to create a team.

func (*TeamCreateRequest) Descriptor deprecated

func (*TeamCreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use TeamCreateRequest.ProtoReflect.Descriptor instead.

func (*TeamCreateRequest) GetDesc

func (x *TeamCreateRequest) GetDesc() string

func (*TeamCreateRequest) GetIcon

func (x *TeamCreateRequest) GetIcon() string

func (*TeamCreateRequest) GetLangTag

func (x *TeamCreateRequest) GetLangTag() string

func (*TeamCreateRequest) GetName

func (x *TeamCreateRequest) GetName() string

func (*TeamCreateRequest) GetOpen

func (x *TeamCreateRequest) GetOpen() bool

func (*TeamCreateRequest) GetSetupMetadata

func (x *TeamCreateRequest) GetSetupMetadata() string

func (*TeamCreateRequest) ProtoMessage

func (*TeamCreateRequest) ProtoMessage()

func (*TeamCreateRequest) ProtoReflect

func (x *TeamCreateRequest) ProtoReflect() protoreflect.Message

func (*TeamCreateRequest) Reset

func (x *TeamCreateRequest) Reset()

func (*TeamCreateRequest) String

func (x *TeamCreateRequest) String() string

type TeamList

type TeamList struct {

	// The current page of teams returned in the list.
	Teams []*Team `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"`
	// A cursor used to get the next page.
	Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

A list of teams.

func (*TeamList) Descriptor deprecated

func (*TeamList) Descriptor() ([]byte, []int)

Deprecated: Use TeamList.ProtoReflect.Descriptor instead.

func (*TeamList) GetCursor

func (x *TeamList) GetCursor() string

func (*TeamList) GetTeams

func (x *TeamList) GetTeams() []*Team

func (*TeamList) ProtoMessage

func (*TeamList) ProtoMessage()

func (*TeamList) ProtoReflect

func (x *TeamList) ProtoReflect() protoreflect.Message

func (*TeamList) Reset

func (x *TeamList) Reset()

func (*TeamList) String

func (x *TeamList) String() string

type TeamListRequest

type TeamListRequest struct {

	// An optional cursor used to get the next page.
	Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// The optional location filter.
	Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
	// An optional limit on how many results are returned. Defaults to 10.
	Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

A request to list teams which a user can join.

func (*TeamListRequest) Descriptor deprecated

func (*TeamListRequest) Descriptor() ([]byte, []int)

Deprecated: Use TeamListRequest.ProtoReflect.Descriptor instead.

func (*TeamListRequest) GetCursor

func (x *TeamListRequest) GetCursor() string

func (*TeamListRequest) GetLimit

func (x *TeamListRequest) GetLimit() int32

func (*TeamListRequest) GetLocation

func (x *TeamListRequest) GetLocation() string

func (*TeamListRequest) ProtoMessage

func (*TeamListRequest) ProtoMessage()

func (*TeamListRequest) ProtoReflect

func (x *TeamListRequest) ProtoReflect() protoreflect.Message

func (*TeamListRequest) Reset

func (x *TeamListRequest) Reset()

func (*TeamListRequest) String

func (x *TeamListRequest) String() string

type TeamSearchRequest

type TeamSearchRequest struct {

	// The search term(s) passed in by the user.
	Input string `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// An optional limit on how many results are returned. Defaults to 10.
	Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

A request to search for teams which the user wants to join.

func (*TeamSearchRequest) Descriptor deprecated

func (*TeamSearchRequest) Descriptor() ([]byte, []int)

Deprecated: Use TeamSearchRequest.ProtoReflect.Descriptor instead.

func (*TeamSearchRequest) GetInput

func (x *TeamSearchRequest) GetInput() string

func (*TeamSearchRequest) GetLimit

func (x *TeamSearchRequest) GetLimit() int32

func (*TeamSearchRequest) ProtoMessage

func (*TeamSearchRequest) ProtoMessage()

func (*TeamSearchRequest) ProtoReflect

func (x *TeamSearchRequest) ProtoReflect() protoreflect.Message

func (*TeamSearchRequest) Reset

func (x *TeamSearchRequest) Reset()

func (*TeamSearchRequest) String

func (x *TeamSearchRequest) String() string

type TeamWriteChatMessageRequest

type TeamWriteChatMessageRequest struct {

	// The ID of the team.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The content of the chat message. Usually an escaped JSON object.
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

A request to write a chat message to the channel for a team the user is part of.

func (*TeamWriteChatMessageRequest) Descriptor deprecated

func (*TeamWriteChatMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use TeamWriteChatMessageRequest.ProtoReflect.Descriptor instead.

func (*TeamWriteChatMessageRequest) GetContent

func (x *TeamWriteChatMessageRequest) GetContent() string

func (*TeamWriteChatMessageRequest) GetId

func (*TeamWriteChatMessageRequest) ProtoMessage

func (*TeamWriteChatMessageRequest) ProtoMessage()

func (*TeamWriteChatMessageRequest) ProtoReflect

func (*TeamWriteChatMessageRequest) Reset

func (x *TeamWriteChatMessageRequest) Reset()

func (*TeamWriteChatMessageRequest) String

func (x *TeamWriteChatMessageRequest) String() string

type TeamsConfig

type TeamsConfig struct {
	MaxTeamSize int `json:"max_team_size,omitempty"`
}

TeamsConfig is the data definition for a TeamsSystem type.

type TeamsSystem

type TeamsSystem interface {
	System

	// Create makes a new team (i.e. Nakama group) with additional metadata which configures the team.
	Create(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, req *TeamCreateRequest) (*Team, error)

	// List will return a list of teams which the user can join.
	List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, req *TeamListRequest) (*TeamList, error)

	// Search
	Search(ctx context.Context, db *sql.DB, logger runtime.Logger, nk runtime.NakamaModule, req *TeamSearchRequest) (*TeamList, error)

	// WriteChatMessage sends a message to the user's team even when they're not connected on a realtime socket.
	WriteChatMessage(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, req *TeamWriteChatMessageRequest) (*ChannelMessageAck, error)
}

A TeamsSystem is a gameplay system which wraps the groups system in Nakama server.

type Tutorial

type Tutorial struct {

	// The unique tutorial identifier.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The current step in the tutorial.
	Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"`
	// The maximum step in the tutorial based on configuration.
	Max int32 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
	// The accepted state of the tutorial.
	State TutorialState `protobuf:"varint,4,opt,name=state,proto3,enum=hiro.TutorialState" json:"state,omitempty"`
	// The UNIX timestamp when the tutorial was last updated.
	UpdateTimeSec int64 `protobuf:"varint,5,opt,name=update_time_sec,json=updateTimeSec,proto3" json:"update_time_sec,omitempty"`
	// The UNIX timestamp when the tutorial was completed, if it is completed.
	CompleteTimeSec int64 `protobuf:"varint,6,opt,name=complete_time_sec,json=completeTimeSec,proto3" json:"complete_time_sec,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 209-byte string literal not displayed */
	// contains filtered or unexported fields
}

An individual set of tutorial steps.

func (*Tutorial) Descriptor deprecated

func (*Tutorial) Descriptor() ([]byte, []int)

Deprecated: Use Tutorial.ProtoReflect.Descriptor instead.

func (*Tutorial) GetAdditionalProperties

func (x *Tutorial) GetAdditionalProperties() map[string]string

func (*Tutorial) GetCompleteTimeSec

func (x *Tutorial) GetCompleteTimeSec() int64

func (*Tutorial) GetCurrent

func (x *Tutorial) GetCurrent() int32

func (*Tutorial) GetId

func (x *Tutorial) GetId() string

func (*Tutorial) GetMax

func (x *Tutorial) GetMax() int32

func (*Tutorial) GetState

func (x *Tutorial) GetState() TutorialState

func (*Tutorial) GetUpdateTimeSec

func (x *Tutorial) GetUpdateTimeSec() int64

func (*Tutorial) ProtoMessage

func (*Tutorial) ProtoMessage()

func (*Tutorial) ProtoReflect

func (x *Tutorial) ProtoReflect() protoreflect.Message

func (*Tutorial) Reset

func (x *Tutorial) Reset()

func (*Tutorial) String

func (x *Tutorial) String() string

type TutorialAbandonRequest

type TutorialAbandonRequest struct {

	// The tutorial to abandon.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A request to abandon a tutorial.

func (*TutorialAbandonRequest) Descriptor deprecated

func (*TutorialAbandonRequest) Descriptor() ([]byte, []int)

Deprecated: Use TutorialAbandonRequest.ProtoReflect.Descriptor instead.

func (*TutorialAbandonRequest) GetId

func (x *TutorialAbandonRequest) GetId() string

func (*TutorialAbandonRequest) ProtoMessage

func (*TutorialAbandonRequest) ProtoMessage()

func (*TutorialAbandonRequest) ProtoReflect

func (x *TutorialAbandonRequest) ProtoReflect() protoreflect.Message

func (*TutorialAbandonRequest) Reset

func (x *TutorialAbandonRequest) Reset()

func (*TutorialAbandonRequest) String

func (x *TutorialAbandonRequest) String() string

type TutorialAcceptRequest

type TutorialAcceptRequest struct {

	// The tutorial to accept.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A request to accept a tutorial.

func (*TutorialAcceptRequest) Descriptor deprecated

func (*TutorialAcceptRequest) Descriptor() ([]byte, []int)

Deprecated: Use TutorialAcceptRequest.ProtoReflect.Descriptor instead.

func (*TutorialAcceptRequest) GetId

func (x *TutorialAcceptRequest) GetId() string

func (*TutorialAcceptRequest) ProtoMessage

func (*TutorialAcceptRequest) ProtoMessage()

func (*TutorialAcceptRequest) ProtoReflect

func (x *TutorialAcceptRequest) ProtoReflect() protoreflect.Message

func (*TutorialAcceptRequest) Reset

func (x *TutorialAcceptRequest) Reset()

func (*TutorialAcceptRequest) String

func (x *TutorialAcceptRequest) String() string

type TutorialDeclineRequest

type TutorialDeclineRequest struct {

	// The tutorial to decline.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A request to decline a tutorial.

func (*TutorialDeclineRequest) Descriptor deprecated

func (*TutorialDeclineRequest) Descriptor() ([]byte, []int)

Deprecated: Use TutorialDeclineRequest.ProtoReflect.Descriptor instead.

func (*TutorialDeclineRequest) GetId

func (x *TutorialDeclineRequest) GetId() string

func (*TutorialDeclineRequest) ProtoMessage

func (*TutorialDeclineRequest) ProtoMessage()

func (*TutorialDeclineRequest) ProtoReflect

func (x *TutorialDeclineRequest) ProtoReflect() protoreflect.Message

func (*TutorialDeclineRequest) Reset

func (x *TutorialDeclineRequest) Reset()

func (*TutorialDeclineRequest) String

func (x *TutorialDeclineRequest) String() string

type TutorialList

type TutorialList struct {

	// All available tutorials.
	Tutorials map[string]*Tutorial `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

The full tutorial statuses for a given user.

func (*TutorialList) Descriptor deprecated

func (*TutorialList) Descriptor() ([]byte, []int)

Deprecated: Use TutorialList.ProtoReflect.Descriptor instead.

func (*TutorialList) GetTutorials

func (x *TutorialList) GetTutorials() map[string]*Tutorial

func (*TutorialList) ProtoMessage

func (*TutorialList) ProtoMessage()

func (*TutorialList) ProtoReflect

func (x *TutorialList) ProtoReflect() protoreflect.Message

func (*TutorialList) Reset

func (x *TutorialList) Reset()

func (*TutorialList) String

func (x *TutorialList) String() string

type TutorialState

type TutorialState int32

The states of a Tutorial.

const (
	// The Tutorial has not been accepted/declined by the user yet.
	TutorialState_TUTORIAL_STATE_NONE TutorialState = 0
	// The Tutorial was accepted.
	TutorialState_TUTORIAL_STATE_ACCEPTED TutorialState = 1
	// The Tutorial was declined.
	TutorialState_TUTORIAL_STATE_DECLINED TutorialState = 2
	// The Tutorial is in progress.
	TutorialState_TUTORIAL_STATE_IN_PROGRESS TutorialState = 3
	// The Tutorial has been completed.
	TutorialState_TUTORIAL_STATE_COMPLETED TutorialState = 4
	// The Tutorial has been abandoned.
	TutorialState_TUTORIAL_STATE_ABANDONED TutorialState = 5
)

func (TutorialState) Descriptor

func (TutorialState) Enum

func (x TutorialState) Enum() *TutorialState

func (TutorialState) EnumDescriptor deprecated

func (TutorialState) EnumDescriptor() ([]byte, []int)

Deprecated: Use TutorialState.Descriptor instead.

func (TutorialState) Number

func (TutorialState) String

func (x TutorialState) String() string

func (TutorialState) Type

type TutorialUpdateRequest

type TutorialUpdateRequest struct {

	// The tutorial to update.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The latest step that should be marked completed. All previous steps will also be marked as completed.
	Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"`
	// contains filtered or unexported fields
}

A request to update a tutorial.

func (*TutorialUpdateRequest) Descriptor deprecated

func (*TutorialUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use TutorialUpdateRequest.ProtoReflect.Descriptor instead.

func (*TutorialUpdateRequest) GetId

func (x *TutorialUpdateRequest) GetId() string

func (*TutorialUpdateRequest) GetStep

func (x *TutorialUpdateRequest) GetStep() int32

func (*TutorialUpdateRequest) ProtoMessage

func (*TutorialUpdateRequest) ProtoMessage()

func (*TutorialUpdateRequest) ProtoReflect

func (x *TutorialUpdateRequest) ProtoReflect() protoreflect.Message

func (*TutorialUpdateRequest) Reset

func (x *TutorialUpdateRequest) Reset()

func (*TutorialUpdateRequest) String

func (x *TutorialUpdateRequest) String() string

type TutorialsConfig

type TutorialsConfig struct {
	Tutorials map[string]*TutorialsConfigTutorial `json:"tutorials,omitempty"`
}

TutorialsConfig is the data definition for the TutorialsSystem type.

type TutorialsConfigTutorial

type TutorialsConfigTutorial struct {
	StartStep            int               `json:"start_step,omitempty"`
	MaxStep              int               `json:"max_step,omitempty"`
	AdditionalProperties map[string]string `json:"additional_properties,omitempty"`
}

type TutorialsSystem

type TutorialsSystem interface {
	System

	// Get returns all tutorials defined and progress made by the user towards them.
	Get(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (map[string]*Tutorial, error)

	// Accept marks a tutorial as accepted by the user.
	Accept(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, tutorialID string, userID string) (*Tutorial, error)

	// Decline marks a tutorial as declined by the user.
	Decline(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, tutorialID string, userID string) (*Tutorial, error)

	// Abandon marks the tutorial as abandoned by the user.
	Abandon(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, tutorialID string, userID string) (*Tutorial, error)

	// Update modifies a tutorial by its ID to step through it for the user by ID.
	Update(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, tutorialID string, step int) (map[string]*Tutorial, error)
}

The TutorialsSystem is a gameplay system which records progress made through tutorials.

type Unlockable

type Unlockable struct {

	// The unlockable definition ID, eg. "bronze-chest".
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The instance ID.
	InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// The category the unlockable is part of.
	Category string `protobuf:"bytes,3,opt,name=category,proto3" json:"category,omitempty"`
	// The cost to begin unlocking this particular unlockable.
	StartCost *UnlockableCost `protobuf:"bytes,4,opt,name=start_cost,json=startCost,proto3" json:"start_cost,omitempty"`
	// The cost to fully unlock this unlockable, accounting for any time already spent.
	Cost *UnlockableCost `protobuf:"bytes,5,opt,name=cost,proto3" json:"cost,omitempty"`
	// The description, if any. May be an i18n code.
	Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	// The name. May be an i18n code.
	Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
	// The reward already granted when the unlockable has been claimed.
	Reward *Reward `protobuf:"bytes,8,opt,name=reward,proto3" json:"reward,omitempty"`
	// The available rewards for when the unlockable is claimed.
	AvailableRewards *AvailableRewards `protobuf:"bytes,9,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// Total time this unlockable will take to unlock once activated.
	WaitTimeSec int32 `protobuf:"varint,10,opt,name=wait_time_sec,json=waitTimeSec,proto3" json:"wait_time_sec,omitempty"`
	// The UNIX timestamp when this unlockable was granted to the user.
	CreateTimeSec int64 `protobuf:"varint,11,opt,name=create_time_sec,json=createTimeSec,proto3" json:"create_time_sec,omitempty"`
	// The UNIX timestamp when this unlockable began unlocking, or 0 if it is not active.
	UnlockStartTimeSec int64 `protobuf:"varint,12,opt,name=unlock_start_time_sec,json=unlockStartTimeSec,proto3" json:"unlock_start_time_sec,omitempty"`
	// The UNIX timestamp when this unlockable will complete unlocking and become claimable, or 0 if it is not active.
	UnlockCompleteTimeSec int64 `` /* 130-byte string literal not displayed */
	// If the unlock process has completed (either by time elapsed or purchase) and the unlockable reward can be claimed.
	CanClaim bool `protobuf:"varint,14,opt,name=can_claim,json=canClaim,proto3" json:"can_claim,omitempty"`
	// Additional metadata properties.
	AdditionalProperties map[string]string `` /* 210-byte string literal not displayed */
	// contains filtered or unexported fields
}

A single unlockable object.

func (*Unlockable) Descriptor deprecated

func (*Unlockable) Descriptor() ([]byte, []int)

Deprecated: Use Unlockable.ProtoReflect.Descriptor instead.

func (*Unlockable) GetAdditionalProperties

func (x *Unlockable) GetAdditionalProperties() map[string]string

func (*Unlockable) GetAvailableRewards

func (x *Unlockable) GetAvailableRewards() *AvailableRewards

func (*Unlockable) GetCanClaim

func (x *Unlockable) GetCanClaim() bool

func (*Unlockable) GetCategory

func (x *Unlockable) GetCategory() string

func (*Unlockable) GetCost

func (x *Unlockable) GetCost() *UnlockableCost

func (*Unlockable) GetCreateTimeSec

func (x *Unlockable) GetCreateTimeSec() int64

func (*Unlockable) GetDescription

func (x *Unlockable) GetDescription() string

func (*Unlockable) GetId

func (x *Unlockable) GetId() string

func (*Unlockable) GetInstanceId

func (x *Unlockable) GetInstanceId() string

func (*Unlockable) GetName

func (x *Unlockable) GetName() string

func (*Unlockable) GetReward

func (x *Unlockable) GetReward() *Reward

func (*Unlockable) GetStartCost

func (x *Unlockable) GetStartCost() *UnlockableCost

func (*Unlockable) GetUnlockCompleteTimeSec

func (x *Unlockable) GetUnlockCompleteTimeSec() int64

func (*Unlockable) GetUnlockStartTimeSec

func (x *Unlockable) GetUnlockStartTimeSec() int64

func (*Unlockable) GetWaitTimeSec

func (x *Unlockable) GetWaitTimeSec() int32

func (*Unlockable) ProtoMessage

func (*Unlockable) ProtoMessage()

func (*Unlockable) ProtoReflect

func (x *Unlockable) ProtoReflect() protoreflect.Message

func (*Unlockable) Reset

func (x *Unlockable) Reset()

func (*Unlockable) String

func (x *Unlockable) String() string

type UnlockableCost

type UnlockableCost struct {

	// The items which will be deducted.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// The currencies which will be deducted.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

The unlockable cost, may relate to starting an unlock, or fully completing it.

func (*UnlockableCost) Descriptor deprecated

func (*UnlockableCost) Descriptor() ([]byte, []int)

Deprecated: Use UnlockableCost.ProtoReflect.Descriptor instead.

func (*UnlockableCost) GetCurrencies

func (x *UnlockableCost) GetCurrencies() map[string]int64

func (*UnlockableCost) GetItems

func (x *UnlockableCost) GetItems() map[string]int64

func (*UnlockableCost) ProtoMessage

func (*UnlockableCost) ProtoMessage()

func (*UnlockableCost) ProtoReflect

func (x *UnlockableCost) ProtoReflect() protoreflect.Message

func (*UnlockableCost) Reset

func (x *UnlockableCost) Reset()

func (*UnlockableCost) String

func (x *UnlockableCost) String() string

type UnlockableSlotCost

type UnlockableSlotCost struct {

	// The items which will be deducted.
	Items map[string]int64 `` /* 152-byte string literal not displayed */
	// The currencies which will be deducted.
	Currencies map[string]int64 `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

The cost to purchase an additional unlockable active slot.

func (*UnlockableSlotCost) Descriptor deprecated

func (*UnlockableSlotCost) Descriptor() ([]byte, []int)

Deprecated: Use UnlockableSlotCost.ProtoReflect.Descriptor instead.

func (*UnlockableSlotCost) GetCurrencies

func (x *UnlockableSlotCost) GetCurrencies() map[string]int64

func (*UnlockableSlotCost) GetItems

func (x *UnlockableSlotCost) GetItems() map[string]int64

func (*UnlockableSlotCost) ProtoMessage

func (*UnlockableSlotCost) ProtoMessage()

func (*UnlockableSlotCost) ProtoReflect

func (x *UnlockableSlotCost) ProtoReflect() protoreflect.Message

func (*UnlockableSlotCost) Reset

func (x *UnlockableSlotCost) Reset()

func (*UnlockableSlotCost) String

func (x *UnlockableSlotCost) String() string

type UnlockablesConfig

type UnlockablesConfig struct {
	ActiveSlots    int                                     `json:"active_slots,omitempty"`
	MaxActiveSlots int                                     `json:"max_active_slots,omitempty"`
	Slots          int                                     `json:"slots,omitempty"`
	SlotCost       *UnlockablesConfigSlotCost              `json:"slot_cost,omitempty"`
	Unlockables    map[string]*UnlockablesConfigUnlockable `json:"unlockables,omitempty"`

	UnlockableProbabilities []string `json:"-"`
}

UnlockablesConfig is the data definition for a UnlockablesSystem type.

type UnlockablesConfigSlotCost

type UnlockablesConfigSlotCost struct {
	Items      map[string]int64 `json:"items,omitempty"`
	Currencies map[string]int64 `json:"currencies,omitempty"`
}

type UnlockablesConfigUnlockable

type UnlockablesConfigUnlockable struct {
	Probability          int                                   `json:"probability,omitempty"`
	Category             string                                `json:"category,omitempty"`
	Cost                 *UnlockablesConfigUnlockableCost      `json:"cost,omitempty"`
	CostUnitTimeSec      int                                   `json:"cost_unit_time_sec,omitempty"`
	Description          string                                `json:"description,omitempty"`
	Name                 string                                `json:"name,omitempty"`
	StartCost            *UnlockablesConfigUnlockableStartCost `json:"start_cost,omitempty"`
	Reward               *EconomyConfigReward                  `json:"reward,omitempty"`
	WaitTimeSec          int                                   `json:"wait_time_sec,omitempty"`
	AdditionalProperties map[string]string                     `json:"additional_properties,omitempty"`
}

type UnlockablesConfigUnlockableCost

type UnlockablesConfigUnlockableCost struct {
	Items      map[string]int64 `json:"items,omitempty"`
	Currencies map[string]int64 `json:"currencies,omitempty"`
}

type UnlockablesConfigUnlockableStartCost

type UnlockablesConfigUnlockableStartCost struct {
	Items      map[string]int64 `json:"items,omitempty"`
	Currencies map[string]int64 `json:"currencies,omitempty"`
}

type UnlockablesList

type UnlockablesList struct {

	// The list of unlockables owned by a user.
	Unlockables []*Unlockable `protobuf:"bytes,1,rep,name=unlockables,proto3" json:"unlockables,omitempty"`
	// The unlockable overflow slot.
	Overflow *Unlockable `protobuf:"bytes,2,opt,name=overflow,proto3" json:"overflow,omitempty"`
	// The total number of non-overflow slots.
	Slots int32 `protobuf:"varint,3,opt,name=slots,proto3" json:"slots,omitempty"`
	// The current number of active slots.
	ActiveSlots int32 `protobuf:"varint,4,opt,name=active_slots,json=activeSlots,proto3" json:"active_slots,omitempty"`
	// The max number of active slots the user can ever obtain.
	MaxActiveSlots int32 `protobuf:"varint,5,opt,name=max_active_slots,json=maxActiveSlots,proto3" json:"max_active_slots,omitempty"`
	// The cost to purchase the next active slot, if another is available for purchase.
	SlotCost *UnlockableSlotCost `protobuf:"bytes,6,opt,name=slot_cost,json=slotCost,proto3" json:"slot_cost,omitempty"`
	// The newly granted unlockable, if any.
	InstanceId string `protobuf:"bytes,7,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// contains filtered or unexported fields
}

A list of unlockables currently owned by a user.

func (*UnlockablesList) Descriptor deprecated

func (*UnlockablesList) Descriptor() ([]byte, []int)

Deprecated: Use UnlockablesList.ProtoReflect.Descriptor instead.

func (*UnlockablesList) GetActiveSlots

func (x *UnlockablesList) GetActiveSlots() int32

func (*UnlockablesList) GetInstanceId

func (x *UnlockablesList) GetInstanceId() string

func (*UnlockablesList) GetMaxActiveSlots

func (x *UnlockablesList) GetMaxActiveSlots() int32

func (*UnlockablesList) GetOverflow

func (x *UnlockablesList) GetOverflow() *Unlockable

func (*UnlockablesList) GetSlotCost

func (x *UnlockablesList) GetSlotCost() *UnlockableSlotCost

func (*UnlockablesList) GetSlots

func (x *UnlockablesList) GetSlots() int32

func (*UnlockablesList) GetUnlockables

func (x *UnlockablesList) GetUnlockables() []*Unlockable

func (*UnlockablesList) ProtoMessage

func (*UnlockablesList) ProtoMessage()

func (*UnlockablesList) ProtoReflect

func (x *UnlockablesList) ProtoReflect() protoreflect.Message

func (*UnlockablesList) Reset

func (x *UnlockablesList) Reset()

func (*UnlockablesList) String

func (x *UnlockablesList) String() string

type UnlockablesRequest

type UnlockablesRequest struct {

	// The unlockable instance ID.
	InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// contains filtered or unexported fields
}

Request body for interacting with a specific unlockable.

func (*UnlockablesRequest) Descriptor deprecated

func (*UnlockablesRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnlockablesRequest.ProtoReflect.Descriptor instead.

func (*UnlockablesRequest) GetInstanceId

func (x *UnlockablesRequest) GetInstanceId() string

func (*UnlockablesRequest) ProtoMessage

func (*UnlockablesRequest) ProtoMessage()

func (*UnlockablesRequest) ProtoReflect

func (x *UnlockablesRequest) ProtoReflect() protoreflect.Message

func (*UnlockablesRequest) Reset

func (x *UnlockablesRequest) Reset()

func (*UnlockablesRequest) String

func (x *UnlockablesRequest) String() string

type UnlockablesReward

type UnlockablesReward struct {

	// The updated state of remaining unlockables.
	Unlockables *UnlockablesList `protobuf:"bytes,1,opt,name=unlockables,proto3" json:"unlockables,omitempty"`
	// The reward granted from the unlockable.
	Reward *Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"`
	// The available rewards active for the unlockable.
	AvailableRewards *AvailableRewards `protobuf:"bytes,3,opt,name=available_rewards,json=availableRewards,proto3" json:"available_rewards,omitempty"`
	// contains filtered or unexported fields
}

A reward that was granted upon unlock, and a new state of all unlockables.

func (*UnlockablesReward) Descriptor deprecated

func (*UnlockablesReward) Descriptor() ([]byte, []int)

Deprecated: Use UnlockablesReward.ProtoReflect.Descriptor instead.

func (*UnlockablesReward) GetAvailableRewards

func (x *UnlockablesReward) GetAvailableRewards() *AvailableRewards

func (*UnlockablesReward) GetReward

func (x *UnlockablesReward) GetReward() *Reward

func (*UnlockablesReward) GetUnlockables

func (x *UnlockablesReward) GetUnlockables() *UnlockablesList

func (*UnlockablesReward) ProtoMessage

func (*UnlockablesReward) ProtoMessage()

func (*UnlockablesReward) ProtoReflect

func (x *UnlockablesReward) ProtoReflect() protoreflect.Message

func (*UnlockablesReward) Reset

func (x *UnlockablesReward) Reset()

func (*UnlockablesReward) String

func (x *UnlockablesReward) String() string

type UnlockablesSystem

type UnlockablesSystem interface {
	System

	// Create will place a new unlockable into a slot by ID.
	Create(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, unlockableID string) (*UnlockablesList, error)

	// Get returns all unlockables active for a user by ID.
	Get(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (*UnlockablesList, error)

	// UnlockStart will begin an unlock of an unlockable by instance ID for a user.
	UnlockStart(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, instanceID string) (*UnlockablesList, error)

	// PurchaseUnlock will immediately unlock an unlockable with the specified instance ID for a user.
	PurchaseUnlock(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, instanceID string) (*UnlockablesList, error)

	// PurchaseSlot will create a new slot for a user by ID.
	PurchaseSlot(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (*UnlockablesList, error)

	// Claim an unlockable which has been unlocked by instance ID for the user.
	Claim(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, instanceID string) (*UnlockablesReward, error)

	// SetOnClaimReward sets a custom reward function which will run after an unlockable's reward is rolled.
	SetOnClaimReward(fn OnReward[*UnlockablesConfigUnlockable])
}

The UnlockablesSystem is a gameplay system which provides slots to store rewards which can be unlocked over time.

type UsernameOverrideFn

type UsernameOverrideFn func() string

UsernameOverrideFn can be used to provide a different username generation strategy from the default in Nakama server.

type ValidateCreateTeamFn

type ValidateCreateTeamFn func(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, req *TeamCreateRequest) *runtime.Error

ValidateCreateTeamFn allows custom rules or velocity checks to be added as a precondition on whether a team is created or not.

type ValidateWriteScoreFn

ValidateWriteScoreFn is a function used to validate the leaderboard score input.

Jump to

Keyboard shortcuts

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