playfab

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 8 Imported by: 3

README

go-playfab

Documentation

Index

Constants

View Source
const (
	TitleActivationStatusActivatedSteam    = "ActivatedSteam"
	TitleActivationStatusActivatedTitleKey = "ActivatedTitleKey"
	TitleActivationStatusNone              = "None"
	TitleActivationStatusPendingSteam      = "PendingSteam"
	TitleActivationStatusRevokedSteam      = "RevokedSteam"
)
View Source
const (
	UserOriginationAmazon                 = "Amazon"
	UserOriginationAndroid                = "Android"
	UserOriginationApple                  = "Apple"
	UserOriginationCustomID               = "CustomId"
	UserOriginationFacebook               = "Facebook"
	UserOriginationFacebookInstantGamesID = "FacebookInstantGamesId"
	UserOriginationGameCenter             = "GameCenter"
	UserOriginationGamersFirst            = "GamersFirst"
	UserOriginationGoogle                 = "Google"
	UserOriginationGooglePlayGames        = "GooglePlayGames"
	UserOriginationIOS                    = "IOS"
	UserOriginationKongregate             = "Kongregate"
	UserOriginationLoadTest               = "LoadTest"
	UserOriginationNintendoSwitchAccount  = "NintendoSwitchAccount"
	UserOriginationNintendoSwitchDeviceID = "NintendoSwitchDeviceID"
	UserOriginationOpenIDConnect          = "OpenIdConnect"
	UserOriginationOrganic                = "Organic"
	UserOriginationPSN                    = "PSN"
	UserOriginationParse                  = "Parse"
	UserOriginationServerCustomID         = "ServerCustomId"
	UserOriginationSteam                  = "Steam"
	UserOriginationTwitch                 = "Twitch"
	UserOriginationUnknown                = "Unknown"
	UserOriginationXboxLive               = "XboxLive"
)
View Source
const (
	IdentityProviderAndroidDevice         = "AndroidDevice"
	IdentityProviderApple                 = "Apple"
	IdentityProviderCustom                = "Custom"
	IdentityProviderCustomServer          = "CustomServer"
	IdentityProviderFacebook              = "Facebook"
	IdentityProviderFacebookInstantGames  = "FacebookInstantGames"
	IdentityProviderGameCenter            = "GameCenter"
	IdentityProviderGameServer            = "GameServer"
	IdentityProviderGooglePlay            = "GooglePlay"
	IdentityProviderGooglePlayGames       = "GooglePlayerGames"
	IdentityProviderIOSDevice             = "IOSDevice"
	IdentityProviderKongregate            = "Kongregate"
	IdentityProviderNintendoSwitch        = "NintendoSwitch"
	IdentityProviderNintendoSwitchAccount = "NintendoSwitchAccount"
	IdentityProviderOpenIDConnect         = "OpenIdConnect"
	IdentityProviderPSN                   = "PSN"
	IdentityProviderPlayFab               = "PlayFab"
	IdentityProviderSteam                 = "Steam"
	IdentityProviderTwitch                = "Twitch"
	IdentityProviderUnknown               = "Unknown"
	IdentityProviderWindowsHello          = "WindowsHello"
	IdentityProviderXboxLive              = "XBoxLive"
)
View Source
const (
	SubscriptionStatusBillingError                    = "BillingError"
	SubscriptionStatusCancelled                       = "Cancelled"
	SubscriptionStatusCustomerDidNotAcceptPriceChange = "CustomerDidNotAcceptPriceChange"
	SubscriptionStatusFreeTrial                       = "FreeTrial"
	SubscriptionStatusNoError                         = "NoError"
	SubscriptionStatusPaymentPending                  = "PaymentPending"
	SubscriptionStatusProductUnavailable              = "ProductUnavailable"
	SubscriptionStatusUnknownError                    = "UnknownError"
)
View Source
const (
	PushNotificationPlatformApplePushNotificationService = "ApplePushNotificationService"
	PushNotificationPlatformGoogleCloudMessaging         = "GoogleCloudMessaging"
)
View Source
const (
	UserDataPermissionPrivate = "Private"
	UserDataPermissionPublic  = "Public"
)
View Source
const (
	ErrorCodeEncryptionKeyMissing                  = 1290
	ErrorCodeEvaluationModePlayerCountExceeded     = 1490
	ErrorCodeExpiredXboxLiveToken                  = 1189
	ErrorCodeInvalidXboxLiveToken                  = 1188
	ErrorCodeRequestViewConstraintParamsNotAllowed = 1303
	ErrorCodeSignedRequestNotAllowed               = 1302
	ErrorCodeXboxInaccessible                      = 1339
	ErrorCodeXboxRejectedXSTSExchangeRequest       = 1343
	ErrorCodeXboxXASSExchangeFailure               = 1306
)
View Source
const (
	ErrorCodeDatabaseThroughputExceeded = 1113
	ErrorCodeItemNotFound               = 1047
	ErrorCodeNotImplemented             = 1515
)
View Source
const RelyingParty = "http://playfab.xboxlive.com/"

