com.beamable 5.1.0 → 5.1.1-PREVIEW.RC1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/CHANGELOG.md +18 -0
- package/Common/Runtime/AgnosticAttribute.cs +2 -2
- package/Common/Runtime/Api/AliasHelper.cs +2 -2
- package/Common/Runtime/Api/Analytics/AnalyticsEventRequest.cs +2 -2
- package/Common/Runtime/Api/Analytics/AnalyticsService.cs +2 -2
- package/Common/Runtime/Api/Analytics/IBeamAnalyticsService.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/CoreEvent.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/IAnalyticsEvent.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/SampleCustomEvent.cs +2 -2
- package/Common/Runtime/Api/Announcements/AbsAnnouncementsApi.cs +2 -2
- package/Common/Runtime/Api/Announcements/IAnnouncementsApi.cs +2 -2
- package/Common/Runtime/Api/Auth/AuthApi.cs +2 -2
- package/Common/Runtime/Api/Auth/IAuthApi.cs +2 -2
- package/Common/Runtime/Api/Calendars/AbsCalendarApi.cs +2 -2
- package/Common/Runtime/Api/Calendars/ICalendarApi.cs +2 -2
- package/Common/Runtime/Api/Chat/ChatApi.cs +2 -2
- package/Common/Runtime/Api/Chat/IChatApi.cs +2 -2
- package/Common/Runtime/Api/CloudData/CloudDataApi.cs +2 -2
- package/Common/Runtime/Api/CloudData/ICloudDataApi.cs +2 -2
- package/Common/Runtime/Api/CometClientData.cs +2 -2
- package/Common/Runtime/Api/Commerce/ICommerceApi.cs +2 -2
- package/Common/Runtime/Api/Content/IContentApi.cs +2 -2
- package/Common/Runtime/Api/Events/AbsEventsApi.cs +2 -2
- package/Common/Runtime/Api/Events/IEventsApi.cs +2 -2
- package/Common/Runtime/Api/Groups/GroupsApi.cs +2 -2
- package/Common/Runtime/Api/Groups/IGroupsApi.cs +2 -2
- package/Common/Runtime/Api/IAccessToken.cs +2 -2
- package/Common/Runtime/Api/IBeamableFilesystemAccessor.cs +2 -2
- package/Common/Runtime/Api/IBeamableRequester.cs +2 -2
- package/Common/Runtime/Api/IConnectivityChecker.cs +2 -2
- package/Common/Runtime/Api/IHasBeamableRequester.cs +2 -2
- package/Common/Runtime/Api/IServiceRoutingStrategy.cs +2 -2
- package/Common/Runtime/Api/ISupportsGet.cs +2 -2
- package/Common/Runtime/Api/IUserContext.cs +2 -2
- package/Common/Runtime/Api/IUserDataCache.cs +2 -2
- package/Common/Runtime/Api/Inventory/IInventoryApi.cs +2 -2
- package/Common/Runtime/Api/Inventory/InventoryApi.cs +2 -2
- package/Common/Runtime/Api/Inventory/InventoryUpdateBuilder.cs +2 -2
- package/Common/Runtime/Api/Leaderboards/ILeaderboardApi.cs +2 -2
- package/Common/Runtime/Api/Leaderboards/LeaderboardApi.cs +2 -2
- package/Common/Runtime/Api/Lobbies/ILobbyApi.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Lobby.cs +2 -2
- package/Common/Runtime/Api/Lobbies/LobbyNotification.cs +2 -2
- package/Common/Runtime/Api/Lobbies/LobbyPlayer.cs +2 -2
- package/Common/Runtime/Api/Lobbies/LobbyRestriction.cs +2 -2
- package/Common/Runtime/Api/Lobbies/LobbyService.cs +2 -2
- package/Common/Runtime/Api/Lobbies/LobbyUtils.cs +2 -2
- package/Common/Runtime/Api/Lobbies/NotInLobby.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/AddTagsRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/CreateLobbyRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/JoinByPasscodeRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/JoinLobbyRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryResponse.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/RemoveFromLobbyRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/RemoveTagsRequest.cs +2 -2
- package/Common/Runtime/Api/Lobbies/Requests/UpdateLobbyRequest.cs +2 -2
- package/Common/Runtime/Api/Mail/AbsMailApi.cs +2 -2
- package/Common/Runtime/Api/Mail/IMailApi.cs +2 -2
- package/Common/Runtime/Api/Notifications/INotificationService.cs +2 -2
- package/Common/Runtime/Api/Notifications/PrimitiveStringPayload.cs +2 -2
- package/Common/Runtime/Api/Parties/IPartyApi.cs +2 -2
- package/Common/Runtime/Api/Parties/NotInParty.cs +2 -2
- package/Common/Runtime/Api/Parties/Party.cs +2 -2
- package/Common/Runtime/Api/Parties/PartyNotifications.cs +2 -2
- package/Common/Runtime/Api/Parties/PartyRestriction.cs +2 -2
- package/Common/Runtime/Api/Parties/PartyService.cs +2 -2
- package/Common/Runtime/Api/Parties/Requests/CreatePartyRequest.cs +2 -2
- package/Common/Runtime/Api/Parties/Requests/PartyQueryResponse.cs +2 -2
- package/Common/Runtime/Api/Parties/Requests/PlayerRequest.cs +2 -2
- package/Common/Runtime/Api/Parties/Requests/UpdatePartyRequest.cs +2 -2
- package/Common/Runtime/Api/Payments/IPaymentsApi.cs +2 -2
- package/Common/Runtime/Api/Payments/PaymentsApi.cs +2 -2
- package/Common/Runtime/Api/Presence/IPresenceApi.cs +2 -2
- package/Common/Runtime/Api/Presence/PresenceService.cs +2 -2
- package/Common/Runtime/Api/Push/IPushApi.cs +2 -2
- package/Common/Runtime/Api/QueryBuilder.cs +2 -2
- package/Common/Runtime/Api/Realms/IAliasService.cs +2 -2
- package/Common/Runtime/Api/Realms/IRealmApi.cs +2 -2
- package/Common/Runtime/Api/Realms/RealmService.cs +2 -2
- package/Common/Runtime/Api/SignedRequesterHelper.cs +2 -2
- package/Common/Runtime/Api/Social/ISocialApi.cs +2 -2
- package/Common/Runtime/Api/Social/SocialApi.cs +2 -2
- package/Common/Runtime/Api/Stats/AbsStatsApi.cs +2 -2
- package/Common/Runtime/Api/Stats/IStatsApi.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsAccessType.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsApiHelper.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsDomainType.cs +2 -2
- package/Common/Runtime/Api/Tournaments/ITournamentApi.cs +2 -2
- package/Common/Runtime/Api/Tournaments/TournamentApi.cs +2 -2
- package/Common/Runtime/BeamCli/CliContractTypeAttribute.cs +2 -2
- package/Common/Runtime/BeamCli/CliOtelData.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/CliLogMessage.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/CollectorStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/Constants.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotActionType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentSnapshotType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifest.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifestEntry.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestAuthor.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestProjectData.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/TagStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/EnvironmentVersionData.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/GenerateEnvOutput.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ServiceInfo.cs +2 -2
- package/Common/Runtime/BeamCli/ErrorOutput.cs +2 -2
- package/Common/Runtime/BeamCli/IBeamCommand.cs +2 -2
- package/Common/Runtime/BeamCli/Reporting.cs +2 -2
- package/Common/Runtime/BeamCli/ServiceInfoHelper.cs +2 -2
- package/Common/Runtime/BeamGenerateSchemaAttribute.cs +2 -2
- package/Common/Runtime/BeamableColorUtil.cs +2 -2
- package/Common/Runtime/BeamableEnumExtensions.cs +2 -2
- package/Common/Runtime/BeamableTaskExtensions.cs +2 -2
- package/Common/Runtime/Collections/ConcurrentBag.cs +2 -2
- package/Common/Runtime/Collections/ConcurrentDictionary.cs +2 -2
- package/Common/Runtime/Constants/Constants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ArchiveConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ConfigConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ContentConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ContentManagerConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/CronConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/DockerConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/EnvironmentConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/LoginBaseConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/MigrationConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/NotificationConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/OtelConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/PortalExtensionConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/RequesterConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/SchedulesConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ServiceConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/SpewConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/TestingToolConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ToolbarConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/ToolboxConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/TooltipConstants.cs +2 -2
- package/Common/Runtime/Content/ClientContentSerializer.cs +2 -2
- package/Common/Runtime/Content/ClientManifest.cs +2 -2
- package/Common/Runtime/Content/ClientPermissions.cs +2 -2
- package/Common/Runtime/Content/ContentCorruptedException.cs +2 -2
- package/Common/Runtime/Content/ContentDataInfo.cs +2 -2
- package/Common/Runtime/Content/ContentDeserializationException.cs +2 -2
- package/Common/Runtime/Content/ContentFieldAttribute.cs +2 -2
- package/Common/Runtime/Content/ContentFilterType.cs +2 -2
- package/Common/Runtime/Content/ContentNotFoundException.cs +2 -2
- package/Common/Runtime/Content/ContentObject.cs +2 -2
- package/Common/Runtime/Content/ContentQuery.cs +2 -2
- package/Common/Runtime/Content/ContentQueryExtensions.cs +2 -2
- package/Common/Runtime/Content/ContentRef.cs +2 -2
- package/Common/Runtime/Content/ContentSerializer.cs +2 -2
- package/Common/Runtime/Content/ContentTypeAttribute.cs +2 -2
- package/Common/Runtime/Content/ContentTypeReflectionCache.cs +2 -2
- package/Common/Runtime/Content/ContentVisibility.cs +2 -2
- package/Common/Runtime/Content/Federation.cs +2 -2
- package/Common/Runtime/Content/IContentObject.cs +2 -2
- package/Common/Runtime/Content/IContentService.cs +2 -2
- package/Common/Runtime/Content/IIgnoreSerializationCallbacks.cs +2 -2
- package/Common/Runtime/Content/IgnoreContentFieldAttribute.cs +2 -2
- package/Common/Runtime/Content/Optionals.cs +2 -2
- package/Common/Runtime/Content/PropertyAttributes/FilePathSelectorAttribute.cs +2 -2
- package/Common/Runtime/Content/PropertyAttributes/HideUnlessServerPackageInstalled.cs +2 -2
- package/Common/Runtime/Content/PropertyAttributes/ReadonlyIfAttribute.cs +2 -2
- package/Common/Runtime/Content/PropertyAttributes/ShowOnlyAttribute.cs +2 -2
- package/Common/Runtime/Content/RenderAsRefAttribute.cs +2 -2
- package/Common/Runtime/Content/SerializableDictionary.cs +2 -2
- package/Common/Runtime/Content/Utility/DateUtility.cs +2 -2
- package/Common/Runtime/Content/Validation/AggregateContentValidationException.cs +2 -2
- package/Common/Runtime/Content/Validation/CannotBeBlank.cs +2 -2
- package/Common/Runtime/Content/Validation/CannotBeEmpty.cs +2 -2
- package/Common/Runtime/Content/Validation/ContentValidationException.cs +2 -2
- package/Common/Runtime/Content/Validation/FederationMustBeValid.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeComparatorString.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeCurrency.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeCurrencyOrItem.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeDateString.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeItem.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeLeaderboard.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeNonDefault.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeNonNegative.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeOneOf.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBePositive.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeSlugString.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeTimeSpanDuration.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeValidCron.cs +2 -2
- package/Common/Runtime/Content/Validation/MustContain.cs +2 -2
- package/Common/Runtime/Content/Validation/MustReferenceContent.cs +2 -80
- package/Common/Runtime/Content/Validation/RouteParametersMustBeValid.cs +2 -2
- package/Common/Runtime/Content/Validation/ServiceRouteMustBeValid.cs +2 -2
- package/Common/Runtime/Content/Validation/TimeSpanDisplayAttribute.cs +2 -2
- package/Common/Runtime/Content/Validation/ValidationAttribute.cs +2 -2
- package/Common/Runtime/Content/Validation/ValidationContext.cs +2 -2
- package/Common/Runtime/CronExpression/CronLocale.cs +2 -2
- package/Common/Runtime/CronExpression/ErrorData.cs +2 -2
- package/Common/Runtime/CronExpression/ExpressionParser.cs +2 -2
- package/Common/Runtime/CronExpression/Options.cs +2 -2
- package/Common/Runtime/Debug.cs +2 -2
- package/Common/Runtime/DefaultQuery.cs +2 -2
- package/Common/Runtime/Dependencies/DependencyBuilder.cs +2 -2
- package/Common/Runtime/Dependencies/DependencyProvider.cs +2 -2
- package/Common/Runtime/Dependencies/Exceptions.cs +2 -2
- package/Common/Runtime/Dependencies/IDependencyList.cs +2 -2
- package/Common/Runtime/Dependencies/IDependencyNameProvider.cs +2 -2
- package/Common/Runtime/Dependencies/RegisterBeamableDependenciesAttribute.cs +2 -2
- package/Common/Runtime/Dependencies/ServiceStorage.cs +2 -2
- package/Common/Runtime/Dependencies/Utils.cs +2 -2
- package/Common/Runtime/DocUtils.cs +2 -2
- package/Common/Runtime/Environment/PackageVersion.cs +2 -2
- package/Common/Runtime/Federation/FederatedGameServer.cs +2 -2
- package/Common/Runtime/Federation/FederatedInventory.cs +2 -2
- package/Common/Runtime/Federation/FederatedLogin.cs +2 -2
- package/Common/Runtime/Federation/FederatedPlayerInit.cs +2 -2
- package/Common/Runtime/Federation/Federation.cs +2 -2
- package/Common/Runtime/IRuntimeConfigProvider.cs +2 -2
- package/Common/Runtime/ISearchableElement.cs +2 -2
- package/Common/Runtime/JsonSerializable/DeleteStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/DiffStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/JsonData.cs +2 -2
- package/Common/Runtime/JsonSerializable/JsonSaveStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/JsonSerializable.cs +2 -2
- package/Common/Runtime/JsonSerializable/LoadStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/MessagePackStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/SaveStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/TypeLookupFactory.cs +2 -2
- package/Common/Runtime/Modules/Announcements/AnnouncementApiContent.cs +2 -2
- package/Common/Runtime/Modules/Announcements/AnnouncementContent.cs +2 -2
- package/Common/Runtime/Modules/Announcements/AnnouncementRef.cs +2 -2
- package/Common/Runtime/Modules/Calendars/CalendarContent.cs +2 -2
- package/Common/Runtime/Modules/Calendars/CalendarRef.cs +2 -2
- package/Common/Runtime/Modules/Groups/GroupDonationContentRef.cs +2 -2
- package/Common/Runtime/Modules/Groups/GroupDonationsContent.cs +2 -2
- package/Common/Runtime/Modules/Inventory/CurrencyContent.cs +2 -2
- package/Common/Runtime/Modules/Inventory/CurrencyRef.cs +2 -2
- package/Common/Runtime/Modules/Inventory/ItemContent.cs +2 -2
- package/Common/Runtime/Modules/Inventory/ItemRef.cs +2 -2
- package/Common/Runtime/Modules/Inventory/VipContent.cs +2 -2
- package/Common/Runtime/Modules/Leaderboards/LeaderboardContent.cs +2 -2
- package/Common/Runtime/Modules/Leaderboards/LeaderboardRef.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/ApiContent.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/EmailContent.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/EventContent.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/PlayerReward.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/ScheduleDefinition.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/ScheduleExtensions.cs +2 -2
- package/Common/Runtime/Modules/SharedContent/SimGameType.cs +2 -2
- package/Common/Runtime/Modules/Shop/ListingContent.cs +2 -2
- package/Common/Runtime/Modules/Shop/ListingLink.cs +2 -2
- package/Common/Runtime/Modules/Shop/ListingRef.cs +2 -2
- package/Common/Runtime/Modules/Shop/SKUContent.cs +2 -2
- package/Common/Runtime/Modules/Shop/SKURef.cs +2 -2
- package/Common/Runtime/Modules/Shop/StoreContent.cs +2 -2
- package/Common/Runtime/Modules/Shop/StoreRef.cs +2 -2
- package/Common/Runtime/Modules/Steam/ISteamService.cs +2 -2
- package/Common/Runtime/Modules/Tournaments/TournamentColorConstants.cs +2 -2
- package/Common/Runtime/Modules/Tournaments/TournamentContent.cs +2 -2
- package/Common/Runtime/ObjectExtensions.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AuthBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AuthBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAuth.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAuthCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamo.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamoCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamootel.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamootelCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBilling.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBillingCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamCustomer.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamCustomerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamLobby.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamLobbyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMailbox.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMailboxCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMatchmaking.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMatchmakingCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamParty.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPartyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayer.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerlobby.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerlobbyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerparty.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerpartyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayersession.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayersessionCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerstats.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerstatsCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerticket.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerticketCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPresence.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPresenceCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamRealmsecrets.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamRealmsecretsCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamScheduler.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamSchedulerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamSession.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamSessionCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamStats.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamStatsCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamoBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamoBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CalendarsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CalendarsObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CloudsavingBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CloudsavingBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CommerceBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CommerceBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CommerceObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/ContentBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/ContentBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Event-playersObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Event-playersObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Group-usersObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Group-usersObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/GroupsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/GroupsObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/InventoryBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/InventoryBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/InventoryObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/LeaderboardsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/LeaderboardsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/LeaderboardsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Models.gs.cs +2 -2
- package/Common/Runtime/OpenApi/NotificationBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/NotificationBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PaymentsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PaymentsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PaymentsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PushBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PushBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/RealmsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/RealmsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SessionBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SessionBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SocialBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SocialBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TrialsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TrialsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApiExtensions/BeamoExtensions.cs +2 -2
- package/Common/Runtime/OpenApiExtensions/LegacyConverterExtensions.cs +2 -2
- package/Common/Runtime/OpenApiSystem.cs +2 -2
- package/Common/Runtime/Player/Lazy.cs +2 -2
- package/Common/Runtime/Player/Observables.cs +2 -2
- package/Common/Runtime/Pooling/ClassPool.cs +2 -2
- package/Common/Runtime/Pooling/StringBuilderPool.cs +2 -2
- package/Common/Runtime/Promise.cs +2 -2
- package/Common/Runtime/ReflectionCache/BeamContextSystemAttribute.cs +2 -2
- package/Common/Runtime/ReflectionCache/INamingAttribute.cs +2 -2
- package/Common/Runtime/ReflectionCache/IReflectionAttribute.cs +2 -2
- package/Common/Runtime/ReflectionCache/PreserveAttribute.cs +2 -2
- package/Common/Runtime/ReflectionCache/ReflectionCache.cs +2 -2
- package/Common/Runtime/ReflectionCache/ReflectionCache_Attributes.cs +2 -2
- package/Common/Runtime/ReflectionCache/ReflectionCache_BaseTypes.cs +2 -2
- package/Common/Runtime/ReflectionCache/ReflectionCache_SignatureMatching.cs +2 -2
- package/Common/Runtime/Scheduler/BeamScheduler.cs +2 -2
- package/Common/Runtime/Scheduler/Cron.cs +2 -2
- package/Common/Runtime/Scheduler/CronValidation.cs +2 -2
- package/Common/Runtime/Semantics/BeamAccountId.cs +2 -2
- package/Common/Runtime/Semantics/BeamCid.cs +2 -2
- package/Common/Runtime/Semantics/BeamContentId.cs +2 -2
- package/Common/Runtime/Semantics/BeamContentManifestId.cs +2 -2
- package/Common/Runtime/Semantics/BeamGamerTag.cs +2 -2
- package/Common/Runtime/Semantics/BeamPid.cs +2 -2
- package/Common/Runtime/Semantics/BeamStats.cs +2 -2
- package/Common/Runtime/Semantics/IBeamSemanticType.cs +2 -2
- package/Common/Runtime/Semantics/ServiceName.cs +2 -2
- package/Common/Runtime/SmallerJSON/IRawJsonProvider.cs +2 -2
- package/Common/Runtime/SmallerJSON/SmallerJSON.ArrayDict.cs +2 -2
- package/Common/Runtime/SmallerJSON/SmallerJSON.FromString.cs +2 -2
- package/Common/Runtime/SmallerJSON/SmallerJSON.cs +2 -2
- package/Common/Runtime/Spew/Logger.cs +2 -2
- package/Common/Runtime/Spew/SpewLoggerAttribute.cs +2 -2
- package/Common/Runtime/Trie.cs +2 -2
- package/Common/Runtime/TypeExtensions.cs +2 -2
- package/Common/Runtime/Util/BeamAssemblyVersionUtil.cs +2 -2
- package/Common/Runtime/Util/BeamFileUtil.cs +2 -2
- package/Common/Runtime/Util/DocsPageHelper.cs +2 -2
- package/Common/Runtime/Util/NaturalStringComparer.cs +2 -2
- package/Editor/Modules/Content/ContentPropertyDrawer.cs +231 -83
- package/Editor/Modules/Content/ContentValidationPropertyDrawer.cs +59 -1
- package/Runtime/Core/Platform/SDK/AccessTokenStorage.cs +1 -1
- package/Runtime/Environment/Resources/env-default.json +3 -3
- package/Runtime/Environment/Resources/versions-default.json +1 -1
- package/Runtime/Player/PlayerAccounts.cs +258 -16
- package/Tests/Runtime/Beamable/Platform/AccessTokenStorageTests.cs +54 -0
- package/package.json +1 -1
|
@@ -62,6 +62,61 @@ namespace Beamable.Editor.Content
|
|
|
62
62
|
return baseHeight + EditorGUIUtility.singleLineHeight * newlineCount;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// For <see cref="string"/> fields (including <c>List<string></c> elements) decorated with
|
|
67
|
+
/// <see cref="MustReferenceContent"/>, draws an editable text field with a dropdown button that opens a
|
|
68
|
+
/// searchable list of valid content ids. Returns <c>false</c> for anything else so the caller falls back
|
|
69
|
+
/// to the default property field.
|
|
70
|
+
/// </summary>
|
|
71
|
+
private bool TryDrawContentDropdown(Rect position, SerializedProperty property, GUIContent label)
|
|
72
|
+
{
|
|
73
|
+
if (property.propertyType != SerializedPropertyType.String)
|
|
74
|
+
{
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Catches MustReferenceContent and its MustBe* subclasses, which preset AllowedTypes.
|
|
79
|
+
var mustReference = fieldInfo.GetCustomAttribute<MustReferenceContent>();
|
|
80
|
+
if (mustReference == null)
|
|
81
|
+
{
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var lineHeight = EditorGUIUtility.singleLineHeight;
|
|
86
|
+
var labelRect = new Rect(position.x, position.y, EditorGUIUtility.labelWidth, lineHeight);
|
|
87
|
+
var fieldX = position.x + EditorGUIUtility.labelWidth;
|
|
88
|
+
var fieldWidth = position.width - EditorGUIUtility.labelWidth;
|
|
89
|
+
const float buttonWidth = 22f;
|
|
90
|
+
var textRect = new Rect(fieldX, position.y, Mathf.Max(0, fieldWidth - buttonWidth), lineHeight);
|
|
91
|
+
var buttonRect = new Rect(fieldX + textRect.width, position.y, buttonWidth, lineHeight);
|
|
92
|
+
|
|
93
|
+
EditorGUI.PrefixLabel(labelRect, label);
|
|
94
|
+
|
|
95
|
+
EditorGUI.BeginChangeCheck();
|
|
96
|
+
var newValue = EditorGUI.DelayedTextField(textRect, property.stringValue);
|
|
97
|
+
if (EditorGUI.EndChangeCheck())
|
|
98
|
+
{
|
|
99
|
+
property.stringValue = newValue;
|
|
100
|
+
property.serializedObject.ApplyModifiedProperties();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (EditorGUI.DropdownButton(buttonRect, new GUIContent(string.Empty, label.tooltip), FocusType.Keyboard, EditorStyles.popup))
|
|
104
|
+
{
|
|
105
|
+
var wnd = ScriptableObject.CreateInstance<ContentStringSearchWindow>();
|
|
106
|
+
wnd.Property = property;
|
|
107
|
+
wnd.Object = property.serializedObject.targetObject;
|
|
108
|
+
wnd.AllowedTypes = mustReference.AllowedTypes;
|
|
109
|
+
wnd.AllowNull = mustReference.AllowNull;
|
|
110
|
+
wnd.Init();
|
|
111
|
+
|
|
112
|
+
var xy = EditorGUIUtility.GUIToScreenPoint(new Vector2(textRect.x, textRect.y));
|
|
113
|
+
wnd.ShowAsDropDown(new Rect((int)xy.x, (int)xy.y + (int)lineHeight, 0, 0),
|
|
114
|
+
new Vector2(fieldWidth, 300));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
|
|
65
120
|
protected bool TryGetArrayIndex(SerializedProperty property, out int arrayIndex)
|
|
66
121
|
{
|
|
67
122
|
arrayIndex = 0;
|
|
@@ -140,7 +195,10 @@ namespace Beamable.Editor.Content
|
|
|
140
195
|
}
|
|
141
196
|
}
|
|
142
197
|
|
|
143
|
-
|
|
198
|
+
if (!TryDrawContentDropdown(position, property, label))
|
|
199
|
+
{
|
|
200
|
+
RefEditorGUI.DefaultPropertyField(position, property, label);
|
|
201
|
+
}
|
|
144
202
|
|
|
145
203
|
if (exceptions.Count > 0)
|
|
146
204
|
{
|
|
@@ -84,7 +84,7 @@ namespace Beamable.Api
|
|
|
84
84
|
{
|
|
85
85
|
if (_prefix.StartsWith("editor."))
|
|
86
86
|
{
|
|
87
|
-
SaveTokenForCustomer(cid, token); // if this token looks like an editor token, then we should should also save it as customer scoped, otherwise, the save action won't apply to the right data.
|
|
87
|
+
SaveTokenForCustomer(cid, token); // if this token looks like an editor token, then we should should also save it as customer scoped, otherwise, the save action won't apply to the right data.
|
|
88
88
|
}
|
|
89
89
|
AliasHelper.ValidateCid(cid);
|
|
90
90
|
PlayerPrefs.SetString($"{_prefix}{cid}.{pid}.access_token", token.Token);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
"environment": "
|
|
1
|
+
{
|
|
2
|
+
"environment": "staging",
|
|
3
3
|
"apiUrl": "https://api.beamable.com",
|
|
4
4
|
"portalUrl": "https://portal.beamable.com",
|
|
5
5
|
"beamMongoExpressUrl": "https://storage.beamable.com",
|
|
6
6
|
"dockerRegistryUrl": "https://microservices.beamable.com/v2/",
|
|
7
7
|
"isUnityVsp": "false",
|
|
8
|
-
"sdkVersion": "5.1.
|
|
8
|
+
"sdkVersion": "5.1.1-PREVIEW.RC1"
|
|
9
9
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
using Beamable.AccountManagement;
|
|
2
2
|
using Beamable.Api;
|
|
3
|
+
using Beamable.Api.Analytics;
|
|
3
4
|
using Beamable.Api.Auth;
|
|
4
5
|
using Beamable.Api.Caches;
|
|
5
6
|
using Beamable.Api.Sessions;
|
|
@@ -1050,6 +1051,7 @@ namespace Beamable.Player
|
|
|
1050
1051
|
private readonly IBeamableRequester _requester;
|
|
1051
1052
|
private readonly IStatsApi _stats;
|
|
1052
1053
|
private readonly Api.Autogenerated.Stats.IStatsApi _statsApi;
|
|
1054
|
+
private readonly HashSet<int> _reportedRememberedTokenFailures = new HashSet<int>();
|
|
1053
1055
|
internal readonly IDependencyProvider _provider;
|
|
1054
1056
|
|
|
1055
1057
|
|
|
@@ -2013,6 +2015,190 @@ namespace Beamable.Player
|
|
|
2013
2015
|
AccountManagementConfiguration.Instance.AvatarStat);
|
|
2014
2016
|
}
|
|
2015
2017
|
|
|
2018
|
+
private class RefreshedAccount
|
|
2019
|
+
{
|
|
2020
|
+
public User user;
|
|
2021
|
+
public TokenResponse token;
|
|
2022
|
+
public UserExtensions.StatCollection stats;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
private class RememberedAccountRefreshResult
|
|
2026
|
+
{
|
|
2027
|
+
public RefreshedAccount account;
|
|
2028
|
+
public TokenResponse token;
|
|
2029
|
+
public TokenResponse tokenToRemove;
|
|
2030
|
+
public string reason;
|
|
2031
|
+
public string action;
|
|
2032
|
+
public string stage;
|
|
2033
|
+
public long status;
|
|
2034
|
+
public Exception exception;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
private static bool IsTerminalRememberedTokenError(Exception ex)
|
|
2038
|
+
{
|
|
2039
|
+
if (!(ex is PlatformRequesterException platformRequesterException)) return false;
|
|
2040
|
+
var error = platformRequesterException.Error?.error ?? platformRequesterException.RequestError?.error;
|
|
2041
|
+
|
|
2042
|
+
return error switch
|
|
2043
|
+
{
|
|
2044
|
+
"UnknownTokenError" or "InvalidTokenError" or "TokenValidationError"
|
|
2045
|
+
or "RefreshAccessTokenError" => true,
|
|
2046
|
+
_ => false
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
private static bool IsDuplicateOfCurrentToken(TokenResponse rememberedToken, AccessToken currentToken)
|
|
2051
|
+
{
|
|
2052
|
+
return rememberedToken != null &&
|
|
2053
|
+
currentToken != null &&
|
|
2054
|
+
!string.IsNullOrEmpty(rememberedToken.refresh_token) &&
|
|
2055
|
+
rememberedToken.refresh_token == currentToken.RefreshToken;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
private static bool IsMalformedRememberedToken(TokenResponse token)
|
|
2059
|
+
{
|
|
2060
|
+
return token == null ||
|
|
2061
|
+
string.IsNullOrEmpty(token.access_token) ||
|
|
2062
|
+
string.IsNullOrEmpty(token.refresh_token);
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
private static TokenResponse ToTokenResponse(AccessToken currentToken)
|
|
2066
|
+
{
|
|
2067
|
+
return new TokenResponse
|
|
2068
|
+
{
|
|
2069
|
+
access_token = currentToken.Token,
|
|
2070
|
+
refresh_token = currentToken.RefreshToken
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
private static UserExtensions.StatCollection CreateEmptyStats()
|
|
2075
|
+
{
|
|
2076
|
+
return new UserExtensions.StatCollection();
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
private static string GetRememberedTokenFailureReason(Exception ex)
|
|
2080
|
+
{
|
|
2081
|
+
if (ex is PlatformRequesterException platformRequesterException)
|
|
2082
|
+
{
|
|
2083
|
+
return platformRequesterException.Error?.error
|
|
2084
|
+
?? platformRequesterException.RequestError?.error
|
|
2085
|
+
?? ex.GetType().Name;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
return ex.GetType().Name;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
private static long GetRememberedTokenFailureStatus(Exception ex)
|
|
2092
|
+
{
|
|
2093
|
+
return ex is PlatformRequesterException platformRequesterException
|
|
2094
|
+
? platformRequesterException.Status
|
|
2095
|
+
: 0;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
private static int GetRememberedTokenDiagnosticKey(TokenResponse token)
|
|
2099
|
+
{
|
|
2100
|
+
unchecked
|
|
2101
|
+
{
|
|
2102
|
+
return ((token?.access_token?.GetHashCode() ?? 0) * 397)
|
|
2103
|
+
^ (token?.refresh_token?.GetHashCode() ?? 0);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
private static CoreEvent CreateRememberedTokenFailureEvent(long playerId, TokenResponse token,
|
|
2108
|
+
string reason, string action, string stage, long status)
|
|
2109
|
+
{
|
|
2110
|
+
var eventParams = new Dictionary<string, object>
|
|
2111
|
+
{
|
|
2112
|
+
["player-id"] = playerId,
|
|
2113
|
+
["reason"] = reason,
|
|
2114
|
+
["action"] = action,
|
|
2115
|
+
["stage"] = stage,
|
|
2116
|
+
["access-token-last-4"] = TokenEvent.Last4(token?.access_token),
|
|
2117
|
+
["refresh-token-last-4"] = TokenEvent.Last4(token?.refresh_token)
|
|
2118
|
+
};
|
|
2119
|
+
if (status > 0)
|
|
2120
|
+
{
|
|
2121
|
+
eventParams["status"] = status;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
return new CoreEvent("user-tokens", "remembered_token_failure", eventParams);
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
private void ReportRememberedTokenFailure(RememberedAccountRefreshResult result)
|
|
2128
|
+
{
|
|
2129
|
+
if (result == null || string.IsNullOrEmpty(result.reason)) return;
|
|
2130
|
+
if (!_reportedRememberedTokenFailures.Add(GetRememberedTokenDiagnosticKey(result.token))) return;
|
|
2131
|
+
|
|
2132
|
+
try
|
|
2133
|
+
{
|
|
2134
|
+
var status = result.status > 0 ? $" status=[{result.status}]" : "";
|
|
2135
|
+
BeamableLogger.LogWarning(
|
|
2136
|
+
$"[Beamable.Accounts.RememberedToken] reason=[{result.reason}] action=[{result.action}] stage=[{result.stage}]{status} " +
|
|
2137
|
+
$"cid=[{_ctx.Cid}] pid=[{_ctx.Pid}] access-token-last-4=[{TokenEvent.Last4(result.token?.access_token)}] " +
|
|
2138
|
+
$"refresh-token-last-4=[{TokenEvent.Last4(result.token?.refresh_token)}]");
|
|
2139
|
+
|
|
2140
|
+
var settings = _provider.GetService<ITokenEventSettings>();
|
|
2141
|
+
if (!settings.EnableTokenAnalytics) return;
|
|
2142
|
+
|
|
2143
|
+
var analytics = _provider.GetService<IAnalyticsTracker>();
|
|
2144
|
+
analytics.TrackEvent(
|
|
2145
|
+
CreateRememberedTokenFailureEvent(
|
|
2146
|
+
_ctx.PlayerId,
|
|
2147
|
+
result.token,
|
|
2148
|
+
result.reason,
|
|
2149
|
+
result.action,
|
|
2150
|
+
result.stage,
|
|
2151
|
+
result.status),
|
|
2152
|
+
true);
|
|
2153
|
+
}
|
|
2154
|
+
catch
|
|
2155
|
+
{
|
|
2156
|
+
// Diagnostics must never prevent Accounts from becoming ready.
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
private async Promise<RememberedAccountRefreshResult> TryRefreshRememberedAccount(TokenResponse token)
|
|
2161
|
+
{
|
|
2162
|
+
try
|
|
2163
|
+
{
|
|
2164
|
+
var user = await _authService.GetUser(token);
|
|
2165
|
+
UserExtensions.StatCollection statValues;
|
|
2166
|
+
|
|
2167
|
+
try
|
|
2168
|
+
{
|
|
2169
|
+
statValues = await GetStatsForUser(user);
|
|
2170
|
+
}
|
|
2171
|
+
catch
|
|
2172
|
+
{
|
|
2173
|
+
statValues = CreateEmptyStats();
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
return new RememberedAccountRefreshResult
|
|
2177
|
+
{
|
|
2178
|
+
account = new RefreshedAccount
|
|
2179
|
+
{
|
|
2180
|
+
user = user,
|
|
2181
|
+
token = token,
|
|
2182
|
+
stats = statValues
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
catch (Exception ex)
|
|
2187
|
+
{
|
|
2188
|
+
var terminal = IsTerminalRememberedTokenError(ex);
|
|
2189
|
+
return new RememberedAccountRefreshResult
|
|
2190
|
+
{
|
|
2191
|
+
token = token,
|
|
2192
|
+
tokenToRemove = terminal ? token : null,
|
|
2193
|
+
reason = GetRememberedTokenFailureReason(ex),
|
|
2194
|
+
action = terminal ? "removed" : "retained",
|
|
2195
|
+
stage = "get-user",
|
|
2196
|
+
status = GetRememberedTokenFailureStatus(ex),
|
|
2197
|
+
exception = ex
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2016
2202
|
protected override async Promise PerformRefresh()
|
|
2017
2203
|
{
|
|
2018
2204
|
await _ctx.OnReady;
|
|
@@ -2028,33 +2214,89 @@ namespace Beamable.Player
|
|
|
2028
2214
|
|
|
2029
2215
|
var deviceTokens = _storage.RetrieveDeviceRefreshTokens(_ctx.Cid, _ctx.Pid);
|
|
2030
2216
|
var currToken = _storage.LoadTokenForRealmImmediate(_ctx.Cid, _ctx.Pid);
|
|
2031
|
-
|
|
2217
|
+
|
|
2218
|
+
if (currToken == null)
|
|
2219
|
+
{
|
|
2220
|
+
throw new Exception(
|
|
2221
|
+
$"Cannot refresh player accounts because no current token exists for cid=[{_ctx.Cid}] pid=[{_ctx.Pid}].");
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
if (string.IsNullOrEmpty(currToken.Token) || string.IsNullOrEmpty(currToken.RefreshToken))
|
|
2225
|
+
{
|
|
2226
|
+
throw new Exception(
|
|
2227
|
+
$"Cannot refresh player accounts because the current token is incomplete for cid=[{_ctx.Cid}] pid=[{_ctx.Pid}].");
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
var refreshedAccounts = new List<RefreshedAccount>();
|
|
2231
|
+
var currentTokenResponse = ToTokenResponse(currToken);
|
|
2232
|
+
var currentUser = await _authService.GetUser(currentTokenResponse);
|
|
2233
|
+
var currentStats = await GetStatsForUser(currentUser);
|
|
2234
|
+
|
|
2235
|
+
refreshedAccounts.Add(new RefreshedAccount
|
|
2236
|
+
{
|
|
2237
|
+
user = currentUser,
|
|
2238
|
+
token = currentTokenResponse,
|
|
2239
|
+
stats = currentStats
|
|
2240
|
+
});
|
|
2241
|
+
|
|
2242
|
+
var rememberedAccountPromises = new List<Promise<RememberedAccountRefreshResult>>();
|
|
2243
|
+
var rememberedAccountResults = new List<RememberedAccountRefreshResult>();
|
|
2244
|
+
|
|
2032
2245
|
for (var i = 0; i < deviceTokens.Length; i++)
|
|
2033
2246
|
{
|
|
2034
|
-
|
|
2247
|
+
var token = deviceTokens[i];
|
|
2248
|
+
if (token == null) continue;
|
|
2249
|
+
if (IsDuplicateOfCurrentToken(token, currToken)) continue;
|
|
2250
|
+
|
|
2251
|
+
if (IsMalformedRememberedToken(token))
|
|
2252
|
+
{
|
|
2253
|
+
rememberedAccountResults.Add(new RememberedAccountRefreshResult
|
|
2254
|
+
{
|
|
2255
|
+
token = token,
|
|
2256
|
+
reason = "MalformedToken",
|
|
2257
|
+
action = "retained",
|
|
2258
|
+
stage = "storage-validation"
|
|
2259
|
+
});
|
|
2260
|
+
continue;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
rememberedAccountPromises.Add(TryRefreshRememberedAccount(token));
|
|
2035
2264
|
}
|
|
2036
|
-
tokens[deviceTokens.Length] = new TokenResponse { access_token = currToken.Token, refresh_token = currToken.RefreshToken, };
|
|
2037
2265
|
|
|
2038
|
-
|
|
2039
|
-
var
|
|
2040
|
-
|
|
2266
|
+
rememberedAccountResults.AddRange(await Promise.Sequence(rememberedAccountPromises));
|
|
2267
|
+
var removedRememberedToken = false;
|
|
2268
|
+
|
|
2269
|
+
for (var i = 0; i < rememberedAccountResults.Count; i++)
|
|
2041
2270
|
{
|
|
2042
|
-
|
|
2043
|
-
|
|
2271
|
+
var result = rememberedAccountResults[i];
|
|
2272
|
+
ReportRememberedTokenFailure(result);
|
|
2273
|
+
|
|
2274
|
+
if (result.account != null)
|
|
2275
|
+
{
|
|
2276
|
+
refreshedAccounts.Add(result.account);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
if (result.tokenToRemove != null)
|
|
2280
|
+
{
|
|
2281
|
+
_storage.RemoveDeviceRefreshToken(_ctx.Cid, _ctx.Pid, result.tokenToRemove);
|
|
2282
|
+
removedRememberedToken = true;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
if (removedRememberedToken)
|
|
2287
|
+
{
|
|
2288
|
+
PlayerPrefs.Save();
|
|
2044
2289
|
}
|
|
2045
|
-
var users = await Promise.Sequence(userPromises);
|
|
2046
|
-
var stats = await Promise.Sequence(statPromises);
|
|
2047
2290
|
|
|
2048
|
-
for (var i = 0; i <
|
|
2291
|
+
for (var i = 0; i < refreshedAccounts.Count; i++)
|
|
2049
2292
|
{
|
|
2050
|
-
var
|
|
2293
|
+
var refreshed = refreshedAccounts[i];
|
|
2294
|
+
var user = refreshed.user;
|
|
2051
2295
|
if (seen.Contains(user.id)) continue;
|
|
2052
2296
|
seen.Add(user.id);
|
|
2053
2297
|
|
|
2054
|
-
var statValues = stats
|
|
2055
|
-
var token =
|
|
2056
|
-
|
|
2057
|
-
|
|
2298
|
+
var statValues = refreshed.stats;
|
|
2299
|
+
var token = refreshed.token;
|
|
2058
2300
|
|
|
2059
2301
|
if (gamerTagToAccount.TryGetValue(user.id, out var existing))
|
|
2060
2302
|
{
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
using Beamable.Api;
|
|
2
|
+
using Beamable.Api.Analytics;
|
|
2
3
|
using Beamable.Common.Api.Auth;
|
|
4
|
+
using Beamable.Player;
|
|
5
|
+
using Beamable.Serialization;
|
|
3
6
|
using NUnit.Framework;
|
|
4
7
|
using System.Collections.Generic;
|
|
5
8
|
using System.Linq;
|
|
9
|
+
using System.Reflection;
|
|
6
10
|
using UnityEngine;
|
|
7
11
|
|
|
8
12
|
namespace Beamable.Platform.Tests
|
|
@@ -150,5 +154,55 @@ namespace Beamable.Platform.Tests
|
|
|
150
154
|
var value = PlayerPrefs.GetString(DeviceTokensKey);
|
|
151
155
|
Assert.AreEqual("token1|test1,token2|test2,token3|test3", value);
|
|
152
156
|
}
|
|
157
|
+
|
|
158
|
+
[Test]
|
|
159
|
+
public void DoesNotRemove_MalformedTokenWithoutRefreshToken()
|
|
160
|
+
{
|
|
161
|
+
PlayerPrefs.SetString(DeviceTokensKey, "token1|test1,bad_access_token,token3|test3");
|
|
162
|
+
_storage.RemoveDeviceRefreshToken(_cid, _pid, new TokenResponse
|
|
163
|
+
{
|
|
164
|
+
access_token = "bad_access_token",
|
|
165
|
+
refresh_token = ""
|
|
166
|
+
});
|
|
167
|
+
var value = PlayerPrefs.GetString(DeviceTokensKey);
|
|
168
|
+
Assert.AreEqual("token1|test1,bad_access_token,token3|test3", value);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public class RememberedTokenDiagnosticTests
|
|
173
|
+
{
|
|
174
|
+
[Test]
|
|
175
|
+
public void RememberedTokenFailure_OnlySerializesTokenSuffixes()
|
|
176
|
+
{
|
|
177
|
+
var method = typeof(PlayerAccounts).GetMethod(
|
|
178
|
+
"CreateRememberedTokenFailureEvent",
|
|
179
|
+
BindingFlags.Static | BindingFlags.NonPublic);
|
|
180
|
+
|
|
181
|
+
Assert.NotNull(method);
|
|
182
|
+
var tokenEvent = (CoreEvent)method.Invoke(null, new object[]
|
|
183
|
+
{
|
|
184
|
+
123L,
|
|
185
|
+
new TokenResponse
|
|
186
|
+
{
|
|
187
|
+
access_token = "access-token-secret-1234",
|
|
188
|
+
refresh_token = "refresh-token-secret-5678"
|
|
189
|
+
},
|
|
190
|
+
"InvalidTokenError",
|
|
191
|
+
"removed",
|
|
192
|
+
"get-user",
|
|
193
|
+
401L
|
|
194
|
+
});
|
|
195
|
+
var json = JsonSerializable.ToJson(tokenEvent);
|
|
196
|
+
|
|
197
|
+
StringAssert.Contains("remembered_token_failure", json);
|
|
198
|
+
StringAssert.Contains("InvalidTokenError", json);
|
|
199
|
+
StringAssert.Contains("removed", json);
|
|
200
|
+
StringAssert.Contains("get-user", json);
|
|
201
|
+
StringAssert.Contains("401", json);
|
|
202
|
+
StringAssert.Contains("1234", json);
|
|
203
|
+
StringAssert.Contains("5678", json);
|
|
204
|
+
StringAssert.DoesNotContain("access-token-secret", json);
|
|
205
|
+
StringAssert.DoesNotContain("refresh-token-secret", json);
|
|
206
|
+
}
|
|
153
207
|
}
|
|
154
208
|
}
|