com.beamable 5.0.0-PREVIEW.RC1 → 5.0.0-PREVIEW.RC11
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 +12 -0
- package/Common/Runtime/AgnosticAttribute.cs +52 -52
- package/Common/Runtime/AgnosticAttribute.cs.meta +11 -11
- package/Common/Runtime/Api/AliasHelper.cs +55 -55
- package/Common/Runtime/Api/AliasHelper.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/AnalyticsEventRequest.cs +2 -2
- package/Common/Runtime/Api/Analytics/AnalyticsEventRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/AnalyticsService.cs +2 -2
- package/Common/Runtime/Api/Analytics/AnalyticsService.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/IBeamAnalyticsService.cs +2 -2
- package/Common/Runtime/Api/Analytics/IBeamAnalyticsService.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/Models/CoreEvent.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/CoreEvent.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/Models/IAnalyticsEvent.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/IAnalyticsEvent.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/Models/SampleCustomEvent.cs +2 -2
- package/Common/Runtime/Api/Analytics/Models/SampleCustomEvent.cs.meta +11 -11
- package/Common/Runtime/Api/Analytics/Models.meta +11 -11
- package/Common/Runtime/Api/Analytics.meta +11 -11
- package/Common/Runtime/Api/Announcements/AbsAnnouncementsApi.cs +68 -68
- package/Common/Runtime/Api/Announcements/AbsAnnouncementsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Announcements/IAnnouncementsApi.cs +388 -388
- package/Common/Runtime/Api/Announcements/IAnnouncementsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Announcements.meta +11 -11
- package/Common/Runtime/Api/Auth/AuthApi.cs +981 -981
- package/Common/Runtime/Api/Auth/AuthApi.cs.meta +11 -11
- package/Common/Runtime/Api/Auth/IAuthApi.cs +343 -343
- package/Common/Runtime/Api/Auth/IAuthApi.cs.meta +11 -11
- package/Common/Runtime/Api/Auth.meta +11 -11
- package/Common/Runtime/Api/Calendars/AbsCalendarApi.cs +41 -41
- package/Common/Runtime/Api/Calendars/AbsCalendarApi.cs.meta +11 -11
- package/Common/Runtime/Api/Calendars/ICalendarApi.cs +120 -120
- package/Common/Runtime/Api/Calendars/ICalendarApi.cs.meta +11 -11
- package/Common/Runtime/Api/Calendars.meta +11 -11
- package/Common/Runtime/Api/Chat/ChatApi.cs +70 -70
- package/Common/Runtime/Api/Chat/ChatApi.cs.meta +11 -11
- package/Common/Runtime/Api/Chat/IChatApi.cs +184 -184
- package/Common/Runtime/Api/Chat/IChatApi.cs.meta +11 -11
- package/Common/Runtime/Api/Chat.meta +11 -11
- package/Common/Runtime/Api/CloudData/CloudDataApi.cs +127 -127
- package/Common/Runtime/Api/CloudData/CloudDataApi.cs.meta +11 -11
- package/Common/Runtime/Api/CloudData/ICloudDataApi.cs +42 -42
- package/Common/Runtime/Api/CloudData/ICloudDataApi.cs.meta +11 -11
- package/Common/Runtime/Api/CloudData.meta +11 -11
- package/Common/Runtime/Api/CometClientData.cs +69 -69
- package/Common/Runtime/Api/CometClientData.cs.meta +11 -11
- package/Common/Runtime/Api/Commerce/ICommerceApi.cs +10 -10
- package/Common/Runtime/Api/Commerce/ICommerceApi.cs.meta +11 -11
- package/Common/Runtime/Api/Commerce.meta +11 -11
- package/Common/Runtime/Api/Content/IContentApi.cs +167 -167
- package/Common/Runtime/Api/Content/IContentApi.cs.meta +11 -11
- package/Common/Runtime/Api/Content.meta +11 -11
- package/Common/Runtime/Api/Events/AbsEventsApi.cs +50 -50
- package/Common/Runtime/Api/Events/AbsEventsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Events/IEventsApi.cs +166 -166
- package/Common/Runtime/Api/Events/IEventsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Events.meta +11 -11
- package/Common/Runtime/Api/Groups/GroupsApi.cs +762 -762
- package/Common/Runtime/Api/Groups/GroupsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Groups/IGroupsApi.cs +211 -211
- package/Common/Runtime/Api/Groups/IGroupsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Groups.meta +11 -11
- package/Common/Runtime/Api/IAccessToken.cs +48 -48
- package/Common/Runtime/Api/IAccessToken.cs.meta +11 -11
- package/Common/Runtime/Api/IBeamableFilesystemAccessor.cs +13 -13
- package/Common/Runtime/Api/IBeamableFilesystemAccessor.cs.meta +11 -11
- package/Common/Runtime/Api/IBeamableRequester.cs +770 -770
- package/Common/Runtime/Api/IBeamableRequester.cs.meta +11 -11
- package/Common/Runtime/Api/IConnectivityChecker.cs +49 -49
- package/Common/Runtime/Api/IConnectivityChecker.cs.meta +11 -11
- package/Common/Runtime/Api/IHasBeamableRequester.cs +12 -12
- package/Common/Runtime/Api/IHasBeamableRequester.cs.meta +11 -11
- package/Common/Runtime/Api/IServiceRoutingStrategy.cs +123 -123
- package/Common/Runtime/Api/IServiceRoutingStrategy.cs.meta +11 -11
- package/Common/Runtime/Api/ISupportsGet.cs +160 -160
- package/Common/Runtime/Api/ISupportsGet.cs.meta +11 -11
- package/Common/Runtime/Api/IUserContext.cs +22 -22
- package/Common/Runtime/Api/IUserContext.cs.meta +11 -11
- package/Common/Runtime/Api/IUserDataCache.cs +88 -88
- package/Common/Runtime/Api/IUserDataCache.cs.meta +11 -11
- package/Common/Runtime/Api/Inventory/IInventoryApi.cs +796 -796
- package/Common/Runtime/Api/Inventory/IInventoryApi.cs.meta +11 -11
- package/Common/Runtime/Api/Inventory/InventoryApi.cs +308 -308
- package/Common/Runtime/Api/Inventory/InventoryApi.cs.meta +11 -11
- package/Common/Runtime/Api/Inventory/InventoryUpdateBuilder.cs +712 -712
- package/Common/Runtime/Api/Inventory/InventoryUpdateBuilder.cs.meta +11 -11
- package/Common/Runtime/Api/Inventory.meta +11 -11
- package/Common/Runtime/Api/Leaderboards/ILeaderboardApi.cs +509 -509
- package/Common/Runtime/Api/Leaderboards/ILeaderboardApi.cs.meta +11 -11
- package/Common/Runtime/Api/Leaderboards/LeaderboardApi.cs +237 -237
- package/Common/Runtime/Api/Leaderboards/LeaderboardApi.cs.meta +11 -11
- package/Common/Runtime/Api/Leaderboards.meta +11 -11
- package/Common/Runtime/Api/Lobbies/ILobbyApi.cs +153 -153
- package/Common/Runtime/Api/Lobbies/ILobbyApi.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Lobby.cs +92 -92
- package/Common/Runtime/Api/Lobbies/Lobby.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/LobbyNotification.cs +15 -15
- package/Common/Runtime/Api/Lobbies/LobbyNotification.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/LobbyPlayer.cs +59 -59
- package/Common/Runtime/Api/Lobbies/LobbyPlayer.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/LobbyRestriction.cs +19 -19
- package/Common/Runtime/Api/Lobbies/LobbyRestriction.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/LobbyService.cs +191 -191
- package/Common/Runtime/Api/Lobbies/LobbyService.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/LobbyUtils.cs +157 -157
- package/Common/Runtime/Api/Lobbies/LobbyUtils.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/NotInLobby.cs +12 -12
- package/Common/Runtime/Api/Lobbies/NotInLobby.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/AddTagsRequest.cs +36 -36
- package/Common/Runtime/Api/Lobbies/Requests/AddTagsRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/CreateLobbyRequest.cs +70 -70
- package/Common/Runtime/Api/Lobbies/Requests/CreateLobbyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/JoinByPasscodeRequest.cs +30 -30
- package/Common/Runtime/Api/Lobbies/Requests/JoinByPasscodeRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/JoinLobbyRequest.cs +24 -24
- package/Common/Runtime/Api/Lobbies/Requests/JoinLobbyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryRequest.cs +35 -35
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryResponse.cs +19 -19
- package/Common/Runtime/Api/Lobbies/Requests/LobbyQueryResponse.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/RemoveFromLobbyRequest.cs +24 -24
- package/Common/Runtime/Api/Lobbies/Requests/RemoveFromLobbyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/RemoveTagsRequest.cs +30 -30
- package/Common/Runtime/Api/Lobbies/Requests/RemoveTagsRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests/UpdateLobbyRequest.cs +62 -62
- package/Common/Runtime/Api/Lobbies/Requests/UpdateLobbyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Lobbies/Requests.meta +11 -11
- package/Common/Runtime/Api/Lobbies.meta +11 -11
- package/Common/Runtime/Api/Mail/AbsMailApi.cs +704 -704
- package/Common/Runtime/Api/Mail/AbsMailApi.cs.meta +11 -11
- package/Common/Runtime/Api/Mail/IMailApi.cs +48 -48
- package/Common/Runtime/Api/Mail/IMailApi.cs.meta +11 -11
- package/Common/Runtime/Api/Mail.meta +11 -11
- package/Common/Runtime/Api/Notifications/INotificationService.cs +113 -113
- package/Common/Runtime/Api/Notifications/INotificationService.cs.meta +11 -11
- package/Common/Runtime/Api/Notifications/PrimitiveStringPayload.cs +13 -13
- package/Common/Runtime/Api/Notifications/PrimitiveStringPayload.cs.meta +11 -11
- package/Common/Runtime/Api/Notifications.meta +11 -11
- package/Common/Runtime/Api/Parties/IPartyApi.cs +96 -96
- package/Common/Runtime/Api/Parties/IPartyApi.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/NotInParty.cs +11 -11
- package/Common/Runtime/Api/Parties/NotInParty.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Party.cs +59 -59
- package/Common/Runtime/Api/Parties/Party.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/PartyNotifications.cs +55 -55
- package/Common/Runtime/Api/Parties/PartyNotifications.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/PartyRestriction.cs +13 -13
- package/Common/Runtime/Api/Parties/PartyRestriction.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/PartyService.cs +124 -124
- package/Common/Runtime/Api/Parties/PartyService.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Requests/CreatePartyRequest.cs +43 -43
- package/Common/Runtime/Api/Parties/Requests/CreatePartyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Requests/PartyQueryResponse.cs +19 -19
- package/Common/Runtime/Api/Parties/Requests/PartyQueryResponse.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Requests/PlayerRequest.cs +24 -24
- package/Common/Runtime/Api/Parties/Requests/PlayerRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Requests/UpdatePartyRequest.cs +37 -37
- package/Common/Runtime/Api/Parties/Requests/UpdatePartyRequest.cs.meta +11 -11
- package/Common/Runtime/Api/Parties/Requests.meta +11 -11
- package/Common/Runtime/Api/Parties.meta +11 -11
- package/Common/Runtime/Api/Payments/IPaymentsApi.cs +14 -14
- package/Common/Runtime/Api/Payments/IPaymentsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Payments/PaymentsApi.cs +33 -33
- package/Common/Runtime/Api/Payments/PaymentsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Payments.meta +11 -11
- package/Common/Runtime/Api/Presence/IPresenceApi.cs +31 -31
- package/Common/Runtime/Api/Presence/IPresenceApi.cs.meta +11 -11
- package/Common/Runtime/Api/Presence/PresenceService.cs +165 -165
- package/Common/Runtime/Api/Presence/PresenceService.cs.meta +11 -11
- package/Common/Runtime/Api/Presence.meta +11 -11
- package/Common/Runtime/Api/Push/IPushApi.cs +9 -9
- package/Common/Runtime/Api/Push/IPushApi.cs.meta +11 -11
- package/Common/Runtime/Api/Push.meta +11 -11
- package/Common/Runtime/Api/QueryBuilder.cs +85 -85
- package/Common/Runtime/Api/QueryBuilder.cs.meta +11 -11
- package/Common/Runtime/Api/Realms/IAliasService.cs +98 -98
- package/Common/Runtime/Api/Realms/IAliasService.cs.meta +11 -11
- package/Common/Runtime/Api/Realms/IRealmApi.cs +17 -17
- package/Common/Runtime/Api/Realms/IRealmApi.cs.meta +11 -11
- package/Common/Runtime/Api/Realms/RealmService.cs +378 -378
- package/Common/Runtime/Api/Realms/RealmService.cs.meta +11 -11
- package/Common/Runtime/Api/Realms.meta +11 -11
- package/Common/Runtime/Api/SignedRequesterHelper.cs +2 -2
- package/Common/Runtime/Api/SignedRequesterHelper.cs.meta +11 -11
- package/Common/Runtime/Api/Social/ISocialApi.cs +76 -76
- package/Common/Runtime/Api/Social/ISocialApi.cs.meta +11 -11
- package/Common/Runtime/Api/Social/SocialApi.cs +329 -329
- package/Common/Runtime/Api/Social/SocialApi.cs.meta +11 -11
- package/Common/Runtime/Api/Social.meta +11 -11
- package/Common/Runtime/Api/Stats/AbsStatsApi.cs +345 -345
- package/Common/Runtime/Api/Stats/AbsStatsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Stats/IStatsApi.cs +199 -199
- package/Common/Runtime/Api/Stats/IStatsApi.cs.meta +11 -11
- package/Common/Runtime/Api/Stats/StatsAccessType.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsAccessType.cs.meta +11 -11
- package/Common/Runtime/Api/Stats/StatsApiHelper.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsApiHelper.cs.meta +11 -11
- package/Common/Runtime/Api/Stats/StatsDomainType.cs +2 -2
- package/Common/Runtime/Api/Stats/StatsDomainType.cs.meta +11 -11
- package/Common/Runtime/Api/Stats.meta +11 -11
- package/Common/Runtime/Api/Tournaments/ITournamentApi.cs +626 -626
- package/Common/Runtime/Api/Tournaments/ITournamentApi.cs.meta +11 -11
- package/Common/Runtime/Api/Tournaments/TournamentApi.cs +284 -284
- package/Common/Runtime/Api/Tournaments/TournamentApi.cs.meta +11 -11
- package/Common/Runtime/Api/Tournaments.meta +11 -11
- package/Common/Runtime/Api.meta +11 -11
- package/Common/Runtime/BeamCli/CliContractTypeAttribute.cs +12 -12
- package/Common/Runtime/BeamCli/CliContractTypeAttribute.cs.meta +11 -11
- package/Common/Runtime/BeamCli/CliOtelData.cs +25 -25
- package/Common/Runtime/BeamCli/CliOtelData.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/CliLogMessage.cs +32 -32
- package/Common/Runtime/BeamCli/Contracts/CliLogMessage.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/CollectorStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/CollectorStatus.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/Constants.cs +33 -33
- package/Common/Runtime/BeamCli/Contracts/Constants.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotActionType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotActionType.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/AutoSnapshotType.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentSnapshotType.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentSnapshotType.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ContentStatus.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifest.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifest.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifestEntry.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/LocalContentManifestEntry.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestAuthor.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestAuthor.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestProjectData.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/ManifestProjectData.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService/TagStatus.cs +2 -2
- package/Common/Runtime/BeamCli/Contracts/ContentService/TagStatus.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ContentService.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/EnvironmentVersionData.cs +14 -14
- package/Common/Runtime/BeamCli/Contracts/EnvironmentVersionData.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/GenerateEnvOutput.cs +23 -23
- package/Common/Runtime/BeamCli/Contracts/GenerateEnvOutput.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts/ServiceInfo.cs +15 -15
- package/Common/Runtime/BeamCli/Contracts/ServiceInfo.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Contracts.meta +11 -11
- package/Common/Runtime/BeamCli/ErrorOutput.cs +38 -38
- package/Common/Runtime/BeamCli/ErrorOutput.cs.meta +11 -11
- package/Common/Runtime/BeamCli/IBeamCommand.cs +51 -51
- package/Common/Runtime/BeamCli/IBeamCommand.cs.meta +11 -11
- package/Common/Runtime/BeamCli/Reporting.cs +51 -51
- package/Common/Runtime/BeamCli/Reporting.cs.meta +11 -11
- package/Common/Runtime/BeamCli/ServiceInfoHelper.cs +31 -31
- package/Common/Runtime/BeamCli/ServiceInfoHelper.cs.meta +11 -11
- package/Common/Runtime/BeamCli.meta +11 -11
- package/Common/Runtime/BeamGenerateSchemaAttribute.cs +2 -2
- package/Common/Runtime/BeamGenerateSchemaAttribute.cs.meta +11 -11
- package/Common/Runtime/BeamableColorUtil.cs +25 -25
- package/Common/Runtime/BeamableColorUtil.cs.meta +11 -11
- package/Common/Runtime/BeamableEnumExtensions.cs +35 -35
- package/Common/Runtime/BeamableEnumExtensions.cs.meta +11 -11
- package/Common/Runtime/BeamableTaskExtensions.cs +27 -27
- package/Common/Runtime/BeamableTaskExtensions.cs.meta +11 -11
- package/Common/Runtime/Collections/ConcurrentBag.cs +49 -49
- package/Common/Runtime/Collections/ConcurrentBag.cs.meta +11 -11
- package/Common/Runtime/Collections/ConcurrentDictionary.cs +109 -109
- package/Common/Runtime/Collections/ConcurrentDictionary.cs.meta +11 -11
- package/Common/Runtime/Collections.meta +11 -11
- package/Common/Runtime/Constants/Constants.cs +184 -184
- package/Common/Runtime/Constants/Constants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ArchiveConstants.cs +24 -24
- package/Common/Runtime/Constants/Implementations/ArchiveConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ConfigConstants.cs +25 -25
- package/Common/Runtime/Constants/Implementations/ConfigConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ContentConstants.cs +28 -28
- package/Common/Runtime/Constants/Implementations/ContentConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ContentManagerConstants.cs +113 -113
- package/Common/Runtime/Constants/Implementations/ContentManagerConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/CronConstants.cs +19 -19
- package/Common/Runtime/Constants/Implementations/CronConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/DockerConstants.cs +21 -21
- package/Common/Runtime/Constants/Implementations/DockerConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/EnvironmentConstants.cs +23 -23
- package/Common/Runtime/Constants/Implementations/EnvironmentConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/LoginBaseConstants.cs +45 -45
- package/Common/Runtime/Constants/Implementations/LoginBaseConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/MigrationConstants.cs +14 -14
- package/Common/Runtime/Constants/Implementations/MigrationConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/NotificationConstants.cs +18 -18
- package/Common/Runtime/Constants/Implementations/NotificationConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/OtelConstants.cs +2 -2
- package/Common/Runtime/Constants/Implementations/OtelConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/RequesterConstants.cs +90 -90
- package/Common/Runtime/Constants/Implementations/RequesterConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/SchedulesConstants.cs +20 -20
- package/Common/Runtime/Constants/Implementations/SchedulesConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ServiceConstants.cs +161 -161
- package/Common/Runtime/Constants/Implementations/ServiceConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/SpewConstants.cs +38 -38
- package/Common/Runtime/Constants/Implementations/SpewConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/TestingToolConstants.cs +40 -40
- package/Common/Runtime/Constants/Implementations/TestingToolConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ToolbarConstants.cs +16 -16
- package/Common/Runtime/Constants/Implementations/ToolbarConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/ToolboxConstants.cs +25 -25
- package/Common/Runtime/Constants/Implementations/ToolboxConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations/TooltipConstants.cs +82 -82
- package/Common/Runtime/Constants/Implementations/TooltipConstants.cs.meta +11 -11
- package/Common/Runtime/Constants/Implementations.meta +11 -11
- package/Common/Runtime/Constants.meta +11 -11
- package/Common/Runtime/Content/ClientContentSerializer.cs +45 -45
- package/Common/Runtime/Content/ClientContentSerializer.cs.meta +11 -11
- package/Common/Runtime/Content/ClientManifest.cs +303 -303
- package/Common/Runtime/Content/ClientManifest.cs.meta +11 -11
- package/Common/Runtime/Content/ClientPermissions.cs +30 -30
- package/Common/Runtime/Content/ClientPermissions.cs.meta +11 -11
- package/Common/Runtime/Content/ContentCorruptedException.cs +15 -15
- package/Common/Runtime/Content/ContentCorruptedException.cs.meta +11 -11
- package/Common/Runtime/Content/ContentDataInfo.cs +147 -147
- package/Common/Runtime/Content/ContentDataInfo.cs.meta +11 -11
- package/Common/Runtime/Content/ContentDeserializationException.cs +14 -14
- package/Common/Runtime/Content/ContentDeserializationException.cs.meta +11 -11
- package/Common/Runtime/Content/ContentFieldAttribute.cs +30 -30
- package/Common/Runtime/Content/ContentFieldAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/ContentFilterType.cs +2 -2
- package/Common/Runtime/Content/ContentFilterType.cs.meta +11 -11
- package/Common/Runtime/Content/ContentNotFoundException.cs +19 -19
- package/Common/Runtime/Content/ContentNotFoundException.cs.meta +11 -11
- package/Common/Runtime/Content/ContentObject.cs +644 -644
- package/Common/Runtime/Content/ContentObject.cs.meta +11 -11
- package/Common/Runtime/Content/ContentQuery.cs +333 -333
- package/Common/Runtime/Content/ContentQuery.cs.meta +11 -11
- package/Common/Runtime/Content/ContentQueryExtensions.cs +42 -42
- package/Common/Runtime/Content/ContentQueryExtensions.cs.meta +11 -11
- package/Common/Runtime/Content/ContentRef.cs +307 -307
- package/Common/Runtime/Content/ContentRef.cs.meta +11 -11
- package/Common/Runtime/Content/ContentSerializer.cs +776 -770
- package/Common/Runtime/Content/ContentSerializer.cs.meta +11 -11
- package/Common/Runtime/Content/ContentTypeAttribute.cs +137 -137
- package/Common/Runtime/Content/ContentTypeAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/ContentTypeReflectionCache.cs +601 -601
- package/Common/Runtime/Content/ContentTypeReflectionCache.cs.meta +11 -11
- package/Common/Runtime/Content/ContentVisibility.cs +24 -24
- package/Common/Runtime/Content/ContentVisibility.cs.meta +11 -11
- package/Common/Runtime/Content/Federation.cs +32 -32
- package/Common/Runtime/Content/Federation.cs.meta +11 -11
- package/Common/Runtime/Content/IContentObject.cs +51 -51
- package/Common/Runtime/Content/IContentObject.cs.meta +11 -11
- package/Common/Runtime/Content/IContentService.cs +20 -20
- package/Common/Runtime/Content/IContentService.cs.meta +11 -11
- package/Common/Runtime/Content/IIgnoreSerializationCallbacks.cs +10 -10
- package/Common/Runtime/Content/IIgnoreSerializationCallbacks.cs.meta +11 -11
- package/Common/Runtime/Content/IgnoreContentFieldAttribute.cs +24 -24
- package/Common/Runtime/Content/IgnoreContentFieldAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/Optionals.cs +582 -582
- package/Common/Runtime/Content/Optionals.cs.meta +11 -11
- package/Common/Runtime/Content/PropertyAttributes/FilePathSelectorAttribute.cs +22 -22
- package/Common/Runtime/Content/PropertyAttributes/FilePathSelectorAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/PropertyAttributes/HideUnlessServerPackageInstalled.cs +14 -14
- package/Common/Runtime/Content/PropertyAttributes/HideUnlessServerPackageInstalled.cs.meta +11 -11
- package/Common/Runtime/Content/PropertyAttributes/ReadonlyIfAttribute.cs +24 -24
- package/Common/Runtime/Content/PropertyAttributes/ReadonlyIfAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/PropertyAttributes/ShowOnlyAttribute.cs +10 -10
- package/Common/Runtime/Content/PropertyAttributes/ShowOnlyAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/PropertyAttributes.meta +11 -11
- package/Common/Runtime/Content/RenderAsRefAttribute.cs +33 -33
- package/Common/Runtime/Content/RenderAsRefAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/SerializableDictionary.cs +183 -183
- package/Common/Runtime/Content/SerializableDictionary.cs.meta +11 -11
- package/Common/Runtime/Content/Utility/DateUtility.cs +120 -120
- package/Common/Runtime/Content/Utility/DateUtility.cs.meta +11 -11
- package/Common/Runtime/Content/Utility.meta +11 -11
- package/Common/Runtime/Content/Validation/AggregateContentValidationException.cs +12 -12
- package/Common/Runtime/Content/Validation/AggregateContentValidationException.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/CannotBeBlank.cs +115 -115
- package/Common/Runtime/Content/Validation/CannotBeBlank.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/CannotBeEmpty.cs +43 -43
- package/Common/Runtime/Content/Validation/CannotBeEmpty.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/ContentValidationException.cs +122 -122
- package/Common/Runtime/Content/Validation/ContentValidationException.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/FederationMustBeValid.cs +58 -58
- package/Common/Runtime/Content/Validation/FederationMustBeValid.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeComparatorString.cs +29 -29
- package/Common/Runtime/Content/Validation/MustBeComparatorString.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeCurrency.cs +25 -25
- package/Common/Runtime/Content/Validation/MustBeCurrency.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeCurrencyOrItem.cs +25 -25
- package/Common/Runtime/Content/Validation/MustBeCurrencyOrItem.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeDateString.cs +85 -85
- package/Common/Runtime/Content/Validation/MustBeDateString.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeItem.cs +25 -25
- package/Common/Runtime/Content/Validation/MustBeItem.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeLeaderboard.cs +26 -26
- package/Common/Runtime/Content/Validation/MustBeLeaderboard.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeNonDefault.cs +30 -30
- package/Common/Runtime/Content/Validation/MustBeNonDefault.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeNonNegative.cs +20 -20
- package/Common/Runtime/Content/Validation/MustBeNonNegative.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeOneOf.cs +64 -64
- package/Common/Runtime/Content/Validation/MustBeOneOf.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBePositive.cs +106 -106
- package/Common/Runtime/Content/Validation/MustBePositive.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeSlugString.cs +86 -86
- package/Common/Runtime/Content/Validation/MustBeSlugString.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeTimeSpanDuration.cs +106 -106
- package/Common/Runtime/Content/Validation/MustBeTimeSpanDuration.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustBeValidCron.cs +2 -2
- package/Common/Runtime/Content/Validation/MustBeValidCron.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustContain.cs +53 -53
- package/Common/Runtime/Content/Validation/MustContain.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/MustReferenceContent.cs +237 -237
- package/Common/Runtime/Content/Validation/MustReferenceContent.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/RouteParametersMustBeValid.cs +51 -51
- package/Common/Runtime/Content/Validation/RouteParametersMustBeValid.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/ServiceRouteMustBeValid.cs +43 -43
- package/Common/Runtime/Content/Validation/ServiceRouteMustBeValid.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/TimeSpanDisplayAttribute.cs +18 -18
- package/Common/Runtime/Content/Validation/TimeSpanDisplayAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/ValidationAttribute.cs +110 -110
- package/Common/Runtime/Content/Validation/ValidationAttribute.cs.meta +11 -11
- package/Common/Runtime/Content/Validation/ValidationContext.cs +104 -104
- package/Common/Runtime/Content/Validation/ValidationContext.cs.meta +11 -11
- package/Common/Runtime/Content/Validation.meta +11 -11
- package/Common/Runtime/Content.meta +11 -11
- package/Common/Runtime/CronExpression/CronLocale.cs +2 -2
- package/Common/Runtime/CronExpression/CronLocale.cs.meta +11 -11
- package/Common/Runtime/CronExpression/ErrorData.cs +2 -2
- package/Common/Runtime/CronExpression/ErrorData.cs.meta +11 -11
- package/Common/Runtime/CronExpression/ExpressionParser.cs +2 -2
- package/Common/Runtime/CronExpression/ExpressionParser.cs.meta +11 -11
- package/Common/Runtime/CronExpression/Options.cs +2 -2
- package/Common/Runtime/CronExpression/Options.cs.meta +11 -11
- package/Common/Runtime/CronExpression.meta +11 -11
- package/Common/Runtime/Debug.cs +180 -180
- package/Common/Runtime/Debug.cs.meta +11 -11
- package/Common/Runtime/DefaultQuery.cs +248 -248
- package/Common/Runtime/DefaultQuery.cs.meta +11 -11
- package/Common/Runtime/Dependencies/DependencyBuilder.cs +776 -776
- package/Common/Runtime/Dependencies/DependencyBuilder.cs.meta +11 -11
- package/Common/Runtime/Dependencies/DependencyProvider.cs +560 -560
- package/Common/Runtime/Dependencies/DependencyProvider.cs.meta +11 -11
- package/Common/Runtime/Dependencies/Exceptions.cs +21 -21
- package/Common/Runtime/Dependencies/Exceptions.cs.meta +11 -11
- package/Common/Runtime/Dependencies/IDependencyList.cs +23 -23
- package/Common/Runtime/Dependencies/IDependencyList.cs.meta +11 -11
- package/Common/Runtime/Dependencies/IDependencyNameProvider.cs +14 -14
- package/Common/Runtime/Dependencies/IDependencyNameProvider.cs.meta +11 -11
- package/Common/Runtime/Dependencies/RegisterBeamableDependenciesAttribute.cs +74 -74
- package/Common/Runtime/Dependencies/RegisterBeamableDependenciesAttribute.cs.meta +11 -11
- package/Common/Runtime/Dependencies/ServiceStorage.cs +258 -258
- package/Common/Runtime/Dependencies/ServiceStorage.cs.meta +11 -11
- package/Common/Runtime/Dependencies/Utils.cs +49 -49
- package/Common/Runtime/Dependencies/Utils.cs.meta +11 -11
- package/Common/Runtime/Dependencies.meta +11 -11
- package/Common/Runtime/DocUtils.cs +24 -24
- package/Common/Runtime/DocUtils.cs.meta +11 -11
- package/Common/Runtime/Environment/PackageVersion.cs +366 -366
- package/Common/Runtime/Environment/PackageVersion.cs.meta +11 -11
- package/Common/Runtime/Environment.meta +11 -11
- package/Common/Runtime/Federation/FederatedGameServer.cs +2 -2
- package/Common/Runtime/Federation/FederatedGameServer.cs.meta +11 -11
- package/Common/Runtime/Federation/FederatedInventory.cs +2 -2
- package/Common/Runtime/Federation/FederatedInventory.cs.meta +11 -11
- package/Common/Runtime/Federation/FederatedLogin.cs +2 -2
- package/Common/Runtime/Federation/FederatedLogin.cs.meta +11 -11
- package/Common/Runtime/Federation/FederatedPlayerInit.cs +36 -36
- package/Common/Runtime/Federation/FederatedPlayerInit.cs.meta +11 -11
- package/Common/Runtime/Federation/Federation.cs +2 -2
- package/Common/Runtime/Federation/Federation.cs.meta +11 -11
- package/Common/Runtime/Federation.meta +11 -11
- package/Common/Runtime/IRuntimeConfigProvider.cs +74 -74
- package/Common/Runtime/IRuntimeConfigProvider.cs.meta +11 -11
- package/Common/Runtime/ISearchableElement.cs +14 -14
- package/Common/Runtime/ISearchableElement.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/DeleteStream.cs +438 -438
- package/Common/Runtime/JsonSerializable/DeleteStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/DiffStream.cs +367 -367
- package/Common/Runtime/JsonSerializable/DiffStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/JsonData.cs +102 -102
- package/Common/Runtime/JsonSerializable/JsonData.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/JsonSaveStream.cs +765 -765
- package/Common/Runtime/JsonSerializable/JsonSaveStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/JsonSerializable.cs +386 -386
- package/Common/Runtime/JsonSerializable/JsonSerializable.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/LoadStream.cs +1103 -1103
- package/Common/Runtime/JsonSerializable/LoadStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/MessagePackStream.cs +2 -2
- package/Common/Runtime/JsonSerializable/MessagePackStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/SaveStream.cs +419 -419
- package/Common/Runtime/JsonSerializable/SaveStream.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable/TypeLookupFactory.cs +58 -58
- package/Common/Runtime/JsonSerializable/TypeLookupFactory.cs.meta +11 -11
- package/Common/Runtime/JsonSerializable.meta +11 -11
- package/Common/Runtime/Modules/Announcements/AnnouncementApiContent.cs +42 -42
- package/Common/Runtime/Modules/Announcements/AnnouncementApiContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Announcements/AnnouncementContent.cs +120 -120
- package/Common/Runtime/Modules/Announcements/AnnouncementContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Announcements/AnnouncementRef.cs +96 -96
- package/Common/Runtime/Modules/Announcements/AnnouncementRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Announcements.meta +11 -11
- package/Common/Runtime/Modules/Calendars/CalendarContent.cs +41 -41
- package/Common/Runtime/Modules/Calendars/CalendarContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Calendars/CalendarRef.cs +67 -67
- package/Common/Runtime/Modules/Calendars/CalendarRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Calendars.meta +11 -11
- package/Common/Runtime/Modules/Groups/GroupDonationContentRef.cs +76 -76
- package/Common/Runtime/Modules/Groups/GroupDonationContentRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Groups/GroupDonationsContent.cs +39 -39
- package/Common/Runtime/Modules/Groups/GroupDonationsContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Groups.meta +11 -11
- package/Common/Runtime/Modules/Inventory/CurrencyContent.cs +79 -79
- package/Common/Runtime/Modules/Inventory/CurrencyContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Inventory/CurrencyRef.cs +82 -82
- package/Common/Runtime/Modules/Inventory/CurrencyRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Inventory/ItemContent.cs +66 -66
- package/Common/Runtime/Modules/Inventory/ItemContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Inventory/ItemRef.cs +79 -79
- package/Common/Runtime/Modules/Inventory/ItemRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Inventory/VipContent.cs +103 -103
- package/Common/Runtime/Modules/Inventory/VipContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Inventory.meta +11 -11
- package/Common/Runtime/Modules/Leaderboards/LeaderboardContent.cs +67 -67
- package/Common/Runtime/Modules/Leaderboards/LeaderboardContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Leaderboards/LeaderboardRef.cs +77 -77
- package/Common/Runtime/Modules/Leaderboards/LeaderboardRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Leaderboards.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/ApiContent.cs +282 -282
- package/Common/Runtime/Modules/SharedContent/ApiContent.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/EmailContent.cs +104 -104
- package/Common/Runtime/Modules/SharedContent/EmailContent.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/EventContent.cs +273 -273
- package/Common/Runtime/Modules/SharedContent/EventContent.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/PlayerReward.cs +63 -63
- package/Common/Runtime/Modules/SharedContent/PlayerReward.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/ScheduleDefinition.cs +129 -129
- package/Common/Runtime/Modules/SharedContent/ScheduleDefinition.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/ScheduleExtensions.cs +35 -35
- package/Common/Runtime/Modules/SharedContent/ScheduleExtensions.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent/SimGameType.cs +300 -300
- package/Common/Runtime/Modules/SharedContent/SimGameType.cs.meta +11 -11
- package/Common/Runtime/Modules/SharedContent.meta +11 -11
- package/Common/Runtime/Modules/Shop/ListingContent.cs +329 -329
- package/Common/Runtime/Modules/Shop/ListingContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/ListingLink.cs +23 -23
- package/Common/Runtime/Modules/Shop/ListingLink.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/ListingRef.cs +33 -33
- package/Common/Runtime/Modules/Shop/ListingRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/SKUContent.cs +105 -105
- package/Common/Runtime/Modules/Shop/SKUContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/SKURef.cs +49 -49
- package/Common/Runtime/Modules/Shop/SKURef.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/StoreContent.cs +47 -47
- package/Common/Runtime/Modules/Shop/StoreContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop/StoreRef.cs +50 -50
- package/Common/Runtime/Modules/Shop/StoreRef.cs.meta +11 -11
- package/Common/Runtime/Modules/Shop.meta +11 -11
- package/Common/Runtime/Modules/Steam/ISteamService.cs +68 -68
- package/Common/Runtime/Modules/Steam/ISteamService.cs.meta +11 -11
- package/Common/Runtime/Modules/Steam.meta +11 -11
- package/Common/Runtime/Modules/Tournaments/TournamentColorConstants.cs +20 -20
- package/Common/Runtime/Modules/Tournaments/TournamentColorConstants.cs.meta +11 -11
- package/Common/Runtime/Modules/Tournaments/TournamentContent.cs +317 -317
- package/Common/Runtime/Modules/Tournaments/TournamentContent.cs.meta +11 -11
- package/Common/Runtime/Modules/Tournaments.meta +11 -11
- package/Common/Runtime/ObjectExtensions.cs +50 -50
- package/Common/Runtime/ObjectExtensions.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AccountsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AccountsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AccountsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AccountsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AnnouncementsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AnnouncementsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AnnouncementsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AnnouncementsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AuthBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AuthBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/AuthBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/AuthBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamAdmin.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAdmin.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamAdminCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAdminCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamAuth.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAuth.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamAuthCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamAuthCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamBeamo.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamo.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamBeamoCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamoCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamBeamootel.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamootel.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamBeamootelCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamBeamootelCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamCustomer.gs.cs +157 -85
- package/Common/Runtime/OpenApi/BeamCustomer.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamCustomerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamCustomerCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamLobby.gs.cs +320 -318
- package/Common/Runtime/OpenApi/BeamLobby.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamLobbyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamLobbyCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamMailbox.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMailbox.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamMailboxCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMailboxCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamMatchmaking.gs.cs +169 -169
- package/Common/Runtime/OpenApi/BeamMatchmaking.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamMatchmakingCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamMatchmakingCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamParty.gs.cs +270 -219
- package/Common/Runtime/OpenApi/BeamParty.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPartyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPartyCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayer.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayer.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerlobby.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerlobby.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerlobbyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerlobbyCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerparty.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerparty.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerpartyCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerpartyCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerticket.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerticket.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPlayerticketCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPlayerticketCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPresence.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPresence.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamPresenceCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamPresenceCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamScheduler.gs.cs +6 -6
- package/Common/Runtime/OpenApi/BeamScheduler.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamSchedulerCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamSchedulerCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamServiceplan.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamServiceplan.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamServiceplanCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamServiceplanCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamoBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamoBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/BeamoBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/BeamoBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CalendarsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CalendarsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CalendarsObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CalendarsObjectCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CloudsavingBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CloudsavingBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CloudsavingBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CloudsavingBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CommerceBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CommerceBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CommerceBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/CommerceBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/CommerceObject.gs.cs +7 -7
- package/Common/Runtime/OpenApi/CommerceObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/ContentBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/ContentBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/ContentBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/ContentBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/Event-playersObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Event-playersObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/Event-playersObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Event-playersObjectCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/EventsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/EventsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/EventsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/EventsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/Group-usersObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Group-usersObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/Group-usersObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/Group-usersObjectCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/GroupsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/GroupsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/GroupsObjectCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/GroupsObjectCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/InventoryBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/InventoryBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/InventoryBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/InventoryBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/InventoryObject.gs.cs +7 -7
- package/Common/Runtime/OpenApi/InventoryObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/LeaderboardsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/LeaderboardsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/LeaderboardsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/LeaderboardsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/LeaderboardsObject.gs.cs +54 -34
- package/Common/Runtime/OpenApi/LeaderboardsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/MailBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/MailBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/MailObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/MailObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/Models.gs.cs +366 -187
- package/Common/Runtime/OpenApi/Models.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/NotificationBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/NotificationBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/NotificationBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/NotificationBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/PaymentsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PaymentsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/PaymentsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PaymentsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/PaymentsObject.gs.cs +4 -4
- package/Common/Runtime/OpenApi/PaymentsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/PushBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PushBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/PushBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/PushBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/RealmsBasic.gs.cs +6 -6
- package/Common/Runtime/OpenApi/RealmsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/RealmsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/RealmsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/SessionBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SessionBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/SessionBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SessionBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/SocialBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SocialBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/SocialBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/SocialBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/StatsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/StatsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/StatsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/StatsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/TournamentsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/TournamentsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/TournamentsObject.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TournamentsObject.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/TrialsBasic.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TrialsBasic.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi/TrialsBasicCommon.gs.cs +2 -2
- package/Common/Runtime/OpenApi/TrialsBasicCommon.gs.cs.meta +11 -11
- package/Common/Runtime/OpenApi.meta +11 -11
- package/Common/Runtime/OpenApiExtensions/BeamoExtensions.cs +48 -48
- package/Common/Runtime/OpenApiExtensions/BeamoExtensions.cs.meta +11 -11
- package/Common/Runtime/OpenApiExtensions/LegacyConverterExtensions.cs +2 -2
- package/Common/Runtime/OpenApiExtensions/LegacyConverterExtensions.cs.meta +11 -11
- package/Common/Runtime/OpenApiExtensions.meta +11 -11
- package/Common/Runtime/OpenApiSystem.cs +236 -236
- package/Common/Runtime/OpenApiSystem.cs.meta +11 -11
- package/Common/Runtime/Player/Lazy.cs +26 -26
- package/Common/Runtime/Player/Lazy.cs.meta +11 -11
- package/Common/Runtime/Player/Observables.cs +449 -449
- package/Common/Runtime/Player/Observables.cs.meta +11 -11
- package/Common/Runtime/Player.meta +11 -11
- package/Common/Runtime/Pooling/ClassPool.cs +142 -142
- package/Common/Runtime/Pooling/ClassPool.cs.meta +11 -11
- package/Common/Runtime/Pooling/StringBuilderPool.cs +171 -171
- package/Common/Runtime/Pooling/StringBuilderPool.cs.meta +11 -11
- package/Common/Runtime/Pooling.meta +11 -11
- package/Common/Runtime/Promise.cs +1329 -1329
- package/Common/Runtime/Promise.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/BeamContextSystemAttribute.cs +11 -11
- package/Common/Runtime/ReflectionCache/BeamContextSystemAttribute.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/INamingAttribute.cs +143 -143
- package/Common/Runtime/ReflectionCache/INamingAttribute.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/IReflectionAttribute.cs +154 -154
- package/Common/Runtime/ReflectionCache/IReflectionAttribute.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/PreserveAttribute.cs +22 -22
- package/Common/Runtime/ReflectionCache/PreserveAttribute.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/ReflectionCache.cs +457 -457
- package/Common/Runtime/ReflectionCache/ReflectionCache.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/ReflectionCache_Attributes.cs +289 -289
- package/Common/Runtime/ReflectionCache/ReflectionCache_Attributes.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/ReflectionCache_BaseTypes.cs +111 -111
- package/Common/Runtime/ReflectionCache/ReflectionCache_BaseTypes.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache/ReflectionCache_SignatureMatching.cs +247 -247
- package/Common/Runtime/ReflectionCache/ReflectionCache_SignatureMatching.cs.meta +11 -11
- package/Common/Runtime/ReflectionCache.meta +11 -11
- package/Common/Runtime/Scheduler/BeamScheduler.cs +962 -962
- package/Common/Runtime/Scheduler/BeamScheduler.cs.meta +11 -11
- package/Common/Runtime/Scheduler/Cron.cs +557 -557
- package/Common/Runtime/Scheduler/Cron.cs.meta +11 -11
- package/Common/Runtime/Scheduler/CronValidation.cs +63 -63
- package/Common/Runtime/Scheduler/CronValidation.cs.meta +11 -11
- package/Common/Runtime/Scheduler.meta +11 -11
- package/Common/Runtime/Semantics/ServiceName.cs +38 -38
- package/Common/Runtime/Semantics/ServiceName.cs.meta +11 -11
- package/Common/Runtime/Semantics.meta +11 -11
- package/Common/Runtime/SmallerJSON/IRawJsonProvider.cs +41 -41
- package/Common/Runtime/SmallerJSON/IRawJsonProvider.cs.meta +11 -11
- package/Common/Runtime/SmallerJSON/SmallerJSON.ArrayDict.cs +479 -479
- package/Common/Runtime/SmallerJSON/SmallerJSON.ArrayDict.cs.meta +11 -11
- package/Common/Runtime/SmallerJSON/SmallerJSON.FromString.cs +627 -627
- package/Common/Runtime/SmallerJSON/SmallerJSON.FromString.cs.meta +11 -11
- package/Common/Runtime/SmallerJSON/SmallerJSON.cs +1056 -1056
- package/Common/Runtime/SmallerJSON/SmallerJSON.cs.meta +11 -11
- package/Common/Runtime/SmallerJSON.meta +11 -11
- package/Common/Runtime/Spew/Logger.cs +418 -418
- package/Common/Runtime/Spew/Logger.cs.meta +11 -11
- package/Common/Runtime/Spew/SpewLoggerAttribute.cs +14 -14
- package/Common/Runtime/Spew/SpewLoggerAttribute.cs.meta +11 -11
- package/Common/Runtime/Spew.meta +11 -11
- package/Common/Runtime/Trie.cs +463 -463
- package/Common/Runtime/Trie.cs.meta +11 -11
- package/Common/Runtime/TypeExtensions.cs +66 -66
- package/Common/Runtime/TypeExtensions.cs.meta +11 -11
- package/Common/Runtime/Util/BeamAssemblyVersionUtil.cs +52 -52
- package/Common/Runtime/Util/BeamAssemblyVersionUtil.cs.meta +11 -11
- package/Common/Runtime/Util/BeamFileUtil.cs +27 -27
- package/Common/Runtime/Util/BeamFileUtil.cs.meta +11 -11
- package/Common/Runtime/Util/DocsPageHelper.cs +2 -2
- package/Common/Runtime/Util/DocsPageHelper.cs.meta +11 -11
- package/Common/Runtime/Util/NaturalStringComparer.cs +2 -2
- package/Common/Runtime/Util/NaturalStringComparer.cs.meta +11 -11
- package/Common/Runtime/Util.meta +11 -11
- package/Common/Runtime.meta +11 -11
- package/Editor/3rdParty/Splitter/SplitterGUILayout2.cs +194 -194
- package/Editor/BeamCli/BeamCli.cs +449 -417
- package/Editor/BeamCli/BeamCliUtil.cs +254 -254
- package/Editor/BeamCli/BeamCommand.cs +555 -552
- package/Editor/BeamCli/BeamWebCommand.cs +534 -534
- package/Editor/BeamCli/BeamWebHistory.cs +267 -267
- package/Editor/BeamCli/CliSpewLogger.cs +17 -17
- package/Editor/BeamCli/Commands/Beam.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamAccountMeCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamAccountMeExternalIdentity.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamBuildProjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamBuildSolutionCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckFixedResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckGrafanaCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckPerfCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckRegistryCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckResultsForBeamoId.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCheckStatusServiceResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamChecksLockedFiles.cs +65 -0
- package/Editor/BeamCli/Commands/BeamChecksLockedFiles.cs.meta +11 -0
- package/Editor/BeamCli/Commands/BeamChecksScan.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamClearTempLogFilesCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCliServiceComponent.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCliServiceDependency.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCliServiceManifest.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCliServiceReference.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCliServiceStorageReference.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCollectorStatusResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfig.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRealm.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRealmRemove.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRealmSet.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRoutes.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRoutesCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConfigRoutesCommandWebsocketResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamConstructVersionOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentArchiveManifest.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentArchiveManifestCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentCreateLocalManifestCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentListManifests.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentListManifestsCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentNewManifest.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentProgressUpdateData.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentPsCommandEvent.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentPsProgressMessage.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentPublish.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentPublishResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentResolve.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentResolveConflictResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentRestore.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentRestoreErrorReport.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentRestoreResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSave.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSnapshot.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSnapshotList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSnapshotListItem.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSnapshotListResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSnapshotResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSync.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSyncReport.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentSyncResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentTagAdd.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentTagRm.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamContentTagSet.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamCopyProjectSrcToUnityCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeleteProjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDependencyData.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeployMode.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeployablePlan.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentDiffSummary.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentGet.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentManifestJsonDiff.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentPlan.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentPlanMetadata.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentRegistry.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentRelease.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeploymentStatus.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserData.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerCleanCapturedUserBuffer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerCreateUser.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerCreateUserBatch.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerRemoveUser.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerSaveUser.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserManagerUpdateInfo.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserPsCommandEvent.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDeveloperUserResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDisableFederationCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDockerServiceDescriptor.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDockerStatusCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDownloadAllNugetDepsToUnityCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDownloadCollectorCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamDownloadNugetDepToUnityCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamEraseStorageObjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationDisable.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationEnable.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationEntry.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationLocalKey.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationLocalSettingsGetIFederatedGameServer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFederationLocalSettingsSetIFederatedGameServer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFetchCommandLogRecord.cs +1 -0
- package/Editor/BeamCli/Commands/BeamFetchCommandLogRecord.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamFetchTelemetryLogsResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGameListCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGenerateClientFileEvent.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGenerateClientOapiCommandArgsResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGenerateMkDocsCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGenerateOApiCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGenerateWebClientCommandArgsResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetBeamOtelConfigCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetClickhouseCredentialsResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetDeploymentCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetLocalRoutingKeyCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetLogsUrlHeader.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetSignedUrlResponse.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetTokenDetailsCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetTokenForGuestCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetTokenListCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetTokenListElement.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetTokenViaRefreshCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGetUnityVersionInfoCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGrafanaOpen.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGrafanaPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamGrafanaStop.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamHostServiceDescriptor.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamInit.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamInitCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamInvalidCidError.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamInvalidTokenError.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamInvalidTokenErrorOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListDeploymentsCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListDepsCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListServicesCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListenPlayer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamListenServer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamLockedFilesCheckCommandResult.cs +12 -0
- package/Editor/BeamCli/Commands/BeamLockedFilesCheckCommandResult.cs.meta +11 -0
- package/Editor/BeamCli/Commands/BeamLogin.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamLoginFailedError.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamLoginResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamLogout.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamLogoutCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamManifestChecksum.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamManifestChecksums.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamManifestServiceEntry.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamManifestSnapshotItem.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamManifestStorageEntry.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamMe.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamMkdocs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamNoTokenError.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamNotificationPlayerOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamNotificationServerOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamOapiDownload.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamOrgGames.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamOrgRealmData.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamOrgRealms.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamPlanReleaseProgress.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProcessInfo.cs +14 -0
- package/Editor/BeamCli/Commands/BeamProcessInfo.cs.meta +11 -0
- package/Editor/BeamCli/Commands/BeamProfileCheckCounters.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProfileCheckNbomber.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectAddPaths.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectAddUnityProject.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectBuild.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectBuildSln.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectDeps.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectDepsAdd.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectDepsList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectDepsRemove.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectDisable.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectEnable.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectErrorReport.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectErrorResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectGenerateClient.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectGenerateClientOapi.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectGenerateEnv.cs +7 -0
- package/Editor/BeamCli/Commands/BeamProjectGenerateEnv.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectGenerateProperties.cs +2 -2
- package/Editor/BeamCli/Commands/BeamProjectGenerateProperties.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectGenerateWebClient.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectLogs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectNewCommonLib.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectNewService.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectNewStorage.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectOapi.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectOpen.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectOpenMongo.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectOpenSwagger.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectReadSettings.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectRegenerate.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectRemoteLogs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectRemove.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectRun.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectSettingsOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectStop.cs +7 -0
- package/Editor/BeamCli/Commands/BeamProjectStop.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectStorageErase.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectStorageRestore.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectStorageSnapshot.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamProjectWriteSetting.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamReadProjectSettingsCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRealmConfigOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRealmRole.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRealmsListCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamReleaseSharedUnityCodeCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRemoteServiceDescriptor.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRemoteStorageDescriptor.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamReportTelemetryResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRequestCliCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRequiredFileEdit.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRestoreProjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRestoreStorageObjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRunFailErrorOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRunProjectBuildErrorStream.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamRunProjectResultStream.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSaveProjectPathsCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServeCliCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerClear.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerDescriptor.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerKillCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerPsCommandResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerReq.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServerServe.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceDependenciesPair.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceDeployReportResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceFederationChange.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceFederations.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceImageIdChange.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceInstance.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceListResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceLogProviderChange.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceManifestOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceRemoteDeployProgressResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceRunProgressResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceRunReportResult.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceStatus.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServiceTemplate.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesBuild.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesBuildCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesBuiltProgress.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesDeploy.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesDockerStart.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesDockerStatus.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesForRouteCollection.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesGetConnectionString.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesGetConnectionStringCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesManifests.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesPromote.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesRegistry.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesRegistryOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesResetContainer.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesResetContainerCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesResetImage.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesResetImageCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesRun.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesServiceLogs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesServiceMetrics.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesStop.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesTemplates.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesTemplatesCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesUpdateDockerfile.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesUploadApi.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamServicesUploadApiOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSetBeamOtelConfigCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSetEnabledCommandArgsOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSetEnabledCommandComponent.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSettingOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamShowCurrentBeamoStatusCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamShowManifestCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamSnapshotStorageObjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamStartDockerCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamStartGrafanaCommandResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamStopProjectCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTailLogMessageForClient.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryCollector.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryCollectorGet.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryCollectorPs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryConfig.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryGetCreds.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryLogs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryPrune.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryPush.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetryReport.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTelemetrySetConfig.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTempClearLogs.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTokenFromRefresh.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTokenInspect.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTokenList.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamTokenNewGuest.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityAssemblyReferenceData.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityCopyDotnetSrc.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityDownloadAllNugetPackages.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityDownloadNugetPackage.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityGetVersionInfo.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityManifest.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityReleaseSharedCode.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityRestore.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityUpdateDlls.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamUnityUpdateReferences.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamVersion.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamVersionConstruct.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamVersionResults.cs.meta +11 -11
- package/Editor/BeamCli/Commands/BeamWriteProjectSettingsCommandOutput.cs.meta +11 -11
- package/Editor/BeamCli/Extensions/BeamManifestServiceEntry_ComputedTypes.cs +53 -53
- package/Editor/BeamCli/Extensions/BeamManifestStorageEntry_ComputedTypes.cs +10 -10
- package/Editor/BeamCli/Extensions/DiscoveryExtensions.cs +57 -41
- package/Editor/BeamCli/Extensions/FederationsConfig.cs +22 -22
- package/Editor/BeamCli/UI/BeamCliJsonPopup.cs +29 -29
- package/Editor/BeamCli/UI/BeamCliTextPopup.cs +32 -32
- package/Editor/BeamCli/UI/BeamCliWindow.cs +174 -174
- package/Editor/BeamCli/UI/BeamCliWindow_Commands.cs +539 -512
- package/Editor/BeamCli/UI/BeamCliWindow_Overrides.cs +117 -117
- package/Editor/BeamCli/UI/BeamCliWindow_Server.cs +156 -156
- package/Editor/BeamCli/UI/BeamCliWindow_Terminal.cs +207 -207
- package/Editor/BeamCli/UI/BeamCliWindow_Util.cs +336 -336
- package/Editor/BeamCli/UI/JsonHighlighterUtil.cs +143 -143
- package/Editor/BeamCli/UI/LogUtil/LogViewUtil.cs +727 -727
- package/Editor/BeamCli/UI/TimeDisplayUtil.cs +22 -22
- package/Editor/BeamEditor.cs +758 -733
- package/Editor/BeamableLinker.cs +77 -77
- package/Editor/BuildPostProcessor.cs +44 -44
- package/Editor/BuildPreProcessor.cs +264 -264
- package/Editor/ContentService/CliContentService.cs +49 -18
- package/Editor/Dotnet/DotnetService.cs +193 -193
- package/Editor/Dotnet/DotnetUtil.cs +296 -296
- package/Editor/EditorAPI.cs +4 -4
- package/Editor/EditorPlatformRequesterErrorHandler.cs +28 -28
- package/Editor/EditorRuntimeConfigProvider.cs +19 -19
- package/Editor/EditorStorageLayer.cs +40 -40
- package/Editor/Eggs/EggEntry.cs +38 -38
- package/Editor/Eggs/Serpent/EggSerpent.cs +209 -209
- package/Editor/Environment/BeamableDiagnosticData.cs +198 -198
- package/Editor/Environment/BeamableEditorWebRequester.cs +62 -62
- package/Editor/Environment/BeamablePackages.cs +90 -90
- package/Editor/Environment/IEditorHttpRequester.cs +49 -49
- package/Editor/FileAssetModificationProcessor.cs +49 -49
- package/Editor/LibraryService.cs +297 -297
- package/Editor/Modules/Account/BeamableSocialsImporter.cs +59 -59
- package/Editor/Modules/Account/EditorAuthService.cs +244 -244
- package/Editor/Modules/Account/PortalCommand.cs +37 -37
- package/Editor/Modules/Content/CalendarWindow.cs +185 -185
- package/Editor/Modules/Content/ContentObjectPropertyDrawer.cs +26 -26
- package/Editor/Modules/Content/ContentPropertyDrawer.cs +372 -372
- package/Editor/Modules/Content/ContentValidationPropertyDrawer.cs +307 -307
- package/Editor/Modules/Content/DatePropertyDrawer.cs +355 -355
- package/Editor/Modules/Content/OptionalPropertyDrawer.cs +80 -80
- package/Editor/Modules/Content/PropertyDrawerHelper.cs +44 -44
- package/Editor/Modules/Content/ScheduleDefinitionPropertyDrawer.cs +554 -554
- package/Editor/Modules/Content/SerializedContentObject.cs +12 -12
- package/Editor/Modules/Content/UI/ContentObjectEditor.cs +395 -390
- package/Editor/Modules/Content/UI/DisplayableListPropertyDrawer.cs +47 -47
- package/Editor/Modules/Content/UI/EditorValidationContext.cs +7 -7
- package/Editor/Modules/Content/UI/SerializedDictionaryEditor.cs +208 -208
- package/Editor/Modules/ContentTypes/ContentTypesCreator.cs +58 -58
- package/Editor/Modules/EditorConfig/EditorConfiguration.cs +209 -209
- package/Editor/Modules/Input/InputActionPropertyDrawer.cs +138 -138
- package/Editor/Modules/Player/ObservableReadonlyListPropertyDrawer.cs +21 -21
- package/Editor/Modules/Purchasing/BeamablePurchaserImporter.cs +74 -74
- package/Editor/Modules/Sessions/DeviceOptionPropertyDrawer.cs +56 -56
- package/Editor/Modules/Sessions/SessionParameterProviderCreator.cs +111 -111
- package/Editor/Modules/Sessions/SessionParameterProviderEditor.cs +25 -25
- package/Editor/Modules/Stats/StatEditor.cs +18 -18
- package/Editor/Modules/Theme/ButtonStyleObject.cs +9 -9
- package/Editor/Modules/Theme/CanHideDrawer.cs +34 -34
- package/Editor/Modules/Theme/ColorStyleObject.cs +9 -9
- package/Editor/Modules/Theme/FilterSelection.cs +41 -41
- package/Editor/Modules/Theme/FontStyleObject.cs +9 -9
- package/Editor/Modules/Theme/GradientStyleObject.cs +9 -9
- package/Editor/Modules/Theme/ImageStyleObject.cs +9 -9
- package/Editor/Modules/Theme/LayoutStyleObject.cs +9 -9
- package/Editor/Modules/Theme/PaletteStyleObject.cs +30 -30
- package/Editor/Modules/Theme/SelectableStyleObject.cs +9 -9
- package/Editor/Modules/Theme/SoundStyleObject.cs +9 -9
- package/Editor/Modules/Theme/StringStyleObject.cs +9 -9
- package/Editor/Modules/Theme/Style/ButtonStyleObjectPropertyDrawer.cs +61 -61
- package/Editor/Modules/Theme/Style/GeneralPaletteBindingOptionDrawer.cs +25 -25
- package/Editor/Modules/Theme/Style/ThemeSelectorEditor.cs +79 -79
- package/Editor/Modules/Theme/TextStyleObject.cs +9 -9
- package/Editor/Modules/Theme/ThemeConfigurationPropertyDrawer.cs +64 -64
- package/Editor/Modules/Theme/TransformStyleObject.cs +9 -9
- package/Editor/Modules/Theme/WindowStyleObject.cs +9 -9
- package/Editor/NoOpAnalyticsTracker.cs +22 -22
- package/Editor/ReflectionCache/ReflectionCacheAssetPostProcessor.cs +68 -68
- package/Editor/ResetPlayerAccessTokenEditor.cs +63 -63
- package/Editor/Server/AssemblyDefinitionHelper.cs +237 -237
- package/Editor/Server/CommonAreaService.cs +198 -189
- package/Editor/Server/DependencyResolver.cs +177 -177
- package/Editor/Server/ExtensionMethods.cs +40 -40
- package/Editor/Server/MicroserviceConfiguration.cs +87 -87
- package/Editor/Server/RegisterDependencies.cs +33 -33
- package/Editor/Server/UI/Configs/BeamFederationSetting.cs +160 -160
- package/Editor/Server/UI/Configs/BeamStorageDependencySetting.cs +55 -55
- package/Editor/Server/UI/Configs/BeamableMicroservicesSettings.cs +180 -180
- package/Editor/Server/UI/Configs/BeamableStorageSettings.cs +83 -83
- package/Editor/Server/UI/FederationPropertyDrawer.cs +209 -209
- package/Editor/Server/UI/PublishWindow/UsamPublishWindow.cs +442 -442
- package/Editor/Server/UI/PublishWindow/UsamPublishWindow_FatalError.cs +39 -39
- package/Editor/Server/UI/PublishWindow/UsamPublishWindow_Plan.cs +125 -125
- package/Editor/Server/UI/PublishWindow/UsamPublishWindow_Review.cs +247 -247
- package/Editor/Server/UI/UsamWindow/ServicePickerWindow.cs +308 -308
- package/Editor/Server/UI/UsamWindow/UsamWindow.cs +94 -94
- package/Editor/Server/UI/UsamWindow/UsamWindow_Badges.cs +55 -55
- package/Editor/Server/UI/UsamWindow/UsamWindow_Create.cs +325 -325
- package/Editor/Server/UI/UsamWindow/UsamWindow_Docker.cs +111 -111
- package/Editor/Server/UI/UsamWindow/UsamWindow_Main.cs +321 -321
- package/Editor/Server/UI/UsamWindow/UsamWindow_Service.cs +313 -313
- package/Editor/Server/UI/UsamWindow/UsamWindow_Settings.cs +405 -405
- package/Editor/Server/UI/UsamWindow/UsamWindow_Storage.cs +237 -237
- package/Editor/Server/Usam/AssemblyUtil.cs +136 -136
- package/Editor/Server/Usam/CsProjUtil.cs +12 -12
- package/Editor/Server/Usam/CsharpProjectUtil.cs +325 -325
- package/Editor/Server/Usam/ServiceRoutingStrategy.cs +81 -81
- package/Editor/Server/Usam/UsamLogger.cs +46 -46
- package/Editor/Server/Usam/UsamService.cs +1152 -1150
- package/Editor/Server/Usam/UsamService_GenerateClient.cs +243 -243
- package/Editor/Server/Usam/UsamService_Reload.cs +119 -119
- package/Editor/Server/WebhookContentEditor/RouteParametersPropertyDrawer.cs +309 -309
- package/Editor/Server/WebhookContentEditor/RouteVariablesPropertyDrawer.cs +56 -56
- package/Editor/Server/WebhookContentEditor/ServiceRoutePropertyDrawer.cs +137 -137
- package/Editor/ServiceStorage.cs +128 -128
- package/Editor/SessionStorageLayer.cs +29 -29
- package/Editor/TextMeshProImporter.cs +101 -101
- package/Editor/Toolbar/BeamableToolbarAssetPostProcessor.cs +30 -32
- package/Editor/Toolbar/BeamableToolbarButton.cs +45 -45
- package/Editor/Toolbar/BeamableToolbarCallbacks.cs +153 -153
- package/Editor/Toolbar/BeamableToolbarExtender.cs +165 -137
- package/Editor/Toolbar/BeamableToolbarMenuItem.cs +40 -40
- package/Editor/Toolbar/MenuItems/AccountMenuItem.cs +51 -51
- package/Editor/Toolbar/MenuItems/BeamableConfigurationManagerMenuItem.cs +21 -21
- package/Editor/Toolbar/MenuItems/BeamableContentManagerMenuItem.cs +20 -20
- package/Editor/Toolbar/MenuItems/BeamableMicroserviceManagerMenuItem.cs +20 -20
- package/Editor/Toolbar/MenuItems/BeamablePortalMenuItem.cs +18 -18
- package/Editor/Toolbar/MenuItems/BeamableRealmMenuItem.cs +113 -100
- package/Editor/Toolbar/MenuItems/BeamableToolbarMenuItemSeparator.cs +17 -17
- package/Editor/Toolbar/MenuItems/BeamableToolboxWindowMenuItem.cs +20 -20
- package/Editor/Toolbar/ToolbarButtons/SampleBeamableButton.cs +27 -27
- package/Editor/UI/AccountWindow/AccountWindow.cs +3 -2
- package/Editor/UI/BeamEditorWindow.cs +393 -393
- package/Editor/UI/BeamGUI/BeamGUI_Dropdowns.cs +205 -205
- package/Editor/UI/BeamGUI/BeamGUI_Enabled.cs +31 -31
- package/Editor/UI/BeamGUI/BeamGUI_Header.cs +148 -148
- package/Editor/UI/BeamGUI/BeamGUI_Icons.cs +330 -330
- package/Editor/UI/BeamGUI/BeamGUI_LoadingBars.cs +105 -105
- package/Editor/UI/BeamGUI/BeamGUI_PlaceholdTextField.cs +64 -64
- package/Editor/UI/BeamGUI/BeamGUI_PrimaryButton.cs +178 -178
- package/Editor/UI/BeamGUI/BeamGUI_Spinner.cs +30 -30
- package/Editor/UI/BeamGUI/BeamGUI_StaticConstructor.cs +17 -17
- package/Editor/UI/BeamGUI/BeamGUI_Toggle.cs +41 -41
- package/Editor/UI/BeamGUI/PropertyDrawers/HelpBoxDecoratorDrawer.cs +32 -32
- package/Editor/UI/Common/FormConstraint.cs +53 -53
- package/Editor/UI/Common/MediaQueryObjectPropertyDrawer.cs +42 -42
- package/Editor/UI/Common/ReparenterCustomEditor.cs +24 -24
- package/Editor/UI/Config/BeamableSettingsProvider.cs +222 -222
- package/Editor/UI/Config/BeamableSpewSettingsProvider.cs +163 -163
- package/Editor/UI/Config/ConfigManager.cs +207 -207
- package/Editor/UI/Config/Model/ConfigOption.cs +26 -26
- package/Editor/UI/Config/Model/ConfigQuery.cs +114 -114
- package/Editor/UI/ContentWindow/ContentWindow.cs +6 -2
- package/Editor/UI/ContentWindow/ContentWindow_ItemsPanel.cs +24 -19
- package/Editor/UI/ContentWindow/ContentWindow_SnapshotManager.cs +2 -2
- package/Editor/UI/CronExpression/Common/Extensions.cs +23 -23
- package/Editor/UI/CronExpression/DescriptionTypeEnum.cs +18 -18
- package/Editor/UI/CronExpression/ExpressionDescriptor.cs +761 -761
- package/Editor/UI/CronExpression/Localization/CronLocalizationData.cs +77 -77
- package/Editor/UI/CronExpression/Localization/CronLocalizationDatabase.cs +15 -15
- package/Editor/UI/HelpMenuItems.cs +29 -29
- package/Editor/UI/IDelayedActionWindow.cs +10 -10
- package/Editor/UI/LibraryWindow/BeamLibraryWindow.cs +71 -71
- package/Editor/UI/LibraryWindow/BeamLibraryWindow_Main.cs +35 -35
- package/Editor/UI/LibraryWindow/BeamLibraryWindow_Samples.cs +330 -330
- package/Editor/UI/Toolbox/ToolboxWindow.cs +19 -19
- package/Editor/Utility/BeamableAssetDatabase.cs +30 -30
- package/Editor/Utility/BeamableDispatcher.cs +222 -222
- package/Editor/Utility/EditorDebouncer.cs +78 -78
- package/Editor/Utility/EditorFilesystemAccessor.cs +13 -13
- package/Editor/Utility/EditorGUIExtension.cs +148 -148
- package/Editor/Utility/EditorGUIRectController.cs +72 -72
- package/Editor/Utility/FilePathSelectorDrawer.cs +81 -81
- package/Editor/Utility/FileUtils.cs +76 -76
- package/Editor/Utility/PlayerSettingsExtensions.cs +54 -54
- package/Editor/Utility/PromiseEditor.cs +22 -22
- package/Editor/Utility/PropertyDrawerFinder.cs +235 -235
- package/Editor/Utility/ReadonlyIfDrawer.cs +56 -56
- package/Editor/Utility/ShowOnlyDrawer.cs +36 -36
- package/Editor/Utility/TaskUtil.cs +58 -58
- package/Editor/Utility/UnityOtelManager.cs +8 -4
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/BuildRequests.cs +961 -961
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/CoroutineClass.cs +1396 -1396
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/ExceptionHandlers.cs +295 -295
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/Helpers.cs +1337 -1337
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/IPubnubUnitTest.cs +31 -31
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/JSONSerializer.cs +62 -62
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/LoggingMethod.cs +661 -661
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/MD5.cs +723 -723
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/Pubnub.cs +1164 -1164
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/PubnubCallbacks.cs +464 -464
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/PubnubCrypto.cs +77 -77
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/PubnubUnity.cs +2080 -2080
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/ReconnectState.cs +180 -180
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/SafeDictionary.cs +204 -204
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/SharedStringBuilder.cs +23 -23
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/SharedStringBuilder.cs.meta +2 -2
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/SubscribeEnvelope.cs +226 -226
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/Subscription.cs +421 -421
- package/Runtime/3rdParty/PubNub/Scripts/Pubnub/Utility.cs +350 -350
- package/Runtime/3rdParty/UnityUIExtensions/ExtentionMethods.cs +19 -19
- package/Runtime/3rdParty/UnityUIExtensions/Gradient.cs +122 -122
- package/Runtime/3rdParty/UnityUIExtensions/HorizontalScrollSnap.cs +317 -317
- package/Runtime/3rdParty/UnityUIExtensions/IScrollSnap.cs +15 -15
- package/Runtime/3rdParty/UnityUIExtensions/ScrollSnap.cs +573 -573
- package/Runtime/3rdParty/UnityUIExtensions/ScrollSnapBase.cs +615 -615
- package/Runtime/3rdParty/UnityUIExtensions/ScrollSnapScrollbarHelper.cs +56 -56
- package/Runtime/3rdParty/UnityUIExtensions/UI_InfiniteScroll.cs +175 -175
- package/Runtime/3rdParty/VirtualList/Editor/AbstractVirtualListEditor.cs +43 -43
- package/Runtime/3rdParty/VirtualList/Runtime/AbstractVirtualList.cs +388 -388
- package/Runtime/3rdParty/VirtualList/Runtime/IListSource.cs +50 -50
- package/Runtime/3rdParty/VirtualList/Runtime/SimpleSource.cs +81 -81
- package/Runtime/3rdParty/VirtualList/Runtime/VirtualGridList.cs +123 -123
- package/Runtime/3rdParty/VirtualList/Runtime/VirtualHorizontalList.cs +84 -84
- package/Runtime/3rdParty/VirtualList/Runtime/VirtualVerticalList.cs +84 -84
- package/Runtime/3rdParty/WebSocket/WebSocket.cs +866 -866
- package/Runtime/API.cs +267 -267
- package/Runtime/Beam.cs +528 -528
- package/Runtime/BeamContext.cs +1037 -1037
- package/Runtime/Commands/CommandExtensions.cs +26 -26
- package/Runtime/Commands/ICommand.cs +7 -7
- package/Runtime/Connection/BeamableSubscriptionManager.cs +38 -38
- package/Runtime/Connection/IBeamableConnection.cs +30 -30
- package/Runtime/Connection/WebSocketConnection.cs +285 -285
- package/Runtime/Connection/WebSocketConnectionException.cs +9 -9
- package/Runtime/Core/Config/ConfigConsoleCommands.cs +69 -69
- package/Runtime/Core/Config/ConfigConsoleCommands.cs.meta +2 -2
- package/Runtime/Core/Config/ConfigDatabase.cs +253 -253
- package/Runtime/Core/Config/RuntimeConfigProvider.cs +86 -86
- package/Runtime/Core/ConsoleCommands/BeamableConsole.cs +169 -169
- package/Runtime/Core/ConsoleCommands/BeamableConsole.cs.meta +2 -2
- package/Runtime/Core/ConsoleCommands/BeamableConsoleCommandAttribute.cs +27 -27
- package/Runtime/Core/ConsoleCommands/BeamableConsoleCommandProviderAttribute.cs +15 -15
- package/Runtime/Core/ConsoleCommands/BeamableConsoleCommandProviderAttribute.cs.meta +2 -2
- package/Runtime/Core/ConsoleCommands/DefaultConsoleCommands.cs +45 -45
- package/Runtime/Core/ConsoleCommands/DefaultConsoleCommands.cs.meta +2 -2
- package/Runtime/Core/Coroutines/CompletedYieldInstruction.cs +14 -14
- package/Runtime/Core/Coroutines/CoroutineService.cs +115 -115
- package/Runtime/Core/Coroutines/Debouncer.cs +147 -147
- package/Runtime/Core/Coroutines/Yielders.cs +40 -40
- package/Runtime/Core/Extensions/TransformExtensions.cs +118 -118
- package/Runtime/Core/Platform/SDK/AccessToken.cs +151 -151
- package/Runtime/Core/Platform/SDK/AccessTokenStorage.cs +225 -225
- package/Runtime/Core/Platform/SDK/AdvertisingIdentifier/AdvertisingIdentifier.cs +30 -30
- package/Runtime/Core/Platform/SDK/Analytics/AnalyticsTracker.cs +200 -200
- package/Runtime/Core/Platform/SDK/Analytics/Batch/BatchContainer.cs +107 -107
- package/Runtime/Core/Platform/SDK/Analytics/Batch/BatchManager.cs +207 -207
- package/Runtime/Core/Platform/SDK/Analytics/Batch/IBatchContainer.cs +66 -66
- package/Runtime/Core/Platform/SDK/Analytics/Batch/PersistentBatchManager.cs +143 -143
- package/Runtime/Core/Platform/SDK/Analytics/Batch/SerializableBatch.cs +33 -33
- package/Runtime/Core/Platform/SDK/Analytics/Models/BillerPurchaseFailedEvent.cs +16 -16
- package/Runtime/Core/Platform/SDK/Analytics/Models/LoginPanicEvent.cs +19 -19
- package/Runtime/Core/Platform/SDK/Announcements/AnnouncementsService.cs +121 -121
- package/Runtime/Core/Platform/SDK/Auth/AuthService.cs +230 -230
- package/Runtime/Core/Platform/SDK/Auth/DeviceIdResolver.cs +24 -24
- package/Runtime/Core/Platform/SDK/Auth/GCIdentity.cs +24 -24
- package/Runtime/Core/Platform/SDK/Auth/GoogleSignIn.cs +89 -89
- package/Runtime/Core/Platform/SDK/Auth/SignInWithApple.cs +263 -263
- package/Runtime/Core/Platform/SDK/Auth/SignInWithFacebookLimited.cs +112 -112
- package/Runtime/Core/Platform/SDK/Auth/SignInWithGPG.cs +109 -109
- package/Runtime/Core/Platform/SDK/Auth/SignInWithGameCenter.cs +107 -107
- package/Runtime/Core/Platform/SDK/BeamableApiRequester.cs +112 -112
- package/Runtime/Core/Platform/SDK/Caches/OfflineCache.cs +319 -319
- package/Runtime/Core/Platform/SDK/Calendars/CalendarsService.cs +123 -123
- package/Runtime/Core/Platform/SDK/Chat/ChatProvider.cs +190 -190
- package/Runtime/Core/Platform/SDK/Chat/ChatService.cs +61 -61
- package/Runtime/Core/Platform/SDK/Chat/ChatView.cs +292 -292
- package/Runtime/Core/Platform/SDK/Chat/PubNubChatProvider.cs +51 -51
- package/Runtime/Core/Platform/SDK/Chat/PubNubRoom.cs +135 -135
- package/Runtime/Core/Platform/SDK/Chat/Room.cs +121 -121
- package/Runtime/Core/Platform/SDK/CloudData/CloudDataConsoleCommands.cs +52 -52
- package/Runtime/Core/Platform/SDK/CloudData/CloudDataService.cs +24 -24
- package/Runtime/Core/Platform/SDK/CloudSaving/CloudSavingError.cs +14 -14
- package/Runtime/Core/Platform/SDK/CloudSaving/CloudSavingExtensions.cs +82 -82
- package/Runtime/Core/Platform/SDK/CometClientData.cs +44 -44
- package/Runtime/Core/Platform/SDK/CometClientData.cs.meta +2 -2
- package/Runtime/Core/Platform/SDK/Commerce/CommerceConsoleCommands.cs +45 -45
- package/Runtime/Core/Platform/SDK/Commerce/CommerceService.cs +101 -101
- package/Runtime/Core/Platform/SDK/Commerce/ICommerceConfig.cs +19 -19
- package/Runtime/Core/Platform/SDK/Connectivity/Connectivity.cs +238 -238
- package/Runtime/Core/Platform/SDK/Connectivity/IConnectivityChecker.cs +109 -109
- package/Runtime/Core/Platform/SDK/ErrorCode.cs +62 -62
- package/Runtime/Core/Platform/SDK/Events/EventsService.cs +129 -129
- package/Runtime/Core/Platform/SDK/Groups/GroupsService.cs +58 -58
- package/Runtime/Core/Platform/SDK/Gzip.cs +51 -51
- package/Runtime/Core/Platform/SDK/Inventory/InventoryConsoleCommands.cs +65 -65
- package/Runtime/Core/Platform/SDK/Inventory/InventoryService.cs +149 -149
- package/Runtime/Core/Platform/SDK/Inventory/InventoryService.cs.meta +2 -2
- package/Runtime/Core/Platform/SDK/Inventory.meta +2 -2
- package/Runtime/Core/Platform/SDK/Leaderboard/LeaderboardService.cs +31 -31
- package/Runtime/Core/Platform/SDK/Mail/MailService.cs +44 -44
- package/Runtime/Core/Platform/SDK/Matchmaking/Match.cs +46 -46
- package/Runtime/Core/Platform/SDK/Matchmaking/MatchmakingService.cs +450 -450
- package/Runtime/Core/Platform/SDK/Matchmaking/Ticket.cs +36 -36
- package/Runtime/Core/Platform/SDK/Matchmaking/TicketReservationRequest.cs +43 -43
- package/Runtime/Core/Platform/SDK/Matchmaking/TicketReservationResponse.cs +21 -21
- package/Runtime/Core/Platform/SDK/Notification/Internal/AppleLocalNotificationRelay.cs +117 -117
- package/Runtime/Core/Platform/SDK/Notification/Internal/DummyLocalNotificationRelay.cs +33 -33
- package/Runtime/Core/Platform/SDK/Notification/Internal/GoogleLocalNotificationRelay.cs +86 -86
- package/Runtime/Core/Platform/SDK/Notification/Internal/ILocalNotificationRelay.cs +40 -40
- package/Runtime/Core/Platform/SDK/Notification/Internal/IMessageHandler.cs +11 -11
- package/Runtime/Core/Platform/SDK/Notification/Internal/InGameNotification.cs +39 -39
- package/Runtime/Core/Platform/SDK/Notification/Internal/MultiChannelSubscriptionHandler.cs +90 -90
- package/Runtime/Core/Platform/SDK/Notification/NotificationService.cs +505 -505
- package/Runtime/Core/Platform/SDK/Notification/PubnubData.cs +50 -50
- package/Runtime/Core/Platform/SDK/Notification/PubnubSubscriptionManager.cs +668 -668
- package/Runtime/Core/Platform/SDK/Notification/PushProvider.cs +25 -25
- package/Runtime/Core/Platform/SDK/Notification/PushService.cs +74 -74
- package/Runtime/Core/Platform/SDK/Payments/IBeamablePurchaser.cs +62 -62
- package/Runtime/Core/Platform/SDK/Payments/IPaymentServiceOptions.cs +38 -38
- package/Runtime/Core/Platform/SDK/Payments/PaymentErrorCodes.cs +17 -17
- package/Runtime/Core/Platform/SDK/Payments/PaymentModel.cs +75 -75
- package/Runtime/Core/Platform/SDK/Payments/PaymentService.cs +445 -445
- package/Runtime/Core/Platform/SDK/Payments/PaymentTransaction.cs +138 -138
- package/Runtime/Core/Platform/SDK/Payments/TransactionManager.cs +348 -348
- package/Runtime/Core/Platform/SDK/PlatformFilesystemAccessor.cs +14 -14
- package/Runtime/Core/Platform/SDK/PlatformRequester.cs +761 -761
- package/Runtime/Core/Platform/SDK/PlatformRequesterExceptions.cs +31 -31
- package/Runtime/Core/Platform/SDK/PlatformRequesterExtensions.cs +21 -21
- package/Runtime/Core/Platform/SDK/PlatformRequesterInterfaces.cs +29 -29
- package/Runtime/Core/Platform/SDK/PlatformService.cs +81 -81
- package/Runtime/Core/Platform/SDK/PlatformSubscribable.cs +621 -621
- package/Runtime/Core/Platform/SDK/Polyfill.cs +25 -25
- package/Runtime/Core/Platform/SDK/PubnubNotificationService.cs +42 -42
- package/Runtime/Core/Platform/SDK/Session/Heartbeat.cs +127 -127
- package/Runtime/Core/Platform/SDK/Session/SessionDeviceOptions.cs +213 -213
- package/Runtime/Core/Platform/SDK/Session/SessionParameterProvider.cs +61 -61
- package/Runtime/Core/Platform/SDK/Session/SessionService.cs +292 -292
- package/Runtime/Core/Platform/SDK/Session/SessionServiceHelper.cs +192 -192
- package/Runtime/Core/Platform/SDK/Sim/GameRelayService.cs +243 -243
- package/Runtime/Core/Platform/SDK/Sim/SimBehavior.cs +73 -73
- package/Runtime/Core/Platform/SDK/Sim/SimClient.cs +427 -427
- package/Runtime/Core/Platform/SDK/Sim/SimEvent.cs +39 -39
- package/Runtime/Core/Platform/SDK/Sim/SimFaultHandler.cs +172 -172
- package/Runtime/Core/Platform/SDK/Sim/SimFrame.cs +76 -76
- package/Runtime/Core/Platform/SDK/Sim/SimLog.cs +113 -113
- package/Runtime/Core/Platform/SDK/Sim/SimNetworkInterface.cs +79 -79
- package/Runtime/Core/Platform/SDK/Sim/network/eventStream/SimNetworkEventStream.cs +186 -186
- package/Runtime/Core/Platform/SDK/Sim/network/local/SimNetworkLocal.cs +62 -62
- package/Runtime/Core/Platform/SDK/Social/SocialService.cs +22 -22
- package/Runtime/Core/Platform/SDK/Stats/StatsService.cs +96 -96
- package/Runtime/Core/Platform/SDK/TokenAnalyticsUtil.cs +65 -65
- package/Runtime/Core/Platform/SDK/Tournaments/TournamentConsoleCommands.cs +87 -87
- package/Runtime/Core/Platform/SDK/Tournaments/TournamentService.cs +26 -26
- package/Runtime/Core/Platform/SDK/UnityUserDataCache.cs +169 -169
- package/Runtime/Core/Platform/TaskLikeExtensions.cs +26 -26
- package/Runtime/Core/Pooling/DisablePool.cs +104 -104
- package/Runtime/Core/Pooling/HidePool.cs +203 -203
- package/Runtime/Core/Pooling/HidePoolObject.cs +15 -15
- package/Runtime/Core/Pooling/HidePoolService.cs +64 -64
- package/Runtime/Core/Pooling/StaticClassPool.cs +82 -82
- package/Runtime/Core/Pooling/StringBuilderPool.cs +116 -116
- package/Runtime/Dependencies/GameObjectContext.cs +36 -36
- package/Runtime/Dependencies/ILoadWithContext.cs +12 -12
- package/Runtime/Environment/BeamableEnvironment.cs +134 -134
- package/Runtime/Environment/Resources/env-default.json +1 -1
- package/Runtime/Environment/Resources/versions-default.json +1 -1
- package/Runtime/ExperimentalAPI.cs +49 -49
- package/Runtime/GlobalServices/BeamableGlobalGameObject.cs +37 -37
- package/Runtime/HelpBoxDecoratorAttribute.cs +16 -16
- package/Runtime/InventoryViewEx.cs +171 -171
- package/Runtime/Modules/AccountManagement/Scripts/AccountAvatarBehaviour.cs +51 -51
- package/Runtime/Modules/AccountManagement/Scripts/AccountCustomizationBehaviour.cs +185 -185
- package/Runtime/Modules/AccountManagement/Scripts/AccountDisplayItem.cs +245 -245
- package/Runtime/Modules/AccountManagement/Scripts/AccountEmailLogin.cs +126 -126
- package/Runtime/Modules/AccountManagement/Scripts/AccountExistsSelect.cs +27 -27
- package/Runtime/Modules/AccountManagement/Scripts/AccountForgotPassword.cs +63 -63
- package/Runtime/Modules/AccountManagement/Scripts/AccountGeneralErrorBehaviour.cs +15 -15
- package/Runtime/Modules/AccountManagement/Scripts/AccountMainMenu.cs +315 -315
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementAdapter.cs +75 -75
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementBehaviour.cs +68 -68
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementCommands.cs +50 -50
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementConfiguration.cs +172 -172
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementHelper.cs +40 -40
- package/Runtime/Modules/AccountManagement/Scripts/AccountManagementSignals.cs +716 -716
- package/Runtime/Modules/AccountManagement/Scripts/AccountPlayerDataMenu.cs +94 -94
- package/Runtime/Modules/AccountManagement/Scripts/AccountSwitch.cs +55 -55
- package/Runtime/Modules/AccountManagement/Scripts/AccountThirdPartyWaitingMenu.cs +22 -22
- package/Runtime/Modules/AccountManagement/Scripts/AppleSignInBehavior.cs +64 -64
- package/Runtime/Modules/AccountManagement/Scripts/ForgotPasswordArguments.cs +10 -10
- package/Runtime/Modules/AccountManagement/Scripts/GoogleGameServicesBehavior.cs +67 -67
- package/Runtime/Modules/AccountManagement/Scripts/GoogleSignInBehavior.cs +70 -70
- package/Runtime/Modules/AccountManagement/Scripts/LoadingPopup.cs +34 -34
- package/Runtime/Modules/AccountManagement/Scripts/LoginArguments.cs +10 -10
- package/Runtime/Modules/AccountManagement/Scripts/ThirdPartyLoginArgument.cs +10 -10
- package/Runtime/Modules/AccountManagement/Scripts/TokenReference.cs +10 -10
- package/Runtime/Modules/Announcements/Rework/AnnouncementsCollection.cs +53 -53
- package/Runtime/Modules/Announcements/Rework/AnnouncementsPresenter.cs +70 -70
- package/Runtime/Modules/Announcements/Scripts/AnnouncementBehavior.cs +22 -22
- package/Runtime/Modules/Announcements/Scripts/AnnouncementMainMenu.cs +79 -79
- package/Runtime/Modules/Announcements/Scripts/AnnouncementReadMenu.cs +47 -47
- package/Runtime/Modules/Announcements/Scripts/AnnouncementSignals.cs +39 -39
- package/Runtime/Modules/Announcements/Scripts/AnnouncementSummary.cs +19 -19
- package/Runtime/Modules/Avatars/Scripts/AvatarConfiguration.cs +33 -33
- package/Runtime/Modules/Avatars/Scripts/AvatarPickerBehaviour.cs +99 -99
- package/Runtime/Modules/BeamableDisplayModule.cs +83 -83
- package/Runtime/Modules/BeamableModule.cs +17 -17
- package/Runtime/Modules/Calendars/Scripts/CalendarBehaviour.cs +85 -85
- package/Runtime/Modules/Calendars/Scripts/CalendarFlowMainPage.cs +8 -8
- package/Runtime/Modules/Calendars/Scripts/CalendarRewardsDay.cs +32 -32
- package/Runtime/Modules/Console/ConsoleConfiguration.cs +25 -25
- package/Runtime/Modules/Console/ConsoleFlow.cs +662 -662
- package/Runtime/Modules/Content/ContentCache.cs +184 -184
- package/Runtime/Modules/Content/ContentCommands.cs +161 -161
- package/Runtime/Modules/Content/ContentConfiguration.cs +161 -161
- package/Runtime/Modules/Content/ContentParameterProvider.cs +9 -9
- package/Runtime/Modules/Content/ContentService.cs +739 -739
- package/Runtime/Modules/Content/Extensions.cs +42 -42
- package/Runtime/Modules/Content/IManifestResolver.cs +42 -42
- package/Runtime/Modules/Content/Manifest.cs +22 -22
- package/Runtime/Modules/CoreConfiguration.cs +285 -285
- package/Runtime/Modules/CurrencyHUD/CurrencyHUDFlow.cs +74 -74
- package/Runtime/Modules/Generics/CollectionPresenter.cs +9 -9
- package/Runtime/Modules/Generics/DataCollection.cs +19 -19
- package/Runtime/Modules/Generics/DataPresenter.cs +40 -40
- package/Runtime/Modules/Generics/GenericButton.cs +21 -21
- package/Runtime/Modules/Generics/Model.cs +26 -26
- package/Runtime/Modules/Generics/ModelPresenter.cs +25 -25
- package/Runtime/Modules/Input/BeamableInput.cs +45 -45
- package/Runtime/Modules/Input/InputActionArg.cs +55 -55
- package/Runtime/Modules/Inventory/Prototype/GenericComponents/GenericTextButton.cs +36 -36
- package/Runtime/Modules/Inventory/Prototype/InventoryPresenter.cs +159 -159
- package/Runtime/Modules/Inventory/Prototype/ItemPresenter.cs +29 -29
- package/Runtime/Modules/Inventory/Prototype/ItemsCollection.cs +79 -79
- package/Runtime/Modules/Inventory/Prototype/LanguageLocalization/LanguageLocalizationElement.cs +47 -47
- package/Runtime/Modules/Inventory/Prototype/LanguageLocalization/LanguageLocalizationManager.cs +43 -43
- package/Runtime/Modules/Inventory/Prototype/LanguageLocalization/LocalizationHelper.cs +15 -15
- package/Runtime/Modules/Inventory/Scripts/InventoryBehaviour.cs +59 -59
- package/Runtime/Modules/Inventory/Scripts/InventoryCommands.cs +190 -190
- package/Runtime/Modules/Inventory/Scripts/InventoryConfiguration.cs +32 -32
- package/Runtime/Modules/Inventory/Scripts/InventoryGroupUI.cs +56 -56
- package/Runtime/Modules/Inventory/Scripts/InventoryMainMenu.cs +65 -65
- package/Runtime/Modules/Inventory/Scripts/InventoryMenuBehaviour.cs +56 -56
- package/Runtime/Modules/Inventory/Scripts/InventoryObjectUI.cs +38 -38
- package/Runtime/Modules/Inventory/Scripts/InventorySignals.cs +43 -43
- package/Runtime/Modules/Inventory/Scripts/ItemImageSetter.cs +41 -41
- package/Runtime/Modules/Leaderboards/Scripts/LeaderboardBehavior.cs +32 -32
- package/Runtime/Modules/Leaderboards/Scripts/LeaderboardItem.cs +24 -24
- package/Runtime/Modules/Leaderboards/Scripts/LeaderboardMainMenu.cs +80 -80
- package/Runtime/Modules/Leaderboards/Scripts/LeaderboardSignals.cs +33 -33
- package/Runtime/Modules/ModuleConfigurationObject.cs +212 -212
- package/Runtime/Modules/PackageUtil.cs +80 -80
- package/Runtime/Modules/Purchasing/PaymentCommands.cs +55 -55
- package/Runtime/Modules/Purchasing/Steam/SteamPurchasingModule.cs +20 -20
- package/Runtime/Modules/Purchasing/Steam/SteamStore.cs +147 -147
- package/Runtime/Modules/Purchasing/UnityBeamablePurchaser.cs +514 -514
- package/Runtime/Modules/Sessions/SessionConfiguration.cs +16 -16
- package/Runtime/Modules/Shop/Scripts/Defaults/BasicListingRenderer.cs +124 -124
- package/Runtime/Modules/Shop/Scripts/Defaults/BasicStoreRenderer.cs +60 -60
- package/Runtime/Modules/Shop/Scripts/Defaults/ObtainSummaryListCurrencyRenderer.cs +25 -25
- package/Runtime/Modules/Shop/Scripts/Defaults/ObtainSummaryListItemRenderer.cs +23 -23
- package/Runtime/Modules/Shop/Scripts/Defaults/ObtainSummaryListRenderer.cs +37 -37
- package/Runtime/Modules/Shop/Scripts/ListingContent.cs +36 -36
- package/Runtime/Modules/Shop/Scripts/ListingRenderer.cs +10 -10
- package/Runtime/Modules/Shop/Scripts/ObtainRenderer.cs +10 -10
- package/Runtime/Modules/Shop/Scripts/ShopConfiguration.cs +24 -24
- package/Runtime/Modules/Shop/Scripts/ShopFlow.cs +124 -124
- package/Runtime/Modules/Shop/Scripts/ShopLoadingMenu.cs +5 -5
- package/Runtime/Modules/Shop/Scripts/ShopRewardRenderer.cs +26 -26
- package/Runtime/Modules/Shop/Scripts/ShopSignals.cs +45 -45
- package/Runtime/Modules/Signals/DeSignal.cs +68 -68
- package/Runtime/Modules/Signals/DeSignalTower.cs +68 -68
- package/Runtime/Modules/Sound/Scripts/SoundConfiguration.cs +52 -52
- package/Runtime/Modules/Stats/StatBehaviour.cs +181 -181
- package/Runtime/Modules/Stats/StatObject.cs +106 -106
- package/Runtime/Modules/Stats/UserExtensions.cs +89 -89
- package/Runtime/Modules/Theme/Appliers/ButtonStyleApplier.cs +59 -59
- package/Runtime/Modules/Theme/Appliers/GradientStyleApplier.cs +32 -32
- package/Runtime/Modules/Theme/Appliers/ImageStyleApplier.cs +30 -30
- package/Runtime/Modules/Theme/Appliers/LayoutStyleApplier.cs +22 -22
- package/Runtime/Modules/Theme/Appliers/SelectableStyleApplier.cs +32 -32
- package/Runtime/Modules/Theme/Appliers/SoundStyleApplier.cs +27 -27
- package/Runtime/Modules/Theme/Appliers/StringStyleApplier.cs +20 -20
- package/Runtime/Modules/Theme/Appliers/StyleApplier.cs +28 -28
- package/Runtime/Modules/Theme/Appliers/TextStyleApplier.cs +57 -57
- package/Runtime/Modules/Theme/Appliers/TransformStyleApplier.cs +21 -21
- package/Runtime/Modules/Theme/Appliers/WindowStyleApplier.cs +51 -51
- package/Runtime/Modules/Theme/CanHideAttribute.cs +12 -12
- package/Runtime/Modules/Theme/Objects/GradientStyleObject.cs +33 -33
- package/Runtime/Modules/Theme/Objects/ImageStyleObject.cs +27 -27
- package/Runtime/Modules/Theme/Objects/LayoutStyleObject.cs +20 -20
- package/Runtime/Modules/Theme/Objects/SelectableStyleObject.cs +38 -38
- package/Runtime/Modules/Theme/Objects/TextStyleObject.cs +34 -34
- package/Runtime/Modules/Theme/Palette.cs +94 -94
- package/Runtime/Modules/Theme/PaletteStyleCopier.cs +34 -34
- package/Runtime/Modules/Theme/Palettes/ButtonPalette.cs +78 -78
- package/Runtime/Modules/Theme/Palettes/ColorPalette.cs +27 -27
- package/Runtime/Modules/Theme/Palettes/FontPalette.cs +28 -28
- package/Runtime/Modules/Theme/Palettes/GradientPalette.cs +57 -57
- package/Runtime/Modules/Theme/Palettes/ImagePalette.cs +31 -31
- package/Runtime/Modules/Theme/Palettes/LayoutPalette.cs +28 -28
- package/Runtime/Modules/Theme/Palettes/SelectablePalette.cs +36 -36
- package/Runtime/Modules/Theme/Palettes/SoundPalette.cs +30 -30
- package/Runtime/Modules/Theme/Palettes/StringPalette.cs +37 -37
- package/Runtime/Modules/Theme/Palettes/TextPalette.cs +61 -61
- package/Runtime/Modules/Theme/Palettes/TransformPalette.cs +29 -29
- package/Runtime/Modules/Theme/Palettes/WindowPalette.cs +43 -43
- package/Runtime/Modules/Theme/StyleBehaviour.cs +73 -73
- package/Runtime/Modules/Theme/StyleObject.cs +46 -46
- package/Runtime/Modules/Theme/ThemeConfiguration.cs +9 -9
- package/Runtime/Modules/Theme/ThemeObject.cs +160 -160
- package/Runtime/Modules/Tournaments/Scripts/CountdownTextBehaviour.cs +65 -65
- package/Runtime/Modules/Tournaments/Scripts/FixedCharacterFitter.cs +49 -49
- package/Runtime/Modules/Tournaments/Scripts/MockTournamentService.cs +221 -221
- package/Runtime/Modules/Tournaments/Scripts/TabBehaviour.cs +97 -97
- package/Runtime/Modules/Tournaments/Scripts/TournamenClaimableRewardBehaviour.cs +37 -37
- package/Runtime/Modules/Tournaments/Scripts/TournamentColorConstraint.cs +62 -62
- package/Runtime/Modules/Tournaments/Scripts/TournamentDataSource.cs +74 -74
- package/Runtime/Modules/Tournaments/Scripts/TournamentEntryBehavior.cs +221 -221
- package/Runtime/Modules/Tournaments/Scripts/TournamentEntryPlayerBehaviour.cs +152 -152
- package/Runtime/Modules/Tournaments/Scripts/TournamentInfoBehaviour.cs +33 -33
- package/Runtime/Modules/Tournaments/Scripts/TournamentInfoDetailBehaviour.cs +8 -8
- package/Runtime/Modules/Tournaments/Scripts/TournamentInfoDetailContainerBehaviour.cs +32 -32
- package/Runtime/Modules/Tournaments/Scripts/TournamentNumbersBehaviour.cs +20 -20
- package/Runtime/Modules/Tournaments/Scripts/TournamentRewardBehaviour.cs +21 -21
- package/Runtime/Modules/Tournaments/Scripts/TournamentRewardEntryBehaviour.cs +32 -32
- package/Runtime/Modules/Tournaments/Scripts/TournamentRewardPanelBehaviour.cs +78 -78
- package/Runtime/Modules/Tournaments/Scripts/TournamentScoreUtil.cs +77 -77
- package/Runtime/Modules/Tournaments/Scripts/TournamentStageGainBehaviour.cs +25 -25
- package/Runtime/Modules/Tournaments/Scripts/TournamentsBehaviour.cs +630 -630
- package/Runtime/Modules/Tournaments/Scripts/TournamentsConfiguration.cs +32 -32
- package/Runtime/PaymentExtensions.cs +16 -16
- package/Runtime/PlatformConsoleCommands.cs +559 -559
- package/Runtime/PlatformConsoleCommands.cs.meta +2 -2
- package/Runtime/Player/ApiServices.cs +162 -162
- package/Runtime/Player/BeamableBehaviour.cs +142 -142
- package/Runtime/Player/Leaderboards/LeaderboardLists.cs +216 -216
- package/Runtime/Player/Leaderboards/Lists/FriendScoresList.cs +76 -76
- package/Runtime/Player/Leaderboards/Lists/NearbyScoresList.cs +67 -67
- package/Runtime/Player/Leaderboards/Lists/PlayerCollectionScoresList.cs +52 -52
- package/Runtime/Player/Leaderboards/Lists/TopScoresList.cs +41 -41
- package/Runtime/Player/Leaderboards/PlayerLeaderboard.cs +774 -774
- package/Runtime/Player/Leaderboards/PlayerLeaderboards.cs +95 -95
- package/Runtime/Player/MonoBehaviourExtensions.cs +17 -17
- package/Runtime/Player/ObservableAccessToken.cs +12 -12
- package/Runtime/Player/ObservableUser.cs +30 -30
- package/Runtime/Player/PlayerAccounts.cs +2132 -2132
- package/Runtime/Player/PlayerAnnouncements.cs +239 -239
- package/Runtime/Player/PlayerCurrencies.cs +157 -157
- package/Runtime/Player/PlayerFriends.cs +661 -661
- package/Runtime/Player/PlayerInventory.cs +893 -893
- package/Runtime/Player/PlayerItemGroup.cs +200 -200
- package/Runtime/Player/PlayerLobby.cs +328 -328
- package/Runtime/Player/PlayerParty.cs +601 -601
- package/Runtime/Player/PlayerStateService.cs +44 -44
- package/Runtime/Player/PlayerStats.cs +238 -238
- package/Runtime/Player/SdkEventService.cs +259 -259
- package/Runtime/PromiseExtensions.cs +304 -304
- package/Runtime/ReflectionCache/BeamReflectionCache.cs +186 -186
- package/Runtime/ReflectionCache/ReflectionSystemObject.cs +55 -55
- package/Runtime/ReflectionCache/ThirdPartyIdentityReflectionCache.cs +84 -84
- package/Runtime/Server/BeamContextExtensions.cs +13 -13
- package/Runtime/Server/Content/ApiContentExtensions.cs +88 -88
- package/Runtime/Server/LegacyCommon/Mocks/MongoDB/Bson.meta +11 -11
- package/Runtime/Server/MicroserviceClient.cs +415 -415
- package/Runtime/Server/MicroserviceIndividualization.cs +80 -80
- package/Runtime/Server/MicroservicePrefixService.cs +10 -10
- package/Runtime/Server/ThirdPartyFederatedLoginExtensions.cs +60 -60
- package/Runtime/UI/Buttons/DeButtonBehaviour.cs +33 -33
- package/Runtime/UI/Layouts/MediaQueryBehaviour.cs +74 -74
- package/Runtime/UI/Layouts/MediaQueryObject.cs +118 -118
- package/Runtime/UI/Layouts/MediaSourceBehaviour.cs +49 -49
- package/Runtime/UI/Layouts/ReparenterBehaviour.cs +86 -86
- package/Runtime/UI/Layouts/StackLayout.cs +70 -70
- package/Runtime/UI/Lightbeam/DependencyExtensions.cs +359 -359
- package/Runtime/UI/Lightbeam/LightBeam.cs +155 -155
- package/Runtime/UI/Lightbeam/UIExtensions.cs +182 -182
- package/Runtime/UI/Prompt/DePromptBehaviour.cs +38 -38
- package/Runtime/UI/Prompt/DePromptData.cs +14 -14
- package/Runtime/UI/Scripts/AddressableImageBehaviour.cs +15 -15
- package/Runtime/UI/Scripts/AddressableSpriteLoader.cs +107 -107
- package/Runtime/UI/Scripts/BackButtonBehaviour.cs +14 -14
- package/Runtime/UI/Scripts/BeamableAnimationUtil.cs +100 -100
- package/Runtime/UI/Scripts/BeamableButton.cs +33 -33
- package/Runtime/UI/Scripts/BeamableWindow.cs +15 -15
- package/Runtime/UI/Scripts/ClickOffBehaviour.cs +42 -42
- package/Runtime/UI/Scripts/CloseButtonBehaviour.cs +14 -14
- package/Runtime/UI/Scripts/EventSoundBehaviour.cs +55 -55
- package/Runtime/UI/Scripts/GameObjectToggler.cs +25 -25
- package/Runtime/UI/Scripts/InputReference.cs +24 -24
- package/Runtime/UI/Scripts/InputValidationBehaviour.cs +153 -153
- package/Runtime/UI/Scripts/LoadingDisableBehaviour.cs +87 -87
- package/Runtime/UI/Scripts/LoadingIndicator.cs +117 -117
- package/Runtime/UI/Scripts/Menu.cs +47 -47
- package/Runtime/UI/Scripts/MenuManagementBehaviour.cs +268 -268
- package/Runtime/UI/Scripts/MobileUtilities.cs +84 -84
- package/Runtime/UI/Scripts/OfflineNotificationBehaviour.cs +37 -37
- package/Runtime/UI/Scripts/OfflineObject.cs +69 -69
- package/Runtime/UI/Scripts/ScrollButton.cs +23 -23
- package/Runtime/UI/Scripts/ScrollDotsBehaviour.cs +83 -83
- package/Runtime/UI/Scripts/ScrollToAlphaBehaviour.cs +47 -47
- package/Runtime/UI/Scripts/StickyScrollElement.cs +176 -176
- package/Runtime/UI/Scripts/TextReference.cs +15 -15
- package/Runtime/UI/Scripts/TextReferenceBase.cs +14 -14
- package/Runtime/UI/Scripts/TransformOffsetBehaviour.cs +61 -61
- package/Runtime/UI/TextField/DeTextFieldBehaviour.cs +48 -48
- package/Runtime/VectorIntExtensions.cs +45 -45
- package/Samples~/LightBeamSamples/AccountManager/AccountExampleConfig.cs +15 -15
- package/Samples~/LightBeamSamples/AccountManager/AccountManager.cs +57 -57
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/AccountDetailsBehaviour/AccountDetailsBehaviour.cs +53 -53
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/AccountDisplayBehaviour/AccountDisplayBehaviour.cs +51 -51
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/AccountSwitchPage/AccountSwitchPage.cs +42 -42
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/AvatarDisplay/AvatarDisplayBehaviour.cs +21 -21
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/ForgotPasswordPage/ForgotPasswordPage.cs +64 -64
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/HomePage/HomePage.cs +70 -70
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/RecoverEmailPage/RecoverEmailPage.cs +131 -131
- package/Samples~/LightBeamSamples/AccountManager/Prefabs/RegisterEmailPage/RegisterEmailPage.cs +79 -79
- package/Samples~/LightBeamSamples/CurrencyHud/CurrencyHudManager.cs +40 -40
- package/Samples~/LightBeamSamples/CurrencyHud/Prefabs/CurrencyView/CurrencyViewBehaviour.cs +50 -50
- package/Samples~/LightBeamSamples/FriendsManager/FriendsExampleConfig.cs +13 -13
- package/Samples~/LightBeamSamples/FriendsManager/FriendsManager.cs +32 -32
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/BlockedDisplay/BlockedPlayersDisplayBehaviour.cs +25 -25
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/FriendDisplay/FriendDisplayBehaviour.cs +31 -31
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/HomePage/HomePage.cs +31 -31
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/PlayerFriendsDisplay/PlayerFriendsBehaviour.cs +194 -194
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/ReceivedInvitesDisplay/ReceivedInviteDisplayBehaviour.cs +31 -31
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/Selector/Editor/SelectorButtonBehaviourEditor.cs +27 -27
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/Selector/SelectorButtonBehaviour.cs +13 -13
- package/Samples~/LightBeamSamples/FriendsManager/Prefabs/SentInvitesDisplay/SentInviteDisplayBehaviour.cs +25 -25
- package/Samples~/LightBeamSamples/Inventory/InventoryExampleConfig.cs +12 -12
- package/Samples~/LightBeamSamples/Inventory/InventoryManager.cs +32 -32
- package/Samples~/LightBeamSamples/Inventory/Prefabs/CurrencyDisplay/CurrencyDisplayBehaviour.cs +48 -48
- package/Samples~/LightBeamSamples/Inventory/Prefabs/CurrencyInfoPage/CurrencyInfoBehaviour.cs +70 -70
- package/Samples~/LightBeamSamples/Inventory/Prefabs/HomePage/HomePage.cs +82 -82
- package/Samples~/LightBeamSamples/Inventory/Prefabs/ItemDisplay/ItemDisplayBehaviour.cs +51 -51
- package/Samples~/LightBeamSamples/Inventory/Prefabs/ItemInfoPage/ItemInfoPage.cs +74 -74
- package/Samples~/LightBeamSamples/Inventory/Prefabs/PropertyDisplay/PropertyDisplayBehaviour.cs +21 -21
- package/Samples~/LightBeamSamples/LobbyManager/LobbyExampleConfig.cs +14 -14
- package/Samples~/LightBeamSamples/LobbyManager/LobbyManager.cs +36 -36
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/CreateLobbyDisplay/CreateLobbyDisplayBehaviour.cs +54 -54
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/FindLobbyDisplay/FindLobbyDisplayBehaviour.cs +36 -36
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/HomePage/HomePage.cs +71 -71
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/JoinLobbyDisplay/JoinLobbyDisplayBehaviour.cs +75 -75
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/LobbyDetailsDisplay/LobbyDetailsDisplayBehaviour.cs +80 -80
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/LobbyDisplay/LobbyDisplayBehaviour.cs +27 -27
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/PlayerDisplay/PlayerIdDisplayBehaviour.cs +17 -17
- package/Samples~/LightBeamSamples/LobbyManager/Prefabs/PlayerLobby/PlayerLobbyBehaviour.cs +112 -112
- package/Samples~/LightBeamSamples/LootBox/BeamableServices~/LootBoxService/LootBoxService.cs +45 -45
- package/Samples~/LightBeamSamples/LootBox/BeamableServices~/LootBoxService/Program.cs +20 -20
- package/Samples~/LightBeamSamples/LootBox/LootBoxExampleConfig.cs +8 -8
- package/Samples~/LightBeamSamples/LootBox/LootBoxManager.cs +30 -30
- package/Samples~/LightBeamSamples/LootBox/Prefabs/LootBoxPage/LootBoxPage.cs +47 -47
- package/Samples~/LightBeamSamples/SceneLoader/Config/LightBeamSceneConfigObject_Editor.cs +37 -37
- package/Samples~/LightBeamSamples/SceneLoader/LightBeamBooter.cs +485 -485
- package/Samples~/LightBeamSamples/SceneLoader/Prefabs/SceneDisplay/SceneDisplayBehaviour.cs +25 -25
- package/Samples~/SampleProjectBase/Scripts/Editor/Beamable/Samples/SampleProjectBase/AutoOpenReadme.cs +46 -46
- package/Samples~/SampleProjectBase/Scripts/Editor/Beamable/Samples/SampleProjectBase/BeamableReadmeEditor.cs +158 -158
- package/Samples~/SampleProjectBase/Scripts/Runtime/Beamable/Samples/SampleProjectBase/Readme.cs +33 -33
- package/Template/SharedSample.cs +19 -19
- package/Tests/Editor/AliasHelperTests.cs +64 -64
- package/Tests/Editor/CLI/DataTransferTests.cs +65 -65
- package/Tests/Editor/Common/BeamUtil/SanitizeStringForPathTests.cs +18 -18
- package/Tests/Editor/Common/TrieTests.cs +253 -253
- package/Tests/Editor/Common/TryInvokeCallbackTests.cs +93 -93
- package/Tests/Editor/ContentObjectTests.cs +65 -65
- package/Tests/Editor/EditorDisruptorEngine/Content/ContentObjectFieldTests.cs +81 -81
- package/Tests/Editor/EditorDisruptorEngine/Content/ContentObjectLinkRefTests.cs +81 -81
- package/Tests/Editor/EditorDisruptorEngine/Content/ExampleContent.cs +10 -10
- package/Tests/Editor/EditorDisruptorEngine/Content/Schedules/CronTests.cs +189 -189
- package/Tests/Editor/EditorTest.cs +51 -51
- package/Tests/Editor/JsonPerfTesting.cs +117 -117
- package/Tests/Editor/JsonPerfTesting_PayloadSize.cs +96 -96
- package/Tests/Editor/JsonTestHelp.cs +82 -82
- package/Tests/Editor/MockLogProvider.cs +47 -47
- package/Tests/Editor/PreserveAttributeTests.cs +26 -26
- package/Tests/Editor/PromiseTests/ErrorTests.cs +582 -582
- package/Tests/Editor/SmallerJSON/InfinityTests.cs +61 -61
- package/Tests/Editor/SmallerJSON/JsonPathTests.cs +107 -107
- package/Tests/Editor/SmallerJSON/JsonSerializeTest.cs +135 -135
- package/Tests/Runtime/Beamable/BeamContextInitTests.cs +103 -103
- package/Tests/Runtime/Beamable/BeamContextTest.cs +72 -72
- package/Tests/Runtime/Beamable/BeamableTest.cs +46 -46
- package/Tests/Runtime/Beamable/Content/ClientManifest/ParseCSVTests.cs +102 -102
- package/Tests/Runtime/Beamable/Content/ContentRegistry/GetTypeFromIdTests.cs +164 -164
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/DeserializeEmptyFields.cs +114 -114
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/DeserializeTests.cs +1343 -1343
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/EscapedStringTests.cs +119 -119
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/GetNullStringForTypeTests.cs +104 -104
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/SerializeFieldSubclassSerializeTests.cs +157 -157
- package/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/SerializeTests.cs +1066 -1066
- package/Tests/Runtime/Beamable/Content/Serialization/TestContentRef.cs +66 -66
- package/Tests/Runtime/Beamable/Content/Serialization/VipContentSerialization/VipContentSerializationTests.cs +34 -34
- package/Tests/Runtime/Beamable/DebouncerTests.cs +110 -110
- package/Tests/Runtime/Beamable/Dependencies/ScopingTests.cs +235 -235
- package/Tests/Runtime/Beamable/Environment/PackageVersionTests/FromSemanticVersionStringTests.cs +161 -161
- package/Tests/Runtime/Beamable/Environment/PackageVersionTests/ImplicitConversionTest.cs +24 -24
- package/Tests/Runtime/Beamable/Environment/PackageVersionTests/RangeOperatorTests.cs +209 -209
- package/Tests/Runtime/Beamable/Environment/PackageVersionTests/ToStringTests.cs +64 -64
- package/Tests/Runtime/Beamable/MockAuthService.cs +218 -218
- package/Tests/Runtime/Beamable/MockBeamContext.cs +171 -171
- package/Tests/Runtime/Beamable/MockBeamableApi.cs +122 -122
- package/Tests/Runtime/Beamable/MockConfigurationHelper.cs +19 -19
- package/Tests/Runtime/Beamable/MockFileAccessor.cs +19 -19
- package/Tests/Runtime/Beamable/Modules/AccountManagement/AccountManagementSignalsTests/AcceptAccountSwitchTests.cs +95 -95
- package/Tests/Runtime/Beamable/Modules/AccountManagement/AccountManagementSignalsTests/CheckSignedInUserTests.cs +134 -134
- package/Tests/Runtime/Beamable/Modules/AccountManagement/AccountManagementSignalsTests/LoginTests.cs +108 -108
- package/Tests/Runtime/Beamable/Modules/AccountManagement/AccountManagementSignalsTests/TestHelperExtensions.cs +38 -38
- package/Tests/Runtime/Beamable/Modules/AccountManagement/AccountManagementSignalsTests/UpdateLoginEmailTests.cs +81 -81
- package/Tests/Runtime/Beamable/Modules/Leaderboards/IncrementTests.cs +88 -88
- package/Tests/Runtime/Beamable/Modules/Leaderboards/LeaderboardViewSerializeTests.cs +109 -109
- package/Tests/Runtime/Beamable/Modules/Shop/ListingContentTests/ValidateListingTests.cs +66 -66
- package/Tests/Runtime/Beamable/Modules/Stats/StatObjectTests/WriteTests.cs +42 -42
- package/Tests/Runtime/Beamable/Modules/Tournaments/TournamentScoreUtilTests/GetShortScoreTests.cs +329 -329
- package/Tests/Runtime/Beamable/Platform/AccessTokenStorageTests.cs +154 -154
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/AuthServiceTestBase.cs +39 -39
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/CustomDeviceIdTests.cs +51 -51
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/GetUserTests.cs +33 -33
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/IsEmailAvailableTests.cs +58 -58
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/LoginTests.cs +37 -37
- package/Tests/Runtime/Beamable/Platform/Auth/AuthServiceTests/RemoveDeviceIdTests.cs +69 -69
- package/Tests/Runtime/Beamable/Platform/Connectivity/MockConnectivityService.cs +45 -45
- package/Tests/Runtime/Beamable/Platform/Content/MockContentService.cs +140 -140
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryResponseTests/MergeViewTests.cs +245 -245
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryServiceTests/GetItemTests.cs +225 -225
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryServiceTests/InventoryServiceTestBase.cs +52 -52
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryServiceTests/UpdateTests.cs +73 -73
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryTestItem.cs +26 -26
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryUpdateBuilderTests/AddItemTests.cs +24 -24
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryUpdateBuilderTests/SerializationTests.cs +227 -227
- package/Tests/Runtime/Beamable/Platform/Inventory/InventoryUpdateBuilderTests/UnitySerializationTests.cs +215 -215
- package/Tests/Runtime/Beamable/Platform/Mail/MailTests.cs +67 -67
- package/Tests/Runtime/Beamable/Platform/MockConnectivityChecker.cs +24 -24
- package/Tests/Runtime/Beamable/Platform/MockPlatformAPI.cs +398 -398
- package/Tests/Runtime/Beamable/Platform/MockPlatformRequester.cs +78 -78
- package/Tests/Runtime/Beamable/Platform/MockPlatformService.cs +47 -47
- package/Tests/Runtime/Beamable/Platform/MockRequesterExtensions.cs +13 -13
- package/Tests/Runtime/Beamable/Platform/TestUtil.cs +59 -59
- package/Tests/Runtime/Beamable/Player/Accounts/ExternalIdentityQueryArgsTests.cs +132 -132
- package/Tests/Runtime/Beamable/Player/Announcements/AnnouncementGiftSerialization.cs +117 -117
- package/Tests/Runtime/Beamable/Player/Announcements/MockAnnouncementsApi.cs +45 -45
- package/Tests/Runtime/Beamable/Player/Announcements/MockNotificationService.cs +70 -70
- package/Tests/Runtime/Beamable/Player/Inventory/GetItemTests.cs +485 -485
- package/Tests/Runtime/Beamable/Player/Inventory/MockInventoryApi.cs +77 -77
- package/Tests/Runtime/Beamable/Player/Leaderboards/ResortTests.cs +236 -236
- package/Tests/Runtime/Beamable/Pooling/StringBuilderPoolTests/SpawnTests.cs +55 -55
- package/Tests/Runtime/Beamable/Promises/PromisePlayModeTests.cs +145 -145
- package/Tests/Runtime/Beamable/Promises/SequenceTests.cs +45 -45
- package/Tests/Runtime/Beamable/QueryBuilder/QueryBuilderTests.cs +94 -94
- package/Tests/Runtime/Server/Runtime/MicroserviceClient/RequestTests.cs +374 -374
- package/Tests/Runtime/Server/Runtime/MicroserviceClient/TestClient.cs +78 -78
- package/Tests/Runtime/Server/Runtime/TestRegistrations.cs +22 -22
- package/package.json +1 -1
|
@@ -1,2132 +1,2132 @@
|
|
|
1
|
-
using Beamable.AccountManagement;
|
|
2
|
-
using Beamable.Api;
|
|
3
|
-
using Beamable.Api.Auth;
|
|
4
|
-
using Beamable.Api.Caches;
|
|
5
|
-
using Beamable.Api.Sessions;
|
|
6
|
-
using Beamable.Api.Stats;
|
|
7
|
-
using Beamable.Common;
|
|
8
|
-
using Beamable.Common.Api;
|
|
9
|
-
using Beamable.Common.Api.Auth;
|
|
10
|
-
using Beamable.Common.Api.Stats;
|
|
11
|
-
using Beamable.Common.Dependencies;
|
|
12
|
-
using Beamable.Common.Player;
|
|
13
|
-
using Beamable.Stats;
|
|
14
|
-
using System;
|
|
15
|
-
using System.Collections.Generic;
|
|
16
|
-
using System.Linq;
|
|
17
|
-
using UnityEngine;
|
|
18
|
-
|
|
19
|
-
namespace Beamable.Player
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
/// <summary>
|
|
23
|
-
/// The <see cref="PlayerAccount"/> contains information about a player's
|
|
24
|
-
/// credentials and basic account details, such as their <see cref="_alias"/>,
|
|
25
|
-
/// <see cref="_email"/>, and <see cref="gamerTag"/>
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Serializable]
|
|
28
|
-
public class PlayerAccount : DefaultObservable, IUserContext
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
#region autogenerated equality checks
|
|
32
|
-
protected bool Equals(PlayerAccount other)
|
|
33
|
-
{
|
|
34
|
-
return _alias == other._alias && _avatar == other._avatar && _subtext == other._subtext && GamerTag == other.GamerTag && _language == other._language && Equals(_deviceIds, other._deviceIds) && Equals(_scopes, other._scopes) && _email == other._email && Equals(_thirdParties, other._thirdParties) && Equals(_externalIdentities, other._externalIdentities) && Equals(token, other.token);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public override bool Equals(object obj)
|
|
38
|
-
{
|
|
39
|
-
if (ReferenceEquals(null, obj))
|
|
40
|
-
{
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (ReferenceEquals(this, obj))
|
|
45
|
-
{
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (obj.GetType() != this.GetType())
|
|
50
|
-
{
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return Equals((PlayerAccount)obj);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public override int GetHashCode()
|
|
58
|
-
{
|
|
59
|
-
unchecked
|
|
60
|
-
{
|
|
61
|
-
var hashCode = (_alias != null ? _alias.GetHashCode() : 0);
|
|
62
|
-
hashCode = (hashCode * 397) ^ (_avatar != null ? _avatar.GetHashCode() : 0);
|
|
63
|
-
hashCode = (hashCode * 397) ^ (_subtext != null ? _subtext.GetHashCode() : 0);
|
|
64
|
-
hashCode = (hashCode * 397) ^ _gamerTag.GetHashCode();
|
|
65
|
-
hashCode = (hashCode * 397) ^ (int)_language;
|
|
66
|
-
hashCode = (hashCode * 397) ^ (_deviceIds != null ? _deviceIds.GetHashCode() : 0);
|
|
67
|
-
hashCode = (hashCode * 397) ^ (_scopes != null ? _scopes.GetHashCode() : 0);
|
|
68
|
-
hashCode = (hashCode * 397) ^ (_email != null ? _email.GetHashCode() : 0);
|
|
69
|
-
hashCode = (hashCode * 397) ^ (_thirdParties != null ? _thirdParties.GetHashCode() : 0);
|
|
70
|
-
hashCode = (hashCode * 397) ^ (_externalIdentities != null ? _externalIdentities.GetHashCode() : 0);
|
|
71
|
-
hashCode = (hashCode * 397) ^ (token != null ? token.GetHashCode() : 0);
|
|
72
|
-
return hashCode;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
#endregion
|
|
77
|
-
|
|
78
|
-
private readonly PlayerAccounts _collection;
|
|
79
|
-
internal User _user;
|
|
80
|
-
internal UserExtensions.StatCollection _stats;
|
|
81
|
-
|
|
82
|
-
/// <summary>
|
|
83
|
-
/// The alias of the current account.
|
|
84
|
-
/// This can be used as a display name.
|
|
85
|
-
/// To change the alias, use <see cref="SetAlias"/>
|
|
86
|
-
/// </summary>
|
|
87
|
-
public string Alias => _alias;
|
|
88
|
-
[SerializeField]
|
|
89
|
-
private string _alias;
|
|
90
|
-
|
|
91
|
-
/// <summary>
|
|
92
|
-
/// The avatar used for this account.
|
|
93
|
-
/// See the <see cref="AvatarConfiguration"/> for more details.
|
|
94
|
-
/// To change the avatar, use <see cref="SetAvatar"/>
|
|
95
|
-
/// </summary>
|
|
96
|
-
public string Avatar => _avatar;
|
|
97
|
-
[SerializeField]
|
|
98
|
-
private string _avatar;
|
|
99
|
-
|
|
100
|
-
/// <summary>
|
|
101
|
-
/// The subtext for the current player can be used to share a small amount
|
|
102
|
-
/// of account detail, like "level" or "progress".
|
|
103
|
-
/// To change the subtext, use <see cref="SetSubtext"/>
|
|
104
|
-
/// </summary>
|
|
105
|
-
public string SubText => _subtext;
|
|
106
|
-
[SerializeField]
|
|
107
|
-
private string _subtext;
|
|
108
|
-
|
|
109
|
-
/// <summary>
|
|
110
|
-
/// The player id for the given player.
|
|
111
|
-
/// Player ids are associated with a specific realm.
|
|
112
|
-
/// This value should not be modified.
|
|
113
|
-
/// </summary>
|
|
114
|
-
public long GamerTag => _gamerTag;
|
|
115
|
-
[SerializeField]
|
|
116
|
-
private long _gamerTag;
|
|
117
|
-
|
|
118
|
-
/// <summary>
|
|
119
|
-
/// The player's language preference
|
|
120
|
-
/// To change the language, use <see cref="SetLanguage"/>
|
|
121
|
-
/// </summary>
|
|
122
|
-
public SystemLanguage Language => _language;
|
|
123
|
-
[SerializeField]
|
|
124
|
-
private SystemLanguage _language;
|
|
125
|
-
|
|
126
|
-
/// <summary>
|
|
127
|
-
/// The set of deviceIds that have been associated with the given player.
|
|
128
|
-
/// A player could have more than one deviceId if they played on multiple devices.
|
|
129
|
-
/// Use the <see cref="HasDeviceId"/> to check if a deviceId is present.
|
|
130
|
-
/// To add a deviceId, use the <see cref="AddDeviceId"/> method.
|
|
131
|
-
/// To remove a deviceId, use the <see cref="RemoveDeviceId"/> method, and to remove all, use the <see cref="RemoveAllDeviceIds"/> method.
|
|
132
|
-
/// </summary>
|
|
133
|
-
public string[] DeviceIds => _deviceIds;
|
|
134
|
-
[SerializeField]
|
|
135
|
-
private string[] _deviceIds;
|
|
136
|
-
|
|
137
|
-
/// <summary>
|
|
138
|
-
/// The player's permission scopes. For most players, this will always be empty.
|
|
139
|
-
/// However, for testers, developers, and admins, this will hold the permission.
|
|
140
|
-
/// </summary>
|
|
141
|
-
public string[] Scopes => _scopes;
|
|
142
|
-
[SerializeField]
|
|
143
|
-
private string[] _scopes;
|
|
144
|
-
|
|
145
|
-
/// <summary>
|
|
146
|
-
/// The email address associated with this account.
|
|
147
|
-
/// Add an email with the <see cref="AddEmail"/> method.
|
|
148
|
-
/// </summary>
|
|
149
|
-
public string Email => _email;
|
|
150
|
-
[SerializeField]
|
|
151
|
-
private string _email;
|
|
152
|
-
|
|
153
|
-
/// <summary>
|
|
154
|
-
/// The set of standard Beamable third parties that have been associated with the given player.
|
|
155
|
-
/// Add a third party with the <see cref="AddThirdParty"/> method.
|
|
156
|
-
/// </summary>
|
|
157
|
-
public AuthThirdParty[] ThirdParties => _thirdParties;
|
|
158
|
-
private AuthThirdParty[] _thirdParties;
|
|
159
|
-
|
|
160
|
-
/// <summary>
|
|
161
|
-
/// The set of external identities that have been associated with the given player.
|
|
162
|
-
/// Add an external identity with the <see cref="AddExternalIdentity"/> method.
|
|
163
|
-
/// </summary>
|
|
164
|
-
public ExternalIdentity[] ExternalIdentities => _externalIdentities;
|
|
165
|
-
[SerializeField]
|
|
166
|
-
private ExternalIdentity[] _externalIdentities;
|
|
167
|
-
|
|
168
|
-
/// <summary>
|
|
169
|
-
/// True when the account has an <see cref="_email"/>.
|
|
170
|
-
/// </summary>
|
|
171
|
-
public bool HasEmail => !string.IsNullOrEmpty(_email);
|
|
172
|
-
|
|
173
|
-
/// <summary>
|
|
174
|
-
/// True when the account has the given <see cref="AuthThirdParty"/>
|
|
175
|
-
/// </summary>
|
|
176
|
-
/// <param name="thirdParty"></param>
|
|
177
|
-
/// <returns></returns>
|
|
178
|
-
public bool HasThirdParty(AuthThirdParty thirdParty) => _thirdParties?.Contains(thirdParty) ?? false;
|
|
179
|
-
|
|
180
|
-
/// <summary>
|
|
181
|
-
/// True when there is at least 1 deviceId.
|
|
182
|
-
/// </summary>
|
|
183
|
-
public bool HasDeviceId => _deviceIds?.Length > 0;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
/// <summary>
|
|
187
|
-
/// Given a combo of Microservice and Third Party Cloud Identity, this method will
|
|
188
|
-
/// return true if the user has a credential associated with the provider.
|
|
189
|
-
/// </summary>
|
|
190
|
-
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
191
|
-
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
192
|
-
/// <returns>true if the user has an existing association with the <see cref="TCloudIdentity"/></returns>
|
|
193
|
-
public bool HasExternalIdentity<TCloudIdentity, TService>()
|
|
194
|
-
where TCloudIdentity : IFederationId, new()
|
|
195
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
196
|
-
TryGetExternalIdentity<TCloudIdentity, TService>(out _);
|
|
197
|
-
|
|
198
|
-
/// <summary>
|
|
199
|
-
/// Given a combo of Microservice and Third Party Cloud Identity, this method will
|
|
200
|
-
/// return true if the user has a credential associated with the provider. Additionally, the <see cref="ExternalIdentity"/>
|
|
201
|
-
/// is available as an out parameter
|
|
202
|
-
/// </summary>
|
|
203
|
-
/// <param name="identity"></param>
|
|
204
|
-
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
205
|
-
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
206
|
-
/// <returns>true if the user has an existing association with the <see cref="TCloudIdentity"/></returns>
|
|
207
|
-
public bool TryGetExternalIdentity<TCloudIdentity, TService>(out ExternalIdentity identity)
|
|
208
|
-
where TCloudIdentity : IFederationId, new()
|
|
209
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
210
|
-
{
|
|
211
|
-
var client = _collection._provider.GetService<TService>();
|
|
212
|
-
var ident = new TCloudIdentity();
|
|
213
|
-
identity = null;
|
|
214
|
-
for (var i = 0; i < _externalIdentities.Length; i++)
|
|
215
|
-
{
|
|
216
|
-
var external = _externalIdentities[i];
|
|
217
|
-
var namespaceMath = external.providerNamespace == ident.GetUniqueName();
|
|
218
|
-
var serviceMatch = external.providerService == client.ServiceName;
|
|
219
|
-
|
|
220
|
-
if (namespaceMath && serviceMatch)
|
|
221
|
-
{
|
|
222
|
-
identity = external;
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/// <summary>
|
|
231
|
-
/// The access token used for this account.
|
|
232
|
-
/// </summary>
|
|
233
|
-
public BeamableToken token;
|
|
234
|
-
|
|
235
|
-
public PlayerAccount(PlayerAccounts collection, BeamableToken token, User user, UserExtensions.StatCollection stats)
|
|
236
|
-
{
|
|
237
|
-
_collection = collection;
|
|
238
|
-
Update(user);
|
|
239
|
-
Update(stats);
|
|
240
|
-
this.token = token;
|
|
241
|
-
TryTriggerUpdate();
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/// <inheritdoc cref="PlayerAccounts.SwitchToAccount"/>
|
|
245
|
-
public async Promise SwitchToAccount()
|
|
246
|
-
{
|
|
247
|
-
await _collection.SwitchToAccount(this);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/// <inheritdoc cref="PlayerAccounts.RemoveAccount"/>
|
|
251
|
-
public async Promise Remove()
|
|
252
|
-
{
|
|
253
|
-
await _collection.RemoveAccount(this);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/// <inheritdoc cref="PlayerAccounts.SetAlias"/>
|
|
257
|
-
public Promise<PlayerAccount> SetAlias(string alias)
|
|
258
|
-
{
|
|
259
|
-
return _collection.SetAlias(alias, this);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/// <inheritdoc cref="PlayerAccounts.SetAvatar"/>
|
|
263
|
-
public Promise<PlayerAccount> SetAvatar(string avatar)
|
|
264
|
-
{
|
|
265
|
-
return _collection.SetAvatar(avatar, this);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/// <inheritdoc cref="PlayerAccounts.SetSubtext"/>
|
|
269
|
-
public Promise<PlayerAccount> SetSubtext(string subtext)
|
|
270
|
-
{
|
|
271
|
-
return _collection.SetSubtext(subtext, this);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/// <inheritdoc cref="PlayerAccounts.AddEmail"/>
|
|
275
|
-
public Promise<RegistrationResult> AddEmail(string email, string password)
|
|
276
|
-
{
|
|
277
|
-
return _collection.AddEmail(email, password, this);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/// <inheritdoc cref="PlayerAccounts.AddDeviceId"/>
|
|
281
|
-
public Promise<RegistrationResult> AddDeviceId()
|
|
282
|
-
{
|
|
283
|
-
return _collection.AddDeviceId(this);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/// <inheritdoc cref="PlayerAccounts.RemoveDeviceId"/>
|
|
287
|
-
public Promise<PlayerAccount> RemoveDeviceId()
|
|
288
|
-
{
|
|
289
|
-
return _collection.RemoveDeviceId(this);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/// <inheritdoc cref="PlayerAccounts.RemoveAllDeviceIds"/>
|
|
293
|
-
public Promise<PlayerAccount> RemoveAllDeviceIds()
|
|
294
|
-
{
|
|
295
|
-
return _collection.RemoveAllDeviceIds(this);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/// <inheritdoc cref="PlayerAccounts.AddThirdParty"/>
|
|
299
|
-
public Promise<RegistrationResult> AddThirdParty(AuthThirdParty thirdParty, string token)
|
|
300
|
-
{
|
|
301
|
-
return _collection.AddThirdParty(thirdParty, token, this);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/// <inheritdoc cref="PlayerAccounts.RemoveThirdParty"/>
|
|
305
|
-
public Promise<PlayerAccount> RemoveThirdParty(AuthThirdParty thirdParty, string token)
|
|
306
|
-
{
|
|
307
|
-
return _collection.RemoveThirdParty(thirdParty, token, this);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/// <inheritdoc cref="PlayerAccounts.AddExternalIdentity"/>
|
|
312
|
-
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, ChallengeHandler challengeHandler)
|
|
313
|
-
where TCloudIdentity : IFederationId, new()
|
|
314
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
315
|
-
{
|
|
316
|
-
return _collection.AddExternalIdentity<TCloudIdentity, TService>(token, challengeHandler);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/// <inheritdoc cref="PlayerAccounts.AddExternalIdentity"/>
|
|
320
|
-
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, AsyncChallengeHandler challengeHandler = null)
|
|
321
|
-
where TCloudIdentity : IFederationId, new()
|
|
322
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
323
|
-
{
|
|
324
|
-
return _collection.AddExternalIdentity<TCloudIdentity, TService>(token, challengeHandler);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/// <inheritdoc cref="PlayerAccounts.RemoveExternalIdentity"/>
|
|
328
|
-
public Promise<PlayerAccount> RemoveExternalIdentity<TCloudIdentity, TService>()
|
|
329
|
-
where TCloudIdentity : IFederationId, new()
|
|
330
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
331
|
-
{
|
|
332
|
-
return _collection.RemoveExternalIdentity<TCloudIdentity, TService>();
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
/// <inheritdoc cref="PlayerAccounts.ResetPassword"/>
|
|
337
|
-
public Promise<PasswordResetOperation> ResetPassword()
|
|
338
|
-
{
|
|
339
|
-
return _collection.ResetPassword(this);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/// <inheritdoc cref="PlayerAccounts.ConfirmPassword"/>
|
|
343
|
-
public async Promise<PasswordResetConfirmOperation> ConfirmPassword(string code, string newPassword)
|
|
344
|
-
{
|
|
345
|
-
return await _collection.ConfirmPassword(code, newPassword, this);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/// <inheritdoc cref="PlayerAccounts.SetLanguage"/>
|
|
349
|
-
public Promise<PlayerAccount> SetLanguage(SystemLanguage language)
|
|
350
|
-
{
|
|
351
|
-
return _collection.SetLanguage(language, this);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
/// <summary>
|
|
356
|
-
/// Update the stat values of this <see cref="PlayerAccount"/>.
|
|
357
|
-
/// This method is called automatically when using the
|
|
358
|
-
/// <see cref="SetAlias"/>, <see cref="SetSubtext"/>, or <see cref="SetAvatar"/> methods.
|
|
359
|
-
///
|
|
360
|
-
/// Generally, it is not recommended that you use this method directly. If stats are
|
|
361
|
-
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
362
|
-
/// </summary>
|
|
363
|
-
/// <param name="stats">The latest stat collection for the account</param>
|
|
364
|
-
public void Update(UserExtensions.StatCollection stats)
|
|
365
|
-
{
|
|
366
|
-
_stats = stats;
|
|
367
|
-
_alias = stats.Get(AccountManagementConfiguration.Instance.DisplayNameStat);
|
|
368
|
-
_avatar = stats.Get(AccountManagementConfiguration.Instance.AvatarStat);
|
|
369
|
-
_subtext = stats.Get(AccountManagementConfiguration.Instance.SubtextStat);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
373
|
-
{
|
|
374
|
-
_collection?.Current?.Update(stats);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/// <summary>
|
|
379
|
-
/// Update all of values of this <see cref="PlayerAccount"/> to mirror the values of the given account.
|
|
380
|
-
/// Generally, it is not recommended that you use this method directly. If data is
|
|
381
|
-
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
382
|
-
/// </summary>
|
|
383
|
-
/// <param name="other">The account to mirror</param>
|
|
384
|
-
public void Update(PlayerAccount other)
|
|
385
|
-
{
|
|
386
|
-
Update(other._user);
|
|
387
|
-
Update(other._stats);
|
|
388
|
-
Update(other.token);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/// <summary>
|
|
392
|
-
/// Update all of the user related data of this <see cref="PlayerAccount"/> based on the given user.
|
|
393
|
-
/// Generally, it is not recommended that you use this method directly. If data is
|
|
394
|
-
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
395
|
-
/// </summary>
|
|
396
|
-
/// <param name="user">the latest user object</param>
|
|
397
|
-
public void Update(User user)
|
|
398
|
-
{
|
|
399
|
-
_user = user;
|
|
400
|
-
|
|
401
|
-
_email = _user?.email;
|
|
402
|
-
_deviceIds = user?.deviceIds?.ToArray() ?? new string[] { };
|
|
403
|
-
|
|
404
|
-
var thirdPartyStrings = user?.thirdPartyAppAssociations.ToArray();
|
|
405
|
-
_thirdParties = new AuthThirdParty[thirdPartyStrings?.Length ?? 0];
|
|
406
|
-
for (var i = 0; i < _thirdParties.Length; i++)
|
|
407
|
-
{
|
|
408
|
-
_thirdParties[i] = AuthThirdPartyMethods.GetAuthThirdParty(thirdPartyStrings[i]);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
_externalIdentities = new ExternalIdentity[user?.external?.Count ?? 0];
|
|
412
|
-
for (var i = 0; i < _externalIdentities.Length; i++)
|
|
413
|
-
{
|
|
414
|
-
_externalIdentities[i] = new ExternalIdentity
|
|
415
|
-
{
|
|
416
|
-
providerNamespace = user.external[i].providerNamespace,
|
|
417
|
-
providerService = user.external[i].providerService,
|
|
418
|
-
userId = user.external[i].userId,
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
_language = SessionServiceHelper.GetSystemLanguageFromIso639CountryCode(user?.language);
|
|
423
|
-
_scopes = user?.scopes?.ToArray() ?? new string[] { };
|
|
424
|
-
_gamerTag = _user?.id ?? 0;
|
|
425
|
-
|
|
426
|
-
try
|
|
427
|
-
{
|
|
428
|
-
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
429
|
-
{
|
|
430
|
-
// TODO: does the stat system still need to call the setter if this is true?
|
|
431
|
-
_collection?.Current?.Update(user);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
catch (NullReferenceException ex)
|
|
435
|
-
{
|
|
436
|
-
Debug.LogException(ex);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/// <summary>
|
|
441
|
-
/// Update the current account's token.
|
|
442
|
-
/// Generally, it is not recommended that you use this method directly. If data is
|
|
443
|
-
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
444
|
-
/// </summary>
|
|
445
|
-
/// <param name="token"></param>
|
|
446
|
-
public void Update(BeamableToken token)
|
|
447
|
-
{
|
|
448
|
-
this.token.Update(token);
|
|
449
|
-
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
450
|
-
{
|
|
451
|
-
_collection.Current?.Update(token);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
public void TryTriggerUpdate()
|
|
456
|
-
{
|
|
457
|
-
TriggerUpdate();
|
|
458
|
-
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
459
|
-
{
|
|
460
|
-
_collection?.Current?.TriggerUpdate();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
long IUserContext.UserId => _gamerTag;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
[Serializable]
|
|
468
|
-
public class BeamableToken
|
|
469
|
-
{
|
|
470
|
-
#region auto generated equality members
|
|
471
|
-
protected bool Equals(BeamableToken other)
|
|
472
|
-
{
|
|
473
|
-
return _accessToken == other._accessToken && _refreshToken == other._refreshToken && _expiresIn == other._expiresIn && _type == other._type;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
public override bool Equals(object obj)
|
|
477
|
-
{
|
|
478
|
-
if (ReferenceEquals(null, obj))
|
|
479
|
-
{
|
|
480
|
-
return false;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (ReferenceEquals(this, obj))
|
|
484
|
-
{
|
|
485
|
-
return true;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (obj.GetType() != this.GetType())
|
|
489
|
-
{
|
|
490
|
-
return false;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
return Equals((BeamableToken)obj);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
public override int GetHashCode()
|
|
497
|
-
{
|
|
498
|
-
unchecked
|
|
499
|
-
{
|
|
500
|
-
var hashCode = (_accessToken != null ? _accessToken.GetHashCode() : 0);
|
|
501
|
-
hashCode = (hashCode * 397) ^ (_refreshToken != null ? _refreshToken.GetHashCode() : 0);
|
|
502
|
-
hashCode = (hashCode * 397) ^ _expiresIn.GetHashCode();
|
|
503
|
-
hashCode = (hashCode * 397) ^ (_type != null ? _type.GetHashCode() : 0);
|
|
504
|
-
return hashCode;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
#endregion
|
|
509
|
-
|
|
510
|
-
/// <summary>
|
|
511
|
-
/// The access token is used for authenticating all requests.
|
|
512
|
-
/// </summary>
|
|
513
|
-
public string AccessToken => _accessToken;
|
|
514
|
-
|
|
515
|
-
/// <summary>
|
|
516
|
-
/// The refresh token is used to generate a new access token.
|
|
517
|
-
/// </summary>
|
|
518
|
-
public string RefreshToken => _refreshToken;
|
|
519
|
-
|
|
520
|
-
/// <summary>
|
|
521
|
-
/// The type of token, usually "token".
|
|
522
|
-
/// </summary>
|
|
523
|
-
public string Type => _type;
|
|
524
|
-
|
|
525
|
-
/// <summary>
|
|
526
|
-
/// The number of ms until the access token expires and new one will be required.
|
|
527
|
-
/// </summary>
|
|
528
|
-
public long ExpiresIn => _expiresIn;
|
|
529
|
-
|
|
530
|
-
[SerializeField]
|
|
531
|
-
private string _accessToken;
|
|
532
|
-
|
|
533
|
-
[SerializeField]
|
|
534
|
-
private string _refreshToken;
|
|
535
|
-
|
|
536
|
-
[SerializeField]
|
|
537
|
-
private long _expiresIn;
|
|
538
|
-
|
|
539
|
-
[SerializeField]
|
|
540
|
-
private string _type;
|
|
541
|
-
|
|
542
|
-
/// <summary>
|
|
543
|
-
/// Update the values of this token to mirror another token.
|
|
544
|
-
/// </summary>
|
|
545
|
-
/// <param name="token"></param>
|
|
546
|
-
public void Update(BeamableToken token)
|
|
547
|
-
{
|
|
548
|
-
this._type = token._type;
|
|
549
|
-
this._accessToken = token._accessToken;
|
|
550
|
-
this._refreshToken = token._refreshToken;
|
|
551
|
-
this._expiresIn = token._expiresIn;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
public static implicit operator BeamableToken(TokenResponse data) =>
|
|
555
|
-
new BeamableToken
|
|
556
|
-
{
|
|
557
|
-
_accessToken = data.access_token,
|
|
558
|
-
_refreshToken = data.refresh_token,
|
|
559
|
-
_expiresIn = data.expires_in,
|
|
560
|
-
_type = data.token_type,
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
public static BeamableToken FromAccessToken(IAccessToken data) =>
|
|
564
|
-
new BeamableToken
|
|
565
|
-
{
|
|
566
|
-
_accessToken = data.Token,
|
|
567
|
-
_refreshToken = data.RefreshToken,
|
|
568
|
-
_expiresIn = (long)(data.ExpiresAt - DateTime.UtcNow).TotalMilliseconds,
|
|
569
|
-
_type = "token",
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
public static implicit operator TokenResponse(BeamableToken data) =>
|
|
573
|
-
new TokenResponse
|
|
574
|
-
{
|
|
575
|
-
access_token = data._accessToken,
|
|
576
|
-
refresh_token = data._refreshToken,
|
|
577
|
-
expires_in = data._expiresIn,
|
|
578
|
-
token_type = data._type,
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
public delegate Promise<string> AsyncChallengeHandler(string challenge);
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
public delegate string ChallengeHandler(string challenge);
|
|
586
|
-
|
|
587
|
-
/// <summary>
|
|
588
|
-
/// The <see cref="RegistrationResult"/> has information about what happened
|
|
589
|
-
/// after attempting to add a credential to a <see cref="PlayerAccount"/>.
|
|
590
|
-
///
|
|
591
|
-
/// If any error occured, the <see cref="isSuccess"/> field will be false,
|
|
592
|
-
/// and the <see cref="error"/> value will contain more detail.
|
|
593
|
-
///
|
|
594
|
-
/// Otherwise, the <see cref="account"/> field will be accessible.
|
|
595
|
-
/// </summary>
|
|
596
|
-
[Serializable]
|
|
597
|
-
public class RegistrationResult
|
|
598
|
-
{
|
|
599
|
-
/// <summary>
|
|
600
|
-
/// Exception thrown by a server will be cached here
|
|
601
|
-
/// </summary>
|
|
602
|
-
public Exception innerException;
|
|
603
|
-
|
|
604
|
-
/// <summary>
|
|
605
|
-
/// The type of error that occured, if <see cref="isSuccess"/> is false.
|
|
606
|
-
/// </summary>
|
|
607
|
-
public PlayerRegistrationError error;
|
|
608
|
-
|
|
609
|
-
[SerializeField]
|
|
610
|
-
private PlayerAccount _account;
|
|
611
|
-
|
|
612
|
-
/// <summary>
|
|
613
|
-
/// True if the registration was successful.
|
|
614
|
-
/// If not, see the <see cref="error"/> field for more detail.
|
|
615
|
-
/// </summary>
|
|
616
|
-
public bool isSuccess => error == PlayerRegistrationError.NONE;
|
|
617
|
-
|
|
618
|
-
/// <summary>
|
|
619
|
-
/// The <see cref="PlayerAccount"/> after the registration
|
|
620
|
-
/// </summary>
|
|
621
|
-
/// <exception cref="PlayerRegistrationException">
|
|
622
|
-
/// This cannot be accessed if <see cref="isSuccess"/> is false.
|
|
623
|
-
/// If it is, an exception will be thrown.
|
|
624
|
-
/// </exception>
|
|
625
|
-
public PlayerAccount account
|
|
626
|
-
{
|
|
627
|
-
get
|
|
628
|
-
{
|
|
629
|
-
if (error == PlayerRegistrationError.NONE)
|
|
630
|
-
{
|
|
631
|
-
return _account;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
throw new PlayerRegistrationException(error, innerException);
|
|
635
|
-
}
|
|
636
|
-
set => _account = value;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
/// <summary>
|
|
642
|
-
/// The <see cref="PasswordResetOperation"/> contains the result of starting
|
|
643
|
-
/// a password reset flow.
|
|
644
|
-
/// </summary>
|
|
645
|
-
[Serializable]
|
|
646
|
-
public class PasswordResetOperation
|
|
647
|
-
{
|
|
648
|
-
private readonly PlayerAccounts _collection;
|
|
649
|
-
|
|
650
|
-
/// <summary>
|
|
651
|
-
/// If an error occured while attempting to reset a <see cref="PlayerAccount"/>'s password,
|
|
652
|
-
/// then this value will be anything other than <see cref="PasswordResetError.NONE"/>.
|
|
653
|
-
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
654
|
-
/// will throw an exception.
|
|
655
|
-
/// </summary>
|
|
656
|
-
public PasswordResetError error;
|
|
657
|
-
|
|
658
|
-
/// <summary>
|
|
659
|
-
/// True when the <see cref="error"/> is none.
|
|
660
|
-
/// </summary>
|
|
661
|
-
public bool isSuccess => error == PasswordResetError.NONE;
|
|
662
|
-
|
|
663
|
-
[SerializeField]
|
|
664
|
-
private PlayerAccount _account;
|
|
665
|
-
|
|
666
|
-
/// <summary>
|
|
667
|
-
/// Access the <see cref="PlayerAccount"/>.
|
|
668
|
-
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
669
|
-
/// </summary>
|
|
670
|
-
/// <exception cref="PasswordResetException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
671
|
-
public PlayerAccount account
|
|
672
|
-
{
|
|
673
|
-
get
|
|
674
|
-
{
|
|
675
|
-
if (error == PasswordResetError.NONE)
|
|
676
|
-
{
|
|
677
|
-
return _account;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
throw new PasswordResetException(error);
|
|
681
|
-
}
|
|
682
|
-
set => _account = value;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
public PasswordResetOperation(PlayerAccounts collection)
|
|
687
|
-
{
|
|
688
|
-
_collection = collection;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
/// <summary>
|
|
692
|
-
/// If the <see cref="isSuccess"/> field is true, then
|
|
693
|
-
/// this method may be called with the new password and reset code.
|
|
694
|
-
/// Calling <see cref="PlayerAccounts.ConfirmPassword"/> will have the same outcome.
|
|
695
|
-
/// </summary>
|
|
696
|
-
/// <param name="code">
|
|
697
|
-
/// The code that was sent to the player's email address by
|
|
698
|
-
/// invoking the <see cref="ResetPassword"/> method.
|
|
699
|
-
/// </param>
|
|
700
|
-
/// <param name="newPassword">A new password to assign to the email credential. </param>
|
|
701
|
-
/// <returns></returns>
|
|
702
|
-
public async Promise<PasswordResetConfirmOperation> Confirm(string code, string newPassword)
|
|
703
|
-
{
|
|
704
|
-
return await _collection.ConfirmPassword(code, newPassword, account);
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
[Serializable]
|
|
709
|
-
public class PasswordResetResult
|
|
710
|
-
{
|
|
711
|
-
public bool isSuccess => innerException == null;
|
|
712
|
-
|
|
713
|
-
public Exception innerException;
|
|
714
|
-
|
|
715
|
-
public PasswordResetConfirmError error;
|
|
716
|
-
|
|
717
|
-
public PasswordResetResult()
|
|
718
|
-
{
|
|
719
|
-
error = PasswordResetConfirmError.NONE;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
public PasswordResetResult(Exception exception)
|
|
723
|
-
{
|
|
724
|
-
innerException = exception;
|
|
725
|
-
switch (innerException)
|
|
726
|
-
{
|
|
727
|
-
case PlatformRequesterException ex when ex.Status == 400:
|
|
728
|
-
error = PasswordResetConfirmError.BAD_CODE;
|
|
729
|
-
break;
|
|
730
|
-
default:
|
|
731
|
-
error = PasswordResetConfirmError.INVALID;
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
/// <summary>
|
|
738
|
-
/// The <see cref="PasswordResetConfirmOperation"/> contain the results
|
|
739
|
-
/// or a password confirmation.
|
|
740
|
-
/// </summary>
|
|
741
|
-
[Serializable]
|
|
742
|
-
public class PasswordResetConfirmOperation
|
|
743
|
-
{
|
|
744
|
-
/// <summary>
|
|
745
|
-
/// If an error occured while attempting to confirm a <see cref="PlayerAccount"/>'s password,
|
|
746
|
-
/// then this value will be anything other than <see cref="PasswordResetConfirmError.NONE"/>.
|
|
747
|
-
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
748
|
-
/// will throw an exception.
|
|
749
|
-
/// </summary>
|
|
750
|
-
public PasswordResetConfirmError error;
|
|
751
|
-
|
|
752
|
-
/// <summary>
|
|
753
|
-
/// True when the <see cref="error"/> is none.
|
|
754
|
-
/// </summary>
|
|
755
|
-
public bool isSuccess => error == PasswordResetConfirmError.NONE;
|
|
756
|
-
|
|
757
|
-
[SerializeField]
|
|
758
|
-
private PlayerAccount _account;
|
|
759
|
-
|
|
760
|
-
/// <summary>
|
|
761
|
-
/// Access the <see cref="PlayerAccount"/>.
|
|
762
|
-
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
763
|
-
/// </summary>
|
|
764
|
-
/// <exception cref="PasswordResetConfirmException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
765
|
-
public PlayerAccount account
|
|
766
|
-
{
|
|
767
|
-
get
|
|
768
|
-
{
|
|
769
|
-
if (error == PasswordResetConfirmError.NONE)
|
|
770
|
-
{
|
|
771
|
-
return _account;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
throw new PasswordResetConfirmException(error);
|
|
775
|
-
}
|
|
776
|
-
set => _account = value;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
/// <summary>
|
|
782
|
-
/// The <see cref="PlayerRecoveryOperation"/> has the results of an account recovery operation.
|
|
783
|
-
/// Accounts can be recovered using the <see cref="PlayerAccounts.RecoverAccountWithEmail"/> method.
|
|
784
|
-
///
|
|
785
|
-
/// Use the <see cref="SwitchToAccount"/> method to switch to the recovered account.
|
|
786
|
-
/// </summary>
|
|
787
|
-
[Serializable]
|
|
788
|
-
public class PlayerRecoveryOperation
|
|
789
|
-
{
|
|
790
|
-
private Exception _innerException;
|
|
791
|
-
|
|
792
|
-
/// <summary>
|
|
793
|
-
/// If an error occured while attempting to recovery a <see cref="PlayerAccount"/>,
|
|
794
|
-
/// then this value will be anything other than <see cref="PlayerRecoveryError.NONE"/>.
|
|
795
|
-
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
796
|
-
/// will throw an exception.
|
|
797
|
-
/// </summary>
|
|
798
|
-
public PlayerRecoveryError error;
|
|
799
|
-
|
|
800
|
-
/// <summary>
|
|
801
|
-
/// True when the <see cref="error"/> is none.
|
|
802
|
-
/// </summary>
|
|
803
|
-
public bool isSuccess => error == PlayerRecoveryError.NONE;
|
|
804
|
-
|
|
805
|
-
/// <summary>
|
|
806
|
-
/// If the account already had a player id in the current realm, then this value be true.
|
|
807
|
-
/// When this value is false, it implies that the account exists in the CID scope, but not
|
|
808
|
-
/// in the current PID scope.
|
|
809
|
-
/// </summary>
|
|
810
|
-
public bool realmAlreadyHasGamerTag;
|
|
811
|
-
|
|
812
|
-
[SerializeField]
|
|
813
|
-
private PlayerAccount _account;
|
|
814
|
-
|
|
815
|
-
/// <summary>
|
|
816
|
-
/// Access the recovered <see cref="PlayerAccount"/>.
|
|
817
|
-
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
818
|
-
/// </summary>
|
|
819
|
-
/// <exception cref="PlayerRecoveryException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
820
|
-
public PlayerAccount account
|
|
821
|
-
{
|
|
822
|
-
get
|
|
823
|
-
{
|
|
824
|
-
if (error == PlayerRecoveryError.NONE)
|
|
825
|
-
{
|
|
826
|
-
return _account;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
throw GetException();
|
|
830
|
-
}
|
|
831
|
-
set => _account = value;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
/// <summary>
|
|
835
|
-
/// Change the current <see cref="BeamContext"/>'s account to the recovered account.
|
|
836
|
-
/// If the <see cref="error"/> value is anything other than none, this method will
|
|
837
|
-
/// throw an exception.
|
|
838
|
-
/// </summary>
|
|
839
|
-
public async Promise SwitchToAccount()
|
|
840
|
-
{
|
|
841
|
-
await account.SwitchToAccount();
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
public PlayerRecoveryOperation()
|
|
845
|
-
{
|
|
846
|
-
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
public PlayerRecoveryOperation(Exception ex, PlayerRecoveryError error)
|
|
850
|
-
{
|
|
851
|
-
this.error = error;
|
|
852
|
-
_innerException = ex;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/// <summary>
|
|
856
|
-
/// This function will create an <see cref="PlayerRecoveryException"/> instance that contains the error code
|
|
857
|
-
/// and any inner exception.
|
|
858
|
-
/// </summary>
|
|
859
|
-
/// <returns></returns>
|
|
860
|
-
public PlayerRecoveryException GetException()
|
|
861
|
-
{
|
|
862
|
-
return new PlayerRecoveryException(error, _innerException);
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
/// <summary>
|
|
868
|
-
/// An exception that can be thrown if there is an error during an account recovery.
|
|
869
|
-
/// </summary>
|
|
870
|
-
public class PlayerRecoveryException : Exception
|
|
871
|
-
{
|
|
872
|
-
|
|
873
|
-
public PlayerRecoveryError Error { get; }
|
|
874
|
-
|
|
875
|
-
public PlayerRecoveryException(PlayerRecoveryError error, Exception innerException = null)
|
|
876
|
-
: base($"The recovery failed. error=[{error}]", innerException)
|
|
877
|
-
{
|
|
878
|
-
Error = error;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
public PlayerRecoveryException(PlayerRecoveryError error, string message, Exception innerException = null)
|
|
882
|
-
: base($"The recovery failed. error=[{error}] message=[{message}]", innerException)
|
|
883
|
-
{
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
/// <summary>
|
|
889
|
-
/// An exception that can be thrown if there is an error while adding a credential to an account.
|
|
890
|
-
/// </summary>
|
|
891
|
-
public class PlayerRegistrationException : Exception
|
|
892
|
-
{
|
|
893
|
-
|
|
894
|
-
public PlayerRegistrationError Error { get; }
|
|
895
|
-
|
|
896
|
-
public PlayerRegistrationException(PlayerRegistrationError error, Exception innerException = null)
|
|
897
|
-
: base($"The registration failed. error=[{error}]", innerException)
|
|
898
|
-
{
|
|
899
|
-
Error = error;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
/// <summary>
|
|
904
|
-
/// An exception that can be thrown if there is an error while starting a password reset flow.
|
|
905
|
-
/// </summary>
|
|
906
|
-
public class PasswordResetException : Exception
|
|
907
|
-
{
|
|
908
|
-
|
|
909
|
-
public PasswordResetError Error { get; }
|
|
910
|
-
|
|
911
|
-
public PasswordResetException(PasswordResetError error)
|
|
912
|
-
: base($"The password reset failed. error=[{error}]")
|
|
913
|
-
{
|
|
914
|
-
Error = error;
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
/// <summary>
|
|
919
|
-
/// An exception that can be thrown if there is an error while confirming a password reset flow.
|
|
920
|
-
/// </summary>
|
|
921
|
-
public class PasswordResetConfirmException : Exception
|
|
922
|
-
{
|
|
923
|
-
public PasswordResetConfirmError Error { get; }
|
|
924
|
-
|
|
925
|
-
public PasswordResetConfirmException(PasswordResetConfirmError error)
|
|
926
|
-
: base($"The password confirm failed. error=[{error}]")
|
|
927
|
-
{
|
|
928
|
-
Error = error;
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
/// <summary>
|
|
933
|
-
/// The <see cref="PlayerRecoveryError"/> lists out the possible errors
|
|
934
|
-
/// that could occur when trying to recover a <see cref="PlayerAccount"/>
|
|
935
|
-
/// </summary>
|
|
936
|
-
public enum PlayerRecoveryError
|
|
937
|
-
{
|
|
938
|
-
/// <summary>
|
|
939
|
-
/// Represents that no error occured
|
|
940
|
-
/// </summary>
|
|
941
|
-
NONE,
|
|
942
|
-
|
|
943
|
-
/// <summary>
|
|
944
|
-
/// Represents that the given credentials weren't valid, or didn't map to an existing <see cref="PlayerAccount"/>
|
|
945
|
-
/// </summary>
|
|
946
|
-
UNKNOWN_CREDENTIALS,
|
|
947
|
-
|
|
948
|
-
/// <summary>
|
|
949
|
-
/// Represents that the given recovery did not specify enough information to login
|
|
950
|
-
/// </summary>
|
|
951
|
-
INSUFFICIENT_DATA,
|
|
952
|
-
|
|
953
|
-
/// <summary>
|
|
954
|
-
/// Represents that the given recovery did not work, but the error isn't classified.
|
|
955
|
-
/// </summary>
|
|
956
|
-
UNKNOWN_ERROR
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
/// <summary>
|
|
960
|
-
/// The <see cref="PlayerRecoveryError"/> lists out the possible errors that
|
|
961
|
-
/// could occur when trying to add a credential to a <see cref="PlayerAccount"/>
|
|
962
|
-
/// </summary>
|
|
963
|
-
public enum PlayerRegistrationError
|
|
964
|
-
{
|
|
965
|
-
/// <summary>
|
|
966
|
-
/// represents no error occured.
|
|
967
|
-
/// </summary>
|
|
968
|
-
NONE,
|
|
969
|
-
|
|
970
|
-
/// <summary>
|
|
971
|
-
/// represents that the <see cref="PlayerAccount"/> already has a value
|
|
972
|
-
/// for the credential. For example, a single account cannot have more
|
|
973
|
-
/// than 1 email address or 1 linked facebook account.
|
|
974
|
-
/// </summary>
|
|
975
|
-
ALREADY_HAS_CREDENTIAL,
|
|
976
|
-
|
|
977
|
-
/// <summary>
|
|
978
|
-
/// represents that the given credential is already in use by a different <see cref="PlayerAccount"/>
|
|
979
|
-
/// </summary>
|
|
980
|
-
CREDENTIAL_IS_ALREADY_TAKEN,
|
|
981
|
-
|
|
982
|
-
/// <summary>
|
|
983
|
-
/// represents that the registration failed due to wrong realm configuration.
|
|
984
|
-
/// Can occur during third party login integration.
|
|
985
|
-
/// </summary>
|
|
986
|
-
INVALID_REALM_CONFIGURATION,
|
|
987
|
-
|
|
988
|
-
/// <summary>
|
|
989
|
-
/// Represents failed Federated Authorization.
|
|
990
|
-
/// </summary>
|
|
991
|
-
FAILED_FEDERATED_AUTHORIZATION,
|
|
992
|
-
|
|
993
|
-
/// <summary>
|
|
994
|
-
/// Represents error when federated identity returns challenge to respond to,
|
|
995
|
-
/// but no challengeHandler is provided.
|
|
996
|
-
/// </summary>
|
|
997
|
-
MISSING_FEDERATED_CHALLENGE_HANDLER,
|
|
998
|
-
|
|
999
|
-
/// <summary>
|
|
1000
|
-
/// Represents error that is not covered by other values of this enum.
|
|
1001
|
-
/// </summary>
|
|
1002
|
-
/// <remarks>If <see cref="RegistrationResult"/> contains this error it is useful to inspect the <see cref="RegistrationResult.innerException"/> field for more details.</remarks>
|
|
1003
|
-
OTHER_ERROR,
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
/// <summary>
|
|
1007
|
-
/// The <see cref="PasswordResetError"/> lists the possible errors
|
|
1008
|
-
/// that could occur when starting a password reset flow.
|
|
1009
|
-
/// </summary>
|
|
1010
|
-
public enum PasswordResetError
|
|
1011
|
-
{
|
|
1012
|
-
/// <summary>
|
|
1013
|
-
/// represents that no error occured.
|
|
1014
|
-
/// </summary>
|
|
1015
|
-
NONE,
|
|
1016
|
-
|
|
1017
|
-
/// <summary>
|
|
1018
|
-
/// represents that the credential was not present on the account.
|
|
1019
|
-
/// </summary>
|
|
1020
|
-
NO_EXISTING_CREDENTIAL
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
/// <summary>
|
|
1024
|
-
/// the <see cref="PasswordResetConfirmError"/> represents the possible
|
|
1025
|
-
/// errors that could occur while confirming a password reset.
|
|
1026
|
-
/// </summary>
|
|
1027
|
-
public enum PasswordResetConfirmError
|
|
1028
|
-
{
|
|
1029
|
-
/// <summary>
|
|
1030
|
-
/// represents that no error occured.
|
|
1031
|
-
/// </summary>
|
|
1032
|
-
NONE,
|
|
1033
|
-
|
|
1034
|
-
/// <summary>
|
|
1035
|
-
/// represents that an invalid code was given
|
|
1036
|
-
/// </summary>
|
|
1037
|
-
BAD_CODE,
|
|
1038
|
-
|
|
1039
|
-
INVALID,
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
[Serializable]
|
|
1045
|
-
public class PlayerAccounts : AbsObservableReadonlyList<PlayerAccount>
|
|
1046
|
-
{
|
|
1047
|
-
private readonly BeamContext _ctx;
|
|
1048
|
-
private readonly IAuthService _authService;
|
|
1049
|
-
private readonly AccessTokenStorage _storage;
|
|
1050
|
-
private readonly IBeamableRequester _requester;
|
|
1051
|
-
private readonly IStatsApi _stats;
|
|
1052
|
-
private readonly Api.Autogenerated.Stats.IStatsApi _statsApi;
|
|
1053
|
-
internal readonly IDependencyProvider _provider;
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
/// <summary>
|
|
1057
|
-
/// The currently signed in <see cref="PlayerAccount"/>.
|
|
1058
|
-
/// There is always a current account, but it may be anonymous.
|
|
1059
|
-
/// </summary>
|
|
1060
|
-
public PlayerAccount Current;
|
|
1061
|
-
|
|
1062
|
-
public Promise OnReady;
|
|
1063
|
-
|
|
1064
|
-
public PlayerAccounts(BeamContext ctx,
|
|
1065
|
-
IAuthService authService,
|
|
1066
|
-
AccessTokenStorage storage,
|
|
1067
|
-
IBeamableRequester requester,
|
|
1068
|
-
IStatsApi stats,
|
|
1069
|
-
Api.Autogenerated.Stats.IStatsApi statsApi,
|
|
1070
|
-
IDependencyProvider provider)
|
|
1071
|
-
{
|
|
1072
|
-
_ctx = ctx;
|
|
1073
|
-
_authService = authService;
|
|
1074
|
-
_storage = storage;
|
|
1075
|
-
_requester = requester;
|
|
1076
|
-
_stats = stats;
|
|
1077
|
-
_statsApi = statsApi;
|
|
1078
|
-
_provider = provider;
|
|
1079
|
-
OnReady = Refresh();
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
/// <summary>
|
|
1085
|
-
/// Change the current <see cref="BeamContext"/>'s current user to the given account.
|
|
1086
|
-
/// After this method finishes, the given <see cref="account"/> will be the <see cref="Current"/> account.
|
|
1087
|
-
/// </summary>
|
|
1088
|
-
/// <param name="account"></param>
|
|
1089
|
-
public async Promise SwitchToAccount(PlayerAccount account)
|
|
1090
|
-
{
|
|
1091
|
-
await OnReady;
|
|
1092
|
-
|
|
1093
|
-
_storage.StoreDeviceRefreshToken(_ctx.Cid, _ctx.Pid,
|
|
1094
|
-
new AccessToken(_storage, _ctx.Cid, _ctx.Pid, _ctx.AccessToken.Token,
|
|
1095
|
-
_ctx.AccessToken.RefreshToken, 1));
|
|
1096
|
-
await _ctx.ChangeAuthorizedPlayer(account.token);
|
|
1097
|
-
await Refresh();
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
/// <summary>
|
|
1101
|
-
/// Create a new anonymous account.
|
|
1102
|
-
/// The new account will be returned, and will be accessible in the <see cref="PlayerAccounts"/> list
|
|
1103
|
-
/// To switch to this new account, use the <see cref="SwitchToAccount"/> method.
|
|
1104
|
-
/// </summary>
|
|
1105
|
-
/// <returns>The newly created <see cref="PlayerAccount"/></returns>
|
|
1106
|
-
public async Promise<PlayerAccount> CreateNewAccount()
|
|
1107
|
-
{
|
|
1108
|
-
await OnReady;
|
|
1109
|
-
|
|
1110
|
-
var tokenResponse = await _authService.CreateUser();
|
|
1111
|
-
var accessToken = new AccessToken(_storage, _ctx.Cid, _ctx.Pid, tokenResponse.access_token,
|
|
1112
|
-
tokenResponse.refresh_token, tokenResponse.expires_in);
|
|
1113
|
-
_storage.StoreDeviceRefreshToken(_ctx.Cid, _ctx.Pid, accessToken);
|
|
1114
|
-
var user = await _authService.GetUser(tokenResponse);
|
|
1115
|
-
await Refresh();
|
|
1116
|
-
return this.FirstOrDefault(x => x.GamerTag == user.id);
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
/// <summary>
|
|
1120
|
-
/// Set the given <see cref="PlayerAccount"/>'s subtext value.
|
|
1121
|
-
/// The subtext can be used to show a small amount of account detail.
|
|
1122
|
-
/// </summary>
|
|
1123
|
-
/// <param name="subtext">the new subtext value</param>
|
|
1124
|
-
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1125
|
-
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1126
|
-
public Promise<PlayerAccount> SetSubtext(string subtext, PlayerAccount account = null) =>
|
|
1127
|
-
SetStatValue(AccountManagementConfiguration.Instance.SubtextStat.StatKey, subtext, account);
|
|
1128
|
-
|
|
1129
|
-
/// <summary>
|
|
1130
|
-
/// Set the given <see cref="PlayerAccount"/>'s alias value.
|
|
1131
|
-
/// The alias is used to show a display name for the account.
|
|
1132
|
-
/// </summary>
|
|
1133
|
-
/// <param name="alias">the new alias value</param>
|
|
1134
|
-
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1135
|
-
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1136
|
-
public Promise<PlayerAccount> SetAlias(string alias, PlayerAccount account = null) =>
|
|
1137
|
-
SetStatValue(AccountManagementConfiguration.Instance.DisplayNameStat.StatKey, alias, account);
|
|
1138
|
-
|
|
1139
|
-
/// <summary>
|
|
1140
|
-
/// Set the given <see cref="PlayerAccount"/>'s avatar value.
|
|
1141
|
-
/// The avatar can be used to record which avatar entry to use.
|
|
1142
|
-
/// </summary>
|
|
1143
|
-
/// <param name="avatar">the new avatar value</param>
|
|
1144
|
-
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1145
|
-
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1146
|
-
public Promise<PlayerAccount> SetAvatar(string avatar, PlayerAccount account = null) =>
|
|
1147
|
-
SetStatValue(AccountManagementConfiguration.Instance.AvatarStat.StatKey, avatar, account);
|
|
1148
|
-
|
|
1149
|
-
private async Promise<PlayerAccount> SetStatValue(string key, string value, PlayerAccount account)
|
|
1150
|
-
{
|
|
1151
|
-
await OnReady;
|
|
1152
|
-
|
|
1153
|
-
if (account == null)
|
|
1154
|
-
{
|
|
1155
|
-
account = Current;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
var statsService = GetStatsServiceForAccount(account);
|
|
1159
|
-
await statsService.SetStats(StatsAccessType.Public,
|
|
1160
|
-
new Dictionary<string, string>
|
|
1161
|
-
{
|
|
1162
|
-
[key] = value
|
|
1163
|
-
});
|
|
1164
|
-
await Refresh();
|
|
1165
|
-
_stats.ClearCaches();
|
|
1166
|
-
return account;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
/// <summary>
|
|
1170
|
-
/// Find an existing account by email and password.
|
|
1171
|
-
///
|
|
1172
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1173
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1174
|
-
/// for the given <see cref="email"/> and <see cref="password"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1175
|
-
///
|
|
1176
|
-
/// </summary>
|
|
1177
|
-
/// <param name="email">
|
|
1178
|
-
/// A valid email address that was previously added to <see cref="PlayerAccount"/>.
|
|
1179
|
-
/// Email credentials can be added with the <see cref="AddEmail"/> method, or the PlayerAccount's <see cref="PlayerAccount.AddEmail"/> method.
|
|
1180
|
-
/// </param>
|
|
1181
|
-
/// <param name="password">
|
|
1182
|
-
/// The password used to add the email address
|
|
1183
|
-
/// </param>
|
|
1184
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1185
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithEmail(string email, string password)
|
|
1186
|
-
{
|
|
1187
|
-
return RecoverAccount((auth, merge) => auth.Login(email, password, merge));
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
/// <summary>
|
|
1191
|
-
/// Find an existing account by the current deviceId
|
|
1192
|
-
///
|
|
1193
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1194
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1195
|
-
/// for the current deviceId, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1196
|
-
///
|
|
1197
|
-
/// </summary>
|
|
1198
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1199
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithDeviceId()
|
|
1200
|
-
{
|
|
1201
|
-
return RecoverAccount((auth, merge) => auth.LoginDeviceId(merge));
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
/// <summary>
|
|
1205
|
-
/// Find an existing account by a third party link.
|
|
1206
|
-
///
|
|
1207
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1208
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1209
|
-
/// for the given <see cref="thirdParty"/> and <see cref="token"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1210
|
-
///
|
|
1211
|
-
/// </summary>
|
|
1212
|
-
/// <param name="thirdParty">
|
|
1213
|
-
/// A third party that was previously added to an account with the <see cref="AddThirdParty"/> method.
|
|
1214
|
-
/// </param>
|
|
1215
|
-
/// <param name="token">
|
|
1216
|
-
/// The auth token issued from the third party.
|
|
1217
|
-
/// </param>
|
|
1218
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1219
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithThirdParty(
|
|
1220
|
-
AuthThirdParty thirdParty,
|
|
1221
|
-
string token)
|
|
1222
|
-
{
|
|
1223
|
-
return RecoverAccount((auth, merge) => auth.LoginThirdParty(thirdParty, token, merge));
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
/// <summary>
|
|
1228
|
-
/// Find an existing account by a <see cref="TokenResponse"/>.
|
|
1229
|
-
///
|
|
1230
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1231
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1232
|
-
/// for the given <see cref="TokenResponse"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1233
|
-
///
|
|
1234
|
-
/// </summary>
|
|
1235
|
-
/// <param name="tokenResponse">
|
|
1236
|
-
/// The auth token.
|
|
1237
|
-
/// </param>
|
|
1238
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1239
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithRefreshToken(
|
|
1240
|
-
TokenResponse tokenResponse)
|
|
1241
|
-
{
|
|
1242
|
-
return RecoverAccountWithRefreshToken(tokenResponse.refresh_token);
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
/// <summary>
|
|
1246
|
-
/// Find an existing account by a refresh token from a <see cref="TokenResponse"/>.
|
|
1247
|
-
///
|
|
1248
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1249
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1250
|
-
/// for the given <see cref="TokenResponse"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1251
|
-
///
|
|
1252
|
-
/// </summary>
|
|
1253
|
-
/// <param name="refreshToken">
|
|
1254
|
-
/// The refresh token from a <see cref="TokenResponse"/>.
|
|
1255
|
-
/// </param>
|
|
1256
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1257
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithRefreshToken(
|
|
1258
|
-
string refreshToken)
|
|
1259
|
-
{
|
|
1260
|
-
return RecoverAccount((auth, _) => auth.LoginRefreshToken(refreshToken));
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
private async Promise<PlayerRecoveryOperation> RecoverAccount(
|
|
1264
|
-
Func<IAuthService, bool, Promise<TokenResponse>> loginFunction, bool attemptAccountMerge = true)
|
|
1265
|
-
{
|
|
1266
|
-
await OnReady;
|
|
1267
|
-
|
|
1268
|
-
TokenResponse res;
|
|
1269
|
-
var op = new PlayerRecoveryOperation();
|
|
1270
|
-
try
|
|
1271
|
-
{
|
|
1272
|
-
try
|
|
1273
|
-
{
|
|
1274
|
-
res = await loginFunction(_authService, attemptAccountMerge);
|
|
1275
|
-
}
|
|
1276
|
-
catch (PlatformRequesterException ex) when (attemptAccountMerge && ex.Error?.error == "UnableToMergeError")
|
|
1277
|
-
{
|
|
1278
|
-
op.realmAlreadyHasGamerTag = true;
|
|
1279
|
-
res = await loginFunction(_authService, false);
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
catch (PlayerRecoveryException ex)
|
|
1283
|
-
{
|
|
1284
|
-
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.INSUFFICIENT_DATA);
|
|
1285
|
-
}
|
|
1286
|
-
catch (PlatformRequesterException ex) when (ex.Error.status == 401 || ex.Error.status == 403)
|
|
1287
|
-
{
|
|
1288
|
-
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.UNKNOWN_CREDENTIALS);
|
|
1289
|
-
}
|
|
1290
|
-
catch (Exception ex)
|
|
1291
|
-
{
|
|
1292
|
-
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.UNKNOWN_ERROR);
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
var user = await _authService.GetUser(res);
|
|
1296
|
-
var stats = await GetStatsForUser(user);
|
|
1297
|
-
|
|
1298
|
-
op.account = new PlayerAccount(this, res, user, stats);
|
|
1299
|
-
return op;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
/// <summary>
|
|
1303
|
-
/// Completes a password reset flow for the given <see cref="PlayerAccount"/>.
|
|
1304
|
-
/// </summary>
|
|
1305
|
-
/// <param name="code">
|
|
1306
|
-
/// The code that was sent to the player's email address by
|
|
1307
|
-
/// invoking the <see cref="ResetPassword"/> method.
|
|
1308
|
-
/// </param>
|
|
1309
|
-
/// <param name="newPassword">A new password to assign to the email credential. </param>
|
|
1310
|
-
/// <param name="account"></param>
|
|
1311
|
-
/// <returns></returns>
|
|
1312
|
-
public async Promise<PasswordResetConfirmOperation> ConfirmPassword(string code, string newPassword, PlayerAccount account = null)
|
|
1313
|
-
{
|
|
1314
|
-
await OnReady;
|
|
1315
|
-
|
|
1316
|
-
if (account == null)
|
|
1317
|
-
{
|
|
1318
|
-
account = Current;
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
var res = new PasswordResetConfirmOperation { account = account };
|
|
1322
|
-
var service = GetAuthServiceForAccount(account);
|
|
1323
|
-
|
|
1324
|
-
await service.ConfirmPasswordUpdate(code, newPassword);
|
|
1325
|
-
await Refresh();
|
|
1326
|
-
return res;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
public async Promise ResetPassword(string email)
|
|
1331
|
-
{
|
|
1332
|
-
await OnReady;
|
|
1333
|
-
|
|
1334
|
-
var service = GetAuthServiceForAccount(Current);
|
|
1335
|
-
await service.IssuePasswordUpdate(email);
|
|
1336
|
-
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
public async Promise<PasswordResetResult> ConfirmPassword(string code, string newPassword)
|
|
1340
|
-
{
|
|
1341
|
-
await OnReady;
|
|
1342
|
-
|
|
1343
|
-
var service = GetAuthServiceForAccount(Current);
|
|
1344
|
-
try
|
|
1345
|
-
{
|
|
1346
|
-
await service.ConfirmPasswordUpdate(code, newPassword);
|
|
1347
|
-
return new PasswordResetResult();
|
|
1348
|
-
}
|
|
1349
|
-
catch (Exception ex)
|
|
1350
|
-
{
|
|
1351
|
-
return new PasswordResetResult(ex);
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
/// <summary>
|
|
1356
|
-
/// Initiates a password reset flow for the given <see cref="PlayerAccount"/>.
|
|
1357
|
-
/// If the given account does not have an email credential, the resulting
|
|
1358
|
-
/// <see cref="PasswordResetOperation"/>'s <see cref="PasswordResetOperation.isSuccess"/>
|
|
1359
|
-
/// field will be false.
|
|
1360
|
-
///
|
|
1361
|
-
/// After the password reset flow is started, a code will be sent to the account's
|
|
1362
|
-
/// email address. The code must be provided to the <see cref="ConfirmPassword"/> method,
|
|
1363
|
-
/// or the <see cref="PasswordResetOperation"/>'s <see cref="PasswordResetOperation.Confirm"/> method.
|
|
1364
|
-
/// </summary>
|
|
1365
|
-
/// <param name="account"></param>
|
|
1366
|
-
/// <returns></returns>
|
|
1367
|
-
public async Promise<PasswordResetOperation> ResetPassword(PlayerAccount account = null)
|
|
1368
|
-
{
|
|
1369
|
-
await OnReady;
|
|
1370
|
-
|
|
1371
|
-
if (account == null)
|
|
1372
|
-
{
|
|
1373
|
-
account = Current;
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
var res = new PasswordResetOperation(this) { account = account };
|
|
1377
|
-
|
|
1378
|
-
if (!account.HasEmail)
|
|
1379
|
-
{
|
|
1380
|
-
res.error = PasswordResetError.NO_EXISTING_CREDENTIAL;
|
|
1381
|
-
return res;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
var service = GetAuthServiceForAccount(account);
|
|
1385
|
-
await service.IssuePasswordUpdate(account.Email);
|
|
1386
|
-
|
|
1387
|
-
return res;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
/// <summary>
|
|
1391
|
-
/// Removes all deviceID credentials from the given account.
|
|
1392
|
-
/// An account could have multiple if the player used multiple devices.
|
|
1393
|
-
///
|
|
1394
|
-
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1395
|
-
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1396
|
-
/// </summary>
|
|
1397
|
-
/// <param name="account"></param>
|
|
1398
|
-
public async Promise<PlayerAccount> RemoveAllDeviceIds(PlayerAccount account = null)
|
|
1399
|
-
{
|
|
1400
|
-
await OnReady;
|
|
1401
|
-
|
|
1402
|
-
if (account == null)
|
|
1403
|
-
{
|
|
1404
|
-
account = Current;
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
var service = GetAuthServiceForAccount(account);
|
|
1408
|
-
var user = await service.RemoveAllDeviceIds();
|
|
1409
|
-
account.Update(user);
|
|
1410
|
-
account.TryTriggerUpdate();
|
|
1411
|
-
return account;
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
/// <summary>
|
|
1415
|
-
/// Removes the current deviceID credential from the given account.
|
|
1416
|
-
///
|
|
1417
|
-
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1418
|
-
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1419
|
-
/// </summary>
|
|
1420
|
-
/// <param name="account"></param>
|
|
1421
|
-
public async Promise<PlayerAccount> RemoveDeviceId(PlayerAccount account = null)
|
|
1422
|
-
{
|
|
1423
|
-
await OnReady;
|
|
1424
|
-
|
|
1425
|
-
if (account == null)
|
|
1426
|
-
{
|
|
1427
|
-
account = Current;
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
var service = GetAuthServiceForAccount(account);
|
|
1431
|
-
var deviceId = await service.GetDeviceId();
|
|
1432
|
-
var user = await service.RemoveDeviceId();
|
|
1433
|
-
user.deviceIds.Remove(deviceId);
|
|
1434
|
-
account.Update(user);
|
|
1435
|
-
account.TryTriggerUpdate();
|
|
1436
|
-
|
|
1437
|
-
return account;
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
/// <summary>
|
|
1441
|
-
/// Removes the third party credential from the given account.
|
|
1442
|
-
/// </summary>
|
|
1443
|
-
/// <param name="thirdParty">
|
|
1444
|
-
/// Which <see cref="AuthThirdParty"/> is being added to the <see cref="PlayerAccount"/>
|
|
1445
|
-
/// </param>
|
|
1446
|
-
/// <param name="token">
|
|
1447
|
-
/// The special token issued from the third party itself. This token's format and origin differ
|
|
1448
|
-
/// depending on which third party is being used.
|
|
1449
|
-
/// </param>
|
|
1450
|
-
/// <param name="account"></param>
|
|
1451
|
-
public async Promise<PlayerAccount> RemoveThirdParty(AuthThirdParty thirdParty, string token, PlayerAccount account = null)
|
|
1452
|
-
{
|
|
1453
|
-
await OnReady;
|
|
1454
|
-
|
|
1455
|
-
if (account == null)
|
|
1456
|
-
{
|
|
1457
|
-
account = Current;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
var service = GetAuthServiceForAccount(account);
|
|
1461
|
-
|
|
1462
|
-
var user = await service.RemoveThirdPartyAssociation(thirdParty, token);
|
|
1463
|
-
account.Update(user);
|
|
1464
|
-
account.TryTriggerUpdate();
|
|
1465
|
-
|
|
1466
|
-
return account;
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
/// <summary>
|
|
1470
|
-
/// Adds the deviceId credential to the given <see cref="PlayerAccount"/>,
|
|
1471
|
-
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1472
|
-
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1473
|
-
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1474
|
-
///
|
|
1475
|
-
/// If the deviceID has already been added to a different <see cref="PlayerAccount"/>,
|
|
1476
|
-
/// then the the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1477
|
-
///
|
|
1478
|
-
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1479
|
-
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1480
|
-
/// </summary>
|
|
1481
|
-
/// <param name="account"></param>
|
|
1482
|
-
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1483
|
-
public async Promise<RegistrationResult> AddDeviceId(PlayerAccount account = null)
|
|
1484
|
-
{
|
|
1485
|
-
await OnReady;
|
|
1486
|
-
|
|
1487
|
-
if (account == null)
|
|
1488
|
-
{
|
|
1489
|
-
account = Current;
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
var res = new RegistrationResult { account = account };
|
|
1493
|
-
var service = GetAuthServiceForAccount(account);
|
|
1494
|
-
|
|
1495
|
-
var isAvailable = await service.IsThisDeviceIdAvailable();
|
|
1496
|
-
if (!isAvailable)
|
|
1497
|
-
{
|
|
1498
|
-
res.error = PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN;
|
|
1499
|
-
return res;
|
|
1500
|
-
}
|
|
1501
|
-
var user = await service.RegisterDeviceId();
|
|
1502
|
-
account.Update(user);
|
|
1503
|
-
await Refresh();
|
|
1504
|
-
return res;
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
/// <inheritdoc cref="RecoverAccountWithExternalIdentity{TCloudIdentity,TService}(string,Beamable.Player.AsyncChallengeHandler,bool)"/>
|
|
1508
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1509
|
-
string token,
|
|
1510
|
-
ChallengeHandler challengeHandler,
|
|
1511
|
-
bool attemptToMergeExistingAccount = true)
|
|
1512
|
-
where TCloudIdentity : IFederationId, new()
|
|
1513
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
1514
|
-
RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1515
|
-
token, challenge => Promise<string>.Successful(challengeHandler(challenge)), attemptToMergeExistingAccount);
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
/// <summary>
|
|
1519
|
-
/// Find an existing account by an external identity link
|
|
1520
|
-
///
|
|
1521
|
-
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1522
|
-
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1523
|
-
/// for the given <see cref="TCloudIdentity"/>, <see cref="TService"/> and <see cref="token"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1524
|
-
///
|
|
1525
|
-
/// </summary>
|
|
1526
|
-
/// <param name="token">
|
|
1527
|
-
/// A unique token for the player from the external third party
|
|
1528
|
-
/// </param>
|
|
1529
|
-
/// <param name="challengeHandler">
|
|
1530
|
-
/// The server may request the client to meet a challenge. The <see cref="ChallengeHandler"/> will be given
|
|
1531
|
-
/// the challenge string from the server, and it must solve the challenge and return the solution. The solution
|
|
1532
|
-
/// will be given back to the server to validate identity.
|
|
1533
|
-
/// <para>
|
|
1534
|
-
/// If the <see cref="ChallengeHandler"/> is not idempotent, please set the <see cref="attemptToMergeExistingAccount"/> field to false.
|
|
1535
|
-
/// </para>
|
|
1536
|
-
/// </param>
|
|
1537
|
-
/// <param name="attemptToMergeExistingAccount">
|
|
1538
|
-
/// Defaults to true.
|
|
1539
|
-
/// <para>
|
|
1540
|
-
/// There may already be an account (on the CID) that has requested external identity associated with the account.
|
|
1541
|
-
/// When there is an existing account, two outcomes are possible for this Recover method, either,
|
|
1542
|
-
/// <list type="bullet">
|
|
1543
|
-
/// <item> The current playerId can reference the existing account, or </item>
|
|
1544
|
-
/// <item> A new playerId will be created that references the existing account </item>
|
|
1545
|
-
/// </list>
|
|
1546
|
-
/// By default, the first option is attempted. However, this approach requires two invocations of the <see cref="ChallengeHandler"/> ,
|
|
1547
|
-
/// and if it is not idempotent, that will cause an error. Therefor, <b> if the <see cref="ChallengeHandler"/> is not idempotent, please set this field to false.</b>
|
|
1548
|
-
/// </para>
|
|
1549
|
-
/// </param>
|
|
1550
|
-
/// <param name="attemptToMergeExistingAccount">
|
|
1551
|
-
/// Defaults to true.
|
|
1552
|
-
/// <para>
|
|
1553
|
-
/// There may already be an account (on the CID) that has requested external identity associated with the account.
|
|
1554
|
-
/// When there is an existing account, two outcomes are possible for this Recover method, either,
|
|
1555
|
-
/// <list type="bullet">
|
|
1556
|
-
/// <item> The current playerId can reference the existing account, or </item>
|
|
1557
|
-
/// <item> A new playerId will be created that references the existing account </item>
|
|
1558
|
-
/// </list>
|
|
1559
|
-
/// By default, the first option is attempted. However, this approach requires two invocations of the <see cref="ChallengeHandler"/> ,
|
|
1560
|
-
/// and if it is not idempotent, that will cause an error. Therefor, <b> if the <see cref="ChallengeHandler"/> is not idempotent, please set this field to false.</b>
|
|
1561
|
-
/// </para>
|
|
1562
|
-
/// </param>
|
|
1563
|
-
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1564
|
-
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1565
|
-
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1566
|
-
public Promise<PlayerRecoveryOperation> RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1567
|
-
string token,
|
|
1568
|
-
AsyncChallengeHandler challengeHandler = null,
|
|
1569
|
-
bool attemptToMergeExistingAccount = true)
|
|
1570
|
-
where TCloudIdentity : IFederationId, new()
|
|
1571
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1572
|
-
{
|
|
1573
|
-
|
|
1574
|
-
return RecoverAccount(
|
|
1575
|
-
attemptAccountMerge: attemptToMergeExistingAccount,
|
|
1576
|
-
loginFunction: async (auth, merge) =>
|
|
1577
|
-
{
|
|
1578
|
-
var client = _provider.GetService<TService>();
|
|
1579
|
-
var ident = new TCloudIdentity();
|
|
1580
|
-
|
|
1581
|
-
async Promise<TokenResponse> HandleResponse(ExternalLoginResponse res)
|
|
1582
|
-
{
|
|
1583
|
-
if (res.tokenResponse.HasValue)
|
|
1584
|
-
{
|
|
1585
|
-
return res.tokenResponse.Value;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
var challenge = res.challenge.Value;
|
|
1589
|
-
if (challengeHandler == null)
|
|
1590
|
-
{
|
|
1591
|
-
throw new PlayerRecoveryException(PlayerRecoveryError.INSUFFICIENT_DATA,
|
|
1592
|
-
"A challenge was requested, but no challenge handler was provided.");
|
|
1593
|
-
}
|
|
1594
|
-
var solution = await challengeHandler?.Invoke(challenge.challenge);
|
|
1595
|
-
var nextRes = await auth.LoginExternalIdentity(token, client.ServiceName, ident.GetUniqueName(), new ChallengeSolution
|
|
1596
|
-
{
|
|
1597
|
-
challenge_token = challenge.challenge,
|
|
1598
|
-
solution = solution
|
|
1599
|
-
}, mergeGamerTagToAccount: merge);
|
|
1600
|
-
return await HandleResponse(nextRes);
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
var loginRes = await auth.LoginExternalIdentity(token, client.ServiceName, ident.GetUniqueName(), mergeGamerTagToAccount: merge);
|
|
1604
|
-
return await HandleResponse(loginRes);
|
|
1605
|
-
});
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
/// <inheritdoc cref="AddExternalIdentity{TCloudIdentity,TService}(string,Beamable.Player.AsyncChallengeHandler,Beamable.Player.PlayerAccount)"/>
|
|
1609
|
-
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(
|
|
1610
|
-
string token,
|
|
1611
|
-
ChallengeHandler challengeHandler,
|
|
1612
|
-
PlayerAccount account = null)
|
|
1613
|
-
where TCloudIdentity : IFederationId, new()
|
|
1614
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
1615
|
-
AddExternalIdentity<TCloudIdentity, TService>(
|
|
1616
|
-
token, challenge => Promise<string>.Successful(challengeHandler(challenge)), account);
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
/// <summary>
|
|
1620
|
-
/// Adds the external identity credential to the given <see cref="PlayerAccount"/>,
|
|
1621
|
-
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1622
|
-
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1623
|
-
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1624
|
-
///
|
|
1625
|
-
/// </summary>
|
|
1626
|
-
/// <param name="token">
|
|
1627
|
-
/// A unique player specific token from the external third party.
|
|
1628
|
-
/// </param>
|
|
1629
|
-
/// <param name="challengeHandler">
|
|
1630
|
-
/// The server may request the client to meet a challenge. The <see cref="ChallengeHandler"/> will be given
|
|
1631
|
-
/// the challenge string from the server, and it must solve the challenge and return the solution. The solution
|
|
1632
|
-
/// will be given back to the server to validate identity.
|
|
1633
|
-
/// </param>
|
|
1634
|
-
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1635
|
-
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1636
|
-
/// <param name="account"></param>
|
|
1637
|
-
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1638
|
-
public async Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, AsyncChallengeHandler challengeHandler = null, PlayerAccount account = null)
|
|
1639
|
-
where TCloudIdentity : IFederationId, new()
|
|
1640
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1641
|
-
{
|
|
1642
|
-
await OnReady;
|
|
1643
|
-
|
|
1644
|
-
if (account == null)
|
|
1645
|
-
{
|
|
1646
|
-
account = Current;
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
var res = new RegistrationResult { account = account };
|
|
1650
|
-
var service = GetAuthServiceForAccount(account);
|
|
1651
|
-
|
|
1652
|
-
var client = _provider.GetService<TService>();
|
|
1653
|
-
var ident = new TCloudIdentity();
|
|
1654
|
-
|
|
1655
|
-
async Promise<RegistrationResult> HandleResponse(AttachExternalIdentityResponse response)
|
|
1656
|
-
{
|
|
1657
|
-
switch (response.result)
|
|
1658
|
-
{
|
|
1659
|
-
case "challenge":
|
|
1660
|
-
if (challengeHandler == null)
|
|
1661
|
-
{
|
|
1662
|
-
res.error = PlayerRegistrationError.MISSING_FEDERATED_CHALLENGE_HANDLER;
|
|
1663
|
-
return res;
|
|
1664
|
-
}
|
|
1665
|
-
var solution = await challengeHandler.Invoke(response.challenge_token);
|
|
1666
|
-
AttachExternalIdentityResponse solutionResponse;
|
|
1667
|
-
try
|
|
1668
|
-
{
|
|
1669
|
-
solutionResponse = await service.AttachIdentity(
|
|
1670
|
-
token, client.ServiceName, ident.GetUniqueName(),
|
|
1671
|
-
new ChallengeSolution
|
|
1672
|
-
{
|
|
1673
|
-
challenge_token = response.challenge_token, solution = solution
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
catch(PlatformRequesterException e)
|
|
1677
|
-
{
|
|
1678
|
-
res.innerException = e;
|
|
1679
|
-
res.error = PlayerErrorFromPlatformError(e.Error, PlayerRegistrationError.FAILED_FEDERATED_AUTHORIZATION);
|
|
1680
|
-
return res;
|
|
1681
|
-
}
|
|
1682
|
-
return await HandleResponse(solutionResponse);
|
|
1683
|
-
case "ok":
|
|
1684
|
-
var user = await service.GetUser();
|
|
1685
|
-
account.Update(user);
|
|
1686
|
-
account.TryTriggerUpdate();
|
|
1687
|
-
return res;
|
|
1688
|
-
default:
|
|
1689
|
-
res.error = PlayerRegistrationError.OTHER_ERROR;
|
|
1690
|
-
return res;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
bool externalIdentityAvailable = await service.IsExternalIdentityAvailable(client.ServiceName, account._user.id.ToString(), ident.GetUniqueName());
|
|
1695
|
-
|
|
1696
|
-
if (!externalIdentityAvailable)
|
|
1697
|
-
{
|
|
1698
|
-
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1699
|
-
return res;
|
|
1700
|
-
}
|
|
1701
|
-
try
|
|
1702
|
-
{
|
|
1703
|
-
var authorizeRes = await service.AttachIdentity(token, client.ServiceName, ident.GetUniqueName());
|
|
1704
|
-
var result = await HandleResponse(authorizeRes);
|
|
1705
|
-
await Refresh();
|
|
1706
|
-
return result;
|
|
1707
|
-
}
|
|
1708
|
-
catch (PlatformRequesterException ex)
|
|
1709
|
-
{
|
|
1710
|
-
res.innerException = ex;
|
|
1711
|
-
res.error = PlayerErrorFromPlatformError(ex.Error);
|
|
1712
|
-
return res;
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
/// <summary>
|
|
1717
|
-
/// Removes the external identity from the given account.
|
|
1718
|
-
/// </summary>
|
|
1719
|
-
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1720
|
-
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1721
|
-
/// <param name="account"></param>
|
|
1722
|
-
public async Promise<PlayerAccount> RemoveExternalIdentity<TCloudIdentity, TService>(PlayerAccount account = null)
|
|
1723
|
-
where TCloudIdentity : IFederationId, new()
|
|
1724
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1725
|
-
{
|
|
1726
|
-
await OnReady;
|
|
1727
|
-
|
|
1728
|
-
if (account == null)
|
|
1729
|
-
{
|
|
1730
|
-
account = Current;
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
var authService = GetAuthServiceForAccount(account);
|
|
1734
|
-
var providerService = _provider.GetService<TService>().ServiceName;
|
|
1735
|
-
var providerNamespace = new TCloudIdentity().GetUniqueName();
|
|
1736
|
-
|
|
1737
|
-
if (!account.TryGetExternalIdentity<TCloudIdentity, TService>(out var identity))
|
|
1738
|
-
{
|
|
1739
|
-
return account;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
await authService.DetachIdentity(providerService, identity.userId, providerNamespace);
|
|
1743
|
-
var user = await authService.GetUser();
|
|
1744
|
-
account.Update(user);
|
|
1745
|
-
account.TryTriggerUpdate();
|
|
1746
|
-
|
|
1747
|
-
return account;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
public async Promise<bool> IsExternalIdentityAvailable<TCloudIdentity, TService>(string token, PlayerAccount account = null)
|
|
1751
|
-
where TCloudIdentity : IFederationId, new()
|
|
1752
|
-
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1753
|
-
{
|
|
1754
|
-
await OnReady;
|
|
1755
|
-
|
|
1756
|
-
if (account == null)
|
|
1757
|
-
{
|
|
1758
|
-
account = Current;
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
var authService = GetAuthServiceForAccount(account);
|
|
1762
|
-
var providerService = _provider.GetService<TService>().ServiceName;
|
|
1763
|
-
var providerNamespace = new TCloudIdentity().GetUniqueName();
|
|
1764
|
-
|
|
1765
|
-
return await authService.IsExternalIdentityAvailable(providerService, token, providerNamespace);
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
/// <summary>
|
|
1769
|
-
/// Adds the third party credential to the given <see cref="PlayerAccount"/>,
|
|
1770
|
-
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1771
|
-
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1772
|
-
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1773
|
-
///
|
|
1774
|
-
/// If the third party token has already been added to a different <see cref="PlayerAccount"/>,
|
|
1775
|
-
/// then the the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1776
|
-
///
|
|
1777
|
-
/// To get the token, follow the available <a href="https://help.beamable.com/Unity-4.0/unity/user-reference/beamable-services/identity/identity/">documentation </a>
|
|
1778
|
-
/// </summary>
|
|
1779
|
-
/// <param name="thirdParty">
|
|
1780
|
-
/// Which <see cref="AuthThirdParty"/> is being added to the <see cref="PlayerAccount"/>
|
|
1781
|
-
/// </param>
|
|
1782
|
-
/// <param name="token">
|
|
1783
|
-
/// The special token issued from the third party itself. This token's format and origin differ
|
|
1784
|
-
/// depending on which third party is being used.
|
|
1785
|
-
/// </param>
|
|
1786
|
-
/// <param name="account"></param>
|
|
1787
|
-
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1788
|
-
public async Promise<RegistrationResult> AddThirdParty(AuthThirdParty thirdParty, string token, PlayerAccount account = null)
|
|
1789
|
-
{
|
|
1790
|
-
await OnReady;
|
|
1791
|
-
|
|
1792
|
-
if (account == null)
|
|
1793
|
-
{
|
|
1794
|
-
account = Current;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
var res = new RegistrationResult { account = account };
|
|
1798
|
-
var service = GetAuthServiceForAccount(account);
|
|
1799
|
-
|
|
1800
|
-
if (account.HasThirdParty(thirdParty))
|
|
1801
|
-
{
|
|
1802
|
-
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1803
|
-
return res;
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
try
|
|
1807
|
-
{
|
|
1808
|
-
var user = await service.RegisterThirdPartyCredentials(thirdParty, token);
|
|
1809
|
-
account.Update(user);
|
|
1810
|
-
account.TryTriggerUpdate();
|
|
1811
|
-
}
|
|
1812
|
-
catch (PlatformRequesterException e)
|
|
1813
|
-
{
|
|
1814
|
-
res.innerException = e;
|
|
1815
|
-
res.error = PlayerErrorFromPlatformError(e.Error);
|
|
1816
|
-
return res;
|
|
1817
|
-
}
|
|
1818
|
-
await Refresh();
|
|
1819
|
-
return res;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
/// <summary>
|
|
1823
|
-
/// Checks if the given third party token is available for usage.
|
|
1824
|
-
/// </summary>
|
|
1825
|
-
/// <returns>True when the token is available, false if taken.</returns>
|
|
1826
|
-
public async Promise<bool> IsThirdPartyAvailable(AuthThirdParty thirdParty, string token)
|
|
1827
|
-
{
|
|
1828
|
-
await OnReady;
|
|
1829
|
-
var status = await _authService.GetCredentialStatus(thirdParty, token);
|
|
1830
|
-
return status == CredentialUsageStatus.NEVER_USED;
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
/// <summary>
|
|
1834
|
-
/// Checks the status of a given third party token.
|
|
1835
|
-
/// </summary>
|
|
1836
|
-
/// <returns>Returns an enum with the correct status for that third party token</returns>
|
|
1837
|
-
public Promise<CredentialUsageStatus> GetCredentialStatus(AuthThirdParty thirdParty, string token)
|
|
1838
|
-
{
|
|
1839
|
-
return _authService.GetCredentialStatus(thirdParty, token);
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
/// <summary>
|
|
1843
|
-
/// Adds an email credential to the given <see cref="PlayerAccount"/>,
|
|
1844
|
-
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1845
|
-
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1846
|
-
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1847
|
-
/// </summary>
|
|
1848
|
-
/// <param name="email">
|
|
1849
|
-
/// The email to add to the account.
|
|
1850
|
-
/// This email must be unique for the CID.
|
|
1851
|
-
/// If the email is already taken, the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1852
|
-
/// </param>
|
|
1853
|
-
/// <param name="password">
|
|
1854
|
-
/// The password to combine with the email address.
|
|
1855
|
-
/// </param>
|
|
1856
|
-
/// <param name="account"></param>
|
|
1857
|
-
/// <returns>A <see cref="RegistrationResult"/> representing the result of the email addition. </returns>
|
|
1858
|
-
public async Promise<RegistrationResult> AddEmail(string email, string password, PlayerAccount account = null)
|
|
1859
|
-
{
|
|
1860
|
-
await OnReady;
|
|
1861
|
-
|
|
1862
|
-
if (account == null)
|
|
1863
|
-
{
|
|
1864
|
-
account = Current;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
var res = new RegistrationResult { account = account };
|
|
1868
|
-
if (account.HasEmail)
|
|
1869
|
-
{
|
|
1870
|
-
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1871
|
-
return res;
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
var service = GetAuthServiceForAccount(account);
|
|
1875
|
-
try
|
|
1876
|
-
{
|
|
1877
|
-
var user = await service.RegisterDBCredentials(email, password);
|
|
1878
|
-
account.Update(user);
|
|
1879
|
-
account.TryTriggerUpdate();
|
|
1880
|
-
}
|
|
1881
|
-
catch (PlatformRequesterException ex)
|
|
1882
|
-
{
|
|
1883
|
-
res.innerException = ex;
|
|
1884
|
-
res.error = PlayerErrorFromPlatformError(ex.Error);
|
|
1885
|
-
return res;
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
await Refresh();
|
|
1889
|
-
|
|
1890
|
-
return res;
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
/// <summary>
|
|
1894
|
-
/// Checks if the provided email is already attached to a player account.
|
|
1895
|
-
/// </summary>
|
|
1896
|
-
/// <returns>True when email is free to be used, false when it's already taken.</returns>
|
|
1897
|
-
public async Promise<bool> IsEmailAvailable(string email)
|
|
1898
|
-
{
|
|
1899
|
-
await OnReady;
|
|
1900
|
-
CredentialUsageStatus status = await _authService.GetCredentialStatus(email);
|
|
1901
|
-
return status == CredentialUsageStatus.NEVER_USED;
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
/// <summary>
|
|
1905
|
-
/// Checks the status of the provided email. If it's attached to an account already then this will return ASSIGNED_TO_AN_ACCOUNT.
|
|
1906
|
-
/// If it's available, it will return NEVER_USED. And finally it will return INVALID_CREDENTIAL in case of a fail in the process.
|
|
1907
|
-
/// </summary>
|
|
1908
|
-
/// <param name="email"></param>
|
|
1909
|
-
/// <returns>The status of this email in the credentials</returns>
|
|
1910
|
-
public Promise<CredentialUsageStatus> GetCredentialStatus(string email)
|
|
1911
|
-
{
|
|
1912
|
-
return _authService.GetCredentialStatus(email);
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
/// <summary>
|
|
1916
|
-
/// Removes the given <see cref="PlayerAccount"/> from the device's memory.
|
|
1917
|
-
/// After the account is removed, the access token will be lost. The player
|
|
1918
|
-
/// will not be able to switch to this account until they initiate an account
|
|
1919
|
-
/// recovery option.
|
|
1920
|
-
///
|
|
1921
|
-
/// If the given account is the currently active account, then nothing will happen.
|
|
1922
|
-
/// It is impossible to remove the current account.
|
|
1923
|
-
///
|
|
1924
|
-
/// </summary>
|
|
1925
|
-
/// <param name="account"></param>
|
|
1926
|
-
public async Promise RemoveAccount(PlayerAccount account)
|
|
1927
|
-
{
|
|
1928
|
-
await OnReady;
|
|
1929
|
-
|
|
1930
|
-
if (account == null || account.GamerTag == Current.GamerTag) return;
|
|
1931
|
-
|
|
1932
|
-
_storage.RemoveDeviceRefreshToken(_ctx.Cid, _ctx.Pid, account.token);
|
|
1933
|
-
await Refresh();
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
/// <summary>
|
|
1937
|
-
/// Removes all accounts from the device's memory.
|
|
1938
|
-
/// After each account is removed, the access token will be lost. The player
|
|
1939
|
-
/// will not be able to switch to this account until they initiate an account
|
|
1940
|
-
/// recovery option.
|
|
1941
|
-
///
|
|
1942
|
-
/// The currently active account will still be available on the device.
|
|
1943
|
-
/// </summary>
|
|
1944
|
-
public async Promise RemoveAllAccounts()
|
|
1945
|
-
{
|
|
1946
|
-
await OnReady;
|
|
1947
|
-
|
|
1948
|
-
// this won't clear the current user, just the other stored ones.
|
|
1949
|
-
_storage.ClearDeviceRefreshTokens(_ctx.Cid, _ctx.Pid);
|
|
1950
|
-
await Refresh();
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
/// <summary>
|
|
1954
|
-
/// Set the given <see cref="PlayerAccount"/>'s language preference.
|
|
1955
|
-
/// </summary>
|
|
1956
|
-
/// <param name="language">A <see cref="SystemLanguage"/></param>
|
|
1957
|
-
/// <param name="account"></param>
|
|
1958
|
-
/// <returns></returns>
|
|
1959
|
-
public async Promise<PlayerAccount> SetLanguage(SystemLanguage language, PlayerAccount account = null)
|
|
1960
|
-
{
|
|
1961
|
-
await OnReady;
|
|
1962
|
-
|
|
1963
|
-
if (account == null)
|
|
1964
|
-
{
|
|
1965
|
-
account = Current;
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
var service = GetAuthServiceForAccount(account);
|
|
1969
|
-
var user = await service.SetLanguage(language);
|
|
1970
|
-
account.Update(user);
|
|
1971
|
-
account.TryTriggerUpdate();
|
|
1972
|
-
return account;
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1975
|
-
private IDependencyProvider GetScopeForAccount(PlayerAccount account)
|
|
1976
|
-
{
|
|
1977
|
-
if (account.GamerTag == Current.GamerTag) return _provider;
|
|
1978
|
-
var requester = _requester.WithAccessToken(account.token);
|
|
1979
|
-
return _provider.Fork(builder =>
|
|
1980
|
-
{
|
|
1981
|
-
builder
|
|
1982
|
-
.AddScoped(requester)
|
|
1983
|
-
.Remove<StatsService>()
|
|
1984
|
-
.AddScoped<StatsService>(provider =>
|
|
1985
|
-
new StatsService(
|
|
1986
|
-
account,
|
|
1987
|
-
requester,
|
|
1988
|
-
provider,
|
|
1989
|
-
UnityUserDataCache<Dictionary<string, string>>
|
|
1990
|
-
.CreateInstance,
|
|
1991
|
-
provider.GetService<OfflineCache>()));
|
|
1992
|
-
;
|
|
1993
|
-
});
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
private IAuthService GetAuthServiceForAccount(PlayerAccount account)
|
|
1997
|
-
{
|
|
1998
|
-
var subScope = GetScopeForAccount(account);
|
|
1999
|
-
return subScope.GetService<IAuthService>();
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
private IStatsApi GetStatsServiceForAccount(PlayerAccount account)
|
|
2003
|
-
{
|
|
2004
|
-
var subScope = GetScopeForAccount(account);
|
|
2005
|
-
return subScope.GetService<IStatsApi>();
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
private Promise<UserExtensions.StatCollection> GetStatsForUser(User user)
|
|
2009
|
-
{
|
|
2010
|
-
return user.GetStats(
|
|
2011
|
-
AccountManagementConfiguration.Instance.DisplayNameStat,
|
|
2012
|
-
AccountManagementConfiguration.Instance.SubtextStat,
|
|
2013
|
-
AccountManagementConfiguration.Instance.AvatarStat);
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
protected override async Promise PerformRefresh()
|
|
2017
|
-
{
|
|
2018
|
-
await _ctx.OnReady;
|
|
2019
|
-
|
|
2020
|
-
var next = new List<PlayerAccount>(Count);
|
|
2021
|
-
var gamerTagToAccount = new Dictionary<long, PlayerAccount>();
|
|
2022
|
-
foreach (var account in this)
|
|
2023
|
-
{
|
|
2024
|
-
gamerTagToAccount[account.GamerTag] = account;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
var seen = new HashSet<long>();
|
|
2028
|
-
|
|
2029
|
-
var deviceTokens = _storage.RetrieveDeviceRefreshTokens(_ctx.Cid, _ctx.Pid);
|
|
2030
|
-
var currToken = _storage.LoadTokenForRealmImmediate(_ctx.Cid, _ctx.Pid);
|
|
2031
|
-
var tokens = new TokenResponse[deviceTokens.Length + 1];
|
|
2032
|
-
for (var i = 0; i < deviceTokens.Length; i++)
|
|
2033
|
-
{
|
|
2034
|
-
tokens[i] = deviceTokens[i];
|
|
2035
|
-
}
|
|
2036
|
-
tokens[deviceTokens.Length] = new TokenResponse { access_token = currToken.Token, refresh_token = currToken.RefreshToken, };
|
|
2037
|
-
|
|
2038
|
-
var userPromises = new Promise<User>[tokens.Length];
|
|
2039
|
-
var statPromises = new Promise<UserExtensions.StatCollection>[tokens.Length];
|
|
2040
|
-
for (var i = 0; i < userPromises.Length; i++)
|
|
2041
|
-
{
|
|
2042
|
-
userPromises[i] = _authService.GetUser(tokens[i]);
|
|
2043
|
-
statPromises[i] = userPromises[i].FlatMap(GetStatsForUser);
|
|
2044
|
-
}
|
|
2045
|
-
var users = await Promise.Sequence(userPromises);
|
|
2046
|
-
var stats = await Promise.Sequence(statPromises);
|
|
2047
|
-
|
|
2048
|
-
for (var i = 0; i < userPromises.Length; i++)
|
|
2049
|
-
{
|
|
2050
|
-
var user = users[i];
|
|
2051
|
-
if (seen.Contains(user.id)) continue;
|
|
2052
|
-
seen.Add(user.id);
|
|
2053
|
-
|
|
2054
|
-
var statValues = stats[i];
|
|
2055
|
-
var token = tokens[i];
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
if (gamerTagToAccount.TryGetValue(user.id, out var existing))
|
|
2060
|
-
{
|
|
2061
|
-
existing.Update(statValues);
|
|
2062
|
-
existing.Update(user);
|
|
2063
|
-
existing.Update(token);
|
|
2064
|
-
existing.TryTriggerUpdate();
|
|
2065
|
-
next.Add(existing);
|
|
2066
|
-
}
|
|
2067
|
-
else
|
|
2068
|
-
{
|
|
2069
|
-
var newAccount = new PlayerAccount(this, token, user, statValues);
|
|
2070
|
-
gamerTagToAccount.Add(user.id, newAccount);
|
|
2071
|
-
next.Add(newAccount);
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
foreach (var account in next)
|
|
2076
|
-
{
|
|
2077
|
-
if (account.GamerTag != _ctx.PlayerId) continue;
|
|
2078
|
-
|
|
2079
|
-
if (Current == null)
|
|
2080
|
-
{
|
|
2081
|
-
// must clone the instance, otherwise, later when account switches will happen, references will point to old objects
|
|
2082
|
-
var tokenClone = JsonUtility.FromJson<BeamableToken>(JsonUtility.ToJson(account.token));
|
|
2083
|
-
var userClone = JsonUtility.FromJson<User>(JsonUtility.ToJson(account._user));
|
|
2084
|
-
UserExtensions.StatCollection statClone = new UserExtensions.StatCollection();
|
|
2085
|
-
foreach (var kvp in account._stats)
|
|
2086
|
-
{
|
|
2087
|
-
statClone[kvp.Key] = kvp.Value;
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
Current = new PlayerAccount(this, tokenClone, userClone, statClone);
|
|
2091
|
-
}
|
|
2092
|
-
else
|
|
2093
|
-
{
|
|
2094
|
-
Current.Update(account);
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
break;
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
SetData(next);
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
/// <summary>
|
|
2105
|
-
/// Converts a platform error to a player registration error.
|
|
2106
|
-
/// </summary>
|
|
2107
|
-
/// <param name="e">The platform error.</param>
|
|
2108
|
-
/// <param name="defaultError">The default error to return if no specific error is found.</param>
|
|
2109
|
-
/// <returns>The player registration error.</returns>
|
|
2110
|
-
private static PlayerRegistrationError PlayerErrorFromPlatformError(PlatformError e, PlayerRegistrationError defaultError = PlayerRegistrationError.OTHER_ERROR)
|
|
2111
|
-
{
|
|
2112
|
-
if (e.status == 400 && (e.error.Equals("EmailAlreadyRegisteredError") ||
|
|
2113
|
-
e.error.Equals("ThirdPartyAssociationAlreadyInUseError") ||
|
|
2114
|
-
e.error.Equals("DeviceAlreadyInUseError")) ||
|
|
2115
|
-
e.error.Equals("ExternalIdentityUnavailable"))
|
|
2116
|
-
{
|
|
2117
|
-
return PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN;
|
|
2118
|
-
}
|
|
2119
|
-
if (e.error.Equals("DuplicateThirdPartyAssociationError"))
|
|
2120
|
-
{
|
|
2121
|
-
return PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
if (e.error.Equals("InvalidClientSecretFile"))
|
|
2125
|
-
{
|
|
2126
|
-
return PlayerRegistrationError.INVALID_REALM_CONFIGURATION;
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2129
|
-
return defaultError;
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
1
|
+
using Beamable.AccountManagement;
|
|
2
|
+
using Beamable.Api;
|
|
3
|
+
using Beamable.Api.Auth;
|
|
4
|
+
using Beamable.Api.Caches;
|
|
5
|
+
using Beamable.Api.Sessions;
|
|
6
|
+
using Beamable.Api.Stats;
|
|
7
|
+
using Beamable.Common;
|
|
8
|
+
using Beamable.Common.Api;
|
|
9
|
+
using Beamable.Common.Api.Auth;
|
|
10
|
+
using Beamable.Common.Api.Stats;
|
|
11
|
+
using Beamable.Common.Dependencies;
|
|
12
|
+
using Beamable.Common.Player;
|
|
13
|
+
using Beamable.Stats;
|
|
14
|
+
using System;
|
|
15
|
+
using System.Collections.Generic;
|
|
16
|
+
using System.Linq;
|
|
17
|
+
using UnityEngine;
|
|
18
|
+
|
|
19
|
+
namespace Beamable.Player
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// The <see cref="PlayerAccount"/> contains information about a player's
|
|
24
|
+
/// credentials and basic account details, such as their <see cref="_alias"/>,
|
|
25
|
+
/// <see cref="_email"/>, and <see cref="gamerTag"/>
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Serializable]
|
|
28
|
+
public class PlayerAccount : DefaultObservable, IUserContext
|
|
29
|
+
{
|
|
30
|
+
|
|
31
|
+
#region autogenerated equality checks
|
|
32
|
+
protected bool Equals(PlayerAccount other)
|
|
33
|
+
{
|
|
34
|
+
return _alias == other._alias && _avatar == other._avatar && _subtext == other._subtext && GamerTag == other.GamerTag && _language == other._language && Equals(_deviceIds, other._deviceIds) && Equals(_scopes, other._scopes) && _email == other._email && Equals(_thirdParties, other._thirdParties) && Equals(_externalIdentities, other._externalIdentities) && Equals(token, other.token);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public override bool Equals(object obj)
|
|
38
|
+
{
|
|
39
|
+
if (ReferenceEquals(null, obj))
|
|
40
|
+
{
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (ReferenceEquals(this, obj))
|
|
45
|
+
{
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (obj.GetType() != this.GetType())
|
|
50
|
+
{
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return Equals((PlayerAccount)obj);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public override int GetHashCode()
|
|
58
|
+
{
|
|
59
|
+
unchecked
|
|
60
|
+
{
|
|
61
|
+
var hashCode = (_alias != null ? _alias.GetHashCode() : 0);
|
|
62
|
+
hashCode = (hashCode * 397) ^ (_avatar != null ? _avatar.GetHashCode() : 0);
|
|
63
|
+
hashCode = (hashCode * 397) ^ (_subtext != null ? _subtext.GetHashCode() : 0);
|
|
64
|
+
hashCode = (hashCode * 397) ^ _gamerTag.GetHashCode();
|
|
65
|
+
hashCode = (hashCode * 397) ^ (int)_language;
|
|
66
|
+
hashCode = (hashCode * 397) ^ (_deviceIds != null ? _deviceIds.GetHashCode() : 0);
|
|
67
|
+
hashCode = (hashCode * 397) ^ (_scopes != null ? _scopes.GetHashCode() : 0);
|
|
68
|
+
hashCode = (hashCode * 397) ^ (_email != null ? _email.GetHashCode() : 0);
|
|
69
|
+
hashCode = (hashCode * 397) ^ (_thirdParties != null ? _thirdParties.GetHashCode() : 0);
|
|
70
|
+
hashCode = (hashCode * 397) ^ (_externalIdentities != null ? _externalIdentities.GetHashCode() : 0);
|
|
71
|
+
hashCode = (hashCode * 397) ^ (token != null ? token.GetHashCode() : 0);
|
|
72
|
+
return hashCode;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#endregion
|
|
77
|
+
|
|
78
|
+
private readonly PlayerAccounts _collection;
|
|
79
|
+
internal User _user;
|
|
80
|
+
internal UserExtensions.StatCollection _stats;
|
|
81
|
+
|
|
82
|
+
/// <summary>
|
|
83
|
+
/// The alias of the current account.
|
|
84
|
+
/// This can be used as a display name.
|
|
85
|
+
/// To change the alias, use <see cref="SetAlias"/>
|
|
86
|
+
/// </summary>
|
|
87
|
+
public string Alias => _alias;
|
|
88
|
+
[SerializeField]
|
|
89
|
+
private string _alias;
|
|
90
|
+
|
|
91
|
+
/// <summary>
|
|
92
|
+
/// The avatar used for this account.
|
|
93
|
+
/// See the <see cref="AvatarConfiguration"/> for more details.
|
|
94
|
+
/// To change the avatar, use <see cref="SetAvatar"/>
|
|
95
|
+
/// </summary>
|
|
96
|
+
public string Avatar => _avatar;
|
|
97
|
+
[SerializeField]
|
|
98
|
+
private string _avatar;
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
/// The subtext for the current player can be used to share a small amount
|
|
102
|
+
/// of account detail, like "level" or "progress".
|
|
103
|
+
/// To change the subtext, use <see cref="SetSubtext"/>
|
|
104
|
+
/// </summary>
|
|
105
|
+
public string SubText => _subtext;
|
|
106
|
+
[SerializeField]
|
|
107
|
+
private string _subtext;
|
|
108
|
+
|
|
109
|
+
/// <summary>
|
|
110
|
+
/// The player id for the given player.
|
|
111
|
+
/// Player ids are associated with a specific realm.
|
|
112
|
+
/// This value should not be modified.
|
|
113
|
+
/// </summary>
|
|
114
|
+
public long GamerTag => _gamerTag;
|
|
115
|
+
[SerializeField]
|
|
116
|
+
private long _gamerTag;
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// The player's language preference
|
|
120
|
+
/// To change the language, use <see cref="SetLanguage"/>
|
|
121
|
+
/// </summary>
|
|
122
|
+
public SystemLanguage Language => _language;
|
|
123
|
+
[SerializeField]
|
|
124
|
+
private SystemLanguage _language;
|
|
125
|
+
|
|
126
|
+
/// <summary>
|
|
127
|
+
/// The set of deviceIds that have been associated with the given player.
|
|
128
|
+
/// A player could have more than one deviceId if they played on multiple devices.
|
|
129
|
+
/// Use the <see cref="HasDeviceId"/> to check if a deviceId is present.
|
|
130
|
+
/// To add a deviceId, use the <see cref="AddDeviceId"/> method.
|
|
131
|
+
/// To remove a deviceId, use the <see cref="RemoveDeviceId"/> method, and to remove all, use the <see cref="RemoveAllDeviceIds"/> method.
|
|
132
|
+
/// </summary>
|
|
133
|
+
public string[] DeviceIds => _deviceIds;
|
|
134
|
+
[SerializeField]
|
|
135
|
+
private string[] _deviceIds;
|
|
136
|
+
|
|
137
|
+
/// <summary>
|
|
138
|
+
/// The player's permission scopes. For most players, this will always be empty.
|
|
139
|
+
/// However, for testers, developers, and admins, this will hold the permission.
|
|
140
|
+
/// </summary>
|
|
141
|
+
public string[] Scopes => _scopes;
|
|
142
|
+
[SerializeField]
|
|
143
|
+
private string[] _scopes;
|
|
144
|
+
|
|
145
|
+
/// <summary>
|
|
146
|
+
/// The email address associated with this account.
|
|
147
|
+
/// Add an email with the <see cref="AddEmail"/> method.
|
|
148
|
+
/// </summary>
|
|
149
|
+
public string Email => _email;
|
|
150
|
+
[SerializeField]
|
|
151
|
+
private string _email;
|
|
152
|
+
|
|
153
|
+
/// <summary>
|
|
154
|
+
/// The set of standard Beamable third parties that have been associated with the given player.
|
|
155
|
+
/// Add a third party with the <see cref="AddThirdParty"/> method.
|
|
156
|
+
/// </summary>
|
|
157
|
+
public AuthThirdParty[] ThirdParties => _thirdParties;
|
|
158
|
+
private AuthThirdParty[] _thirdParties;
|
|
159
|
+
|
|
160
|
+
/// <summary>
|
|
161
|
+
/// The set of external identities that have been associated with the given player.
|
|
162
|
+
/// Add an external identity with the <see cref="AddExternalIdentity"/> method.
|
|
163
|
+
/// </summary>
|
|
164
|
+
public ExternalIdentity[] ExternalIdentities => _externalIdentities;
|
|
165
|
+
[SerializeField]
|
|
166
|
+
private ExternalIdentity[] _externalIdentities;
|
|
167
|
+
|
|
168
|
+
/// <summary>
|
|
169
|
+
/// True when the account has an <see cref="_email"/>.
|
|
170
|
+
/// </summary>
|
|
171
|
+
public bool HasEmail => !string.IsNullOrEmpty(_email);
|
|
172
|
+
|
|
173
|
+
/// <summary>
|
|
174
|
+
/// True when the account has the given <see cref="AuthThirdParty"/>
|
|
175
|
+
/// </summary>
|
|
176
|
+
/// <param name="thirdParty"></param>
|
|
177
|
+
/// <returns></returns>
|
|
178
|
+
public bool HasThirdParty(AuthThirdParty thirdParty) => _thirdParties?.Contains(thirdParty) ?? false;
|
|
179
|
+
|
|
180
|
+
/// <summary>
|
|
181
|
+
/// True when there is at least 1 deviceId.
|
|
182
|
+
/// </summary>
|
|
183
|
+
public bool HasDeviceId => _deviceIds?.Length > 0;
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/// <summary>
|
|
187
|
+
/// Given a combo of Microservice and Third Party Cloud Identity, this method will
|
|
188
|
+
/// return true if the user has a credential associated with the provider.
|
|
189
|
+
/// </summary>
|
|
190
|
+
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
191
|
+
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
192
|
+
/// <returns>true if the user has an existing association with the <see cref="TCloudIdentity"/></returns>
|
|
193
|
+
public bool HasExternalIdentity<TCloudIdentity, TService>()
|
|
194
|
+
where TCloudIdentity : IFederationId, new()
|
|
195
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
196
|
+
TryGetExternalIdentity<TCloudIdentity, TService>(out _);
|
|
197
|
+
|
|
198
|
+
/// <summary>
|
|
199
|
+
/// Given a combo of Microservice and Third Party Cloud Identity, this method will
|
|
200
|
+
/// return true if the user has a credential associated with the provider. Additionally, the <see cref="ExternalIdentity"/>
|
|
201
|
+
/// is available as an out parameter
|
|
202
|
+
/// </summary>
|
|
203
|
+
/// <param name="identity"></param>
|
|
204
|
+
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
205
|
+
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
206
|
+
/// <returns>true if the user has an existing association with the <see cref="TCloudIdentity"/></returns>
|
|
207
|
+
public bool TryGetExternalIdentity<TCloudIdentity, TService>(out ExternalIdentity identity)
|
|
208
|
+
where TCloudIdentity : IFederationId, new()
|
|
209
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
210
|
+
{
|
|
211
|
+
var client = _collection._provider.GetService<TService>();
|
|
212
|
+
var ident = new TCloudIdentity();
|
|
213
|
+
identity = null;
|
|
214
|
+
for (var i = 0; i < _externalIdentities.Length; i++)
|
|
215
|
+
{
|
|
216
|
+
var external = _externalIdentities[i];
|
|
217
|
+
var namespaceMath = external.providerNamespace == ident.GetUniqueName();
|
|
218
|
+
var serviceMatch = external.providerService == client.ServiceName;
|
|
219
|
+
|
|
220
|
+
if (namespaceMath && serviceMatch)
|
|
221
|
+
{
|
|
222
|
+
identity = external;
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/// <summary>
|
|
231
|
+
/// The access token used for this account.
|
|
232
|
+
/// </summary>
|
|
233
|
+
public BeamableToken token;
|
|
234
|
+
|
|
235
|
+
public PlayerAccount(PlayerAccounts collection, BeamableToken token, User user, UserExtensions.StatCollection stats)
|
|
236
|
+
{
|
|
237
|
+
_collection = collection;
|
|
238
|
+
Update(user);
|
|
239
|
+
Update(stats);
|
|
240
|
+
this.token = token;
|
|
241
|
+
TryTriggerUpdate();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/// <inheritdoc cref="PlayerAccounts.SwitchToAccount"/>
|
|
245
|
+
public async Promise SwitchToAccount()
|
|
246
|
+
{
|
|
247
|
+
await _collection.SwitchToAccount(this);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/// <inheritdoc cref="PlayerAccounts.RemoveAccount"/>
|
|
251
|
+
public async Promise Remove()
|
|
252
|
+
{
|
|
253
|
+
await _collection.RemoveAccount(this);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/// <inheritdoc cref="PlayerAccounts.SetAlias"/>
|
|
257
|
+
public Promise<PlayerAccount> SetAlias(string alias)
|
|
258
|
+
{
|
|
259
|
+
return _collection.SetAlias(alias, this);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// <inheritdoc cref="PlayerAccounts.SetAvatar"/>
|
|
263
|
+
public Promise<PlayerAccount> SetAvatar(string avatar)
|
|
264
|
+
{
|
|
265
|
+
return _collection.SetAvatar(avatar, this);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/// <inheritdoc cref="PlayerAccounts.SetSubtext"/>
|
|
269
|
+
public Promise<PlayerAccount> SetSubtext(string subtext)
|
|
270
|
+
{
|
|
271
|
+
return _collection.SetSubtext(subtext, this);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/// <inheritdoc cref="PlayerAccounts.AddEmail"/>
|
|
275
|
+
public Promise<RegistrationResult> AddEmail(string email, string password)
|
|
276
|
+
{
|
|
277
|
+
return _collection.AddEmail(email, password, this);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/// <inheritdoc cref="PlayerAccounts.AddDeviceId"/>
|
|
281
|
+
public Promise<RegistrationResult> AddDeviceId()
|
|
282
|
+
{
|
|
283
|
+
return _collection.AddDeviceId(this);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/// <inheritdoc cref="PlayerAccounts.RemoveDeviceId"/>
|
|
287
|
+
public Promise<PlayerAccount> RemoveDeviceId()
|
|
288
|
+
{
|
|
289
|
+
return _collection.RemoveDeviceId(this);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/// <inheritdoc cref="PlayerAccounts.RemoveAllDeviceIds"/>
|
|
293
|
+
public Promise<PlayerAccount> RemoveAllDeviceIds()
|
|
294
|
+
{
|
|
295
|
+
return _collection.RemoveAllDeviceIds(this);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/// <inheritdoc cref="PlayerAccounts.AddThirdParty"/>
|
|
299
|
+
public Promise<RegistrationResult> AddThirdParty(AuthThirdParty thirdParty, string token)
|
|
300
|
+
{
|
|
301
|
+
return _collection.AddThirdParty(thirdParty, token, this);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/// <inheritdoc cref="PlayerAccounts.RemoveThirdParty"/>
|
|
305
|
+
public Promise<PlayerAccount> RemoveThirdParty(AuthThirdParty thirdParty, string token)
|
|
306
|
+
{
|
|
307
|
+
return _collection.RemoveThirdParty(thirdParty, token, this);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
/// <inheritdoc cref="PlayerAccounts.AddExternalIdentity"/>
|
|
312
|
+
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, ChallengeHandler challengeHandler)
|
|
313
|
+
where TCloudIdentity : IFederationId, new()
|
|
314
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
315
|
+
{
|
|
316
|
+
return _collection.AddExternalIdentity<TCloudIdentity, TService>(token, challengeHandler);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/// <inheritdoc cref="PlayerAccounts.AddExternalIdentity"/>
|
|
320
|
+
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, AsyncChallengeHandler challengeHandler = null)
|
|
321
|
+
where TCloudIdentity : IFederationId, new()
|
|
322
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
323
|
+
{
|
|
324
|
+
return _collection.AddExternalIdentity<TCloudIdentity, TService>(token, challengeHandler);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/// <inheritdoc cref="PlayerAccounts.RemoveExternalIdentity"/>
|
|
328
|
+
public Promise<PlayerAccount> RemoveExternalIdentity<TCloudIdentity, TService>()
|
|
329
|
+
where TCloudIdentity : IFederationId, new()
|
|
330
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
331
|
+
{
|
|
332
|
+
return _collection.RemoveExternalIdentity<TCloudIdentity, TService>();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
/// <inheritdoc cref="PlayerAccounts.ResetPassword"/>
|
|
337
|
+
public Promise<PasswordResetOperation> ResetPassword()
|
|
338
|
+
{
|
|
339
|
+
return _collection.ResetPassword(this);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/// <inheritdoc cref="PlayerAccounts.ConfirmPassword"/>
|
|
343
|
+
public async Promise<PasswordResetConfirmOperation> ConfirmPassword(string code, string newPassword)
|
|
344
|
+
{
|
|
345
|
+
return await _collection.ConfirmPassword(code, newPassword, this);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/// <inheritdoc cref="PlayerAccounts.SetLanguage"/>
|
|
349
|
+
public Promise<PlayerAccount> SetLanguage(SystemLanguage language)
|
|
350
|
+
{
|
|
351
|
+
return _collection.SetLanguage(language, this);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
/// <summary>
|
|
356
|
+
/// Update the stat values of this <see cref="PlayerAccount"/>.
|
|
357
|
+
/// This method is called automatically when using the
|
|
358
|
+
/// <see cref="SetAlias"/>, <see cref="SetSubtext"/>, or <see cref="SetAvatar"/> methods.
|
|
359
|
+
///
|
|
360
|
+
/// Generally, it is not recommended that you use this method directly. If stats are
|
|
361
|
+
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
362
|
+
/// </summary>
|
|
363
|
+
/// <param name="stats">The latest stat collection for the account</param>
|
|
364
|
+
public void Update(UserExtensions.StatCollection stats)
|
|
365
|
+
{
|
|
366
|
+
_stats = stats;
|
|
367
|
+
_alias = stats.Get(AccountManagementConfiguration.Instance.DisplayNameStat);
|
|
368
|
+
_avatar = stats.Get(AccountManagementConfiguration.Instance.AvatarStat);
|
|
369
|
+
_subtext = stats.Get(AccountManagementConfiguration.Instance.SubtextStat);
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
373
|
+
{
|
|
374
|
+
_collection?.Current?.Update(stats);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/// <summary>
|
|
379
|
+
/// Update all of values of this <see cref="PlayerAccount"/> to mirror the values of the given account.
|
|
380
|
+
/// Generally, it is not recommended that you use this method directly. If data is
|
|
381
|
+
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
382
|
+
/// </summary>
|
|
383
|
+
/// <param name="other">The account to mirror</param>
|
|
384
|
+
public void Update(PlayerAccount other)
|
|
385
|
+
{
|
|
386
|
+
Update(other._user);
|
|
387
|
+
Update(other._stats);
|
|
388
|
+
Update(other.token);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/// <summary>
|
|
392
|
+
/// Update all of the user related data of this <see cref="PlayerAccount"/> based on the given user.
|
|
393
|
+
/// Generally, it is not recommended that you use this method directly. If data is
|
|
394
|
+
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
395
|
+
/// </summary>
|
|
396
|
+
/// <param name="user">the latest user object</param>
|
|
397
|
+
public void Update(User user)
|
|
398
|
+
{
|
|
399
|
+
_user = user;
|
|
400
|
+
|
|
401
|
+
_email = _user?.email;
|
|
402
|
+
_deviceIds = user?.deviceIds?.ToArray() ?? new string[] { };
|
|
403
|
+
|
|
404
|
+
var thirdPartyStrings = user?.thirdPartyAppAssociations.ToArray();
|
|
405
|
+
_thirdParties = new AuthThirdParty[thirdPartyStrings?.Length ?? 0];
|
|
406
|
+
for (var i = 0; i < _thirdParties.Length; i++)
|
|
407
|
+
{
|
|
408
|
+
_thirdParties[i] = AuthThirdPartyMethods.GetAuthThirdParty(thirdPartyStrings[i]);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
_externalIdentities = new ExternalIdentity[user?.external?.Count ?? 0];
|
|
412
|
+
for (var i = 0; i < _externalIdentities.Length; i++)
|
|
413
|
+
{
|
|
414
|
+
_externalIdentities[i] = new ExternalIdentity
|
|
415
|
+
{
|
|
416
|
+
providerNamespace = user.external[i].providerNamespace,
|
|
417
|
+
providerService = user.external[i].providerService,
|
|
418
|
+
userId = user.external[i].userId,
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
_language = SessionServiceHelper.GetSystemLanguageFromIso639CountryCode(user?.language);
|
|
423
|
+
_scopes = user?.scopes?.ToArray() ?? new string[] { };
|
|
424
|
+
_gamerTag = _user?.id ?? 0;
|
|
425
|
+
|
|
426
|
+
try
|
|
427
|
+
{
|
|
428
|
+
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
429
|
+
{
|
|
430
|
+
// TODO: does the stat system still need to call the setter if this is true?
|
|
431
|
+
_collection?.Current?.Update(user);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
catch (NullReferenceException ex)
|
|
435
|
+
{
|
|
436
|
+
Debug.LogException(ex);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/// <summary>
|
|
441
|
+
/// Update the current account's token.
|
|
442
|
+
/// Generally, it is not recommended that you use this method directly. If data is
|
|
443
|
+
/// out of date, consider calling the <see cref="PlayerAccounts.Refresh"/> method.
|
|
444
|
+
/// </summary>
|
|
445
|
+
/// <param name="token"></param>
|
|
446
|
+
public void Update(BeamableToken token)
|
|
447
|
+
{
|
|
448
|
+
this.token.Update(token);
|
|
449
|
+
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
450
|
+
{
|
|
451
|
+
_collection.Current?.Update(token);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
public void TryTriggerUpdate()
|
|
456
|
+
{
|
|
457
|
+
TriggerUpdate();
|
|
458
|
+
if (_collection?.Current != this && _collection?.Current?._gamerTag == _gamerTag)
|
|
459
|
+
{
|
|
460
|
+
_collection?.Current?.TriggerUpdate();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
long IUserContext.UserId => _gamerTag;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
[Serializable]
|
|
468
|
+
public class BeamableToken
|
|
469
|
+
{
|
|
470
|
+
#region auto generated equality members
|
|
471
|
+
protected bool Equals(BeamableToken other)
|
|
472
|
+
{
|
|
473
|
+
return _accessToken == other._accessToken && _refreshToken == other._refreshToken && _expiresIn == other._expiresIn && _type == other._type;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
public override bool Equals(object obj)
|
|
477
|
+
{
|
|
478
|
+
if (ReferenceEquals(null, obj))
|
|
479
|
+
{
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (ReferenceEquals(this, obj))
|
|
484
|
+
{
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (obj.GetType() != this.GetType())
|
|
489
|
+
{
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
return Equals((BeamableToken)obj);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
public override int GetHashCode()
|
|
497
|
+
{
|
|
498
|
+
unchecked
|
|
499
|
+
{
|
|
500
|
+
var hashCode = (_accessToken != null ? _accessToken.GetHashCode() : 0);
|
|
501
|
+
hashCode = (hashCode * 397) ^ (_refreshToken != null ? _refreshToken.GetHashCode() : 0);
|
|
502
|
+
hashCode = (hashCode * 397) ^ _expiresIn.GetHashCode();
|
|
503
|
+
hashCode = (hashCode * 397) ^ (_type != null ? _type.GetHashCode() : 0);
|
|
504
|
+
return hashCode;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
#endregion
|
|
509
|
+
|
|
510
|
+
/// <summary>
|
|
511
|
+
/// The access token is used for authenticating all requests.
|
|
512
|
+
/// </summary>
|
|
513
|
+
public string AccessToken => _accessToken;
|
|
514
|
+
|
|
515
|
+
/// <summary>
|
|
516
|
+
/// The refresh token is used to generate a new access token.
|
|
517
|
+
/// </summary>
|
|
518
|
+
public string RefreshToken => _refreshToken;
|
|
519
|
+
|
|
520
|
+
/// <summary>
|
|
521
|
+
/// The type of token, usually "token".
|
|
522
|
+
/// </summary>
|
|
523
|
+
public string Type => _type;
|
|
524
|
+
|
|
525
|
+
/// <summary>
|
|
526
|
+
/// The number of ms until the access token expires and new one will be required.
|
|
527
|
+
/// </summary>
|
|
528
|
+
public long ExpiresIn => _expiresIn;
|
|
529
|
+
|
|
530
|
+
[SerializeField]
|
|
531
|
+
private string _accessToken;
|
|
532
|
+
|
|
533
|
+
[SerializeField]
|
|
534
|
+
private string _refreshToken;
|
|
535
|
+
|
|
536
|
+
[SerializeField]
|
|
537
|
+
private long _expiresIn;
|
|
538
|
+
|
|
539
|
+
[SerializeField]
|
|
540
|
+
private string _type;
|
|
541
|
+
|
|
542
|
+
/// <summary>
|
|
543
|
+
/// Update the values of this token to mirror another token.
|
|
544
|
+
/// </summary>
|
|
545
|
+
/// <param name="token"></param>
|
|
546
|
+
public void Update(BeamableToken token)
|
|
547
|
+
{
|
|
548
|
+
this._type = token._type;
|
|
549
|
+
this._accessToken = token._accessToken;
|
|
550
|
+
this._refreshToken = token._refreshToken;
|
|
551
|
+
this._expiresIn = token._expiresIn;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
public static implicit operator BeamableToken(TokenResponse data) =>
|
|
555
|
+
new BeamableToken
|
|
556
|
+
{
|
|
557
|
+
_accessToken = data.access_token,
|
|
558
|
+
_refreshToken = data.refresh_token,
|
|
559
|
+
_expiresIn = data.expires_in,
|
|
560
|
+
_type = data.token_type,
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
public static BeamableToken FromAccessToken(IAccessToken data) =>
|
|
564
|
+
new BeamableToken
|
|
565
|
+
{
|
|
566
|
+
_accessToken = data.Token,
|
|
567
|
+
_refreshToken = data.RefreshToken,
|
|
568
|
+
_expiresIn = (long)(data.ExpiresAt - DateTime.UtcNow).TotalMilliseconds,
|
|
569
|
+
_type = "token",
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
public static implicit operator TokenResponse(BeamableToken data) =>
|
|
573
|
+
new TokenResponse
|
|
574
|
+
{
|
|
575
|
+
access_token = data._accessToken,
|
|
576
|
+
refresh_token = data._refreshToken,
|
|
577
|
+
expires_in = data._expiresIn,
|
|
578
|
+
token_type = data._type,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
public delegate Promise<string> AsyncChallengeHandler(string challenge);
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
public delegate string ChallengeHandler(string challenge);
|
|
586
|
+
|
|
587
|
+
/// <summary>
|
|
588
|
+
/// The <see cref="RegistrationResult"/> has information about what happened
|
|
589
|
+
/// after attempting to add a credential to a <see cref="PlayerAccount"/>.
|
|
590
|
+
///
|
|
591
|
+
/// If any error occured, the <see cref="isSuccess"/> field will be false,
|
|
592
|
+
/// and the <see cref="error"/> value will contain more detail.
|
|
593
|
+
///
|
|
594
|
+
/// Otherwise, the <see cref="account"/> field will be accessible.
|
|
595
|
+
/// </summary>
|
|
596
|
+
[Serializable]
|
|
597
|
+
public class RegistrationResult
|
|
598
|
+
{
|
|
599
|
+
/// <summary>
|
|
600
|
+
/// Exception thrown by a server will be cached here
|
|
601
|
+
/// </summary>
|
|
602
|
+
public Exception innerException;
|
|
603
|
+
|
|
604
|
+
/// <summary>
|
|
605
|
+
/// The type of error that occured, if <see cref="isSuccess"/> is false.
|
|
606
|
+
/// </summary>
|
|
607
|
+
public PlayerRegistrationError error;
|
|
608
|
+
|
|
609
|
+
[SerializeField]
|
|
610
|
+
private PlayerAccount _account;
|
|
611
|
+
|
|
612
|
+
/// <summary>
|
|
613
|
+
/// True if the registration was successful.
|
|
614
|
+
/// If not, see the <see cref="error"/> field for more detail.
|
|
615
|
+
/// </summary>
|
|
616
|
+
public bool isSuccess => error == PlayerRegistrationError.NONE;
|
|
617
|
+
|
|
618
|
+
/// <summary>
|
|
619
|
+
/// The <see cref="PlayerAccount"/> after the registration
|
|
620
|
+
/// </summary>
|
|
621
|
+
/// <exception cref="PlayerRegistrationException">
|
|
622
|
+
/// This cannot be accessed if <see cref="isSuccess"/> is false.
|
|
623
|
+
/// If it is, an exception will be thrown.
|
|
624
|
+
/// </exception>
|
|
625
|
+
public PlayerAccount account
|
|
626
|
+
{
|
|
627
|
+
get
|
|
628
|
+
{
|
|
629
|
+
if (error == PlayerRegistrationError.NONE)
|
|
630
|
+
{
|
|
631
|
+
return _account;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
throw new PlayerRegistrationException(error, innerException);
|
|
635
|
+
}
|
|
636
|
+
set => _account = value;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
/// <summary>
|
|
642
|
+
/// The <see cref="PasswordResetOperation"/> contains the result of starting
|
|
643
|
+
/// a password reset flow.
|
|
644
|
+
/// </summary>
|
|
645
|
+
[Serializable]
|
|
646
|
+
public class PasswordResetOperation
|
|
647
|
+
{
|
|
648
|
+
private readonly PlayerAccounts _collection;
|
|
649
|
+
|
|
650
|
+
/// <summary>
|
|
651
|
+
/// If an error occured while attempting to reset a <see cref="PlayerAccount"/>'s password,
|
|
652
|
+
/// then this value will be anything other than <see cref="PasswordResetError.NONE"/>.
|
|
653
|
+
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
654
|
+
/// will throw an exception.
|
|
655
|
+
/// </summary>
|
|
656
|
+
public PasswordResetError error;
|
|
657
|
+
|
|
658
|
+
/// <summary>
|
|
659
|
+
/// True when the <see cref="error"/> is none.
|
|
660
|
+
/// </summary>
|
|
661
|
+
public bool isSuccess => error == PasswordResetError.NONE;
|
|
662
|
+
|
|
663
|
+
[SerializeField]
|
|
664
|
+
private PlayerAccount _account;
|
|
665
|
+
|
|
666
|
+
/// <summary>
|
|
667
|
+
/// Access the <see cref="PlayerAccount"/>.
|
|
668
|
+
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
669
|
+
/// </summary>
|
|
670
|
+
/// <exception cref="PasswordResetException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
671
|
+
public PlayerAccount account
|
|
672
|
+
{
|
|
673
|
+
get
|
|
674
|
+
{
|
|
675
|
+
if (error == PasswordResetError.NONE)
|
|
676
|
+
{
|
|
677
|
+
return _account;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
throw new PasswordResetException(error);
|
|
681
|
+
}
|
|
682
|
+
set => _account = value;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
public PasswordResetOperation(PlayerAccounts collection)
|
|
687
|
+
{
|
|
688
|
+
_collection = collection;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/// <summary>
|
|
692
|
+
/// If the <see cref="isSuccess"/> field is true, then
|
|
693
|
+
/// this method may be called with the new password and reset code.
|
|
694
|
+
/// Calling <see cref="PlayerAccounts.ConfirmPassword"/> will have the same outcome.
|
|
695
|
+
/// </summary>
|
|
696
|
+
/// <param name="code">
|
|
697
|
+
/// The code that was sent to the player's email address by
|
|
698
|
+
/// invoking the <see cref="ResetPassword"/> method.
|
|
699
|
+
/// </param>
|
|
700
|
+
/// <param name="newPassword">A new password to assign to the email credential. </param>
|
|
701
|
+
/// <returns></returns>
|
|
702
|
+
public async Promise<PasswordResetConfirmOperation> Confirm(string code, string newPassword)
|
|
703
|
+
{
|
|
704
|
+
return await _collection.ConfirmPassword(code, newPassword, account);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
[Serializable]
|
|
709
|
+
public class PasswordResetResult
|
|
710
|
+
{
|
|
711
|
+
public bool isSuccess => innerException == null;
|
|
712
|
+
|
|
713
|
+
public Exception innerException;
|
|
714
|
+
|
|
715
|
+
public PasswordResetConfirmError error;
|
|
716
|
+
|
|
717
|
+
public PasswordResetResult()
|
|
718
|
+
{
|
|
719
|
+
error = PasswordResetConfirmError.NONE;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
public PasswordResetResult(Exception exception)
|
|
723
|
+
{
|
|
724
|
+
innerException = exception;
|
|
725
|
+
switch (innerException)
|
|
726
|
+
{
|
|
727
|
+
case PlatformRequesterException ex when ex.Status == 400:
|
|
728
|
+
error = PasswordResetConfirmError.BAD_CODE;
|
|
729
|
+
break;
|
|
730
|
+
default:
|
|
731
|
+
error = PasswordResetConfirmError.INVALID;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/// <summary>
|
|
738
|
+
/// The <see cref="PasswordResetConfirmOperation"/> contain the results
|
|
739
|
+
/// or a password confirmation.
|
|
740
|
+
/// </summary>
|
|
741
|
+
[Serializable]
|
|
742
|
+
public class PasswordResetConfirmOperation
|
|
743
|
+
{
|
|
744
|
+
/// <summary>
|
|
745
|
+
/// If an error occured while attempting to confirm a <see cref="PlayerAccount"/>'s password,
|
|
746
|
+
/// then this value will be anything other than <see cref="PasswordResetConfirmError.NONE"/>.
|
|
747
|
+
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
748
|
+
/// will throw an exception.
|
|
749
|
+
/// </summary>
|
|
750
|
+
public PasswordResetConfirmError error;
|
|
751
|
+
|
|
752
|
+
/// <summary>
|
|
753
|
+
/// True when the <see cref="error"/> is none.
|
|
754
|
+
/// </summary>
|
|
755
|
+
public bool isSuccess => error == PasswordResetConfirmError.NONE;
|
|
756
|
+
|
|
757
|
+
[SerializeField]
|
|
758
|
+
private PlayerAccount _account;
|
|
759
|
+
|
|
760
|
+
/// <summary>
|
|
761
|
+
/// Access the <see cref="PlayerAccount"/>.
|
|
762
|
+
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
763
|
+
/// </summary>
|
|
764
|
+
/// <exception cref="PasswordResetConfirmException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
765
|
+
public PlayerAccount account
|
|
766
|
+
{
|
|
767
|
+
get
|
|
768
|
+
{
|
|
769
|
+
if (error == PasswordResetConfirmError.NONE)
|
|
770
|
+
{
|
|
771
|
+
return _account;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
throw new PasswordResetConfirmException(error);
|
|
775
|
+
}
|
|
776
|
+
set => _account = value;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
/// <summary>
|
|
782
|
+
/// The <see cref="PlayerRecoveryOperation"/> has the results of an account recovery operation.
|
|
783
|
+
/// Accounts can be recovered using the <see cref="PlayerAccounts.RecoverAccountWithEmail"/> method.
|
|
784
|
+
///
|
|
785
|
+
/// Use the <see cref="SwitchToAccount"/> method to switch to the recovered account.
|
|
786
|
+
/// </summary>
|
|
787
|
+
[Serializable]
|
|
788
|
+
public class PlayerRecoveryOperation
|
|
789
|
+
{
|
|
790
|
+
private Exception _innerException;
|
|
791
|
+
|
|
792
|
+
/// <summary>
|
|
793
|
+
/// If an error occured while attempting to recovery a <see cref="PlayerAccount"/>,
|
|
794
|
+
/// then this value will be anything other than <see cref="PlayerRecoveryError.NONE"/>.
|
|
795
|
+
/// If the <see cref="account"/> property is accessed while this value is not none, then it
|
|
796
|
+
/// will throw an exception.
|
|
797
|
+
/// </summary>
|
|
798
|
+
public PlayerRecoveryError error;
|
|
799
|
+
|
|
800
|
+
/// <summary>
|
|
801
|
+
/// True when the <see cref="error"/> is none.
|
|
802
|
+
/// </summary>
|
|
803
|
+
public bool isSuccess => error == PlayerRecoveryError.NONE;
|
|
804
|
+
|
|
805
|
+
/// <summary>
|
|
806
|
+
/// If the account already had a player id in the current realm, then this value be true.
|
|
807
|
+
/// When this value is false, it implies that the account exists in the CID scope, but not
|
|
808
|
+
/// in the current PID scope.
|
|
809
|
+
/// </summary>
|
|
810
|
+
public bool realmAlreadyHasGamerTag;
|
|
811
|
+
|
|
812
|
+
[SerializeField]
|
|
813
|
+
private PlayerAccount _account;
|
|
814
|
+
|
|
815
|
+
/// <summary>
|
|
816
|
+
/// Access the recovered <see cref="PlayerAccount"/>.
|
|
817
|
+
/// If there is an <see cref="error"/> value, then this accessor will throw an exception.
|
|
818
|
+
/// </summary>
|
|
819
|
+
/// <exception cref="PlayerRecoveryException">Only thrown when the <see cref="error"/> value isn't none.</exception>
|
|
820
|
+
public PlayerAccount account
|
|
821
|
+
{
|
|
822
|
+
get
|
|
823
|
+
{
|
|
824
|
+
if (error == PlayerRecoveryError.NONE)
|
|
825
|
+
{
|
|
826
|
+
return _account;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
throw GetException();
|
|
830
|
+
}
|
|
831
|
+
set => _account = value;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/// <summary>
|
|
835
|
+
/// Change the current <see cref="BeamContext"/>'s account to the recovered account.
|
|
836
|
+
/// If the <see cref="error"/> value is anything other than none, this method will
|
|
837
|
+
/// throw an exception.
|
|
838
|
+
/// </summary>
|
|
839
|
+
public async Promise SwitchToAccount()
|
|
840
|
+
{
|
|
841
|
+
await account.SwitchToAccount();
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
public PlayerRecoveryOperation()
|
|
845
|
+
{
|
|
846
|
+
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
public PlayerRecoveryOperation(Exception ex, PlayerRecoveryError error)
|
|
850
|
+
{
|
|
851
|
+
this.error = error;
|
|
852
|
+
_innerException = ex;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/// <summary>
|
|
856
|
+
/// This function will create an <see cref="PlayerRecoveryException"/> instance that contains the error code
|
|
857
|
+
/// and any inner exception.
|
|
858
|
+
/// </summary>
|
|
859
|
+
/// <returns></returns>
|
|
860
|
+
public PlayerRecoveryException GetException()
|
|
861
|
+
{
|
|
862
|
+
return new PlayerRecoveryException(error, _innerException);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
/// <summary>
|
|
868
|
+
/// An exception that can be thrown if there is an error during an account recovery.
|
|
869
|
+
/// </summary>
|
|
870
|
+
public class PlayerRecoveryException : Exception
|
|
871
|
+
{
|
|
872
|
+
|
|
873
|
+
public PlayerRecoveryError Error { get; }
|
|
874
|
+
|
|
875
|
+
public PlayerRecoveryException(PlayerRecoveryError error, Exception innerException = null)
|
|
876
|
+
: base($"The recovery failed. error=[{error}]", innerException)
|
|
877
|
+
{
|
|
878
|
+
Error = error;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
public PlayerRecoveryException(PlayerRecoveryError error, string message, Exception innerException = null)
|
|
882
|
+
: base($"The recovery failed. error=[{error}] message=[{message}]", innerException)
|
|
883
|
+
{
|
|
884
|
+
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/// <summary>
|
|
889
|
+
/// An exception that can be thrown if there is an error while adding a credential to an account.
|
|
890
|
+
/// </summary>
|
|
891
|
+
public class PlayerRegistrationException : Exception
|
|
892
|
+
{
|
|
893
|
+
|
|
894
|
+
public PlayerRegistrationError Error { get; }
|
|
895
|
+
|
|
896
|
+
public PlayerRegistrationException(PlayerRegistrationError error, Exception innerException = null)
|
|
897
|
+
: base($"The registration failed. error=[{error}]", innerException)
|
|
898
|
+
{
|
|
899
|
+
Error = error;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/// <summary>
|
|
904
|
+
/// An exception that can be thrown if there is an error while starting a password reset flow.
|
|
905
|
+
/// </summary>
|
|
906
|
+
public class PasswordResetException : Exception
|
|
907
|
+
{
|
|
908
|
+
|
|
909
|
+
public PasswordResetError Error { get; }
|
|
910
|
+
|
|
911
|
+
public PasswordResetException(PasswordResetError error)
|
|
912
|
+
: base($"The password reset failed. error=[{error}]")
|
|
913
|
+
{
|
|
914
|
+
Error = error;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/// <summary>
|
|
919
|
+
/// An exception that can be thrown if there is an error while confirming a password reset flow.
|
|
920
|
+
/// </summary>
|
|
921
|
+
public class PasswordResetConfirmException : Exception
|
|
922
|
+
{
|
|
923
|
+
public PasswordResetConfirmError Error { get; }
|
|
924
|
+
|
|
925
|
+
public PasswordResetConfirmException(PasswordResetConfirmError error)
|
|
926
|
+
: base($"The password confirm failed. error=[{error}]")
|
|
927
|
+
{
|
|
928
|
+
Error = error;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/// <summary>
|
|
933
|
+
/// The <see cref="PlayerRecoveryError"/> lists out the possible errors
|
|
934
|
+
/// that could occur when trying to recover a <see cref="PlayerAccount"/>
|
|
935
|
+
/// </summary>
|
|
936
|
+
public enum PlayerRecoveryError
|
|
937
|
+
{
|
|
938
|
+
/// <summary>
|
|
939
|
+
/// Represents that no error occured
|
|
940
|
+
/// </summary>
|
|
941
|
+
NONE,
|
|
942
|
+
|
|
943
|
+
/// <summary>
|
|
944
|
+
/// Represents that the given credentials weren't valid, or didn't map to an existing <see cref="PlayerAccount"/>
|
|
945
|
+
/// </summary>
|
|
946
|
+
UNKNOWN_CREDENTIALS,
|
|
947
|
+
|
|
948
|
+
/// <summary>
|
|
949
|
+
/// Represents that the given recovery did not specify enough information to login
|
|
950
|
+
/// </summary>
|
|
951
|
+
INSUFFICIENT_DATA,
|
|
952
|
+
|
|
953
|
+
/// <summary>
|
|
954
|
+
/// Represents that the given recovery did not work, but the error isn't classified.
|
|
955
|
+
/// </summary>
|
|
956
|
+
UNKNOWN_ERROR
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/// <summary>
|
|
960
|
+
/// The <see cref="PlayerRecoveryError"/> lists out the possible errors that
|
|
961
|
+
/// could occur when trying to add a credential to a <see cref="PlayerAccount"/>
|
|
962
|
+
/// </summary>
|
|
963
|
+
public enum PlayerRegistrationError
|
|
964
|
+
{
|
|
965
|
+
/// <summary>
|
|
966
|
+
/// represents no error occured.
|
|
967
|
+
/// </summary>
|
|
968
|
+
NONE,
|
|
969
|
+
|
|
970
|
+
/// <summary>
|
|
971
|
+
/// represents that the <see cref="PlayerAccount"/> already has a value
|
|
972
|
+
/// for the credential. For example, a single account cannot have more
|
|
973
|
+
/// than 1 email address or 1 linked facebook account.
|
|
974
|
+
/// </summary>
|
|
975
|
+
ALREADY_HAS_CREDENTIAL,
|
|
976
|
+
|
|
977
|
+
/// <summary>
|
|
978
|
+
/// represents that the given credential is already in use by a different <see cref="PlayerAccount"/>
|
|
979
|
+
/// </summary>
|
|
980
|
+
CREDENTIAL_IS_ALREADY_TAKEN,
|
|
981
|
+
|
|
982
|
+
/// <summary>
|
|
983
|
+
/// represents that the registration failed due to wrong realm configuration.
|
|
984
|
+
/// Can occur during third party login integration.
|
|
985
|
+
/// </summary>
|
|
986
|
+
INVALID_REALM_CONFIGURATION,
|
|
987
|
+
|
|
988
|
+
/// <summary>
|
|
989
|
+
/// Represents failed Federated Authorization.
|
|
990
|
+
/// </summary>
|
|
991
|
+
FAILED_FEDERATED_AUTHORIZATION,
|
|
992
|
+
|
|
993
|
+
/// <summary>
|
|
994
|
+
/// Represents error when federated identity returns challenge to respond to,
|
|
995
|
+
/// but no challengeHandler is provided.
|
|
996
|
+
/// </summary>
|
|
997
|
+
MISSING_FEDERATED_CHALLENGE_HANDLER,
|
|
998
|
+
|
|
999
|
+
/// <summary>
|
|
1000
|
+
/// Represents error that is not covered by other values of this enum.
|
|
1001
|
+
/// </summary>
|
|
1002
|
+
/// <remarks>If <see cref="RegistrationResult"/> contains this error it is useful to inspect the <see cref="RegistrationResult.innerException"/> field for more details.</remarks>
|
|
1003
|
+
OTHER_ERROR,
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/// <summary>
|
|
1007
|
+
/// The <see cref="PasswordResetError"/> lists the possible errors
|
|
1008
|
+
/// that could occur when starting a password reset flow.
|
|
1009
|
+
/// </summary>
|
|
1010
|
+
public enum PasswordResetError
|
|
1011
|
+
{
|
|
1012
|
+
/// <summary>
|
|
1013
|
+
/// represents that no error occured.
|
|
1014
|
+
/// </summary>
|
|
1015
|
+
NONE,
|
|
1016
|
+
|
|
1017
|
+
/// <summary>
|
|
1018
|
+
/// represents that the credential was not present on the account.
|
|
1019
|
+
/// </summary>
|
|
1020
|
+
NO_EXISTING_CREDENTIAL
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/// <summary>
|
|
1024
|
+
/// the <see cref="PasswordResetConfirmError"/> represents the possible
|
|
1025
|
+
/// errors that could occur while confirming a password reset.
|
|
1026
|
+
/// </summary>
|
|
1027
|
+
public enum PasswordResetConfirmError
|
|
1028
|
+
{
|
|
1029
|
+
/// <summary>
|
|
1030
|
+
/// represents that no error occured.
|
|
1031
|
+
/// </summary>
|
|
1032
|
+
NONE,
|
|
1033
|
+
|
|
1034
|
+
/// <summary>
|
|
1035
|
+
/// represents that an invalid code was given
|
|
1036
|
+
/// </summary>
|
|
1037
|
+
BAD_CODE,
|
|
1038
|
+
|
|
1039
|
+
INVALID,
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
[Serializable]
|
|
1045
|
+
public class PlayerAccounts : AbsObservableReadonlyList<PlayerAccount>
|
|
1046
|
+
{
|
|
1047
|
+
private readonly BeamContext _ctx;
|
|
1048
|
+
private readonly IAuthService _authService;
|
|
1049
|
+
private readonly AccessTokenStorage _storage;
|
|
1050
|
+
private readonly IBeamableRequester _requester;
|
|
1051
|
+
private readonly IStatsApi _stats;
|
|
1052
|
+
private readonly Api.Autogenerated.Stats.IStatsApi _statsApi;
|
|
1053
|
+
internal readonly IDependencyProvider _provider;
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
/// <summary>
|
|
1057
|
+
/// The currently signed in <see cref="PlayerAccount"/>.
|
|
1058
|
+
/// There is always a current account, but it may be anonymous.
|
|
1059
|
+
/// </summary>
|
|
1060
|
+
public PlayerAccount Current;
|
|
1061
|
+
|
|
1062
|
+
public Promise OnReady;
|
|
1063
|
+
|
|
1064
|
+
public PlayerAccounts(BeamContext ctx,
|
|
1065
|
+
IAuthService authService,
|
|
1066
|
+
AccessTokenStorage storage,
|
|
1067
|
+
IBeamableRequester requester,
|
|
1068
|
+
IStatsApi stats,
|
|
1069
|
+
Api.Autogenerated.Stats.IStatsApi statsApi,
|
|
1070
|
+
IDependencyProvider provider)
|
|
1071
|
+
{
|
|
1072
|
+
_ctx = ctx;
|
|
1073
|
+
_authService = authService;
|
|
1074
|
+
_storage = storage;
|
|
1075
|
+
_requester = requester;
|
|
1076
|
+
_stats = stats;
|
|
1077
|
+
_statsApi = statsApi;
|
|
1078
|
+
_provider = provider;
|
|
1079
|
+
OnReady = Refresh();
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
/// <summary>
|
|
1085
|
+
/// Change the current <see cref="BeamContext"/>'s current user to the given account.
|
|
1086
|
+
/// After this method finishes, the given <see cref="account"/> will be the <see cref="Current"/> account.
|
|
1087
|
+
/// </summary>
|
|
1088
|
+
/// <param name="account"></param>
|
|
1089
|
+
public async Promise SwitchToAccount(PlayerAccount account)
|
|
1090
|
+
{
|
|
1091
|
+
await OnReady;
|
|
1092
|
+
|
|
1093
|
+
_storage.StoreDeviceRefreshToken(_ctx.Cid, _ctx.Pid,
|
|
1094
|
+
new AccessToken(_storage, _ctx.Cid, _ctx.Pid, _ctx.AccessToken.Token,
|
|
1095
|
+
_ctx.AccessToken.RefreshToken, 1));
|
|
1096
|
+
await _ctx.ChangeAuthorizedPlayer(account.token);
|
|
1097
|
+
await Refresh();
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/// <summary>
|
|
1101
|
+
/// Create a new anonymous account.
|
|
1102
|
+
/// The new account will be returned, and will be accessible in the <see cref="PlayerAccounts"/> list
|
|
1103
|
+
/// To switch to this new account, use the <see cref="SwitchToAccount"/> method.
|
|
1104
|
+
/// </summary>
|
|
1105
|
+
/// <returns>The newly created <see cref="PlayerAccount"/></returns>
|
|
1106
|
+
public async Promise<PlayerAccount> CreateNewAccount()
|
|
1107
|
+
{
|
|
1108
|
+
await OnReady;
|
|
1109
|
+
|
|
1110
|
+
var tokenResponse = await _authService.CreateUser();
|
|
1111
|
+
var accessToken = new AccessToken(_storage, _ctx.Cid, _ctx.Pid, tokenResponse.access_token,
|
|
1112
|
+
tokenResponse.refresh_token, tokenResponse.expires_in);
|
|
1113
|
+
_storage.StoreDeviceRefreshToken(_ctx.Cid, _ctx.Pid, accessToken);
|
|
1114
|
+
var user = await _authService.GetUser(tokenResponse);
|
|
1115
|
+
await Refresh();
|
|
1116
|
+
return this.FirstOrDefault(x => x.GamerTag == user.id);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/// <summary>
|
|
1120
|
+
/// Set the given <see cref="PlayerAccount"/>'s subtext value.
|
|
1121
|
+
/// The subtext can be used to show a small amount of account detail.
|
|
1122
|
+
/// </summary>
|
|
1123
|
+
/// <param name="subtext">the new subtext value</param>
|
|
1124
|
+
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1125
|
+
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1126
|
+
public Promise<PlayerAccount> SetSubtext(string subtext, PlayerAccount account = null) =>
|
|
1127
|
+
SetStatValue(AccountManagementConfiguration.Instance.SubtextStat.StatKey, subtext, account);
|
|
1128
|
+
|
|
1129
|
+
/// <summary>
|
|
1130
|
+
/// Set the given <see cref="PlayerAccount"/>'s alias value.
|
|
1131
|
+
/// The alias is used to show a display name for the account.
|
|
1132
|
+
/// </summary>
|
|
1133
|
+
/// <param name="alias">the new alias value</param>
|
|
1134
|
+
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1135
|
+
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1136
|
+
public Promise<PlayerAccount> SetAlias(string alias, PlayerAccount account = null) =>
|
|
1137
|
+
SetStatValue(AccountManagementConfiguration.Instance.DisplayNameStat.StatKey, alias, account);
|
|
1138
|
+
|
|
1139
|
+
/// <summary>
|
|
1140
|
+
/// Set the given <see cref="PlayerAccount"/>'s avatar value.
|
|
1141
|
+
/// The avatar can be used to record which avatar entry to use.
|
|
1142
|
+
/// </summary>
|
|
1143
|
+
/// <param name="avatar">the new avatar value</param>
|
|
1144
|
+
/// <param name="account">the <see cref="PlayerAccount"/> to use. If null is given, the <see cref="Current"/> account is used.</param>
|
|
1145
|
+
/// <returns>The modified <see cref="PlayerAccount"/></returns>
|
|
1146
|
+
public Promise<PlayerAccount> SetAvatar(string avatar, PlayerAccount account = null) =>
|
|
1147
|
+
SetStatValue(AccountManagementConfiguration.Instance.AvatarStat.StatKey, avatar, account);
|
|
1148
|
+
|
|
1149
|
+
private async Promise<PlayerAccount> SetStatValue(string key, string value, PlayerAccount account)
|
|
1150
|
+
{
|
|
1151
|
+
await OnReady;
|
|
1152
|
+
|
|
1153
|
+
if (account == null)
|
|
1154
|
+
{
|
|
1155
|
+
account = Current;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
var statsService = GetStatsServiceForAccount(account);
|
|
1159
|
+
await statsService.SetStats(StatsAccessType.Public,
|
|
1160
|
+
new Dictionary<string, string>
|
|
1161
|
+
{
|
|
1162
|
+
[key] = value
|
|
1163
|
+
});
|
|
1164
|
+
await Refresh();
|
|
1165
|
+
_stats.ClearCaches();
|
|
1166
|
+
return account;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/// <summary>
|
|
1170
|
+
/// Find an existing account by email and password.
|
|
1171
|
+
///
|
|
1172
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1173
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1174
|
+
/// for the given <see cref="email"/> and <see cref="password"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1175
|
+
///
|
|
1176
|
+
/// </summary>
|
|
1177
|
+
/// <param name="email">
|
|
1178
|
+
/// A valid email address that was previously added to <see cref="PlayerAccount"/>.
|
|
1179
|
+
/// Email credentials can be added with the <see cref="AddEmail"/> method, or the PlayerAccount's <see cref="PlayerAccount.AddEmail"/> method.
|
|
1180
|
+
/// </param>
|
|
1181
|
+
/// <param name="password">
|
|
1182
|
+
/// The password used to add the email address
|
|
1183
|
+
/// </param>
|
|
1184
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1185
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithEmail(string email, string password)
|
|
1186
|
+
{
|
|
1187
|
+
return RecoverAccount((auth, merge) => auth.Login(email, password, merge));
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/// <summary>
|
|
1191
|
+
/// Find an existing account by the current deviceId
|
|
1192
|
+
///
|
|
1193
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1194
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1195
|
+
/// for the current deviceId, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1196
|
+
///
|
|
1197
|
+
/// </summary>
|
|
1198
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1199
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithDeviceId()
|
|
1200
|
+
{
|
|
1201
|
+
return RecoverAccount((auth, merge) => auth.LoginDeviceId(merge));
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/// <summary>
|
|
1205
|
+
/// Find an existing account by a third party link.
|
|
1206
|
+
///
|
|
1207
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1208
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1209
|
+
/// for the given <see cref="thirdParty"/> and <see cref="token"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1210
|
+
///
|
|
1211
|
+
/// </summary>
|
|
1212
|
+
/// <param name="thirdParty">
|
|
1213
|
+
/// A third party that was previously added to an account with the <see cref="AddThirdParty"/> method.
|
|
1214
|
+
/// </param>
|
|
1215
|
+
/// <param name="token">
|
|
1216
|
+
/// The auth token issued from the third party.
|
|
1217
|
+
/// </param>
|
|
1218
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1219
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithThirdParty(
|
|
1220
|
+
AuthThirdParty thirdParty,
|
|
1221
|
+
string token)
|
|
1222
|
+
{
|
|
1223
|
+
return RecoverAccount((auth, merge) => auth.LoginThirdParty(thirdParty, token, merge));
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
/// <summary>
|
|
1228
|
+
/// Find an existing account by a <see cref="TokenResponse"/>.
|
|
1229
|
+
///
|
|
1230
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1231
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1232
|
+
/// for the given <see cref="TokenResponse"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1233
|
+
///
|
|
1234
|
+
/// </summary>
|
|
1235
|
+
/// <param name="tokenResponse">
|
|
1236
|
+
/// The auth token.
|
|
1237
|
+
/// </param>
|
|
1238
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1239
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithRefreshToken(
|
|
1240
|
+
TokenResponse tokenResponse)
|
|
1241
|
+
{
|
|
1242
|
+
return RecoverAccountWithRefreshToken(tokenResponse.refresh_token);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/// <summary>
|
|
1246
|
+
/// Find an existing account by a refresh token from a <see cref="TokenResponse"/>.
|
|
1247
|
+
///
|
|
1248
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1249
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1250
|
+
/// for the given <see cref="TokenResponse"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1251
|
+
///
|
|
1252
|
+
/// </summary>
|
|
1253
|
+
/// <param name="refreshToken">
|
|
1254
|
+
/// The refresh token from a <see cref="TokenResponse"/>.
|
|
1255
|
+
/// </param>
|
|
1256
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1257
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithRefreshToken(
|
|
1258
|
+
string refreshToken)
|
|
1259
|
+
{
|
|
1260
|
+
return RecoverAccount((auth, _) => auth.LoginRefreshToken(refreshToken));
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
private async Promise<PlayerRecoveryOperation> RecoverAccount(
|
|
1264
|
+
Func<IAuthService, bool, Promise<TokenResponse>> loginFunction, bool attemptAccountMerge = true)
|
|
1265
|
+
{
|
|
1266
|
+
await OnReady;
|
|
1267
|
+
|
|
1268
|
+
TokenResponse res;
|
|
1269
|
+
var op = new PlayerRecoveryOperation();
|
|
1270
|
+
try
|
|
1271
|
+
{
|
|
1272
|
+
try
|
|
1273
|
+
{
|
|
1274
|
+
res = await loginFunction(_authService, attemptAccountMerge);
|
|
1275
|
+
}
|
|
1276
|
+
catch (PlatformRequesterException ex) when (attemptAccountMerge && ex.Error?.error == "UnableToMergeError")
|
|
1277
|
+
{
|
|
1278
|
+
op.realmAlreadyHasGamerTag = true;
|
|
1279
|
+
res = await loginFunction(_authService, false);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
catch (PlayerRecoveryException ex)
|
|
1283
|
+
{
|
|
1284
|
+
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.INSUFFICIENT_DATA);
|
|
1285
|
+
}
|
|
1286
|
+
catch (PlatformRequesterException ex) when (ex.Error.status == 401 || ex.Error.status == 403)
|
|
1287
|
+
{
|
|
1288
|
+
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.UNKNOWN_CREDENTIALS);
|
|
1289
|
+
}
|
|
1290
|
+
catch (Exception ex)
|
|
1291
|
+
{
|
|
1292
|
+
return new PlayerRecoveryOperation(ex, PlayerRecoveryError.UNKNOWN_ERROR);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
var user = await _authService.GetUser(res);
|
|
1296
|
+
var stats = await GetStatsForUser(user);
|
|
1297
|
+
|
|
1298
|
+
op.account = new PlayerAccount(this, res, user, stats);
|
|
1299
|
+
return op;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/// <summary>
|
|
1303
|
+
/// Completes a password reset flow for the given <see cref="PlayerAccount"/>.
|
|
1304
|
+
/// </summary>
|
|
1305
|
+
/// <param name="code">
|
|
1306
|
+
/// The code that was sent to the player's email address by
|
|
1307
|
+
/// invoking the <see cref="ResetPassword"/> method.
|
|
1308
|
+
/// </param>
|
|
1309
|
+
/// <param name="newPassword">A new password to assign to the email credential. </param>
|
|
1310
|
+
/// <param name="account"></param>
|
|
1311
|
+
/// <returns></returns>
|
|
1312
|
+
public async Promise<PasswordResetConfirmOperation> ConfirmPassword(string code, string newPassword, PlayerAccount account = null)
|
|
1313
|
+
{
|
|
1314
|
+
await OnReady;
|
|
1315
|
+
|
|
1316
|
+
if (account == null)
|
|
1317
|
+
{
|
|
1318
|
+
account = Current;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
var res = new PasswordResetConfirmOperation { account = account };
|
|
1322
|
+
var service = GetAuthServiceForAccount(account);
|
|
1323
|
+
|
|
1324
|
+
await service.ConfirmPasswordUpdate(code, newPassword);
|
|
1325
|
+
await Refresh();
|
|
1326
|
+
return res;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
public async Promise ResetPassword(string email)
|
|
1331
|
+
{
|
|
1332
|
+
await OnReady;
|
|
1333
|
+
|
|
1334
|
+
var service = GetAuthServiceForAccount(Current);
|
|
1335
|
+
await service.IssuePasswordUpdate(email);
|
|
1336
|
+
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
public async Promise<PasswordResetResult> ConfirmPassword(string code, string newPassword)
|
|
1340
|
+
{
|
|
1341
|
+
await OnReady;
|
|
1342
|
+
|
|
1343
|
+
var service = GetAuthServiceForAccount(Current);
|
|
1344
|
+
try
|
|
1345
|
+
{
|
|
1346
|
+
await service.ConfirmPasswordUpdate(code, newPassword);
|
|
1347
|
+
return new PasswordResetResult();
|
|
1348
|
+
}
|
|
1349
|
+
catch (Exception ex)
|
|
1350
|
+
{
|
|
1351
|
+
return new PasswordResetResult(ex);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/// <summary>
|
|
1356
|
+
/// Initiates a password reset flow for the given <see cref="PlayerAccount"/>.
|
|
1357
|
+
/// If the given account does not have an email credential, the resulting
|
|
1358
|
+
/// <see cref="PasswordResetOperation"/>'s <see cref="PasswordResetOperation.isSuccess"/>
|
|
1359
|
+
/// field will be false.
|
|
1360
|
+
///
|
|
1361
|
+
/// After the password reset flow is started, a code will be sent to the account's
|
|
1362
|
+
/// email address. The code must be provided to the <see cref="ConfirmPassword"/> method,
|
|
1363
|
+
/// or the <see cref="PasswordResetOperation"/>'s <see cref="PasswordResetOperation.Confirm"/> method.
|
|
1364
|
+
/// </summary>
|
|
1365
|
+
/// <param name="account"></param>
|
|
1366
|
+
/// <returns></returns>
|
|
1367
|
+
public async Promise<PasswordResetOperation> ResetPassword(PlayerAccount account = null)
|
|
1368
|
+
{
|
|
1369
|
+
await OnReady;
|
|
1370
|
+
|
|
1371
|
+
if (account == null)
|
|
1372
|
+
{
|
|
1373
|
+
account = Current;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
var res = new PasswordResetOperation(this) { account = account };
|
|
1377
|
+
|
|
1378
|
+
if (!account.HasEmail)
|
|
1379
|
+
{
|
|
1380
|
+
res.error = PasswordResetError.NO_EXISTING_CREDENTIAL;
|
|
1381
|
+
return res;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
var service = GetAuthServiceForAccount(account);
|
|
1385
|
+
await service.IssuePasswordUpdate(account.Email);
|
|
1386
|
+
|
|
1387
|
+
return res;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/// <summary>
|
|
1391
|
+
/// Removes all deviceID credentials from the given account.
|
|
1392
|
+
/// An account could have multiple if the player used multiple devices.
|
|
1393
|
+
///
|
|
1394
|
+
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1395
|
+
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1396
|
+
/// </summary>
|
|
1397
|
+
/// <param name="account"></param>
|
|
1398
|
+
public async Promise<PlayerAccount> RemoveAllDeviceIds(PlayerAccount account = null)
|
|
1399
|
+
{
|
|
1400
|
+
await OnReady;
|
|
1401
|
+
|
|
1402
|
+
if (account == null)
|
|
1403
|
+
{
|
|
1404
|
+
account = Current;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
var service = GetAuthServiceForAccount(account);
|
|
1408
|
+
var user = await service.RemoveAllDeviceIds();
|
|
1409
|
+
account.Update(user);
|
|
1410
|
+
account.TryTriggerUpdate();
|
|
1411
|
+
return account;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/// <summary>
|
|
1415
|
+
/// Removes the current deviceID credential from the given account.
|
|
1416
|
+
///
|
|
1417
|
+
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1418
|
+
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1419
|
+
/// </summary>
|
|
1420
|
+
/// <param name="account"></param>
|
|
1421
|
+
public async Promise<PlayerAccount> RemoveDeviceId(PlayerAccount account = null)
|
|
1422
|
+
{
|
|
1423
|
+
await OnReady;
|
|
1424
|
+
|
|
1425
|
+
if (account == null)
|
|
1426
|
+
{
|
|
1427
|
+
account = Current;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
var service = GetAuthServiceForAccount(account);
|
|
1431
|
+
var deviceId = await service.GetDeviceId();
|
|
1432
|
+
var user = await service.RemoveDeviceId();
|
|
1433
|
+
user.deviceIds.Remove(deviceId);
|
|
1434
|
+
account.Update(user);
|
|
1435
|
+
account.TryTriggerUpdate();
|
|
1436
|
+
|
|
1437
|
+
return account;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/// <summary>
|
|
1441
|
+
/// Removes the third party credential from the given account.
|
|
1442
|
+
/// </summary>
|
|
1443
|
+
/// <param name="thirdParty">
|
|
1444
|
+
/// Which <see cref="AuthThirdParty"/> is being added to the <see cref="PlayerAccount"/>
|
|
1445
|
+
/// </param>
|
|
1446
|
+
/// <param name="token">
|
|
1447
|
+
/// The special token issued from the third party itself. This token's format and origin differ
|
|
1448
|
+
/// depending on which third party is being used.
|
|
1449
|
+
/// </param>
|
|
1450
|
+
/// <param name="account"></param>
|
|
1451
|
+
public async Promise<PlayerAccount> RemoveThirdParty(AuthThirdParty thirdParty, string token, PlayerAccount account = null)
|
|
1452
|
+
{
|
|
1453
|
+
await OnReady;
|
|
1454
|
+
|
|
1455
|
+
if (account == null)
|
|
1456
|
+
{
|
|
1457
|
+
account = Current;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
var service = GetAuthServiceForAccount(account);
|
|
1461
|
+
|
|
1462
|
+
var user = await service.RemoveThirdPartyAssociation(thirdParty, token);
|
|
1463
|
+
account.Update(user);
|
|
1464
|
+
account.TryTriggerUpdate();
|
|
1465
|
+
|
|
1466
|
+
return account;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/// <summary>
|
|
1470
|
+
/// Adds the deviceId credential to the given <see cref="PlayerAccount"/>,
|
|
1471
|
+
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1472
|
+
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1473
|
+
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1474
|
+
///
|
|
1475
|
+
/// If the deviceID has already been added to a different <see cref="PlayerAccount"/>,
|
|
1476
|
+
/// then the the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1477
|
+
///
|
|
1478
|
+
/// By default, the deviceID is the `SystemInfo.deviceUniqueIdentifier` value.
|
|
1479
|
+
/// However, it can be overriden by registering a custom <see cref="IDeviceIdResolver"/> instance.
|
|
1480
|
+
/// </summary>
|
|
1481
|
+
/// <param name="account"></param>
|
|
1482
|
+
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1483
|
+
public async Promise<RegistrationResult> AddDeviceId(PlayerAccount account = null)
|
|
1484
|
+
{
|
|
1485
|
+
await OnReady;
|
|
1486
|
+
|
|
1487
|
+
if (account == null)
|
|
1488
|
+
{
|
|
1489
|
+
account = Current;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
var res = new RegistrationResult { account = account };
|
|
1493
|
+
var service = GetAuthServiceForAccount(account);
|
|
1494
|
+
|
|
1495
|
+
var isAvailable = await service.IsThisDeviceIdAvailable();
|
|
1496
|
+
if (!isAvailable)
|
|
1497
|
+
{
|
|
1498
|
+
res.error = PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN;
|
|
1499
|
+
return res;
|
|
1500
|
+
}
|
|
1501
|
+
var user = await service.RegisterDeviceId();
|
|
1502
|
+
account.Update(user);
|
|
1503
|
+
await Refresh();
|
|
1504
|
+
return res;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/// <inheritdoc cref="RecoverAccountWithExternalIdentity{TCloudIdentity,TService}(string,Beamable.Player.AsyncChallengeHandler,bool)"/>
|
|
1508
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1509
|
+
string token,
|
|
1510
|
+
ChallengeHandler challengeHandler,
|
|
1511
|
+
bool attemptToMergeExistingAccount = true)
|
|
1512
|
+
where TCloudIdentity : IFederationId, new()
|
|
1513
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
1514
|
+
RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1515
|
+
token, challenge => Promise<string>.Successful(challengeHandler(challenge)), attemptToMergeExistingAccount);
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
/// <summary>
|
|
1519
|
+
/// Find an existing account by an external identity link
|
|
1520
|
+
///
|
|
1521
|
+
/// Depending on the state of the realm, this method may produce different behaviour.
|
|
1522
|
+
/// The returned <see cref="PlayerRecoveryOperation"/> will either contain the <see cref="PlayerAccount"/>
|
|
1523
|
+
/// for the given <see cref="TCloudIdentity"/>, <see cref="TService"/> and <see cref="token"/>, or it will have a <see cref="PlayerRecoveryError"/> value.
|
|
1524
|
+
///
|
|
1525
|
+
/// </summary>
|
|
1526
|
+
/// <param name="token">
|
|
1527
|
+
/// A unique token for the player from the external third party
|
|
1528
|
+
/// </param>
|
|
1529
|
+
/// <param name="challengeHandler">
|
|
1530
|
+
/// The server may request the client to meet a challenge. The <see cref="ChallengeHandler"/> will be given
|
|
1531
|
+
/// the challenge string from the server, and it must solve the challenge and return the solution. The solution
|
|
1532
|
+
/// will be given back to the server to validate identity.
|
|
1533
|
+
/// <para>
|
|
1534
|
+
/// If the <see cref="ChallengeHandler"/> is not idempotent, please set the <see cref="attemptToMergeExistingAccount"/> field to false.
|
|
1535
|
+
/// </para>
|
|
1536
|
+
/// </param>
|
|
1537
|
+
/// <param name="attemptToMergeExistingAccount">
|
|
1538
|
+
/// Defaults to true.
|
|
1539
|
+
/// <para>
|
|
1540
|
+
/// There may already be an account (on the CID) that has requested external identity associated with the account.
|
|
1541
|
+
/// When there is an existing account, two outcomes are possible for this Recover method, either,
|
|
1542
|
+
/// <list type="bullet">
|
|
1543
|
+
/// <item> The current playerId can reference the existing account, or </item>
|
|
1544
|
+
/// <item> A new playerId will be created that references the existing account </item>
|
|
1545
|
+
/// </list>
|
|
1546
|
+
/// By default, the first option is attempted. However, this approach requires two invocations of the <see cref="ChallengeHandler"/> ,
|
|
1547
|
+
/// and if it is not idempotent, that will cause an error. Therefor, <b> if the <see cref="ChallengeHandler"/> is not idempotent, please set this field to false.</b>
|
|
1548
|
+
/// </para>
|
|
1549
|
+
/// </param>
|
|
1550
|
+
/// <param name="attemptToMergeExistingAccount">
|
|
1551
|
+
/// Defaults to true.
|
|
1552
|
+
/// <para>
|
|
1553
|
+
/// There may already be an account (on the CID) that has requested external identity associated with the account.
|
|
1554
|
+
/// When there is an existing account, two outcomes are possible for this Recover method, either,
|
|
1555
|
+
/// <list type="bullet">
|
|
1556
|
+
/// <item> The current playerId can reference the existing account, or </item>
|
|
1557
|
+
/// <item> A new playerId will be created that references the existing account </item>
|
|
1558
|
+
/// </list>
|
|
1559
|
+
/// By default, the first option is attempted. However, this approach requires two invocations of the <see cref="ChallengeHandler"/> ,
|
|
1560
|
+
/// and if it is not idempotent, that will cause an error. Therefor, <b> if the <see cref="ChallengeHandler"/> is not idempotent, please set this field to false.</b>
|
|
1561
|
+
/// </para>
|
|
1562
|
+
/// </param>
|
|
1563
|
+
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1564
|
+
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1565
|
+
/// <returns>A <see cref="PlayerRecoveryOperation"/> containing the <see cref="PlayerAccount"/> or a <see cref="PlayerRecoveryError"/> value.</returns>
|
|
1566
|
+
public Promise<PlayerRecoveryOperation> RecoverAccountWithExternalIdentity<TCloudIdentity, TService>(
|
|
1567
|
+
string token,
|
|
1568
|
+
AsyncChallengeHandler challengeHandler = null,
|
|
1569
|
+
bool attemptToMergeExistingAccount = true)
|
|
1570
|
+
where TCloudIdentity : IFederationId, new()
|
|
1571
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1572
|
+
{
|
|
1573
|
+
|
|
1574
|
+
return RecoverAccount(
|
|
1575
|
+
attemptAccountMerge: attemptToMergeExistingAccount,
|
|
1576
|
+
loginFunction: async (auth, merge) =>
|
|
1577
|
+
{
|
|
1578
|
+
var client = _provider.GetService<TService>();
|
|
1579
|
+
var ident = new TCloudIdentity();
|
|
1580
|
+
|
|
1581
|
+
async Promise<TokenResponse> HandleResponse(ExternalLoginResponse res)
|
|
1582
|
+
{
|
|
1583
|
+
if (res.tokenResponse.HasValue)
|
|
1584
|
+
{
|
|
1585
|
+
return res.tokenResponse.Value;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
var challenge = res.challenge.Value;
|
|
1589
|
+
if (challengeHandler == null)
|
|
1590
|
+
{
|
|
1591
|
+
throw new PlayerRecoveryException(PlayerRecoveryError.INSUFFICIENT_DATA,
|
|
1592
|
+
"A challenge was requested, but no challenge handler was provided.");
|
|
1593
|
+
}
|
|
1594
|
+
var solution = await challengeHandler?.Invoke(challenge.challenge);
|
|
1595
|
+
var nextRes = await auth.LoginExternalIdentity(token, client.ServiceName, ident.GetUniqueName(), new ChallengeSolution
|
|
1596
|
+
{
|
|
1597
|
+
challenge_token = challenge.challenge,
|
|
1598
|
+
solution = solution
|
|
1599
|
+
}, mergeGamerTagToAccount: merge);
|
|
1600
|
+
return await HandleResponse(nextRes);
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
var loginRes = await auth.LoginExternalIdentity(token, client.ServiceName, ident.GetUniqueName(), mergeGamerTagToAccount: merge);
|
|
1604
|
+
return await HandleResponse(loginRes);
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
/// <inheritdoc cref="AddExternalIdentity{TCloudIdentity,TService}(string,Beamable.Player.AsyncChallengeHandler,Beamable.Player.PlayerAccount)"/>
|
|
1609
|
+
public Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(
|
|
1610
|
+
string token,
|
|
1611
|
+
ChallengeHandler challengeHandler,
|
|
1612
|
+
PlayerAccount account = null)
|
|
1613
|
+
where TCloudIdentity : IFederationId, new()
|
|
1614
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity> =>
|
|
1615
|
+
AddExternalIdentity<TCloudIdentity, TService>(
|
|
1616
|
+
token, challenge => Promise<string>.Successful(challengeHandler(challenge)), account);
|
|
1617
|
+
|
|
1618
|
+
|
|
1619
|
+
/// <summary>
|
|
1620
|
+
/// Adds the external identity credential to the given <see cref="PlayerAccount"/>,
|
|
1621
|
+
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1622
|
+
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1623
|
+
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1624
|
+
///
|
|
1625
|
+
/// </summary>
|
|
1626
|
+
/// <param name="token">
|
|
1627
|
+
/// A unique player specific token from the external third party.
|
|
1628
|
+
/// </param>
|
|
1629
|
+
/// <param name="challengeHandler">
|
|
1630
|
+
/// The server may request the client to meet a challenge. The <see cref="ChallengeHandler"/> will be given
|
|
1631
|
+
/// the challenge string from the server, and it must solve the challenge and return the solution. The solution
|
|
1632
|
+
/// will be given back to the server to validate identity.
|
|
1633
|
+
/// </param>
|
|
1634
|
+
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1635
|
+
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1636
|
+
/// <param name="account"></param>
|
|
1637
|
+
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1638
|
+
public async Promise<RegistrationResult> AddExternalIdentity<TCloudIdentity, TService>(string token, AsyncChallengeHandler challengeHandler = null, PlayerAccount account = null)
|
|
1639
|
+
where TCloudIdentity : IFederationId, new()
|
|
1640
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1641
|
+
{
|
|
1642
|
+
await OnReady;
|
|
1643
|
+
|
|
1644
|
+
if (account == null)
|
|
1645
|
+
{
|
|
1646
|
+
account = Current;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
var res = new RegistrationResult { account = account };
|
|
1650
|
+
var service = GetAuthServiceForAccount(account);
|
|
1651
|
+
|
|
1652
|
+
var client = _provider.GetService<TService>();
|
|
1653
|
+
var ident = new TCloudIdentity();
|
|
1654
|
+
|
|
1655
|
+
async Promise<RegistrationResult> HandleResponse(AttachExternalIdentityResponse response)
|
|
1656
|
+
{
|
|
1657
|
+
switch (response.result)
|
|
1658
|
+
{
|
|
1659
|
+
case "challenge":
|
|
1660
|
+
if (challengeHandler == null)
|
|
1661
|
+
{
|
|
1662
|
+
res.error = PlayerRegistrationError.MISSING_FEDERATED_CHALLENGE_HANDLER;
|
|
1663
|
+
return res;
|
|
1664
|
+
}
|
|
1665
|
+
var solution = await challengeHandler.Invoke(response.challenge_token);
|
|
1666
|
+
AttachExternalIdentityResponse solutionResponse;
|
|
1667
|
+
try
|
|
1668
|
+
{
|
|
1669
|
+
solutionResponse = await service.AttachIdentity(
|
|
1670
|
+
token, client.ServiceName, ident.GetUniqueName(),
|
|
1671
|
+
new ChallengeSolution
|
|
1672
|
+
{
|
|
1673
|
+
challenge_token = response.challenge_token, solution = solution
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
catch(PlatformRequesterException e)
|
|
1677
|
+
{
|
|
1678
|
+
res.innerException = e;
|
|
1679
|
+
res.error = PlayerErrorFromPlatformError(e.Error, PlayerRegistrationError.FAILED_FEDERATED_AUTHORIZATION);
|
|
1680
|
+
return res;
|
|
1681
|
+
}
|
|
1682
|
+
return await HandleResponse(solutionResponse);
|
|
1683
|
+
case "ok":
|
|
1684
|
+
var user = await service.GetUser();
|
|
1685
|
+
account.Update(user);
|
|
1686
|
+
account.TryTriggerUpdate();
|
|
1687
|
+
return res;
|
|
1688
|
+
default:
|
|
1689
|
+
res.error = PlayerRegistrationError.OTHER_ERROR;
|
|
1690
|
+
return res;
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
bool externalIdentityAvailable = await service.IsExternalIdentityAvailable(client.ServiceName, account._user.id.ToString(), ident.GetUniqueName());
|
|
1695
|
+
|
|
1696
|
+
if (!externalIdentityAvailable)
|
|
1697
|
+
{
|
|
1698
|
+
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1699
|
+
return res;
|
|
1700
|
+
}
|
|
1701
|
+
try
|
|
1702
|
+
{
|
|
1703
|
+
var authorizeRes = await service.AttachIdentity(token, client.ServiceName, ident.GetUniqueName());
|
|
1704
|
+
var result = await HandleResponse(authorizeRes);
|
|
1705
|
+
await Refresh();
|
|
1706
|
+
return result;
|
|
1707
|
+
}
|
|
1708
|
+
catch (PlatformRequesterException ex)
|
|
1709
|
+
{
|
|
1710
|
+
res.innerException = ex;
|
|
1711
|
+
res.error = PlayerErrorFromPlatformError(ex.Error);
|
|
1712
|
+
return res;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
/// <summary>
|
|
1717
|
+
/// Removes the external identity from the given account.
|
|
1718
|
+
/// </summary>
|
|
1719
|
+
/// <typeparam name="TCloudIdentity">A <see cref="IFederationId"/> type</typeparam>
|
|
1720
|
+
/// <typeparam name="TService">A <see cref="Microservice"/> that implements <see cref="TCloudIdentity"/></typeparam>
|
|
1721
|
+
/// <param name="account"></param>
|
|
1722
|
+
public async Promise<PlayerAccount> RemoveExternalIdentity<TCloudIdentity, TService>(PlayerAccount account = null)
|
|
1723
|
+
where TCloudIdentity : IFederationId, new()
|
|
1724
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1725
|
+
{
|
|
1726
|
+
await OnReady;
|
|
1727
|
+
|
|
1728
|
+
if (account == null)
|
|
1729
|
+
{
|
|
1730
|
+
account = Current;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
var authService = GetAuthServiceForAccount(account);
|
|
1734
|
+
var providerService = _provider.GetService<TService>().ServiceName;
|
|
1735
|
+
var providerNamespace = new TCloudIdentity().GetUniqueName();
|
|
1736
|
+
|
|
1737
|
+
if (!account.TryGetExternalIdentity<TCloudIdentity, TService>(out var identity))
|
|
1738
|
+
{
|
|
1739
|
+
return account;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
await authService.DetachIdentity(providerService, identity.userId, providerNamespace);
|
|
1743
|
+
var user = await authService.GetUser();
|
|
1744
|
+
account.Update(user);
|
|
1745
|
+
account.TryTriggerUpdate();
|
|
1746
|
+
|
|
1747
|
+
return account;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
public async Promise<bool> IsExternalIdentityAvailable<TCloudIdentity, TService>(string token, PlayerAccount account = null)
|
|
1751
|
+
where TCloudIdentity : IFederationId, new()
|
|
1752
|
+
where TService : IHaveServiceName, ISupportsFederatedLogin<TCloudIdentity>
|
|
1753
|
+
{
|
|
1754
|
+
await OnReady;
|
|
1755
|
+
|
|
1756
|
+
if (account == null)
|
|
1757
|
+
{
|
|
1758
|
+
account = Current;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
var authService = GetAuthServiceForAccount(account);
|
|
1762
|
+
var providerService = _provider.GetService<TService>().ServiceName;
|
|
1763
|
+
var providerNamespace = new TCloudIdentity().GetUniqueName();
|
|
1764
|
+
|
|
1765
|
+
return await authService.IsExternalIdentityAvailable(providerService, token, providerNamespace);
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
/// <summary>
|
|
1769
|
+
/// Adds the third party credential to the given <see cref="PlayerAccount"/>,
|
|
1770
|
+
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1771
|
+
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1772
|
+
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1773
|
+
///
|
|
1774
|
+
/// If the third party token has already been added to a different <see cref="PlayerAccount"/>,
|
|
1775
|
+
/// then the the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1776
|
+
///
|
|
1777
|
+
/// To get the token, follow the available <a href="https://help.beamable.com/Unity-4.0/unity/user-reference/beamable-services/identity/identity/">documentation </a>
|
|
1778
|
+
/// </summary>
|
|
1779
|
+
/// <param name="thirdParty">
|
|
1780
|
+
/// Which <see cref="AuthThirdParty"/> is being added to the <see cref="PlayerAccount"/>
|
|
1781
|
+
/// </param>
|
|
1782
|
+
/// <param name="token">
|
|
1783
|
+
/// The special token issued from the third party itself. This token's format and origin differ
|
|
1784
|
+
/// depending on which third party is being used.
|
|
1785
|
+
/// </param>
|
|
1786
|
+
/// <param name="account"></param>
|
|
1787
|
+
/// <returns>A <see cref="RegistrationResult"/> representing the result of the deviceId addition. </returns>
|
|
1788
|
+
public async Promise<RegistrationResult> AddThirdParty(AuthThirdParty thirdParty, string token, PlayerAccount account = null)
|
|
1789
|
+
{
|
|
1790
|
+
await OnReady;
|
|
1791
|
+
|
|
1792
|
+
if (account == null)
|
|
1793
|
+
{
|
|
1794
|
+
account = Current;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
var res = new RegistrationResult { account = account };
|
|
1798
|
+
var service = GetAuthServiceForAccount(account);
|
|
1799
|
+
|
|
1800
|
+
if (account.HasThirdParty(thirdParty))
|
|
1801
|
+
{
|
|
1802
|
+
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1803
|
+
return res;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
try
|
|
1807
|
+
{
|
|
1808
|
+
var user = await service.RegisterThirdPartyCredentials(thirdParty, token);
|
|
1809
|
+
account.Update(user);
|
|
1810
|
+
account.TryTriggerUpdate();
|
|
1811
|
+
}
|
|
1812
|
+
catch (PlatformRequesterException e)
|
|
1813
|
+
{
|
|
1814
|
+
res.innerException = e;
|
|
1815
|
+
res.error = PlayerErrorFromPlatformError(e.Error);
|
|
1816
|
+
return res;
|
|
1817
|
+
}
|
|
1818
|
+
await Refresh();
|
|
1819
|
+
return res;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/// <summary>
|
|
1823
|
+
/// Checks if the given third party token is available for usage.
|
|
1824
|
+
/// </summary>
|
|
1825
|
+
/// <returns>True when the token is available, false if taken.</returns>
|
|
1826
|
+
public async Promise<bool> IsThirdPartyAvailable(AuthThirdParty thirdParty, string token)
|
|
1827
|
+
{
|
|
1828
|
+
await OnReady;
|
|
1829
|
+
var status = await _authService.GetCredentialStatus(thirdParty, token);
|
|
1830
|
+
return status == CredentialUsageStatus.NEVER_USED;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
/// <summary>
|
|
1834
|
+
/// Checks the status of a given third party token.
|
|
1835
|
+
/// </summary>
|
|
1836
|
+
/// <returns>Returns an enum with the correct status for that third party token</returns>
|
|
1837
|
+
public Promise<CredentialUsageStatus> GetCredentialStatus(AuthThirdParty thirdParty, string token)
|
|
1838
|
+
{
|
|
1839
|
+
return _authService.GetCredentialStatus(thirdParty, token);
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
/// <summary>
|
|
1843
|
+
/// Adds an email credential to the given <see cref="PlayerAccount"/>,
|
|
1844
|
+
/// and returns a <see cref="RegistrationResult"/>. If the returned
|
|
1845
|
+
/// <see cref="RegistrationResult.isSuccess"/> is true, then the addition worked.
|
|
1846
|
+
/// Otherwise, check the <see cref="RegistrationResult.error"/> field.
|
|
1847
|
+
/// </summary>
|
|
1848
|
+
/// <param name="email">
|
|
1849
|
+
/// The email to add to the account.
|
|
1850
|
+
/// This email must be unique for the CID.
|
|
1851
|
+
/// If the email is already taken, the resulting <see cref="RegistrationResult.error"/> field will be <see cref="PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN"/>
|
|
1852
|
+
/// </param>
|
|
1853
|
+
/// <param name="password">
|
|
1854
|
+
/// The password to combine with the email address.
|
|
1855
|
+
/// </param>
|
|
1856
|
+
/// <param name="account"></param>
|
|
1857
|
+
/// <returns>A <see cref="RegistrationResult"/> representing the result of the email addition. </returns>
|
|
1858
|
+
public async Promise<RegistrationResult> AddEmail(string email, string password, PlayerAccount account = null)
|
|
1859
|
+
{
|
|
1860
|
+
await OnReady;
|
|
1861
|
+
|
|
1862
|
+
if (account == null)
|
|
1863
|
+
{
|
|
1864
|
+
account = Current;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
var res = new RegistrationResult { account = account };
|
|
1868
|
+
if (account.HasEmail)
|
|
1869
|
+
{
|
|
1870
|
+
res.error = PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
1871
|
+
return res;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
var service = GetAuthServiceForAccount(account);
|
|
1875
|
+
try
|
|
1876
|
+
{
|
|
1877
|
+
var user = await service.RegisterDBCredentials(email, password);
|
|
1878
|
+
account.Update(user);
|
|
1879
|
+
account.TryTriggerUpdate();
|
|
1880
|
+
}
|
|
1881
|
+
catch (PlatformRequesterException ex)
|
|
1882
|
+
{
|
|
1883
|
+
res.innerException = ex;
|
|
1884
|
+
res.error = PlayerErrorFromPlatformError(ex.Error);
|
|
1885
|
+
return res;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
await Refresh();
|
|
1889
|
+
|
|
1890
|
+
return res;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
/// <summary>
|
|
1894
|
+
/// Checks if the provided email is already attached to a player account.
|
|
1895
|
+
/// </summary>
|
|
1896
|
+
/// <returns>True when email is free to be used, false when it's already taken.</returns>
|
|
1897
|
+
public async Promise<bool> IsEmailAvailable(string email)
|
|
1898
|
+
{
|
|
1899
|
+
await OnReady;
|
|
1900
|
+
CredentialUsageStatus status = await _authService.GetCredentialStatus(email);
|
|
1901
|
+
return status == CredentialUsageStatus.NEVER_USED;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/// <summary>
|
|
1905
|
+
/// Checks the status of the provided email. If it's attached to an account already then this will return ASSIGNED_TO_AN_ACCOUNT.
|
|
1906
|
+
/// If it's available, it will return NEVER_USED. And finally it will return INVALID_CREDENTIAL in case of a fail in the process.
|
|
1907
|
+
/// </summary>
|
|
1908
|
+
/// <param name="email"></param>
|
|
1909
|
+
/// <returns>The status of this email in the credentials</returns>
|
|
1910
|
+
public Promise<CredentialUsageStatus> GetCredentialStatus(string email)
|
|
1911
|
+
{
|
|
1912
|
+
return _authService.GetCredentialStatus(email);
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/// <summary>
|
|
1916
|
+
/// Removes the given <see cref="PlayerAccount"/> from the device's memory.
|
|
1917
|
+
/// After the account is removed, the access token will be lost. The player
|
|
1918
|
+
/// will not be able to switch to this account until they initiate an account
|
|
1919
|
+
/// recovery option.
|
|
1920
|
+
///
|
|
1921
|
+
/// If the given account is the currently active account, then nothing will happen.
|
|
1922
|
+
/// It is impossible to remove the current account.
|
|
1923
|
+
///
|
|
1924
|
+
/// </summary>
|
|
1925
|
+
/// <param name="account"></param>
|
|
1926
|
+
public async Promise RemoveAccount(PlayerAccount account)
|
|
1927
|
+
{
|
|
1928
|
+
await OnReady;
|
|
1929
|
+
|
|
1930
|
+
if (account == null || account.GamerTag == Current.GamerTag) return;
|
|
1931
|
+
|
|
1932
|
+
_storage.RemoveDeviceRefreshToken(_ctx.Cid, _ctx.Pid, account.token);
|
|
1933
|
+
await Refresh();
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/// <summary>
|
|
1937
|
+
/// Removes all accounts from the device's memory.
|
|
1938
|
+
/// After each account is removed, the access token will be lost. The player
|
|
1939
|
+
/// will not be able to switch to this account until they initiate an account
|
|
1940
|
+
/// recovery option.
|
|
1941
|
+
///
|
|
1942
|
+
/// The currently active account will still be available on the device.
|
|
1943
|
+
/// </summary>
|
|
1944
|
+
public async Promise RemoveAllAccounts()
|
|
1945
|
+
{
|
|
1946
|
+
await OnReady;
|
|
1947
|
+
|
|
1948
|
+
// this won't clear the current user, just the other stored ones.
|
|
1949
|
+
_storage.ClearDeviceRefreshTokens(_ctx.Cid, _ctx.Pid);
|
|
1950
|
+
await Refresh();
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/// <summary>
|
|
1954
|
+
/// Set the given <see cref="PlayerAccount"/>'s language preference.
|
|
1955
|
+
/// </summary>
|
|
1956
|
+
/// <param name="language">A <see cref="SystemLanguage"/></param>
|
|
1957
|
+
/// <param name="account"></param>
|
|
1958
|
+
/// <returns></returns>
|
|
1959
|
+
public async Promise<PlayerAccount> SetLanguage(SystemLanguage language, PlayerAccount account = null)
|
|
1960
|
+
{
|
|
1961
|
+
await OnReady;
|
|
1962
|
+
|
|
1963
|
+
if (account == null)
|
|
1964
|
+
{
|
|
1965
|
+
account = Current;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
var service = GetAuthServiceForAccount(account);
|
|
1969
|
+
var user = await service.SetLanguage(language);
|
|
1970
|
+
account.Update(user);
|
|
1971
|
+
account.TryTriggerUpdate();
|
|
1972
|
+
return account;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
private IDependencyProvider GetScopeForAccount(PlayerAccount account)
|
|
1976
|
+
{
|
|
1977
|
+
if (account.GamerTag == Current.GamerTag) return _provider;
|
|
1978
|
+
var requester = _requester.WithAccessToken(account.token);
|
|
1979
|
+
return _provider.Fork(builder =>
|
|
1980
|
+
{
|
|
1981
|
+
builder
|
|
1982
|
+
.AddScoped(requester)
|
|
1983
|
+
.Remove<StatsService>()
|
|
1984
|
+
.AddScoped<StatsService>(provider =>
|
|
1985
|
+
new StatsService(
|
|
1986
|
+
account,
|
|
1987
|
+
requester,
|
|
1988
|
+
provider,
|
|
1989
|
+
UnityUserDataCache<Dictionary<string, string>>
|
|
1990
|
+
.CreateInstance,
|
|
1991
|
+
provider.GetService<OfflineCache>()));
|
|
1992
|
+
;
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
private IAuthService GetAuthServiceForAccount(PlayerAccount account)
|
|
1997
|
+
{
|
|
1998
|
+
var subScope = GetScopeForAccount(account);
|
|
1999
|
+
return subScope.GetService<IAuthService>();
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
private IStatsApi GetStatsServiceForAccount(PlayerAccount account)
|
|
2003
|
+
{
|
|
2004
|
+
var subScope = GetScopeForAccount(account);
|
|
2005
|
+
return subScope.GetService<IStatsApi>();
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
private Promise<UserExtensions.StatCollection> GetStatsForUser(User user)
|
|
2009
|
+
{
|
|
2010
|
+
return user.GetStats(
|
|
2011
|
+
AccountManagementConfiguration.Instance.DisplayNameStat,
|
|
2012
|
+
AccountManagementConfiguration.Instance.SubtextStat,
|
|
2013
|
+
AccountManagementConfiguration.Instance.AvatarStat);
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
protected override async Promise PerformRefresh()
|
|
2017
|
+
{
|
|
2018
|
+
await _ctx.OnReady;
|
|
2019
|
+
|
|
2020
|
+
var next = new List<PlayerAccount>(Count);
|
|
2021
|
+
var gamerTagToAccount = new Dictionary<long, PlayerAccount>();
|
|
2022
|
+
foreach (var account in this)
|
|
2023
|
+
{
|
|
2024
|
+
gamerTagToAccount[account.GamerTag] = account;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
var seen = new HashSet<long>();
|
|
2028
|
+
|
|
2029
|
+
var deviceTokens = _storage.RetrieveDeviceRefreshTokens(_ctx.Cid, _ctx.Pid);
|
|
2030
|
+
var currToken = _storage.LoadTokenForRealmImmediate(_ctx.Cid, _ctx.Pid);
|
|
2031
|
+
var tokens = new TokenResponse[deviceTokens.Length + 1];
|
|
2032
|
+
for (var i = 0; i < deviceTokens.Length; i++)
|
|
2033
|
+
{
|
|
2034
|
+
tokens[i] = deviceTokens[i];
|
|
2035
|
+
}
|
|
2036
|
+
tokens[deviceTokens.Length] = new TokenResponse { access_token = currToken.Token, refresh_token = currToken.RefreshToken, };
|
|
2037
|
+
|
|
2038
|
+
var userPromises = new Promise<User>[tokens.Length];
|
|
2039
|
+
var statPromises = new Promise<UserExtensions.StatCollection>[tokens.Length];
|
|
2040
|
+
for (var i = 0; i < userPromises.Length; i++)
|
|
2041
|
+
{
|
|
2042
|
+
userPromises[i] = _authService.GetUser(tokens[i]);
|
|
2043
|
+
statPromises[i] = userPromises[i].FlatMap(GetStatsForUser);
|
|
2044
|
+
}
|
|
2045
|
+
var users = await Promise.Sequence(userPromises);
|
|
2046
|
+
var stats = await Promise.Sequence(statPromises);
|
|
2047
|
+
|
|
2048
|
+
for (var i = 0; i < userPromises.Length; i++)
|
|
2049
|
+
{
|
|
2050
|
+
var user = users[i];
|
|
2051
|
+
if (seen.Contains(user.id)) continue;
|
|
2052
|
+
seen.Add(user.id);
|
|
2053
|
+
|
|
2054
|
+
var statValues = stats[i];
|
|
2055
|
+
var token = tokens[i];
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
|
|
2059
|
+
if (gamerTagToAccount.TryGetValue(user.id, out var existing))
|
|
2060
|
+
{
|
|
2061
|
+
existing.Update(statValues);
|
|
2062
|
+
existing.Update(user);
|
|
2063
|
+
existing.Update(token);
|
|
2064
|
+
existing.TryTriggerUpdate();
|
|
2065
|
+
next.Add(existing);
|
|
2066
|
+
}
|
|
2067
|
+
else
|
|
2068
|
+
{
|
|
2069
|
+
var newAccount = new PlayerAccount(this, token, user, statValues);
|
|
2070
|
+
gamerTagToAccount.Add(user.id, newAccount);
|
|
2071
|
+
next.Add(newAccount);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
foreach (var account in next)
|
|
2076
|
+
{
|
|
2077
|
+
if (account.GamerTag != _ctx.PlayerId) continue;
|
|
2078
|
+
|
|
2079
|
+
if (Current == null)
|
|
2080
|
+
{
|
|
2081
|
+
// must clone the instance, otherwise, later when account switches will happen, references will point to old objects
|
|
2082
|
+
var tokenClone = JsonUtility.FromJson<BeamableToken>(JsonUtility.ToJson(account.token));
|
|
2083
|
+
var userClone = JsonUtility.FromJson<User>(JsonUtility.ToJson(account._user));
|
|
2084
|
+
UserExtensions.StatCollection statClone = new UserExtensions.StatCollection();
|
|
2085
|
+
foreach (var kvp in account._stats)
|
|
2086
|
+
{
|
|
2087
|
+
statClone[kvp.Key] = kvp.Value;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
Current = new PlayerAccount(this, tokenClone, userClone, statClone);
|
|
2091
|
+
}
|
|
2092
|
+
else
|
|
2093
|
+
{
|
|
2094
|
+
Current.Update(account);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
SetData(next);
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
/// <summary>
|
|
2105
|
+
/// Converts a platform error to a player registration error.
|
|
2106
|
+
/// </summary>
|
|
2107
|
+
/// <param name="e">The platform error.</param>
|
|
2108
|
+
/// <param name="defaultError">The default error to return if no specific error is found.</param>
|
|
2109
|
+
/// <returns>The player registration error.</returns>
|
|
2110
|
+
private static PlayerRegistrationError PlayerErrorFromPlatformError(PlatformError e, PlayerRegistrationError defaultError = PlayerRegistrationError.OTHER_ERROR)
|
|
2111
|
+
{
|
|
2112
|
+
if (e.status == 400 && (e.error.Equals("EmailAlreadyRegisteredError") ||
|
|
2113
|
+
e.error.Equals("ThirdPartyAssociationAlreadyInUseError") ||
|
|
2114
|
+
e.error.Equals("DeviceAlreadyInUseError")) ||
|
|
2115
|
+
e.error.Equals("ExternalIdentityUnavailable"))
|
|
2116
|
+
{
|
|
2117
|
+
return PlayerRegistrationError.CREDENTIAL_IS_ALREADY_TAKEN;
|
|
2118
|
+
}
|
|
2119
|
+
if (e.error.Equals("DuplicateThirdPartyAssociationError"))
|
|
2120
|
+
{
|
|
2121
|
+
return PlayerRegistrationError.ALREADY_HAS_CREDENTIAL;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
if (e.error.Equals("InvalidClientSecretFile"))
|
|
2125
|
+
{
|
|
2126
|
+
return PlayerRegistrationError.INVALID_REALM_CONFIGURATION;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
return defaultError;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
}
|