RelyingParty is the party that a xsapi.Token obtained from [XBLIdentityProvider.TokenSource] should rely on. Using a xsapi.Token that relies on other party may cause an error related to "decrypting token body".

Variables

This section is empty.

Functions

This section is empty.

Types

type AdCampaignAttribution

type AdCampaignAttribution struct {
	AttributedAt time.Time `json:"AttributedAt,omitempty"`
	CampaignID   string    `json:"CampaignId,omitempty"`
	Platform     string    `json:"Platform,omitempty"`
}

type Character

type Character struct {
	ID   string `json:"CharacterId,omitempty"`
	Name string `json:"CharacterName,omitempty"`
	Type string `json:"CharacterType,omitempty"`
}

type CharacterInventory

type CharacterInventory struct {
	ID        string         `json:"CharacterId,omitempty"`
	Inventory []ItemInstance `json:"Inventory,omitempty"`
}

type ContactEmailAddress

type ContactEmailAddress struct {
	Address            string                  `json:"EmailAddress,omitempty"`
	Name               string                  `json:"Name,omitempty"`
	VerificationStatus EmailVerificationStatus `json:"VerificationStatus,omitempty"`
}

type EmailVerificationStatus

type EmailVerificationStatus string
const (
	EmailVerificationStatusConfirmed  EmailVerificationStatus = "Confirmed"
	EmailVerificationStatusPending    EmailVerificationStatus = "Pending"
	EmailVerificationStatusUnverified EmailVerificationStatus = "Unverified"
)

type Error

type Error = internal.Error

type Identity

type Identity struct {
	// EntityToken is an [entity.Token] of [entity.TypeTitlePlayerAccount].
	// API requests will mostly require an [entity.Token] of [entity.TypeMasterPlayerAccount]
	// so you may exchange it with [entity.Token.Exchange] with PlayFabID.
	EntityToken        *entity.Token      `json:"EntityToken,omitempty"`
	ResponseParameters ResponseParameters `json:"InfoResultPayload,omitempty"`
	// LastLoginTime is the time of previous login. If there was no previous login, it is zero [time.Time].
	LastLoginTime time.Time `json:"LastLoginTime,omitempty"`
	// NewlyCreated is true if the account was newly created on login.
	NewlyCreated bool `json:"NewlyCreated,omitempty"`
	// PlayFabID is the unique ID of player. It can be used for exchanging an [entity.Token]
	// of [entity.TypeMasterPlayerAccount] with [entity.Token.Exchange].
	PlayFabID string `json:"PlayFabId,omitempty"`
	// SessionTicket is a unique token authorizing the user and game at server level, for the
	// current session. In Minecraft, it is used for authorizing with franchise API using a PlayFab token.
	SessionTicket string `json:"SessionTicket,omitempty"`
	// SettingsForUser is the settings specific to the user.
	SettingsForUser     UserSettings        `json:"SettingsForUser,omitempty"`
	TreatmentAssignment TreatmentAssignment `json:"TreatmentAssignment,omitempty"`
}

Identity a session identity that can subsequently be used for API which requires an authentication. It is generally returned as a result of [IdentityProvider.Login] or LoginConfig.Login.

type IdentityProvider

type IdentityProvider interface {
	Login(config LoginConfig) (*Identity, error)
}

IdentityProvider implements a Login method, which signs in to the PlayFab using LoginConfig.Login with a LoginConfig with additional fields required to fill in, through the path '/Client/LoginWithXXX', where X is normally the method to sign in. IdentityProvider is implemented by several platforms which supports signing in to the PlayFab with their identity.

type ItemInstance

type ItemInstance struct {
	Annotation        string                     `json:"Annotation,omitempty"`
	BundleContents    []string                   `json:"BundleContents,omitempty"`
	BundleParent      string                     `json:"BundleParent,omitempty"`
	CatalogVersion    string                     `json:"CatalogVersion,omitempty"`
	CustomData        map[string]json.RawMessage `json:"CustomData,omitempty"`
	DisplayName       string                     `json:"DisplayName,omitempty"`
	Expiration        time.Time                  `json:"Expiration,omitempty"`
	Class             string                     `json:"ItemClass,omitempty"`
	ID                string                     `json:"ItemId,omitempty"`
	InstanceID        string                     `json:"ItemInstanceId,omitempty"`
	PurchaseDate      time.Time                  `json:"PurchaseDate,omitempty"`
	RemainingUses     int                        `json:"RemainingUses,omitempty"`
	UnitCurrency      string                     `json:"UnitCurrency,omitempty"`
	UnitPrice         int                        `json:"UnitPrice,omitempty"`
	UsesIncrementedBy int                        `json:"UsesIncrementedBy,omitempty"`
}

type LinkedPlatformAccount

type LinkedPlatformAccount struct {
	Email          string `json:"Email,omitempty"`
	Platform       string `json:"Platform,omitempty"`
	PlatformUserID string `json:"PlatformUserId,omitempty"`
	Username       string `json:"Username,omitempty"`
}

type Location

type Location struct {
	City          string `json:"City,omitempty"`
	ContinentCode string `json:"ContinentCode,omitempty"`
	CountryCode   string `json:"CountryCode,omitempty"`
	Latitude      int    `json:"Latitude,omitempty"`
	Longitude     int    `json:"Longitude,omitempty"`
}

type LoginConfig

type LoginConfig struct {
	Title title.Title `json:"TitleId,omitempty"`
	// CreateAccount specifies to automatically create a PlayFab account if
	// one is not currently linked to the ID.
	CreateAccount bool `json:"CreateAccount,omitempty"`
	// CustomTags is the optional custom tags associated with the request.
	CustomTags map[string]any `json:"CustomTags,omitempty"`
	// EncryptedRequest is a base64-encoded body that is encrypted with the
	// Title's public RSA key (Enterprise Only).
	EncryptedRequest  []byte             `json:"EncryptedRequest,omitempty"`
	RequestParameters *RequestParameters `json:"InfoRequestParameters,omitempty"`
	// PlayerSecret that is used to verify API request signatures (Enterprise Only).
	PlayerSecret string `json:"PlayerSecret,omitempty"`
}

LoginConfig represents a base structure used for signing in to the PlayFab through a method. An implementation of IdentityProvider may embed LoginConfig with additional fields required to fill in.

func (LoginConfig) Login

func (l LoginConfig) Login(path string, body any) (*Identity, error)

Login signs in to PlayFab using the request body and the path. The path normally follows the format 'Client/LoginWithXXX' where X typically is the method for signing in. The request body is generally a structure that may embed LoginConfig with additional fields required for the specific path, such as a token of IdentityProvider.

type Membership

type Membership struct {
	Active             bool           `json:"IsActive,omitempty"`
	Expiration         time.Time      `json:"MembershipExpiration,omitempty"`
	ID                 string         `json:"MembershipId,omitempty"`
	OverrideExpiration time.Time      `json:"OverrideExpiration,omitempty"`
	OverrideSet        bool           `json:"OverrideIsSet,omitempty"`
	Subscriptions      []Subscription `json:"Subscriptions,omitempty"`
}

type PlayerProfile

type PlayerProfile struct {
	AdCampaignAttributions        []AdCampaignAttribution        `json:"AdCampaignAttributions,omitempty"`
	AvatarURL                     string                         `json:"AvatarUrl,omitempty"`
	BannedUntil                   time.Time                      `json:"BannedUntil,omitempty"`
	ContactEmailAddresses         []ContactEmailAddress          `json:"ContactEmailAddresses,omitempty"`
	Created                       time.Time                      `json:"Created,omitempty"`
	DisplayName                   string                         `json:"DisplayName,omitempty"`
	ExperimentVariants            []string                       `json:"ExperimentVariants,omitempty"`
	LastLogin                     time.Time                      `json:"LastLogin,omitempty"`
	LinkedAccounts                []LinkedPlatformAccount        `json:"LinkedAccounts,omitempty"`
	Locations                     []Location                     `json:"Locations,omitempty"`
	Memberships                   []Membership                   `json:"Memberships,omitempty"`
	Origination                   string                         `json:"Origination,omitempty"`
	PlayerID                      string                         `json:"PlayerId,omitempty"`
	PublisherID                   string                         `json:"PublisherId,omitempty"`
	PushNotificationRegistrations []PushNotificationRegistration `json:"PushNotificationRegistrations,omitempty"`
	Statistics                    []Statistic                    `json:"Statistics,omitempty"`
	Tags                          []Tag                          `json:"Tags,omitempty"`
	Title                         title.Title                    `json:"TitleId,omitempty"`
	TotalValueToDateInUSD         int                            `json:"TotalValueToDateInUSD,omitempty"`
	ValuesToDates                 []ValuesToDate                 `json:"ValuesToDate,omitempty"`
}

type ProfileConstraints

type ProfileConstraints struct {
	ShowAvatarURL                     bool `json:"ShowAvatarUrl,omitempty"`
	ShowBannedUntil                   bool `json:"ShowBannedUntil,omitempty"`
	ShowCampaignAttributions          bool `json:"ShowCampaignAttributions,omitempty"`
	ShowContactEmailAddresses         bool `json:"ShowContactEmailAddresses,omitempty"`
	ShowCreated                       bool `json:"ShowCreated,omitempty"`
	ShowDisplayName                   bool `json:"ShowDisplayName,omitempty"`
	ShowExperimentVariants            bool `json:"ShowExperimentVariants,omitempty"`
	ShowLastLogin                     bool `json:"ShowLastLogin,omitempty"`
	ShowLinkedAccounts                bool `json:"ShowLinkedAccounts,omitempty"`
	ShowLocations                     bool `json:"ShowLocations,omitempty"`
	ShowMemberships                   bool `json:"ShowMemberships,omitempty"`
	ShowOrigination                   bool `json:"ShowOrigination,omitempty"`
	ShowPushNotificationRegistrations bool `json:"ShowPushNotificationRegistrations,omitempty"`
	ShowStatistics                    bool `json:"ShowStatistics,omitempty"`
	ShowTags                          bool `json:"ShowTags,omitempty"`
	ShowTotalValueToDateInUSD         bool `json:"ShowTotalValueToDateInUsd,omitempty"`
	ShowValuesToDate                  bool `json:"ShowValuesToDate,omitempty"`
}

ProfileConstraints specifies the properties to return from the player profile, it is included as [RequestParameters.ProfileConstraints] to request some of the properties specified on the fields as [ResponseParameters.PlayerProfile].

type PushNotificationRegistration

type PushNotificationRegistration struct {
	NotificationEndpointARN string `json:"NotificationEndpointARN,omitempty"`
	Platform                string `json:"Platform,omitempty"`
}

type RequestParameters

type RequestParameters struct {
	CharacterInventories bool               `json:"GetCharacterInventories,omitempty"`
	CharacterList        bool               `json:"GetCharacterList,omitempty"`
	PlayerProfile        bool               `json:"GetPlayerProfile,omitempty"`
	PlayerStatistics     bool               `json:"GetPlayerStatistics,omitempty"`
	TitleData            bool               `json:"GetTitleData,omitempty"`
	UserAccountInfo      bool               `json:"GetUserAccountInfo,omitempty"`
	UserData             bool               `json:"GetUserData,omitempty"`
	UserInventory        bool               `json:"GetUserInventory,omitempty"`
	UserReadOnlyData     bool               `json:"GetUserReadOnlyData,omitempty"`
	UserVirtualCurrency  bool               `json:"GetUserVirtualCurrency,omitempty"`
	PlayerStatisticNames []string           `json:"PlayerStatisticNames,omitempty"`
	ProfileConstraints   ProfileConstraints `json:"ProfileConstraints,omitempty"`
	TitleDataKeys        []string           `json:"TitleDataKeys,omitempty"`
	UserDataKeys         []string           `json:"UserDataKeys,omitempty"`
	UserReadOnlyDataKeys []string           `json:"UserReadOnlyDataKeys,omitempty"`
}

RequestParameters is a set of requested parameters included in ResponseParameters, which can be retrieved through [Identity.ResponseParameters]. Users may set RequestParameters as a part of LoginConfig to include additional parameters while signing in to PlayFab.

type ResponseParameters

type ResponseParameters struct {
	Account                         UserAccount                 `json:"AccountInfo,omitempty"`
	CharacterInventories            []CharacterInventory        `json:"CharacterInventories,omitempty"`
	CharacterList                   []Character                 `json:"CharacterList,omitempty"`
	PlayerProfile                   PlayerProfile               `json:"PlayerProfile,omitempty"`
	PlayerStatistics                []StatisticValue            `json:"PlayerStatistics,omitempty"`
	TitleData                       map[string]json.RawMessage  `json:"TitleData,omitempty"`
	UserData                        UserDataRecord              `json:"UserData,omitempty"`
	UserDataVersion                 int                         `json:"UserDataVersion,omitempty"`
	UserInventory                   []ItemInstance              `json:"UserInventory,omitempty"`
	UserReadOnlyData                UserDataRecord              `json:"UserReadOnlyData,omitempty"`
	UserReadOnlyDataVersion         int                         `json:"UserReadOnlyDataVersion,omitempty"`
	UserVirtualCurrency             map[string]json.RawMessage  `json:"UserVirtualCurrency,omitempty"`
	UserVirtualCurrencyRechargeTime VirtualCurrencyRechargeTime `json:"UserVirtualCurrencyRechargeTimes"`
}

ResponseParameters is a set of parameters requested to be included in RequestParameters, which is a part of LoginConfig as [LoginConfig.RequestParameters]. It includes an information of player/entity signed in at Identity.

type Result

type Result[T any] internal.Result[T]

type Statistic

type Statistic struct {
	Name    string `json:"Name,omitempty"`
	Value   int    `json:"Value,omitempty"`
	Version int    `json:"Version,omitempty"`
}

type StatisticValue

type StatisticValue struct {
	Name    string `json:"StatisticName"`
	Value   int    `json:"Value,omitempty"`
	Version int    `json:"Version,omitempty"`
}

type Subscription

type Subscription struct {
	Expiration              time.Time `json:"Expiration,omitempty"`
	InitialSubscriptionTime time.Time `json:"InitialSubscriptionTime,omitempty"`
	Active                  bool      `json:"IsActive,omitempty"`
	Status                  string    `json:"Status,omitempty"`
	ID                      string    `json:"SubscriptionId,omitempty"`
	ItemID                  string    `json:"SubscriptionItemId,omitempty"`
	Provider                string    `json:"SubscriptionProvider,omitempty"`
}

type Tag

type Tag struct {
	Value string `json:"TagValue,omitempty"`
}

type TreatmentAssignment

type TreatmentAssignment struct {
	Variables []Variable `json:"Variables,omitempty"`
	Variants  []string   `json:"Variants,omitempty"`
}

type UserAccount

type UserAccount struct {
	AndroidDevice          UserAndroidDevice          `json:"AndroidDeviceInfo,omitempty"`
	AppleAccount           UserAppleAccount           `json:"AppleAccountInfo,omitempty"`
	Created                time.Time                  `json:"Created,omitempty"`
	CustomID               UserCustomID               `json:"CustomIdInfo,omitempty"`
	Facebook               UserFacebook               `json:"FacebookInfo,omitempty"`
	FacebookInstantGamesID UserFacebookInstantGamesID `json:"FacebookInstantGamesIdInfo,omitempty"`
	GameCenter             UserGameCenter             `json:"GameCenterInfo,omitempty"`
	Google                 UserGoogle                 `json:"GoogleInfo,omitempty"`
	GooglePlayGames        UserGooglePlayGames        `json:"GooglePlayGamesInfo,omitempty"`
	IOSDevice              UserIOSDevice              `json:"IosDeviceInfo,omitempty"`
	Kongregate             UserKongregate             `json:"KongregateInfo,omitempty"`
	NintendoSwitchAccount  UserNintendoSwitchAccount  `json:"NintendoSwitchAccountInfo,omitempty"`
	NintendoSwitchDeviceID UserNintendoSwitchDeviceID `json:"NintendoSwitchDeviceIdInfo,omitempty"`
	OpenID                 UserOpenID                 `json:"OpenIdInfo,omitempty"`
	PlayFabID              string                     `json:"PlayFabId,omitempty"`
	Private                UserPrivate                `json:"PrivateInfo,omitempty"`
	PSN                    UserPSN                    `json:"PsnInfo,omitempty"`
	Steam                  UserSteam                  `json:"SteamInfo,omitempty"`
	Title                  UserTitle                  `json:"TitleInfo,omitempty"`
	Twitch                 UserTwitch                 `json:"TwitchInfo,omitempty"`
	Username               string                     `json:"Username,omitempty"`
	Xbox                   UserXbox                   `json:"Xbox,omitempty"`
}

UserAccount specifies an account information for several platforms that supports PlayFab as an identity provider.

type UserAndroidDevice

type UserAndroidDevice struct {
	DeviceID string `json:"AndroidDeviceId,omitempty"`
}

type UserAppleAccount

type UserAppleAccount struct {
	SubjectID string `json:"AppleSubjectId,omitempty"`
}

type UserCustomID

type UserCustomID struct {
	ID string `json:"CustomId,omitempty"`
}

type UserDataRecord

type UserDataRecord struct {
	LastUpdated time.Time `json:"LastUpdated,omitempty"`
	Permission  string    `json:"Permission,omitempty"`
	Value       string    `json:"Value,omitempty"`
}

type UserFacebook

type UserFacebook struct {
	ID       string `json:"FacebookId,omitempty"`
	FullName string `json:"FullName,omitempty"`
}

type UserFacebookInstantGamesID

type UserFacebookInstantGamesID struct {
	ID string `json:"FacebookInstantGamesId,omitempty"`
}

type UserGameCenter

type UserGameCenter struct {
	ID string `json:"GameCenterId,omitempty"`
}

type UserGoogle

type UserGoogle struct {
	Email  string `json:"GoogleEmail,omitempty"`
	Gender string `json:"GoogleGender,omitempty"`
	ID     string `json:"GoogleId,omitempty"`
	Locale string `json:"GoogleLocale,omitempty"`
	Name   string `json:"GoogleName,omitempty"`
}

type UserGooglePlayGames

type UserGooglePlayGames struct {
	PlayerAvatarImageURL string `json:"GooglePlayGamesPlayerAvatarImageUrl,omitempty"`
	PlayerDisplayName    string `json:"GooglePlayGamesPlayerDisplayName,omitempty"`
	PlayerID             string `json:"GooglePlayGamesPlayerId,omitempty"`
}

type UserIOSDevice

type UserIOSDevice struct {
	ID string `json:"IosDeviceId,omitempty"`
}

type UserKongregate

type UserKongregate struct {
	ID   string `json:"KongregateId,omitempty"`
	Name string `json:"KongregateName,omitempty"`
}

type UserNintendoSwitchAccount

type UserNintendoSwitchAccount struct {
	SubjectID string `json:"NintendoSwitchAccountSubjectId,omitempty"`
}

type UserNintendoSwitchDeviceID

type UserNintendoSwitchDeviceID struct {
	ID string `json:"NintendoSwitchDeviceId,omitempty"`
}

type UserOpenID

type UserOpenID struct {
	ConnectionID string `json:"ConnectionId,omitempty"`
	Issuer       string `json:"Issuer,omitempty"`
	Subject      string `json:"Subject,omitempty"`
}

type UserPSN

type UserPSN struct {
	AccountID string `json:"PsnAccountId,omitempty"`
	OnlineID  string `json:"PsnOnlineId,omitempty"`
}

type UserPrivate

type UserPrivate struct {
	Email string `json:"Email,omitempty"`
}

type UserSettings

type UserSettings struct {
	GatherDevice     bool `json:"GatherDeviceInfo,omitempty"`
	GatherFocus      bool `json:"GatherFocusInfo,omitempty"`
	NeedsAttribution bool `json:"NeedsAttribution,omitempty"`
}

type UserSteam

type UserSteam struct {
	ActivationStatus string `json:"SteamActivationStatus,omitempty"`
	Country          string `json:"SteamCountry,omitempty"`
	Currency         string `json:"Currency,omitempty"`
	ID               string `json:"SteamId,omitempty"`
	Name             string `json:"SteamName,omitempty"`
}

type UserTitle

type UserTitle struct {
	AvatarURL          string     `json:"AvatarUrl,omitempty"`
	Created            time.Time  `json:"Created,omitempty"`
	DisplayName        string     `json:"DisplayName,omitempty"`
	FirstLogin         time.Time  `json:"FirstLogin,omitempty"`
	LastLogin          time.Time  `json:"LastLogin,omitempty"`
	Origination        string     `json:"Origination,omitempty"`
	TitlePlayerAccount entity.Key `json:"TitlePlayerAccount,omitempty"`
	Banned             bool       `json:"isBanned,omitempty"`
}

type UserTwitch

type UserTwitch struct {
	ID       string `json:"TwitchId,omitempty"`
	UserName string `json:"TwitchUserName,omitempty"`
}

type UserXbox

type UserXbox struct {
	UserID      string `json:"XboxUserId,omitempty"`
	UserSandbox string `json:"XboxUserSandbox,omitempty"`
}

type ValuesToDate

type ValuesToDate struct {
	Currency            string `json:"Currency,omitempty"`
	TotalValue          int    `json:"TotalValue,omitempty"`
	TotalValueAsDecimal string `json:"TotalValueAsDecimal,omitempty"`
}

type Variable

type Variable struct {
	Name  string `json:"Name,omitempty"`
	Value string `json:"Value,omitempty"`
}

type VirtualCurrencyRechargeTime

type VirtualCurrencyRechargeTime struct {
	Max               int       `json:"RechargeMax,omitempty"`
	Time              time.Time `json:"RechargeTime,omitempty"`
	SecondsToRecharge int       `json:"SecondsToRecharge,omitempty"`
}

type XBLIdentityProvider

type XBLIdentityProvider struct {
	// TokenSource is used for obtaining a [xsapi.Token] that relies on the party defined in
	// the constant below (see RelyingParty).
	TokenSource xsapi.TokenSource
}

XBLIdentityProvider implements IdentityProvider for signing in to PlayFab using the path '/Client/LoginWithXbox' with a xsapi.Token that relies on the party 'http://playfab.xboxlive.com/'.

func (XBLIdentityProvider) Login

func (prov XBLIdentityProvider) Login(config LoginConfig) (*Identity, error)

Login signs in to PlayFab using a xsapi.Token obtained from the TokenSource that relies on the party 'http://playfab.xboxlive.com/'. It returns an Identity by calling the LoginConfig.Login method with an additional field named 'XboxToken' that specifies a string obtained from xsapi.Token.String and the path '/Client/LoginWithXbox'.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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