diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk.meta deleted file mode 100755 index 445eb3f4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d7627240a732b5c4a828c37d5adb304a -folderAsset: yes -timeCreated: 1468616383 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin.meta deleted file mode 100755 index a865e687..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f80b73ed5fc053a409c5e9347d9c609a -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs deleted file mode 100755 index 1854ed8e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs +++ /dev/null @@ -1,818 +0,0 @@ -#if ENABLE_PLAYFABADMIN_API -using System; -using PlayFab.AdminModels; -using PlayFab.Internal; -using PlayFab.Json; - -namespace PlayFab -{ - /// - /// APIs for managing title configurations, uploaded Game Server code executables, and user data - /// - public static class PlayFabAdminAPI - { - - /// - /// Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. - /// - public static void BanUsers(BanUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/BanUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier - /// - public static void GetUserAccountInfo(LookupUserAccountInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserAccountInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Gets all bans for a user. - /// - public static void GetUserBans(GetUserBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Resets all title-specific information about a particular account, including user data, virtual currency balances, inventory, purchase history, and statistics - /// - public static void ResetUsers(ResetUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ResetUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revoke all active bans for a user. - /// - public static void RevokeAllBansForUser(RevokeAllBansForUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RevokeAllBansForUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revoke all active bans specified with BanId. - /// - public static void RevokeBans(RevokeBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RevokeBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Forces an email to be sent to the registered email address for the specified account, with a link allowing the user to change the password - /// - public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SendAccountRecoveryEmail", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates information of a list of existing bans specified with Ban Ids. - /// - public static void UpdateBans(UpdateBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title specific display name for a user - /// - public static void UpdateUserTitleDisplayName(UpdateUserTitleDisplayNameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserTitleDisplayName", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval and an aggregation method. - /// - public static void CreatePlayerStatisticDefinition(CreatePlayerStatisticDefinitionRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/CreatePlayerStatisticDefinition", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. This method does not remove the player's event history, login history, inventory items, nor virtual currencies. - /// - public static void DeleteUsers(DeleteUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/DeleteUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a download URL for the requested report - /// - public static void GetDataReport(GetDataReportRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetDataReport", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have a reset interval. - /// - public static void GetPlayerStatisticDefinitions(GetPlayerStatisticDefinitionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPlayerStatisticDefinitions", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the information on the available versions of the specified statistic. - /// - public static void GetPlayerStatisticVersions(GetPlayerStatisticVersionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPlayerStatisticVersions", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which cannot be accessed by the client - /// - public static void GetUserInternalData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserPublisherData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which cannot be accessed by the client - /// - public static void GetUserPublisherInternalData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserPublisherInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which can only be read by the client - /// - public static void GetUserPublisherReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserPublisherReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which can only be read by the client - /// - public static void GetUserReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Resets the indicated statistic, removing all player entries for it and backing up the old values. - /// - public static void IncrementPlayerStatisticVersion(IncrementPlayerStatisticVersionRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/IncrementPlayerStatisticVersion", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Attempts to process an order refund through the original real money payment provider. - /// - public static void RefundPurchase(RefundPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RefundPurchase", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Completely removes all statistics for the specified user, for the current game - /// - public static void ResetUserStatistics(ResetUserStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ResetUserStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Attempts to resolve a dispute with the original order's payment provider. - /// - public static void ResolvePurchaseDispute(ResolvePurchaseDisputeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ResolvePurchaseDispute", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. - /// - public static void UpdatePlayerStatisticDefinition(UpdatePlayerStatisticDefinitionRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdatePlayerStatisticDefinition", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which cannot be accessed by the client - /// - public static void UpdateUserInternalData(UpdateUserInternalDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserPublisherData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which cannot be accessed by the client - /// - public static void UpdateUserPublisherInternalData(UpdateUserInternalDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserPublisherInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which can only be read by the client - /// - public static void UpdateUserPublisherReadOnlyData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserPublisherReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which can only be read by the client - /// - public static void UpdateUserReadOnlyData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateUserReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds a new news item to the title's news feed - /// - public static void AddNews(AddNewsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/AddNews", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded. - /// - public static void AddVirtualCurrencyTypes(AddVirtualCurrencyTypesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/AddVirtualCurrencyTypes", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Deletes an existing virtual item store - /// - public static void DeleteStore(DeleteStoreRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/DeleteStore", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified version of the title's catalog of virtual goods, including all defined properties - /// - public static void GetCatalogItems(GetCatalogItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetCatalogItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom publisher settings - /// - public static void GetPublisherData(GetPublisherDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the random drop table configuration for the title - /// - public static void GetRandomResultTables(GetRandomResultTablesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetRandomResultTables", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the set of items defined for the specified store, including all prices defined - /// - public static void GetStoreItems(GetStoreItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetStoreItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom title settings which can be read by the client - /// - public static void GetTitleData(GetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetTitleData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom title settings which cannot be read by the client - /// - public static void GetTitleInternalData(GetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetTitleInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retuns the list of all defined virtual currencies for the title - /// - public static void ListVirtualCurrencyTypes(ListVirtualCurrencyTypesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ListVirtualCurrencyTypes", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Removes one or more virtual currencies from the set defined for the title. - /// - public static void RemoveVirtualCurrencyTypes(RemoveVirtualCurrencyTypesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RemoveVirtualCurrencyTypes", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Creates the catalog configuration of all virtual goods for the specified catalog version - /// - public static void SetCatalogItems(UpdateCatalogItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetCatalogItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Sets all the items in one virtual store - /// - public static void SetStoreItems(UpdateStoreItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetStoreItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Creates and updates the key-value store of custom title settings which can be read by the client - /// - public static void SetTitleData(SetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetTitleData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value store of custom title settings which cannot be read by the client - /// - public static void SetTitleInternalData(SetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetTitleInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported. - /// - public static void SetupPushNotification(SetupPushNotificationRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetupPushNotification", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the catalog configuration for virtual goods in the specified catalog version - /// - public static void UpdateCatalogItems(UpdateCatalogItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateCatalogItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the random drop table configuration for the title - /// - public static void UpdateRandomResultTables(UpdateRandomResultTablesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateRandomResultTables", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates an existing virtual item store with new or modified items - /// - public static void UpdateStoreItems(UpdateStoreItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateStoreItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Increments the specified virtual currency by the stated amount - /// - public static void AddUserVirtualCurrency(AddUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/AddUserVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified user's current inventory of virtual goods - /// - public static void GetUserInventory(GetUserInventoryRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetUserInventory", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the specified items to the specified user inventories - /// - public static void GrantItemsToUsers(GrantItemsToUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GrantItemsToUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revokes access to an item in a user's inventory - /// - public static void RevokeInventoryItem(RevokeInventoryItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RevokeInventoryItem", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Decrements the specified virtual currency by the stated amount - /// - public static void SubtractUserVirtualCurrency(SubtractUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SubtractUserVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details for a specific completed session, including links to standard out and standard error logs - /// - public static void GetMatchmakerGameInfo(GetMatchmakerGameInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetMatchmakerGameInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details of defined game modes for the specified game server executable - /// - public static void GetMatchmakerGameModes(GetMatchmakerGameModesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetMatchmakerGameModes", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the game server mode details for the specified game server executable - /// - public static void ModifyMatchmakerGameModes(ModifyMatchmakerGameModesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ModifyMatchmakerGameModes", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a client is permitted to request in a call to StartGame - /// - public static void AddServerBuild(AddServerBuildRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/AddServerBuild", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the build details for the specified game server executable - /// - public static void GetServerBuildInfo(GetServerBuildInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetServerBuildInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for use - see AddServerBuild) - /// - public static void GetServerBuildUploadUrl(GetServerBuildUploadURLRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetServerBuildUploadUrl", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the build details for all game server executables which are currently defined for the title - /// - public static void ListServerBuilds(ListBuildsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ListServerBuilds", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the build details for the specified game server executable - /// - public static void ModifyServerBuild(ModifyServerBuildRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ModifyServerBuild", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Removes the game server executable specified from the set of those a client is permitted to request in a call to StartGame - /// - public static void RemoveServerBuild(RemoveServerBuildRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RemoveServerBuild", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value store of custom publisher settings - /// - public static void SetPublisherData(SetPublisherDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Gets the contents and information of a specific Cloud Script revision. - /// - public static void GetCloudScriptRevision(GetCloudScriptRevisionRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetCloudScriptRevision", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Lists all the current cloud script versions. For each version, information about the current published and latest revisions is also listed. - /// - public static void GetCloudScriptVersions(GetCloudScriptVersionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetCloudScriptVersions", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Sets the currently published revision of a title Cloud Script - /// - public static void SetPublishedRevision(SetPublishedRevisionRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/SetPublishedRevision", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be submitted in the revision. - /// - public static void UpdateCloudScript(UpdateCloudScriptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/UpdateCloudScript", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Delete a content file from the title - /// - public static void DeleteContent(DeleteContentRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/DeleteContent", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// List all contents of the title and get statistics such as size - /// - public static void GetContentList(GetContentListRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetContentList", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. - /// - public static void GetContentUploadUrl(GetContentUploadUrlRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetContentUploadUrl", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Completely removes all statistics for the specified character, for the current game - /// - public static void ResetCharacterStatistics(ResetCharacterStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/ResetCharacterStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. - /// - public static void AddPlayerTag(AddPlayerTagRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/AddPlayerTag", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieve a list of all PlayStream actions groups. - /// - public static void GetAllActionGroups(GetAllActionGroupsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetAllActionGroups", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. - /// - public static void GetAllSegments(GetAllSegmentsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetAllSegments", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// List all segments that a player currently belongs to at this moment in time. - /// - public static void GetPlayerSegments(GetPlayersSegmentsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPlayerSegments", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. - /// - public static void GetPlayersInSegment(GetPlayersInSegmentRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPlayersInSegment", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Get all tags with a given Namespace (optional) from a player profile. - /// - public static void GetPlayerTags(GetPlayerTagsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/GetPlayerTags", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. - /// - public static void RemovePlayerTag(RemovePlayerTagRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Admin/RemovePlayerTag", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs.meta deleted file mode 100755 index ec37b6e1..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminAPI.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 98aa7d0b4d53fe24392fc8cc52120845 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs deleted file mode 100755 index 2571c915..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs +++ /dev/null @@ -1,3034 +0,0 @@ -#if ENABLE_PLAYFABADMIN_API -using System; -using System.Collections.Generic; -using PlayFab.SharedModels; - -namespace PlayFab.AdminModels -{ - [Serializable] - public class AdCampaignAttribution - { - /// - /// Attribution network name - /// - public string Platform { get; set;} - /// - /// Attribution campaign identifier - /// - public string CampaignId { get; set;} - /// - /// UTC time stamp of attribution - /// - public DateTime AttributedAt { get; set;} - } - - [Serializable] - public class AddNewsRequest : PlayFabRequestCommon - { - /// - /// Time this news was published. If not set, defaults to now. - /// - public DateTime? Timestamp { get; set;} - /// - /// Title (headline) of the news item - /// - public string Title { get; set;} - /// - /// Body text of the news - /// - public string Body { get; set;} - } - - [Serializable] - public class AddNewsResult : PlayFabResultCommon - { - /// - /// Unique id of the new news item - /// - public string NewsId { get; set;} - } - - [Serializable] - public class AddPlayerTagRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique tag for player profile. - /// - public string TagName { get; set;} - } - - [Serializable] - public class AddPlayerTagResult : PlayFabResultCommon - { - } - - [Serializable] - public class AddServerBuildRequest : PlayFabRequestCommon - { - /// - /// unique identifier for the build executable - /// - public string BuildId { get; set;} - /// - /// appended to the end of the command line when starting game servers - /// - public string CommandLineTemplate { get; set;} - /// - /// path to the game server executable. Defaults to gameserver.exe - /// - public string ExecutablePath { get; set;} - /// - /// server host regions in which this build should be running and available - /// - public List ActiveRegions { get; set;} - /// - /// developer comment(s) for this build - /// - public string Comment { get; set;} - /// - /// maximum number of game server instances that can run on a single host machine - /// - public int MaxGamesPerHost { get; set;} - /// - /// minimum capacity of additional game server instances that can be started before the autoscaling service starts new host machines (given the number of current running host machines and game server instances) - /// - public int MinFreeGameSlots { get; set;} - } - - [Serializable] - public class AddServerBuildResult : PlayFabResultCommon - { - /// - /// unique identifier for this build executable - /// - public string BuildId { get; set;} - /// - /// array of regions where this build can used, when it is active - /// - public List ActiveRegions { get; set;} - /// - /// maximum number of game server instances that can run on a single host machine - /// - public int MaxGamesPerHost { get; set;} - /// - /// minimum capacity of additional game server instances that can be started before the autoscaling service starts new host machines (given the number of current running host machines and game server instances) - /// - public int MinFreeGameSlots { get; set;} - /// - /// appended to the end of the command line when starting game servers - /// - public string CommandLineTemplate { get; set;} - /// - /// path to the game server executable. Defaults to gameserver.exe - /// - public string ExecutablePath { get; set;} - /// - /// developer comment(s) for this build - /// - public string Comment { get; set;} - /// - /// time this build was last modified (or uploaded, if this build has never been modified) - /// - public DateTime Timestamp { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// the current status of the build validation and processing steps - /// - public GameBuildStatus? Status { get; set;} - } - - [Serializable] - public class AddUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose virtual currency balance is to be increased. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which is to be incremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int Amount { get; set;} - } - - [Serializable] - public class AddVirtualCurrencyTypesRequest : PlayFabRequestCommon - { - /// - /// List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) to the title - /// - public List VirtualCurrencies { get; set;} - } - - /// - /// Contains information for a ban. - /// - [Serializable] - public class BanInfo - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// The unique Ban Id associated with this ban. - /// - public string BanId { get; set;} - /// - /// The IP address on which the ban was applied. May affect multiple players. - /// - public string IPAddress { get; set;} - /// - /// The MAC address on which the ban was applied. May affect multiple players. - /// - public string MACAddress { get; set;} - /// - /// The time when this ban was applied. - /// - public DateTime? Created { get; set;} - /// - /// The time when this ban expires. Permanent bans do not have expiration date. - /// - public DateTime? Expires { get; set;} - /// - /// The reason why this ban was applied. - /// - public string Reason { get; set;} - /// - /// The active state of this ban. Expired bans may still have this value set to true but they will have no effect. - /// - public bool Active { get; set;} - } - - /// - /// Represents a single ban request. - /// - [Serializable] - public class BanRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// IP address to be banned. May affect multiple players. - /// - public string IPAddress { get; set;} - /// - /// MAC address to be banned. May affect multiple players. - /// - public string MACAddress { get; set;} - /// - /// The reason for this ban. Maximum 140 characters. - /// - public string Reason { get; set;} - /// - /// The duration in hours for the ban. Leave this blank for a permanent ban. - /// - public uint? DurationInHours { get; set;} - } - - [Serializable] - public class BanUsersRequest : PlayFabRequestCommon - { - /// - /// List of ban requests to be applied. Maximum 100. - /// - public List Bans { get; set;} - } - - [Serializable] - public class BanUsersResult : PlayFabResultCommon - { - /// - /// Information on the bans that were applied - /// - public List BanData { get; set;} - } - - [Serializable] - public class BlankResult : PlayFabResultCommon - { - } - - /// - /// A purchasable item from the item catalog - /// - [Serializable] - public class CatalogItem - { - /// - /// unique identifier for this item - /// - public string ItemId { get; set;} - /// - /// class to which the item belongs - /// - public string ItemClass { get; set;} - /// - /// catalog version for this item - /// - public string CatalogVersion { get; set;} - /// - /// text name for the item, to show in-game - /// - public string DisplayName { get; set;} - /// - /// text description of item, to show in-game - /// - public string Description { get; set;} - /// - /// price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// override prices for this item for specific currencies - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// list of item tags - /// - public List Tags { get; set;} - /// - /// game specific custom data - /// - public string CustomData { get; set;} - /// - /// defines the consumable properties (number of uses, timeout) for the item - /// - public CatalogItemConsumableInfo Consumable { get; set;} - /// - /// defines the container properties for the item - what items it contains, including random drop tables and virtual currencies, and what item (if any) is required to open it via the UnlockContainerItem API - /// - public CatalogItemContainerInfo Container { get; set;} - /// - /// defines the bundle properties for the item - bundles are items which contain other items, including random drop tables and virtual currencies - /// - public CatalogItemBundleInfo Bundle { get; set;} - /// - /// if true, then an item instance of this type can be used to grant a character to a user. - /// - public bool CanBecomeCharacter { get; set;} - /// - /// if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded - /// - public bool IsStackable { get; set;} - /// - /// if true, then an item instance of this type can be traded between players using the trading APIs - /// - public bool IsTradable { get; set;} - /// - /// URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. - /// - public string ItemImageUrl { get; set;} - /// - /// BETA: If true, then only a fixed number can ever be granted. - /// - public bool IsLimitedEdition { get; set;} - /// - /// BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. - /// - public int InitialLimitedEditionCount { get; set;} - } - - [Serializable] - public class CatalogItemBundleInfo - { - /// - /// unique ItemId values for all items which will be added to the player inventory when the bundle is added - /// - public List BundledItems { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) - /// - public List BundledResultTables { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the bundle is added - /// - public Dictionary BundledVirtualCurrencies { get; set;} - } - - [Serializable] - public class CatalogItemConsumableInfo - { - /// - /// number of times this object can be used, after which it will be removed from the player inventory - /// - public uint? UsageCount { get; set;} - /// - /// duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed - /// - public uint? UsagePeriod { get; set;} - /// - /// all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values added together, and share the result - when that period has elapsed, all the items in the group will be removed - /// - public string UsagePeriodGroup { get; set;} - } - - /// - /// Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. - /// - [Serializable] - public class CatalogItemContainerInfo - { - /// - /// ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will open the container, adding the contents to the player inventory and currency balances) - /// - public string KeyItemId { get; set;} - /// - /// unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked - /// - public List ItemContents { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) - /// - public List ResultTableContents { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the container is unlocked - /// - public Dictionary VirtualCurrencyContents { get; set;} - } - - [Serializable] - public class CloudScriptFile - { - /// - /// Name of the javascript file. These names are not used internally by the server, they are only for developer organizational purposes. - /// - public string Filename { get; set;} - /// - /// Contents of the Cloud Script javascript. Must be string-escaped javascript. - /// - public string FileContents { get; set;} - } - - [Serializable] - public class CloudScriptVersionStatus - { - /// - /// Version number - /// - public int Version { get; set;} - /// - /// Published code revision for this Cloud Script version - /// - public int PublishedRevision { get; set;} - /// - /// Most recent revision for this Cloud Script version - /// - public int LatestRevision { get; set;} - } - - [Serializable] - public class ContentInfo - { - /// - /// Key of the content - /// - public string Key { get; set;} - /// - /// Size of the content in bytes - /// - public uint Size { get; set;} - /// - /// Last modified time - /// - public DateTime LastModified { get; set;} - } - - [Serializable] - public class CreatePlayerStatisticDefinitionRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// interval at which the values of the statistic for all players are reset (resets begin at the next interval boundary) - /// - public StatisticResetIntervalOption? VersionChangeInterval { get; set;} - /// - /// the aggregation method to use in updating the statistic (defaults to last) - /// - public StatisticAggregationMethod? AggregationMethod { get; set;} - } - - [Serializable] - public class CreatePlayerStatisticDefinitionResult : PlayFabResultCommon - { - /// - /// created statistic definition - /// - public PlayerStatisticDefinition Statistic { get; set;} - } - - public enum Currency - { - AED, - AFN, - ALL, - AMD, - ANG, - AOA, - ARS, - AUD, - AWG, - AZN, - BAM, - BBD, - BDT, - BGN, - BHD, - BIF, - BMD, - BND, - BOB, - BRL, - BSD, - BTN, - BWP, - BYR, - BZD, - CAD, - CDF, - CHF, - CLP, - CNY, - COP, - CRC, - CUC, - CUP, - CVE, - CZK, - DJF, - DKK, - DOP, - DZD, - EGP, - ERN, - ETB, - EUR, - FJD, - FKP, - GBP, - GEL, - GGP, - GHS, - GIP, - GMD, - GNF, - GTQ, - GYD, - HKD, - HNL, - HRK, - HTG, - HUF, - IDR, - ILS, - IMP, - INR, - IQD, - IRR, - ISK, - JEP, - JMD, - JOD, - JPY, - KES, - KGS, - KHR, - KMF, - KPW, - KRW, - KWD, - KYD, - KZT, - LAK, - LBP, - LKR, - LRD, - LSL, - LYD, - MAD, - MDL, - MGA, - MKD, - MMK, - MNT, - MOP, - MRO, - MUR, - MVR, - MWK, - MXN, - MYR, - MZN, - NAD, - NGN, - NIO, - NOK, - NPR, - NZD, - OMR, - PAB, - PEN, - PGK, - PHP, - PKR, - PLN, - PYG, - QAR, - RON, - RSD, - RUB, - RWF, - SAR, - SBD, - SCR, - SDG, - SEK, - SGD, - SHP, - SLL, - SOS, - SPL, - SRD, - STD, - SVC, - SYP, - SZL, - THB, - TJS, - TMT, - TND, - TOP, - TRY, - TTD, - TVD, - TWD, - TZS, - UAH, - UGX, - USD, - UYU, - UZS, - VEF, - VND, - VUV, - WST, - XAF, - XCD, - XDR, - XOF, - XPF, - YER, - ZAR, - ZMW, - ZWD - } - - [Serializable] - public class DeleteContentRequest : PlayFabRequestCommon - { - /// - /// Key of the content item to be deleted - /// - public string Key { get; set;} - } - - [Serializable] - public class DeleteStoreRequest : PlayFabRequestCommon - { - /// - /// catalog version of the store to delete. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - /// - /// unqiue identifier for the store which is to be deleted - /// - public string StoreId { get; set;} - } - - [Serializable] - public class DeleteStoreResult : PlayFabResultCommon - { - } - - [Serializable] - public class DeleteUsersRequest : PlayFabRequestCommon - { - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - } - - [Serializable] - public class DeleteUsersResult : PlayFabResultCommon - { - } - - public enum GameBuildStatus - { - Available, - Validating, - InvalidBuildPackage, - Processing, - FailedToProcess - } - - [Serializable] - public class GameModeInfo - { - /// - /// specific game mode type - /// - public string Gamemode { get; set;} - /// - /// minimum user count required for this Game Server Instance to continue (usually 1) - /// - public uint MinPlayerCount { get; set;} - /// - /// maximum user count a specific Game Server Instance can support - /// - public uint MaxPlayerCount { get; set;} - /// - /// whether to start as an open session, meaning that players can matchmake into it (defaults to true) - /// - public bool? StartOpen { get; set;} - } - - [Serializable] - public class GetActionGroupResult : PlayFabResultCommon - { - /// - /// Action Group name - /// - public string Name { get; set;} - /// - /// Action Group ID - /// - public string Id { get; set;} - } - - [Serializable] - public class GetAllActionGroupsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetAllActionGroupsResult : PlayFabResultCommon - { - /// - /// List of Action Groups. - /// - public List ActionGroups { get; set;} - } - - [Serializable] - public class GetAllSegmentsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetAllSegmentsResult : PlayFabResultCommon - { - /// - /// Array of segments for this title. - /// - public List Segments { get; set;} - } - - [Serializable] - public class GetCatalogItemsRequest : PlayFabRequestCommon - { - /// - /// Which catalog is being requested. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetCatalogItemsResult : PlayFabResultCommon - { - /// - /// Array of items which can be purchased. - /// - public List Catalog { get; set;} - } - - [Serializable] - public class GetCloudScriptRevisionRequest : PlayFabRequestCommon - { - /// - /// Version number. If left null, defaults to the latest version - /// - public int? Version { get; set;} - /// - /// Revision number. If left null, defaults to the latest revision - /// - public int? Revision { get; set;} - } - - [Serializable] - public class GetCloudScriptRevisionResult : PlayFabResultCommon - { - /// - /// Version number. - /// - public int Version { get; set;} - /// - /// Revision number. - /// - public int Revision { get; set;} - /// - /// Time this revision was created - /// - public DateTime CreatedAt { get; set;} - /// - /// List of Cloud Script files in this revision. - /// - public List Files { get; set;} - /// - /// True if this is the currently published revision - /// - public bool IsPublished { get; set;} - } - - [Serializable] - public class GetCloudScriptVersionsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetCloudScriptVersionsResult : PlayFabResultCommon - { - /// - /// List of versions - /// - public List Versions { get; set;} - } - - [Serializable] - public class GetContentListRequest : PlayFabRequestCommon - { - /// - /// Limits the response to keys that begin with the specified prefix. You can use prefixes to list contents under a folder, or for a specified version, etc. - /// - public string Prefix { get; set;} - } - - [Serializable] - public class GetContentListResult : PlayFabResultCommon - { - /// - /// Number of content items returned. We currently have a maximum of 1000 items limit. - /// - public int ItemCount { get; set;} - /// - /// The total size of listed contents in bytes. - /// - public uint TotalSize { get; set;} - /// - /// List of content items. - /// - public List Contents { get; set;} - } - - [Serializable] - public class GetContentUploadUrlRequest : PlayFabRequestCommon - { - /// - /// Key of the content item to upload, usually formatted as a path, e.g. images/a.png - /// - public string Key { get; set;} - /// - /// A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default. - /// - public string ContentType { get; set;} - } - - [Serializable] - public class GetContentUploadUrlResult : PlayFabResultCommon - { - /// - /// URL for uploading content via HTTP PUT method. The URL will expire in 1 hour. - /// - public string URL { get; set;} - } - - [Serializable] - public class GetDataReportRequest : PlayFabRequestCommon - { - /// - /// Report name - /// - public string ReportName { get; set;} - /// - /// Reporting year (UTC) - /// - public int Year { get; set;} - /// - /// Reporting month (UTC) - /// - public int Month { get; set;} - /// - /// Reporting year (UTC) - /// - public int Day { get; set;} - } - - [Serializable] - public class GetDataReportResult : PlayFabResultCommon - { - /// - /// The URL where the requested report can be downloaded. - /// - public string DownloadUrl { get; set;} - } - - [Serializable] - public class GetMatchmakerGameInfoRequest : PlayFabRequestCommon - { - /// - /// unique identifier of the lobby for which info is being requested - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class GetMatchmakerGameInfoResult : PlayFabResultCommon - { - /// - /// unique identifier of the lobby - /// - public string LobbyId { get; set;} - /// - /// unique identifier of the Game Server Instance for this lobby - /// - public string TitleId { get; set;} - /// - /// time when the Game Server Instance was created - /// - public DateTime StartTime { get; set;} - /// - /// time when Game Server Instance is currently scheduled to end - /// - public DateTime? EndTime { get; set;} - /// - /// game mode for this Game Server Instance - /// - public string Mode { get; set;} - /// - /// version identifier of the game server executable binary being run - /// - public string BuildVersion { get; set;} - /// - /// region in which the Game Server Instance is running - /// - public Region? Region { get; set;} - /// - /// array of unique PlayFab identifiers for users currently connected to this Game Server Instance - /// - public List Players { get; set;} - /// - /// IP address for this Game Server Instance - /// - public string ServerAddress { get; set;} - /// - /// communication port for this Game Server Instance - /// - public uint ServerPort { get; set;} - } - - [Serializable] - public class GetMatchmakerGameModesRequest : PlayFabRequestCommon - { - /// - /// previously uploaded build version for which game modes are being requested - /// - public string BuildVersion { get; set;} - } - - [Serializable] - public class GetMatchmakerGameModesResult : PlayFabResultCommon - { - /// - /// array of game modes available for the specified build - /// - public List GameModes { get; set;} - } - - [Serializable] - public class GetPlayerSegmentsResult : PlayFabResultCommon - { - /// - /// Array of segments the requested player currently belongs to. - /// - public List Segments { get; set;} - } - - [Serializable] - public class GetPlayersInSegmentRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for this segment. - /// - public string SegmentId { get; set;} - /// - /// Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). - /// - public uint? SecondsToLive { get; set;} - /// - /// Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. - /// - public uint? MaxBatchSize { get; set;} - /// - /// Continuation token if retrieving subsequent pages of results. - /// - public string ContinuationToken { get; set;} - } - - [Serializable] - public class GetPlayersInSegmentResult : PlayFabResultCommon - { - /// - /// Count of profiles matching this segment. - /// - public int ProfilesInSegment { get; set;} - /// - /// Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. - /// - public string ContinuationToken { get; set;} - /// - /// Array of player profiles in this segment. - /// - public List PlayerProfiles { get; set;} - } - - [Serializable] - public class GetPlayersSegmentsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetPlayerStatisticDefinitionsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetPlayerStatisticDefinitionsResult : PlayFabResultCommon - { - /// - /// the player statistic definitions for the title - /// - public List Statistics { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsResult : PlayFabResultCommon - { - /// - /// version change history of the statistic - /// - public List StatisticVersions { get; set;} - } - - [Serializable] - public class GetPlayerTagsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Optional namespace to filter results by - /// - public string Namespace { get; set;} - } - - [Serializable] - public class GetPlayerTagsResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Canonical tags (including namespace and tag's name) for the requested user - /// - public List Tags { get; set;} - } - - [Serializable] - public class GetPublisherDataRequest : PlayFabRequestCommon - { - /// - /// array of keys to get back data from the Publisher data blob, set by the admin tools - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetPublisherDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetRandomResultTablesRequest : PlayFabRequestCommon - { - /// - /// catalog version to fetch tables from. Use default catalog version if null - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetRandomResultTablesResult : PlayFabResultCommon - { - /// - /// array of random result tables currently available - /// - public Dictionary Tables { get; set;} - } - - [Serializable] - public class GetSegmentResult : PlayFabResultCommon - { - /// - /// Unique identifier for this segment. - /// - public string Id { get; set;} - /// - /// Segment name. - /// - public string Name { get; set;} - /// - /// Identifier of the segments AB Test, if it is attached to one. - /// - public string ABTestParent { get; set;} - } - - [Serializable] - public class GetServerBuildInfoRequest : PlayFabRequestCommon - { - /// - /// unique identifier of the previously uploaded build executable for which information is being requested - /// - public string BuildId { get; set;} - } - - /// - /// Information about a particular server build - /// - [Serializable] - public class GetServerBuildInfoResult : PlayFabResultCommon - { - /// - /// unique identifier for this build executable - /// - public string BuildId { get; set;} - /// - /// array of regions where this build can used, when it is active - /// - public List ActiveRegions { get; set;} - /// - /// maximum number of game server instances that can run on a single host machine - /// - public int MaxGamesPerHost { get; set;} - /// - /// minimum capacity of additional game server instances that can be started before the autoscaling service starts new host machines (given the number of current running host machines and game server instances) - /// - public int MinFreeGameSlots { get; set;} - /// - /// developer comment(s) for this build - /// - public string Comment { get; set;} - /// - /// time this build was last modified (or uploaded, if this build has never been modified) - /// - public DateTime Timestamp { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// the current status of the build validation and processing steps - /// - public GameBuildStatus? Status { get; set;} - /// - /// error message, if any, about this build - /// - public string ErrorMessage { get; set;} - } - - [Serializable] - public class GetServerBuildUploadURLRequest : PlayFabRequestCommon - { - /// - /// unique identifier of the game server build to upload - /// - public string BuildId { get; set;} - } - - [Serializable] - public class GetServerBuildUploadURLResult : PlayFabResultCommon - { - /// - /// pre-authorized URL for uploading the game server build package - /// - public string URL { get; set;} - } - - [Serializable] - public class GetStoreItemsRequest : PlayFabRequestCommon - { - /// - /// catalog version to store items from. Use default catalog version if null - /// - public string CatalogVersion { get; set;} - /// - /// Unqiue identifier for the store which is being requested. - /// - public string StoreId { get; set;} - } - - [Serializable] - public class GetStoreItemsResult : PlayFabResultCommon - { - /// - /// Array of items which can be purchased from this store. - /// - public List Store { get; set;} - /// - /// How the store was last updated (Admin or a third party). - /// - public SourceType? Source { get; set;} - /// - /// The base catalog that this store is a part of. - /// - public string CatalogVersion { get; set;} - /// - /// The ID of this store. - /// - public string StoreId { get; set;} - /// - /// Additional data about the store. - /// - public StoreMarketingModel MarketingData { get; set;} - } - - [Serializable] - public class GetTitleDataRequest : PlayFabRequestCommon - { - /// - /// Specific keys to search for in the title data (leave null to get all keys) - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetTitleDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetUserBansRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserBansResult : PlayFabResultCommon - { - /// - /// Information about the bans - /// - public List BanData { get; set;} - } - - [Serializable] - public class GetUserDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Specific keys to search for in the custom user data. - /// - public List Keys { get; set;} - /// - /// The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this. - /// - public uint? IfChangedFromDataVersion { get; set;} - } - - [Serializable] - public class GetUserDataResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose custom data is being returned. - /// - public string PlayFabId { get; set;} - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - /// - /// User specific data for this title. - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetUserInventoryRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserInventoryResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Array of inventory items belonging to the user. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - } - - /// - /// Result of granting an item to a user - /// - [Serializable] - public class GrantedItemInstance - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Result of this operation. - /// - public bool Result { get; set;} - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class GrantItemsToUsersRequest : PlayFabRequestCommon - { - /// - /// Catalog version from which items are to be granted. - /// - public string CatalogVersion { get; set;} - /// - /// Array of items to grant and the users to whom the items are to be granted. - /// - public List ItemGrants { get; set;} - } - - [Serializable] - public class GrantItemsToUsersResult : PlayFabResultCommon - { - /// - /// Array of items granted to users. - /// - public List ItemGrantResults { get; set;} - } - - [Serializable] - public class IncrementPlayerStatisticVersionRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - } - - [Serializable] - public class IncrementPlayerStatisticVersionResult : PlayFabResultCommon - { - /// - /// version change history of the statistic - /// - public PlayerStatisticVersion StatisticVersion { get; set;} - } - - [Serializable] - public class ItemGrant - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique identifier of the catalog item to be granted to the user. - /// - public string ItemId { get; set;} - /// - /// String detailing any additional information concerning this operation. - /// - public string Annotation { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - } - - /// - /// A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. - /// - [Serializable] - public class ItemInstance - { - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class ListBuildsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class ListBuildsResult : PlayFabResultCommon - { - /// - /// array of uploaded game server builds - /// - public List Builds { get; set;} - } - - [Serializable] - public class ListVirtualCurrencyTypesRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class ListVirtualCurrencyTypesResult : PlayFabResultCommon - { - /// - /// List of virtual currency names defined for this title - /// - public List VirtualCurrencies { get; set;} - } - - public enum LoginIdentityProvider - { - Unknown, - PlayFab, - Custom, - GameCenter, - GooglePlay, - Steam, - XBoxLive, - PSN, - Kongregate, - Facebook, - IOSDevice, - AndroidDevice, - Twitch - } - - [Serializable] - public class LookupUserAccountInfoRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// User email address attached to their account - /// - public string Email { get; set;} - /// - /// PlayFab username for the account (3-20 characters) - /// - public string Username { get; set;} - /// - /// Title specific username to match against existing user accounts - /// - public string TitleDisplayName { get; set;} - } - - [Serializable] - public class LookupUserAccountInfoResult : PlayFabResultCommon - { - /// - /// User info for the user matching the request - /// - public UserAccountInfo UserInfo { get; set;} - } - - [Serializable] - public class ModifyMatchmakerGameModesRequest : PlayFabRequestCommon - { - /// - /// previously uploaded build version for which game modes are being specified - /// - public string BuildVersion { get; set;} - /// - /// array of game modes (Note: this will replace all game modes for the indicated build version) - /// - public List GameModes { get; set;} - } - - [Serializable] - public class ModifyMatchmakerGameModesResult : PlayFabResultCommon - { - } - - [Serializable] - public class ModifyServerBuildRequest : PlayFabRequestCommon - { - /// - /// unique identifier of the previously uploaded build executable to be updated - /// - public string BuildId { get; set;} - /// - /// new timestamp - /// - public DateTime? Timestamp { get; set;} - /// - /// array of regions where this build can used, when it is active - /// - public List ActiveRegions { get; set;} - /// - /// maximum number of game server instances that can run on a single host machine - /// - public int MaxGamesPerHost { get; set;} - /// - /// minimum capacity of additional game server instances that can be started before the autoscaling service starts new host machines (given the number of current running host machines and game server instances) - /// - public int MinFreeGameSlots { get; set;} - /// - /// appended to the end of the command line when starting game servers - /// - public string CommandLineTemplate { get; set;} - /// - /// path to the game server executable. Defaults to gameserver.exe - /// - public string ExecutablePath { get; set;} - /// - /// developer comment(s) for this build - /// - public string Comment { get; set;} - } - - [Serializable] - public class ModifyServerBuildResult : PlayFabResultCommon - { - /// - /// unique identifier for this build executable - /// - public string BuildId { get; set;} - /// - /// array of regions where this build can used, when it is active - /// - public List ActiveRegions { get; set;} - /// - /// maximum number of game server instances that can run on a single host machine - /// - public int MaxGamesPerHost { get; set;} - /// - /// minimum capacity of additional game server instances that can be started before the autoscaling service starts new host machines (given the number of current running host machines and game server instances) - /// - public int MinFreeGameSlots { get; set;} - /// - /// appended to the end of the command line when starting game servers - /// - public string CommandLineTemplate { get; set;} - /// - /// path to the game server executable. Defaults to gameserver.exe - /// - public string ExecutablePath { get; set;} - /// - /// developer comment(s) for this build - /// - public string Comment { get; set;} - /// - /// time this build was last modified (or uploaded, if this build has never been modified) - /// - public DateTime Timestamp { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// the current status of the build validation and processing steps - /// - public GameBuildStatus? Status { get; set;} - } - - [Serializable] - public class ModifyUserVirtualCurrencyResult : PlayFabResultCommon - { - /// - /// User currency was subtracted from. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which was modified. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int BalanceChange { get; set;} - /// - /// Balance of the virtual currency after modification. - /// - public int Balance { get; set;} - } - - [Serializable] - public class PlayerLinkedAccount - { - /// - /// Authentication platform - /// - public LoginIdentityProvider? Platform { get; set;} - /// - /// Platform user identifier - /// - public string PlatformUserId { get; set;} - /// - /// Linked account's username - /// - public string Username { get; set;} - /// - /// Linked account's email - /// - public string Email { get; set;} - } - - [Serializable] - public class PlayerProfile - { - /// - /// PlayFab Player ID - /// - public string PlayerId { get; set;} - /// - /// Title ID this profile applies to - /// - public string TitleId { get; set;} - /// - /// Player Display Name - /// - public string DisplayName { get; set;} - /// - /// Publisher this player belongs to - /// - public string PublisherId { get; set;} - /// - /// Player account origination - /// - public LoginIdentityProvider? Origination { get; set;} - /// - /// Player record created - /// - public DateTime? Created { get; set;} - /// - /// Last login - /// - public DateTime? LastLogin { get; set;} - /// - /// Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. - /// - public DateTime? BannedUntil { get; set;} - /// - /// Dictionary of player's statistics using only the latest version's value - /// - public Dictionary Statistics { get; set;} - /// - /// A sum of player's total purchases in USD across all currencies. - /// - public uint? TotalValueToDateInUSD { get; set;} - /// - /// Dictionary of player's total purchases by currency. - /// - public Dictionary ValuesToDate { get; set;} - /// - /// List of player's tags for segmentation. - /// - public List Tags { get; set;} - /// - /// Dictionary of player's virtual currency balances - /// - public Dictionary VirtualCurrencyBalances { get; set;} - /// - /// Array of ad campaigns player has been attributed to - /// - public List AdCampaignAttributions { get; set;} - /// - /// Array of configured push notification end points - /// - public List PushNotificationRegistrations { get; set;} - /// - /// Array of third party accounts linked to this player - /// - public List LinkedAccounts { get; set;} - /// - /// Array of player statistics - /// - public List PlayerStatistics { get; set;} - } - - [Serializable] - public class PlayerStatistic - { - /// - /// Statistic ID - /// - public string Id { get; set;} - /// - /// Statistic version (0 if not a versioned statistic) - /// - public int StatisticVersion { get; set;} - /// - /// Current statistic value - /// - public int StatisticValue { get; set;} - /// - /// Statistic name - /// - public string Name { get; set;} - } - - [Serializable] - public class PlayerStatisticDefinition - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// current active version of the statistic, incremented each time the statistic resets - /// - public uint CurrentVersion { get; set;} - /// - /// interval at which the values of the statistic for all players are reset automatically - /// - public StatisticResetIntervalOption? VersionChangeInterval { get; set;} - /// - /// the aggregation method to use in updating the statistic (defaults to last) - /// - public StatisticAggregationMethod? AggregationMethod { get; set;} - } - - [Serializable] - public class PlayerStatisticVersion - { - /// - /// name of the statistic when the version became active - /// - public string StatisticName { get; set;} - /// - /// version of the statistic - /// - public uint Version { get; set;} - /// - /// time at which the statistic version was scheduled to become active, based on the configured ResetInterval - /// - public DateTime? ScheduledActivationTime { get; set;} - /// - /// time when the statistic version became active - /// - public DateTime ActivationTime { get; set;} - /// - /// time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval - /// - public DateTime? ScheduledDeactivationTime { get; set;} - /// - /// time when the statistic version became inactive due to statistic version incrementing - /// - public DateTime? DeactivationTime { get; set;} - /// - /// status of the process of saving player statistic values of the previous version to a downloadable archive - /// - public StatisticVersionArchivalStatus? ArchivalStatus { get; set;} - /// - /// URL for the downloadable archive of player statistic values, if available - /// - public string ArchiveDownloadUrl { get; set;} - } - - public enum PushNotificationPlatform - { - ApplePushNotificationService, - GoogleCloudMessaging - } - - [Serializable] - public class PushNotificationRegistration - { - /// - /// Push notification platform - /// - public PushNotificationPlatform? Platform { get; set;} - /// - /// Notification configured endpoint - /// - public string NotificationEndpointARN { get; set;} - } - - [Serializable] - public class RandomResultTable - { - /// - /// Unique name for this drop table - /// - public string TableId { get; set;} - /// - /// Child nodes that indicate what kind of drop table item this actually is. - /// - public List Nodes { get; set;} - } - - [Serializable] - public class RandomResultTableListing - { - /// - /// Catalog version this table is associated with - /// - public string CatalogVersion { get; set;} - /// - /// Unique name for this drop table - /// - public string TableId { get; set;} - /// - /// Child nodes that indicate what kind of drop table item this actually is. - /// - public List Nodes { get; set;} - } - - [Serializable] - public class RefundPurchaseRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique order ID for the purchase in question. - /// - public string OrderId { get; set;} - /// - /// Reason for refund. In the case of Facebook this must match one of their refund or dispute resolution enums (See: https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) - /// - public string Reason { get; set;} - } - - [Serializable] - public class RefundPurchaseResponse : PlayFabResultCommon - { - /// - /// The order's updated purchase status. - /// - public string PurchaseStatus { get; set;} - } - - public enum Region - { - USCentral, - USEast, - EUWest, - Singapore, - Japan, - Brazil, - Australia - } - - [Serializable] - public class RemovePlayerTagRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique tag for player profile. - /// - public string TagName { get; set;} - } - - [Serializable] - public class RemovePlayerTagResult : PlayFabResultCommon - { - } - - [Serializable] - public class RemoveServerBuildRequest : PlayFabRequestCommon - { - /// - /// unique identifier of the previously uploaded build executable to be removed - /// - public string BuildId { get; set;} - } - - [Serializable] - public class RemoveServerBuildResult : PlayFabResultCommon - { - } - - [Serializable] - public class RemoveVirtualCurrencyTypesRequest : PlayFabRequestCommon - { - /// - /// List of virtual currencies to delete - /// - public List VirtualCurrencies { get; set;} - } - - [Serializable] - public class ResetCharacterStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class ResetCharacterStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class ResetUsersRequest : PlayFabRequestCommon - { - /// - /// Array of users to reset - /// - public List Users { get; set;} - } - - [Serializable] - public class ResetUserStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class ResetUserStatisticsResult : PlayFabResultCommon - { - } - - public enum ResolutionOutcome - { - Revoke, - Reinstate, - Manual - } - - [Serializable] - public class ResolvePurchaseDisputeRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique order ID for the purchase in question. - /// - public string OrderId { get; set;} - /// - /// Reason for refund. In the case of Facebook this must match one of their refund or dispute resolution enums (See: https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) - /// - public string Reason { get; set;} - /// - /// Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and Manual. Manual will cause no change to the order state. - /// - public ResolutionOutcome Outcome { get; set;} - } - - [Serializable] - public class ResolvePurchaseDisputeResponse : PlayFabResultCommon - { - /// - /// The order's updated purchase status. - /// - public string PurchaseStatus { get; set;} - } - - [Serializable] - public class ResultTableNode - { - /// - /// Whether this entry in the table is an item or a link to another table - /// - public ResultTableNodeType ResultItemType { get; set;} - /// - /// Either an ItemId, or the TableId of another random result table - /// - public string ResultItem { get; set;} - /// - /// How likely this is to be rolled - larger numbers add more weight - /// - public int Weight { get; set;} - } - - public enum ResultTableNodeType - { - ItemId, - TableId - } - - [Serializable] - public class RevokeAllBansForUserRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class RevokeAllBansForUserResult : PlayFabResultCommon - { - /// - /// Information on the bans that were revoked. - /// - public List BanData { get; set;} - } - - [Serializable] - public class RevokeBansRequest : PlayFabRequestCommon - { - /// - /// Ids of the bans to be revoked. Maximum 100. - /// - public List BanIds { get; set;} - } - - [Serializable] - public class RevokeBansResult : PlayFabResultCommon - { - /// - /// Information on the bans that were revoked - /// - public List BanData { get; set;} - } - - [Serializable] - public class RevokeInventoryItemRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - } - - [Serializable] - public class RevokeInventoryResult : PlayFabResultCommon - { - } - - [Serializable] - public class SendAccountRecoveryEmailRequest : PlayFabRequestCommon - { - /// - /// User email address attached to their account - /// - public string Email { get; set;} - } - - [Serializable] - public class SendAccountRecoveryEmailResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetPublishedRevisionRequest : PlayFabRequestCommon - { - /// - /// Version number - /// - public int Version { get; set;} - /// - /// Revision to make the current published revision - /// - public int Revision { get; set;} - } - - [Serializable] - public class SetPublishedRevisionResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetPublisherDataRequest : PlayFabRequestCommon - { - /// - /// key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. - /// - public string Key { get; set;} - /// - /// new value to set. Set to null to remove a value - /// - public string Value { get; set;} - } - - [Serializable] - public class SetPublisherDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetTitleDataRequest : PlayFabRequestCommon - { - /// - /// key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. - /// - public string Key { get; set;} - /// - /// new value to set. Set to null to remove a value - /// - public string Value { get; set;} - } - - [Serializable] - public class SetTitleDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetupPushNotificationRequest : PlayFabRequestCommon - { - /// - /// name of the application sending the message (application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) - /// - public string Name { get; set;} - /// - /// supported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud Messaging (GCM) for Android - /// - public string Platform { get; set;} - /// - /// for APNS, this is the PlatformPrincipal (SSL Certificate) - /// - public string Key { get; set;} - /// - /// Credential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM - /// - public string Credential { get; set;} - /// - /// replace any existing ARN with the newly generated one. If this is set to false, an error will be returned if notifications have already setup for this platform. - /// - public bool OverwriteOldARN { get; set;} - } - - [Serializable] - public class SetupPushNotificationResult : PlayFabResultCommon - { - /// - /// Amazon Resource Name for the created notification topic. - /// - public string ARN { get; set;} - } - - public enum SourceType - { - Admin, - BackEnd, - GameClient, - GameServer, - Partner - } - - public enum StatisticAggregationMethod - { - Last, - Min, - Max, - Sum - } - - public enum StatisticResetIntervalOption - { - Never, - Hour, - Day, - Week, - Month - } - - public enum StatisticVersionArchivalStatus - { - NotScheduled, - Scheduled, - Queued, - InProgress, - Complete - } - - /// - /// A store entry that list a catalog item at a particular price - /// - [Serializable] - public class StoreItem - { - /// - /// Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog - /// - public string ItemId { get; set;} - /// - /// Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// Override prices for this item for specific currencies - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// Store specific custom data. The data only exists as part of this store; it is not transferred to item instances - /// - public object CustomData { get; set;} - /// - /// Intended display position for this item. Note that 0 is the first position - /// - public uint? DisplayPosition { get; set;} - } - - /// - /// Marketing data about a specific store - /// - [Serializable] - public class StoreMarketingModel - { - /// - /// Display name of a store as it will appear to users. - /// - public string DisplayName { get; set;} - /// - /// Tagline for a store. - /// - public string Description { get; set;} - /// - /// Custom data about a store. - /// - public object Metadata { get; set;} - } - - [Serializable] - public class SubtractUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose virtual currency balance is to be decreased. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which is to be decremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be subtracted from the user balance of the specified virtual currency. - /// - public int Amount { get; set;} - } - - public enum TitleActivationStatus - { - None, - ActivatedTitleKey, - PendingSteam, - ActivatedSteam, - RevokedSteam - } - - /// - /// Represents a single update ban request. - /// - [Serializable] - public class UpdateBanRequest : PlayFabRequestCommon - { - /// - /// The id of the ban to be updated. - /// - public string BanId { get; set;} - /// - /// The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. - /// - public string Reason { get; set;} - /// - /// The updated expiration date for the ban. Null for no change. - /// - public DateTime? Expires { get; set;} - /// - /// The updated IP address for the ban. Null for no change. - /// - public string IPAddress { get; set;} - /// - /// The updated MAC address for the ban. Null for no change. - /// - public string MACAddress { get; set;} - /// - /// Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. - /// - public bool? Permanent { get; set;} - /// - /// The updated active state for the ban. Null for no change. - /// - public bool? Active { get; set;} - } - - [Serializable] - public class UpdateBansRequest : PlayFabRequestCommon - { - /// - /// List of bans to be updated. Maximum 100. - /// - public List Bans { get; set;} - } - - [Serializable] - public class UpdateBansResult : PlayFabResultCommon - { - /// - /// Information on the bans that were updated - /// - public List BanData { get; set;} - } - - [Serializable] - public class UpdateCatalogItemsRequest : PlayFabRequestCommon - { - /// - /// Which catalog is being updated. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - /// - /// Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will always set it. - /// - public bool? SetAsDefaultCatalog { get; set;} - /// - /// Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not required and ignored in this call. - /// - public List Catalog { get; set;} - } - - [Serializable] - public class UpdateCatalogItemsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateCloudScriptRequest : PlayFabRequestCommon - { - /// - /// Deprecated - Do not use - /// - [Obsolete("No longer available", true)] - public int? Version { get; set;} - /// - /// List of Cloud Script files to upload to create the new revision. Must have at least one file. - /// - public List Files { get; set;} - /// - /// Immediately publish the new revision - /// - public bool Publish { get; set;} - /// - /// PlayFab user ID of the developer initiating the request. - /// - public string DeveloperPlayFabId { get; set;} - } - - [Serializable] - public class UpdateCloudScriptResult : PlayFabResultCommon - { - /// - /// Cloud Script version updated - /// - public int Version { get; set;} - /// - /// New revision number created - /// - public int Revision { get; set;} - } - - [Serializable] - public class UpdatePlayerStatisticDefinitionRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// interval at which the values of the statistic for all players are reset (changes are effective at the next occurance of the new interval boundary) - /// - public StatisticResetIntervalOption? VersionChangeInterval { get; set;} - /// - /// the aggregation method to use in updating the statistic (defaults to last) - /// - public StatisticAggregationMethod? AggregationMethod { get; set;} - } - - [Serializable] - public class UpdatePlayerStatisticDefinitionResult : PlayFabResultCommon - { - /// - /// updated statistic definition - /// - public PlayerStatisticDefinition Statistic { get; set;} - } - - [Serializable] - public class UpdateRandomResultTablesRequest : PlayFabRequestCommon - { - /// - /// which catalog is being updated. If null, update the current default catalog version - /// - public string CatalogVersion { get; set;} - /// - /// array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that table, while any others will be added to the available set) - /// - public List Tables { get; set;} - } - - [Serializable] - public class UpdateRandomResultTablesResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateStoreItemsRequest : PlayFabRequestCommon - { - /// - /// Catalog version of the store to update. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the store which is to be updated - /// - public string StoreId { get; set;} - /// - /// Additional data about the store - /// - public StoreMarketingModel MarketingData { get; set;} - /// - /// Array of store items - references to catalog items, with specific pricing - to be added - /// - public List Store { get; set;} - } - - [Serializable] - public class UpdateStoreItemsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateUserDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateUserDataResult : PlayFabResultCommon - { - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class UpdateUserInternalDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - } - - [Serializable] - public class UpdateUserTitleDisplayNameRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose title specific display name is to be changed - /// - public string PlayFabId { get; set;} - /// - /// new title display name for the user - must be between 3 and 25 characters - /// - public string DisplayName { get; set;} - } - - [Serializable] - public class UpdateUserTitleDisplayNameResult : PlayFabResultCommon - { - /// - /// current title display name for the user (this will be the original display name if the rename attempt failed) - /// - public string DisplayName { get; set;} - } - - [Serializable] - public class UserAccountInfo - { - /// - /// Unique identifier for the user account - /// - public string PlayFabId { get; set;} - /// - /// Timestamp indicating when the user account was created - /// - public DateTime Created { get; set;} - /// - /// User account name in the PlayFab service - /// - public string Username { get; set;} - /// - /// Title-specific information for the user account - /// - public UserTitleInfo TitleInfo { get; set;} - /// - /// Personal information for the user which is considered more sensitive - /// - public UserPrivateAccountInfo PrivateInfo { get; set;} - /// - /// User Facebook information, if a Facebook account has been linked - /// - public UserFacebookInfo FacebookInfo { get; set;} - /// - /// User Steam information, if a Steam account has been linked - /// - public UserSteamInfo SteamInfo { get; set;} - /// - /// User Gamecenter information, if a Gamecenter account has been linked - /// - public UserGameCenterInfo GameCenterInfo { get; set;} - /// - /// User iOS device information, if an iOS device has been linked - /// - public UserIosDeviceInfo IosDeviceInfo { get; set;} - /// - /// User Android device information, if an Android device has been linked - /// - public UserAndroidDeviceInfo AndroidDeviceInfo { get; set;} - /// - /// User Kongregate account information, if a Kongregate account has been linked - /// - public UserKongregateInfo KongregateInfo { get; set;} - /// - /// User Twitch account information, if a Twitch account has been linked - /// - public UserTwitchInfo TwitchInfo { get; set;} - /// - /// User PSN account information, if a PSN account has been linked - /// - public UserPsnInfo PsnInfo { get; set;} - /// - /// User Google account information, if a Google account has been linked - /// - public UserGoogleInfo GoogleInfo { get; set;} - /// - /// User XBox account information, if a XBox account has been linked - /// - public UserXboxInfo XboxInfo { get; set;} - /// - /// Custom ID information, if a custom ID has been assigned - /// - public UserCustomIdInfo CustomIdInfo { get; set;} - } - - [Serializable] - public class UserAndroidDeviceInfo - { - /// - /// Android device ID - /// - public string AndroidDeviceId { get; set;} - } - - [Serializable] - public class UserCredentials - { - /// - /// Username of user to reset - /// - public string Username { get; set;} - /// - /// Password for the PlayFab account (6-100 characters) - /// - public string Password { get; set;} - } - - [Serializable] - public class UserCustomIdInfo - { - /// - /// Custom ID - /// - public string CustomId { get; set;} - } - - /// - /// Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - /// - public enum UserDataPermission - { - Private, - Public - } - - [Serializable] - public class UserDataRecord - { - /// - /// Data stored for the specified user data key. - /// - public string Value { get; set;} - /// - /// Timestamp for when this data was last updated. - /// - public DateTime LastUpdated { get; set;} - /// - /// Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UserFacebookInfo - { - /// - /// Facebook identifier - /// - public string FacebookId { get; set;} - /// - /// Facebook full name - /// - public string FullName { get; set;} - } - - [Serializable] - public class UserGameCenterInfo - { - /// - /// Gamecenter identifier - /// - public string GameCenterId { get; set;} - } - - [Serializable] - public class UserGoogleInfo - { - /// - /// Google ID - /// - public string GoogleId { get; set;} - /// - /// Email address of the Google account - /// - public string GoogleEmail { get; set;} - /// - /// Locale of the Google account - /// - public string GoogleLocale { get; set;} - /// - /// Gender information of the Google account - /// - public string GoogleGender { get; set;} - } - - [Serializable] - public class UserIosDeviceInfo - { - /// - /// iOS device ID - /// - public string IosDeviceId { get; set;} - } - - [Serializable] - public class UserKongregateInfo - { - /// - /// Kongregate ID - /// - public string KongregateId { get; set;} - /// - /// Kongregate Username - /// - public string KongregateName { get; set;} - } - - public enum UserOrigination - { - Organic, - Steam, - Google, - Amazon, - Facebook, - Kongregate, - GamersFirst, - Unknown, - IOS, - LoadTest, - Android, - PSN, - GameCenter, - CustomId, - XboxLive, - Parse, - Twitch - } - - [Serializable] - public class UserPrivateAccountInfo - { - /// - /// user email address - /// - public string Email { get; set;} - } - - [Serializable] - public class UserPsnInfo - { - /// - /// PSN account ID - /// - public string PsnAccountId { get; set;} - /// - /// PSN online ID - /// - public string PsnOnlineId { get; set;} - } - - [Serializable] - public class UserSteamInfo - { - /// - /// Steam identifier - /// - public string SteamId { get; set;} - /// - /// the country in which the player resides, from Steam data - /// - public string SteamCountry { get; set;} - /// - /// currency type set in the user Steam account - /// - public Currency? SteamCurrency { get; set;} - /// - /// what stage of game ownership the user is listed as being in, from Steam - /// - public TitleActivationStatus? SteamActivationStatus { get; set;} - } - - [Serializable] - public class UserTitleInfo - { - /// - /// name of the user, as it is displayed in-game - /// - public string DisplayName { get; set;} - /// - /// source by which the user first joined the game, if known - /// - public UserOrigination? Origination { get; set;} - /// - /// timestamp indicating when the user was first associated with this game (this can differ significantly from when the user first registered with PlayFab) - /// - public DateTime Created { get; set;} - /// - /// timestamp for the last user login for this title - /// - public DateTime? LastLogin { get; set;} - /// - /// timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other events, such as issuing a beta key to the user, can associate the title to the user) - /// - public DateTime? FirstLogin { get; set;} - /// - /// boolean indicating whether or not the user is currently banned for a title - /// - public bool? isBanned { get; set;} - } - - [Serializable] - public class UserTwitchInfo - { - /// - /// Twitch ID - /// - public string TwitchId { get; set;} - /// - /// Twitch Username - /// - public string TwitchUserName { get; set;} - } - - [Serializable] - public class UserXboxInfo - { - /// - /// XBox user ID - /// - public string XboxUserId { get; set;} - } - - [Serializable] - public class VirtualCurrencyData - { - /// - /// unique one- or two-character identifier for this currency type (e.g.: "CC", "G") - /// - public string CurrencyCode { get; set;} - /// - /// friendly name to show in the developer portal, reports, etc. - /// - public string DisplayName { get; set;} - /// - /// amount to automatically grant users upon first login to the title - /// - public int? InitialDeposit { get; set;} - /// - /// rate at which the currency automatically be added to over time, in units per day (24 hours) - /// - public int? RechargeRate { get; set;} - /// - /// maximum amount to which the currency will recharge (cannot exceed MaxAmount, but can be less) - /// - public int? RechargeMax { get; set;} - } - - [Serializable] - public class VirtualCurrencyRechargeTime - { - /// - /// Time remaining (in seconds) before the next recharge increment of the virtual currency. - /// - public int SecondsToRecharge { get; set;} - /// - /// Server timestamp in UTC indicating the next time the virtual currency will be incremented. - /// - public DateTime RechargeTime { get; set;} - /// - /// Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen below this value. - /// - public int RechargeMax { get; set;} - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs.meta deleted file mode 100755 index 98594459..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabAdminModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5d7a769446de4b7459591c36c05197ed -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs deleted file mode 100755 index 5d70835a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs +++ /dev/null @@ -1,170 +0,0 @@ -#if ENABLE_PLAYFABADMIN_API -using PlayFab.AdminModels; - -namespace PlayFab.Events -{ - public partial class PlayFabEvents - { - public event PlayFabRequestEvent OnAdminBanUsersRequestEvent; - public event PlayFabResultEvent OnAdminBanUsersResultEvent; - public event PlayFabRequestEvent OnAdminGetUserAccountInfoRequestEvent; - public event PlayFabResultEvent OnAdminGetUserAccountInfoResultEvent; - public event PlayFabRequestEvent OnAdminGetUserBansRequestEvent; - public event PlayFabResultEvent OnAdminGetUserBansResultEvent; - public event PlayFabRequestEvent OnAdminResetUsersRequestEvent; - public event PlayFabResultEvent OnAdminResetUsersResultEvent; - public event PlayFabRequestEvent OnAdminRevokeAllBansForUserRequestEvent; - public event PlayFabResultEvent OnAdminRevokeAllBansForUserResultEvent; - public event PlayFabRequestEvent OnAdminRevokeBansRequestEvent; - public event PlayFabResultEvent OnAdminRevokeBansResultEvent; - public event PlayFabRequestEvent OnAdminSendAccountRecoveryEmailRequestEvent; - public event PlayFabResultEvent OnAdminSendAccountRecoveryEmailResultEvent; - public event PlayFabRequestEvent OnAdminUpdateBansRequestEvent; - public event PlayFabResultEvent OnAdminUpdateBansResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserTitleDisplayNameRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserTitleDisplayNameResultEvent; - public event PlayFabRequestEvent OnAdminCreatePlayerStatisticDefinitionRequestEvent; - public event PlayFabResultEvent OnAdminCreatePlayerStatisticDefinitionResultEvent; - public event PlayFabRequestEvent OnAdminDeleteUsersRequestEvent; - public event PlayFabResultEvent OnAdminDeleteUsersResultEvent; - public event PlayFabRequestEvent OnAdminGetDataReportRequestEvent; - public event PlayFabResultEvent OnAdminGetDataReportResultEvent; - public event PlayFabRequestEvent OnAdminGetPlayerStatisticDefinitionsRequestEvent; - public event PlayFabResultEvent OnAdminGetPlayerStatisticDefinitionsResultEvent; - public event PlayFabRequestEvent OnAdminGetPlayerStatisticVersionsRequestEvent; - public event PlayFabResultEvent OnAdminGetPlayerStatisticVersionsResultEvent; - public event PlayFabRequestEvent OnAdminGetUserDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserDataResultEvent; - public event PlayFabRequestEvent OnAdminGetUserInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminGetUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnAdminGetUserPublisherInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserPublisherInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminGetUserPublisherReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserPublisherReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnAdminGetUserReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnAdminGetUserReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnAdminIncrementPlayerStatisticVersionRequestEvent; - public event PlayFabResultEvent OnAdminIncrementPlayerStatisticVersionResultEvent; - public event PlayFabRequestEvent OnAdminRefundPurchaseRequestEvent; - public event PlayFabResultEvent OnAdminRefundPurchaseResultEvent; - public event PlayFabRequestEvent OnAdminResetUserStatisticsRequestEvent; - public event PlayFabResultEvent OnAdminResetUserStatisticsResultEvent; - public event PlayFabRequestEvent OnAdminResolvePurchaseDisputeRequestEvent; - public event PlayFabResultEvent OnAdminResolvePurchaseDisputeResultEvent; - public event PlayFabRequestEvent OnAdminUpdatePlayerStatisticDefinitionRequestEvent; - public event PlayFabResultEvent OnAdminUpdatePlayerStatisticDefinitionResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserDataResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserPublisherInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserPublisherInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserPublisherReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserPublisherReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnAdminUpdateUserReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnAdminUpdateUserReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnAdminAddNewsRequestEvent; - public event PlayFabResultEvent OnAdminAddNewsResultEvent; - public event PlayFabRequestEvent OnAdminAddVirtualCurrencyTypesRequestEvent; - public event PlayFabResultEvent OnAdminAddVirtualCurrencyTypesResultEvent; - public event PlayFabRequestEvent OnAdminDeleteStoreRequestEvent; - public event PlayFabResultEvent OnAdminDeleteStoreResultEvent; - public event PlayFabRequestEvent OnAdminGetCatalogItemsRequestEvent; - public event PlayFabResultEvent OnAdminGetCatalogItemsResultEvent; - public event PlayFabRequestEvent OnAdminGetPublisherDataRequestEvent; - public event PlayFabResultEvent OnAdminGetPublisherDataResultEvent; - public event PlayFabRequestEvent OnAdminGetRandomResultTablesRequestEvent; - public event PlayFabResultEvent OnAdminGetRandomResultTablesResultEvent; - public event PlayFabRequestEvent OnAdminGetStoreItemsRequestEvent; - public event PlayFabResultEvent OnAdminGetStoreItemsResultEvent; - public event PlayFabRequestEvent OnAdminGetTitleDataRequestEvent; - public event PlayFabResultEvent OnAdminGetTitleDataResultEvent; - public event PlayFabRequestEvent OnAdminGetTitleInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminGetTitleInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminListVirtualCurrencyTypesRequestEvent; - public event PlayFabResultEvent OnAdminListVirtualCurrencyTypesResultEvent; - public event PlayFabRequestEvent OnAdminRemoveVirtualCurrencyTypesRequestEvent; - public event PlayFabResultEvent OnAdminRemoveVirtualCurrencyTypesResultEvent; - public event PlayFabRequestEvent OnAdminSetCatalogItemsRequestEvent; - public event PlayFabResultEvent OnAdminSetCatalogItemsResultEvent; - public event PlayFabRequestEvent OnAdminSetStoreItemsRequestEvent; - public event PlayFabResultEvent OnAdminSetStoreItemsResultEvent; - public event PlayFabRequestEvent OnAdminSetTitleDataRequestEvent; - public event PlayFabResultEvent OnAdminSetTitleDataResultEvent; - public event PlayFabRequestEvent OnAdminSetTitleInternalDataRequestEvent; - public event PlayFabResultEvent OnAdminSetTitleInternalDataResultEvent; - public event PlayFabRequestEvent OnAdminSetupPushNotificationRequestEvent; - public event PlayFabResultEvent OnAdminSetupPushNotificationResultEvent; - public event PlayFabRequestEvent OnAdminUpdateCatalogItemsRequestEvent; - public event PlayFabResultEvent OnAdminUpdateCatalogItemsResultEvent; - public event PlayFabRequestEvent OnAdminUpdateRandomResultTablesRequestEvent; - public event PlayFabResultEvent OnAdminUpdateRandomResultTablesResultEvent; - public event PlayFabRequestEvent OnAdminUpdateStoreItemsRequestEvent; - public event PlayFabResultEvent OnAdminUpdateStoreItemsResultEvent; - public event PlayFabRequestEvent OnAdminAddUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnAdminAddUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnAdminGetUserInventoryRequestEvent; - public event PlayFabResultEvent OnAdminGetUserInventoryResultEvent; - public event PlayFabRequestEvent OnAdminGrantItemsToUsersRequestEvent; - public event PlayFabResultEvent OnAdminGrantItemsToUsersResultEvent; - public event PlayFabRequestEvent OnAdminRevokeInventoryItemRequestEvent; - public event PlayFabResultEvent OnAdminRevokeInventoryItemResultEvent; - public event PlayFabRequestEvent OnAdminSubtractUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnAdminSubtractUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnAdminGetMatchmakerGameInfoRequestEvent; - public event PlayFabResultEvent OnAdminGetMatchmakerGameInfoResultEvent; - public event PlayFabRequestEvent OnAdminGetMatchmakerGameModesRequestEvent; - public event PlayFabResultEvent OnAdminGetMatchmakerGameModesResultEvent; - public event PlayFabRequestEvent OnAdminModifyMatchmakerGameModesRequestEvent; - public event PlayFabResultEvent OnAdminModifyMatchmakerGameModesResultEvent; - public event PlayFabRequestEvent OnAdminAddServerBuildRequestEvent; - public event PlayFabResultEvent OnAdminAddServerBuildResultEvent; - public event PlayFabRequestEvent OnAdminGetServerBuildInfoRequestEvent; - public event PlayFabResultEvent OnAdminGetServerBuildInfoResultEvent; - public event PlayFabRequestEvent OnAdminGetServerBuildUploadUrlRequestEvent; - public event PlayFabResultEvent OnAdminGetServerBuildUploadUrlResultEvent; - public event PlayFabRequestEvent OnAdminListServerBuildsRequestEvent; - public event PlayFabResultEvent OnAdminListServerBuildsResultEvent; - public event PlayFabRequestEvent OnAdminModifyServerBuildRequestEvent; - public event PlayFabResultEvent OnAdminModifyServerBuildResultEvent; - public event PlayFabRequestEvent OnAdminRemoveServerBuildRequestEvent; - public event PlayFabResultEvent OnAdminRemoveServerBuildResultEvent; - public event PlayFabRequestEvent OnAdminSetPublisherDataRequestEvent; - public event PlayFabResultEvent OnAdminSetPublisherDataResultEvent; - public event PlayFabRequestEvent OnAdminGetCloudScriptRevisionRequestEvent; - public event PlayFabResultEvent OnAdminGetCloudScriptRevisionResultEvent; - public event PlayFabRequestEvent OnAdminGetCloudScriptVersionsRequestEvent; - public event PlayFabResultEvent OnAdminGetCloudScriptVersionsResultEvent; - public event PlayFabRequestEvent OnAdminSetPublishedRevisionRequestEvent; - public event PlayFabResultEvent OnAdminSetPublishedRevisionResultEvent; - public event PlayFabRequestEvent OnAdminUpdateCloudScriptRequestEvent; - public event PlayFabResultEvent OnAdminUpdateCloudScriptResultEvent; - public event PlayFabRequestEvent OnAdminDeleteContentRequestEvent; - public event PlayFabResultEvent OnAdminDeleteContentResultEvent; - public event PlayFabRequestEvent OnAdminGetContentListRequestEvent; - public event PlayFabResultEvent OnAdminGetContentListResultEvent; - public event PlayFabRequestEvent OnAdminGetContentUploadUrlRequestEvent; - public event PlayFabResultEvent OnAdminGetContentUploadUrlResultEvent; - public event PlayFabRequestEvent OnAdminResetCharacterStatisticsRequestEvent; - public event PlayFabResultEvent OnAdminResetCharacterStatisticsResultEvent; - public event PlayFabRequestEvent OnAdminAddPlayerTagRequestEvent; - public event PlayFabResultEvent OnAdminAddPlayerTagResultEvent; - public event PlayFabRequestEvent OnAdminGetAllActionGroupsRequestEvent; - public event PlayFabResultEvent OnAdminGetAllActionGroupsResultEvent; - public event PlayFabRequestEvent OnAdminGetAllSegmentsRequestEvent; - public event PlayFabResultEvent OnAdminGetAllSegmentsResultEvent; - public event PlayFabRequestEvent OnAdminGetPlayerSegmentsRequestEvent; - public event PlayFabResultEvent OnAdminGetPlayerSegmentsResultEvent; - public event PlayFabRequestEvent OnAdminGetPlayersInSegmentRequestEvent; - public event PlayFabResultEvent OnAdminGetPlayersInSegmentResultEvent; - public event PlayFabRequestEvent OnAdminGetPlayerTagsRequestEvent; - public event PlayFabResultEvent OnAdminGetPlayerTagsResultEvent; - public event PlayFabRequestEvent OnAdminRemovePlayerTagRequestEvent; - public event PlayFabResultEvent OnAdminRemovePlayerTagResultEvent; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs.meta deleted file mode 100755 index 6d719e8c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabEvents.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 17d913d4a2b01d044a0f70f2679f2fca -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs deleted file mode 100755 index 77919db5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs +++ /dev/null @@ -1,14 +0,0 @@ -#if ENABLE_PLAYFABADMIN_API -using System; -using UnityEngine; -using System.Collections; -using PlayFab.Internal; - -namespace PlayFab -{ - public static partial class PlayFabSettings - { - - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs.meta deleted file mode 100755 index 218d17ac..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Admin/PlayFabSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 408e9b80d4674c1479f859704ba01b09 -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client.meta deleted file mode 100755 index c4bdb8f7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ea91f77d2459767449ffe7e92185faa3 -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs deleted file mode 100755 index 7358b28c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs +++ /dev/null @@ -1,1344 +0,0 @@ -#if !DISABLE_PLAYFABCLIENT_API -using System; -using PlayFab.ClientModels; -using PlayFab.Internal; -using PlayFab.Json; - -namespace PlayFab -{ - /// - /// APIs which provide the full range of PlayFab features available to the client - authentication, account and data management, inventory, friends, matchmaking, reporting, and platform-specific functionality - /// - public static class PlayFabClientAPI - { - - /// - /// Check to See if the client is logged in. - /// - /// boolean - public static bool IsClientLoggedIn() - { - return PlayFabHttp.IsClientLoggedIn(); - } - - /// - /// Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See https://api.playfab.com/docs/using-photon-with-playfab/ for more details. - /// - public static void GetPhotonAuthenticationToken(GetPhotonAuthenticationTokenRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPhotonAuthenticationToken", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithAndroidDeviceID(LoginWithAndroidDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithAndroidDeviceID", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithCustomID(LoginWithCustomIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithCustomID", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithEmailAddress(LoginWithEmailAddressRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithEmailAddress", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithFacebook(LoginWithFacebookRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithFacebook", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithGameCenter(LoginWithGameCenterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithGameCenter", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a Google account access token(https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods), returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithGoogleAccount(LoginWithGoogleAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithGoogleAccount", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithIOSDeviceID(LoginWithIOSDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithIOSDeviceID", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a Kongregate player account. - /// - public static void LoginWithKongregate(LoginWithKongregateRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithKongregate", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Unlike other login API calls, LoginWithEmailAddress does not permit the creation of new accounts via the CreateAccountFlag. Email accounts must be created using the RegisterPlayFabUser API or added to existing accounts using AddUsernamePassword. - /// - public static void LoginWithPlayFab(LoginWithPlayFabRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithPlayFab", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user - /// - public static void LoginWithSteam(LoginWithSteamRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithSteam", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Signs the user in using a Twitch access token. - /// - public static void LoginWithTwitch(LoginWithTwitchRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LoginWithTwitch", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. - /// - public static void RegisterPlayFabUser(RegisterPlayFabUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - request.TitleId = request.TitleId ?? PlayFabSettings.TitleId; - if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RegisterPlayFabUser", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. - /// - public static void AddGenericID(AddGenericIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AddGenericID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device ID login. - /// - public static void AddUsernamePassword(AddUsernamePasswordRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AddUsernamePassword", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the user's PlayFab account details - /// - public static void GetAccountInfo(GetAccountInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetAccountInfo", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves all of the user's different kinds of info. - /// - public static void GetPlayerCombinedInfo(GetPlayerCombinedInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerCombinedInfo", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. - /// - public static void GetPlayFabIDsFromFacebookIDs(GetPlayFabIDsFromFacebookIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromFacebookIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). - /// - public static void GetPlayFabIDsFromGameCenterIDs(GetPlayFabIDsFromGameCenterIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromGameCenterIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. - /// - public static void GetPlayFabIDsFromGenericIDs(GetPlayFabIDsFromGenericIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromGenericIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. - /// - public static void GetPlayFabIDsFromGoogleIDs(GetPlayFabIDsFromGoogleIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromGoogleIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: http://developers.kongregate.com/docs/client/getUserId). - /// - public static void GetPlayFabIDsFromKongregateIDs(GetPlayFabIDsFromKongregateIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromKongregateIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. - /// - public static void GetPlayFabIDsFromSteamIDs(GetPlayFabIDsFromSteamIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromSteamIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for the user accounts, available as "_id" from the Twitch API methods (ex: https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). - /// - public static void GetPlayFabIDsFromTwitchIDs(GetPlayFabIDsFromTwitchIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayFabIDsFromTwitchIDs", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. - /// - [Obsolete("Use 'GetPlayerCombinedInfo' instead", false)] - public static void GetUserCombinedInfo(GetUserCombinedInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserCombinedInfo", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Android device identifier to the user's PlayFab account - /// - public static void LinkAndroidDeviceID(LinkAndroidDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkAndroidDeviceID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the custom identifier, generated by the title, to the user's PlayFab account - /// - public static void LinkCustomID(LinkCustomIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkCustomID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account - /// - public static void LinkFacebookAccount(LinkFacebookAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkFacebookAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account - /// - public static void LinkGameCenterAccount(LinkGameCenterAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkGameCenterAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the currently signed-in user account to the Google account specified by the Google account access token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). - /// - public static void LinkGoogleAccount(LinkGoogleAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkGoogleAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the vendor-specific iOS device identifier to the user's PlayFab account - /// - public static void LinkIOSDeviceID(LinkIOSDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkIOSDeviceID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Kongregate identifier to the user's PlayFab account - /// - public static void LinkKongregate(LinkKongregateAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkKongregate", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account - /// - public static void LinkSteamAccount(LinkSteamAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkSteamAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Links the Twitch account associated with the token to the user's PlayFab account. - /// - public static void LinkTwitch(LinkTwitchAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LinkTwitch", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Removes the specified generic service identifier from the player's PlayFab account. - /// - public static void RemoveGenericID(RemoveGenericIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RemoveGenericID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. - /// - public static void ReportPlayer(ReportPlayerClientRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ReportPlayer", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password - /// - public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - - PlayFabHttp.MakeApiCall("/Client/SendAccountRecoveryEmail", request, AuthType.None, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Android device identifier from the user's PlayFab account - /// - public static void UnlinkAndroidDeviceID(UnlinkAndroidDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkAndroidDeviceID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related custom identifier from the user's PlayFab account - /// - public static void UnlinkCustomID(UnlinkCustomIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkCustomID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Facebook account from the user's PlayFab account - /// - public static void UnlinkFacebookAccount(UnlinkFacebookAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkFacebookAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Game Center account from the user's PlayFab account - /// - public static void UnlinkGameCenterAccount(UnlinkGameCenterAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkGameCenterAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Google account from the user's PlayFab account (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). - /// - public static void UnlinkGoogleAccount(UnlinkGoogleAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkGoogleAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related iOS device identifier from the user's PlayFab account - /// - public static void UnlinkIOSDeviceID(UnlinkIOSDeviceIDRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkIOSDeviceID", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Kongregate identifier from the user's PlayFab account - /// - public static void UnlinkKongregate(UnlinkKongregateAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkKongregate", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Steam account from the user's PlayFab account - /// - public static void UnlinkSteamAccount(UnlinkSteamAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkSteamAccount", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Unlinks the related Twitch account from the user's PlayFab account. - /// - public static void UnlinkTwitch(UnlinkTwitchAccountRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlinkTwitch", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title specific display name for the user - /// - public static void UpdateUserTitleDisplayName(UpdateUserTitleDisplayNameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateUserTitleDisplayName", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetFriendLeaderboard(GetFriendLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetFriendLeaderboard", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user - /// - [Obsolete("Use 'GetFriendLeaderboardAroundPlayer' instead", true)] - public static void GetFriendLeaderboardAroundCurrentUser(GetFriendLeaderboardAroundCurrentUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetFriendLeaderboardAroundCurrentUser", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab user. If PlayFabId is empty or null will return currently logged in user. - /// - public static void GetFriendLeaderboardAroundPlayer(GetFriendLeaderboardAroundPlayerRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetFriendLeaderboardAroundPlayer", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetLeaderboard(GetLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetLeaderboard", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user - /// - [Obsolete("Use 'GetLeaderboardAroundPlayer' instead", true)] - public static void GetLeaderboardAroundCurrentUser(GetLeaderboardAroundCurrentUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetLeaderboardAroundCurrentUser", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or null will return currently logged in user. - /// - public static void GetLeaderboardAroundPlayer(GetLeaderboardAroundPlayerRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetLeaderboardAroundPlayer", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local player. - /// - public static void GetPlayerStatistics(GetPlayerStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the information on the available versions of the specified statistic. - /// - public static void GetPlayerStatisticVersions(GetPlayerStatisticVersionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerStatisticVersions", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserPublisherData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserPublisherData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which can only be read by the client - /// - public static void GetUserPublisherReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserPublisherReadOnlyData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which can only be read by the client - /// - public static void GetUserReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserReadOnlyData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details of all title-specific statistics for the user - /// - [Obsolete("Use 'GetPlayerStatistics' instead", true)] - public static void GetUserStatistics(GetUserStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. - /// - public static void UpdatePlayerStatistics(UpdatePlayerStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdatePlayerStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Creates and updates the title-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateUserData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Creates and updates the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserPublisherData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateUserPublisherData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. - /// - [Obsolete("Use 'UpdatePlayerStatistics' instead", true)] - public static void UpdateUserStatistics(UpdateUserStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateUserStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified version of the title's catalog of virtual goods, including all defined properties - /// - public static void GetCatalogItems(GetCatalogItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCatalogItems", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom publisher settings - /// - public static void GetPublisherData(GetPublisherDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPublisherData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the set of items defined for the specified store, including all prices defined - /// - public static void GetStoreItems(GetStoreItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetStoreItems", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the current server time - /// - public static void GetTime(GetTimeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetTime", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom title settings - /// - public static void GetTitleData(GetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetTitleData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title news feed, as configured in the developer portal - /// - public static void GetTitleNews(GetTitleNewsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetTitleNews", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Increments the user's balance of the specified virtual currency by the stated amount - /// - public static void AddUserVirtualCurrency(AddUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AddUserVirtualCurrency", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate - /// - public static void ConfirmPurchase(ConfirmPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ConfirmPurchase", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. - /// - public static void ConsumeItem(ConsumeItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ConsumeItem", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified character's current inventory of virtual goods - /// - public static void GetCharacterInventory(GetCharacterInventoryRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCharacterInventory", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a completed purchase along with its current PlayFab status. - /// - public static void GetPurchase(GetPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPurchase", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the user's current inventory of virtual goods - /// - public static void GetUserInventory(GetUserInventoryRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetUserInventory", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Selects a payment option for purchase order created via StartPurchase - /// - public static void PayForPurchase(PayForPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/PayForPurchase", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. - /// - public static void PurchaseItem(PurchaseItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/PurchaseItem", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. - /// - public static void RedeemCoupon(RedeemCouponRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RedeemCoupon", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Creates an order for a list of items from the title catalog - /// - public static void StartPurchase(StartPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/StartPurchase", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Decrements the user's balance of the specified virtual currency by the stated amount - /// - public static void SubtractUserVirtualCurrency(SubtractUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/SubtractUserVirtualCurrency", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. - /// - public static void UnlockContainerInstance(UnlockContainerInstanceRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlockContainerInstance", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. - /// - public static void UnlockContainerItem(UnlockContainerItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UnlockContainerItem", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. - /// - public static void AddFriend(AddFriendRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AddFriend", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. - /// - public static void GetFriendsList(GetFriendsListRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetFriendsList", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Removes a specified user from the friend list of the local user - /// - public static void RemoveFriend(RemoveFriendRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RemoveFriend", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Updates the tag list for a specified user in the friend list of the local user - /// - public static void SetFriendTags(SetFriendTagsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/SetFriendTags", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Registers the iOS device to receive push notifications - /// - public static void RegisterForIOSPushNotification(RegisterForIOSPushNotificationRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RegisterForIOSPushNotification", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Restores all in-app purchases based on the given refresh receipt. - /// - public static void RestoreIOSPurchases(RestoreIOSPurchasesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RestoreIOSPurchases", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - /// - public static void ValidateIOSReceipt(ValidateIOSReceiptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ValidateIOSReceipt", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Get details about all current running game servers matching the given parameters. - /// - public static void GetCurrentGames(CurrentGamesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCurrentGames", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Get details about the regions hosting game servers matching the given parameters. - /// - public static void GetGameServerRegions(GameServerRegionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetGameServerRegions", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. Note that EnableQueue is deprecated at this time. - /// - public static void Matchmake(MatchmakeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/Matchmake", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Start a new game server with a given configuration, add the current player and return the connection information. - /// - public static void StartGame(StartGameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/StartGame", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Registers the Android device to receive push notifications - /// - public static void AndroidDevicePushNotificationRegistration(AndroidDevicePushNotificationRegistrationRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AndroidDevicePushNotificationRegistration", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Validates a Google Play purchase and gives the corresponding item to the player. - /// - public static void ValidateGooglePlayPurchase(ValidateGooglePlayPurchaseRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ValidateGooglePlayPurchase", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Logs a custom analytics event - /// - [Obsolete("Use 'WritePlayerEvent' instead", true)] - public static void LogEvent(LogEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/LogEvent", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Writes a character-based event into PlayStream. - /// - public static void WriteCharacterEvent(WriteClientCharacterEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/WriteCharacterEvent", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Writes a player-based event into PlayStream. - /// - public static void WritePlayerEvent(WriteClientPlayerEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/WritePlayerEvent", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Writes a title-based event into PlayStream. - /// - public static void WriteTitleEvent(WriteTitleEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/WriteTitleEvent", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. - /// - public static void AddSharedGroupMembers(AddSharedGroupMembersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AddSharedGroupMembers", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. - /// - public static void CreateSharedGroup(CreateSharedGroupRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/CreateSharedGroup", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. - /// - public static void GetSharedGroupData(GetSharedGroupDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetSharedGroupData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. - /// - public static void RemoveSharedGroupMembers(RemoveSharedGroupMembersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RemoveSharedGroupMembers", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. - /// - public static void UpdateSharedGroupData(UpdateSharedGroupDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateSharedGroupData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. - /// - public static void ExecuteCloudScript(ExecuteCloudScriptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ExecuteCloudScript", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - public static void ExecuteCloudScript(ExecuteCloudScriptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - Action wrappedResultCallback = (wrappedResult) => - { - var wrappedJson = JsonWrapper.SerializeObject(wrappedResult.FunctionResult, PlayFabUtil.ApiSerializerStrategy); - try { - wrappedResult.FunctionResult = JsonWrapper.DeserializeObject(wrappedJson, PlayFabUtil.ApiSerializerStrategy); - } - catch (Exception) - { - wrappedResult.FunctionResult = wrappedJson; - wrappedResult.Logs.Add(new LogStatement{ Level = "Warning", Data = wrappedJson, Message = "Sdk Message: Could not deserialize result as: " + typeof (TOut).Name }); - } - resultCallback(wrappedResult); - }; - ExecuteCloudScript(request, wrappedResultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. - /// - [Obsolete("Use 'ExecuteCloudScript' instead", true)] - public static void GetCloudScriptUrl(GetCloudScriptUrlRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCloudScriptUrl", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. - /// - [Obsolete("Use 'ExecuteCloudScript' instead", true)] - public static void RunCloudScript(RunCloudScriptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/RunCloudScript", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service - /// - public static void GetContentDownloadUrl(GetContentDownloadUrlRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetContentDownloadUrl", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. - /// - public static void GetAllUsersCharacters(ListUsersCharactersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetAllUsersCharacters", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetCharacterLeaderboard(GetCharacterLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCharacterLeaderboard", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details of all title-specific statistics for the user - /// - public static void GetCharacterStatistics(GetCharacterStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCharacterStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID - /// - public static void GetLeaderboardAroundCharacter(GetLeaderboardAroundCharacterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetLeaderboardAroundCharacter", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of all of the user's characters for the given statistic. - /// - public static void GetLeaderboardForUserCharacters(GetLeaderboardForUsersCharactersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetLeaderboardForUserCharacters", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. - /// - public static void GrantCharacterToUser(GrantCharacterToUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GrantCharacterToUser", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the specific character. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. - /// - public static void UpdateCharacterStatistics(UpdateCharacterStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateCharacterStatistics", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the character which is readable and writable by the client - /// - public static void GetCharacterData(GetCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCharacterData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the character which can only be read by the client - /// - public static void GetCharacterReadOnlyData(GetCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetCharacterReadOnlyData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Creates and updates the title-specific custom data for the user's character which is readable and writable by the client - /// - public static void UpdateCharacterData(UpdateCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/UpdateCharacterData", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - /// - public static void ValidateAmazonIAPReceipt(ValidateAmazonReceiptRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/ValidateAmazonIAPReceipt", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Accepts an open trade. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. - /// - public static void AcceptTrade(AcceptTradeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AcceptTrade", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Cancels an open trade. - /// - public static void CancelTrade(CancelTradeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/CancelTrade", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Gets all trades the player has either opened or accepted, optionally filtered by trade status. - /// - public static void GetPlayerTrades(GetPlayerTradesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerTrades", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Gets the current status of an existing trade. - /// - public static void GetTradeStatus(GetTradeStatusRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetTradeStatus", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Opens a new outstanding trade. - /// - public static void OpenTrade(OpenTradeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/OpenTrade", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Attributes an install for advertisment. - /// - public static void AttributeInstall(AttributeInstallRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/AttributeInstall", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// List all segments that a player currently belongs to at this moment in time. - /// - public static void GetPlayerSegments(GetPlayerSegmentsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerSegments", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - /// - /// Get all tags with a given Namespace (optional) from a player profile. - /// - public static void GetPlayerTags(GetPlayerTagsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (!IsClientLoggedIn()) throw new Exception("Must be logged in to call this method"); - - PlayFabHttp.MakeApiCall("/Client/GetPlayerTags", request, AuthType.LoginSession, resultCallback, errorCallback, customData); - } - - - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs.meta deleted file mode 100755 index 2050daf5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientAPI.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 90390500e82fe784caf147e8a6dee649 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs deleted file mode 100755 index ad5aad62..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs +++ /dev/null @@ -1,4656 +0,0 @@ -#if !DISABLE_PLAYFABCLIENT_API -using System; -using System.Collections.Generic; -using PlayFab.SharedModels; - -namespace PlayFab.ClientModels -{ - [Serializable] - public class AcceptTradeRequest : PlayFabRequestCommon - { - /// - /// Player who opened the trade. - /// - public string OfferingPlayerId { get; set;} - /// - /// Trade identifier. - /// - public string TradeId { get; set;} - /// - /// Items from the accepting player's or guild's inventory in exchange for the offered items in the trade. In the case of a gift, this will be null. - /// - public List AcceptedInventoryInstanceIds { get; set;} - } - - [Serializable] - public class AcceptTradeResponse : PlayFabResultCommon - { - /// - /// Details about trade which was just accepted. - /// - public TradeInfo Trade { get; set;} - } - - [Serializable] - public class AddFriendRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the user to attempt to add to the local user's friend list. - /// - public string FriendPlayFabId { get; set;} - /// - /// PlayFab username of the user to attempt to add to the local user's friend list. - /// - public string FriendUsername { get; set;} - /// - /// Email address of the user to attempt to add to the local user's friend list. - /// - public string FriendEmail { get; set;} - /// - /// Title-specific display name of the user to attempt to add to the local user's friend list. - /// - public string FriendTitleDisplayName { get; set;} - } - - [Serializable] - public class AddFriendResult : PlayFabResultCommon - { - /// - /// True if the friend request was processed successfully. - /// - public bool Created { get; set;} - } - - [Serializable] - public class AddGenericIDRequest : PlayFabRequestCommon - { - /// - /// Generic service identifier to add to the player account. - /// - public GenericServiceId GenericId { get; set;} - } - - [Serializable] - public class AddGenericIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class AddSharedGroupMembersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - } - - [Serializable] - public class AddSharedGroupMembersResult : PlayFabResultCommon - { - } - - [Serializable] - public class AddUsernamePasswordRequest : PlayFabRequestCommon - { - /// - /// PlayFab username for the account (3-20 characters) - /// - public string Username { get; set;} - /// - /// User email address attached to their account - /// - public string Email { get; set;} - /// - /// Password for the PlayFab account (6-100 characters) - /// - public string Password { get; set;} - } - - [Serializable] - public class AddUsernamePasswordResult : PlayFabResultCommon - { - /// - /// PlayFab unique user name. - /// - public string Username { get; set;} - } - - [Serializable] - public class AddUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// Name of the virtual currency which is to be incremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be added to the user balance of the specified virtual currency. - /// - public int Amount { get; set;} - } - - [Serializable] - public class AndroidDevicePushNotificationRegistrationRequest : PlayFabRequestCommon - { - /// - /// Registration ID provided by the Google Cloud Messaging service when the title registered to receive push notifications (see the GCM documentation, here: http://developer.android.com/google/gcm/client.html). - /// - public string DeviceToken { get; set;} - /// - /// If true, send a test push message immediately after sucessful registration. Defaults to false. - /// - public bool? SendPushNotificationConfirmation { get; set;} - /// - /// Message to display when confirming push notification. - /// - public string ConfirmationMessage { get; set;} - } - - [Serializable] - public class AndroidDevicePushNotificationRegistrationResult : PlayFabResultCommon - { - } - - [Serializable] - public class AttributeInstallRequest : PlayFabRequestCommon - { - /// - /// The IdentifierForAdvertisers for iOS Devices. - /// - public string Idfa { get; set;} - /// - /// The Android Id for this Android device. - /// - public string Android_Id { get; set;} - } - - [Serializable] - public class AttributeInstallResult : PlayFabResultCommon - { - } - - [Serializable] - public class CancelTradeRequest : PlayFabRequestCommon - { - /// - /// Trade identifier. - /// - public string TradeId { get; set;} - } - - [Serializable] - public class CancelTradeResponse : PlayFabResultCommon - { - /// - /// Details about trade which was just canceled. - /// - public TradeInfo Trade { get; set;} - } - - [Serializable] - public class CartItem - { - /// - /// Unique identifier for the catalog item. - /// - public string ItemId { get; set;} - /// - /// Class name to which catalog item belongs. - /// - public string ItemClass { get; set;} - /// - /// Unique instance identifier for this catalog item. - /// - public string ItemInstanceId { get; set;} - /// - /// Display name for the catalog item. - /// - public string DisplayName { get; set;} - /// - /// Description of the catalog item. - /// - public string Description { get; set;} - /// - /// Cost of the catalog item for each applicable virtual currency. - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// Cost of the catalog item for each applicable real world currency. - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// Amount of each applicable virtual currency which will be received as a result of purchasing this catalog item. - /// - public Dictionary VCAmount { get; set;} - } - - /// - /// A purchasable item from the item catalog - /// - [Serializable] - public class CatalogItem - { - /// - /// unique identifier for this item - /// - public string ItemId { get; set;} - /// - /// class to which the item belongs - /// - public string ItemClass { get; set;} - /// - /// catalog version for this item - /// - public string CatalogVersion { get; set;} - /// - /// text name for the item, to show in-game - /// - public string DisplayName { get; set;} - /// - /// text description of item, to show in-game - /// - public string Description { get; set;} - /// - /// price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// override prices for this item for specific currencies - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// list of item tags - /// - public List Tags { get; set;} - /// - /// game specific custom data - /// - public string CustomData { get; set;} - /// - /// defines the consumable properties (number of uses, timeout) for the item - /// - public CatalogItemConsumableInfo Consumable { get; set;} - /// - /// defines the container properties for the item - what items it contains, including random drop tables and virtual currencies, and what item (if any) is required to open it via the UnlockContainerItem API - /// - public CatalogItemContainerInfo Container { get; set;} - /// - /// defines the bundle properties for the item - bundles are items which contain other items, including random drop tables and virtual currencies - /// - public CatalogItemBundleInfo Bundle { get; set;} - /// - /// if true, then an item instance of this type can be used to grant a character to a user. - /// - public bool CanBecomeCharacter { get; set;} - /// - /// if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded - /// - public bool IsStackable { get; set;} - /// - /// if true, then an item instance of this type can be traded between players using the trading APIs - /// - public bool IsTradable { get; set;} - /// - /// URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. - /// - public string ItemImageUrl { get; set;} - /// - /// BETA: If true, then only a fixed number can ever be granted. - /// - public bool IsLimitedEdition { get; set;} - /// - /// BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. - /// - public int InitialLimitedEditionCount { get; set;} - } - - [Serializable] - public class CatalogItemBundleInfo - { - /// - /// unique ItemId values for all items which will be added to the player inventory when the bundle is added - /// - public List BundledItems { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) - /// - public List BundledResultTables { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the bundle is added - /// - public Dictionary BundledVirtualCurrencies { get; set;} - } - - [Serializable] - public class CatalogItemConsumableInfo - { - /// - /// number of times this object can be used, after which it will be removed from the player inventory - /// - public uint? UsageCount { get; set;} - /// - /// duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed - /// - public uint? UsagePeriod { get; set;} - /// - /// all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values added together, and share the result - when that period has elapsed, all the items in the group will be removed - /// - public string UsagePeriodGroup { get; set;} - } - - /// - /// Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. - /// - [Serializable] - public class CatalogItemContainerInfo - { - /// - /// ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will open the container, adding the contents to the player inventory and currency balances) - /// - public string KeyItemId { get; set;} - /// - /// unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked - /// - public List ItemContents { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) - /// - public List ResultTableContents { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the container is unlocked - /// - public Dictionary VirtualCurrencyContents { get; set;} - } - - [Serializable] - public class CharacterInventory - { - /// - /// The id of this character. - /// - public string CharacterId { get; set;} - /// - /// The inventory of this character. - /// - public List Inventory { get; set;} - } - - [Serializable] - public class CharacterLeaderboardEntry - { - /// - /// PlayFab unique identifier of the user for this leaderboard entry. - /// - public string PlayFabId { get; set;} - /// - /// PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. - /// - public string CharacterId { get; set;} - /// - /// Title-specific display name of the character for this leaderboard entry. - /// - public string CharacterName { get; set;} - /// - /// Title-specific display name of the user for this leaderboard entry. - /// - public string DisplayName { get; set;} - /// - /// Name of the character class for this entry. - /// - public string CharacterType { get; set;} - /// - /// Specific value of the user's statistic. - /// - public int StatValue { get; set;} - /// - /// User's overall position in the leaderboard. - /// - public int Position { get; set;} - } - - [Serializable] - public class CharacterResult : PlayFabResultCommon - { - /// - /// The id for this character on this player. - /// - public string CharacterId { get; set;} - /// - /// The name of this character. - /// - public string CharacterName { get; set;} - /// - /// The type-string that was given to this character on creation. - /// - public string CharacterType { get; set;} - } - - public enum CloudScriptRevisionOption - { - Live, - Latest, - Specific - } - - /// - /// Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. - /// - [Serializable] - public class CollectionFilter - { - /// - /// List of Include rules, with any of which if a collection matches, it is included by the filter, unless it is excluded by one of the Exclude rule - /// - public List Includes { get; set;} - /// - /// List of Exclude rules, with any of which if a collection matches, it is excluded by the filter. - /// - public List Excludes { get; set;} - } - - [Serializable] - public class ConfirmPurchaseRequest : PlayFabRequestCommon - { - /// - /// Purchase order identifier returned from StartPurchase. - /// - public string OrderId { get; set;} - } - - [Serializable] - public class ConfirmPurchaseResult : PlayFabResultCommon - { - /// - /// Purchase order identifier. - /// - public string OrderId { get; set;} - /// - /// Date and time of the purchase. - /// - public DateTime PurchaseDate { get; set;} - /// - /// Array of items purchased. - /// - public List Items { get; set;} - } - - [Serializable] - public class ConsumeItemRequest : PlayFabRequestCommon - { - /// - /// Unique instance identifier of the item to be consumed. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses to consume from the item. - /// - public int ConsumeCount { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class ConsumeItemResult : PlayFabResultCommon - { - /// - /// Unique instance identifier of the item with uses consumed. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses remaining on the item. - /// - public int RemainingUses { get; set;} - } - - /// - /// A data container - /// - [Serializable] - public class Container_Dictionary_String_String - { - /// - /// Content of data - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class CreateSharedGroupRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). - /// - public string SharedGroupId { get; set;} - } - - [Serializable] - public class CreateSharedGroupResult : PlayFabResultCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - } - - public enum Currency - { - AED, - AFN, - ALL, - AMD, - ANG, - AOA, - ARS, - AUD, - AWG, - AZN, - BAM, - BBD, - BDT, - BGN, - BHD, - BIF, - BMD, - BND, - BOB, - BRL, - BSD, - BTN, - BWP, - BYR, - BZD, - CAD, - CDF, - CHF, - CLP, - CNY, - COP, - CRC, - CUC, - CUP, - CVE, - CZK, - DJF, - DKK, - DOP, - DZD, - EGP, - ERN, - ETB, - EUR, - FJD, - FKP, - GBP, - GEL, - GGP, - GHS, - GIP, - GMD, - GNF, - GTQ, - GYD, - HKD, - HNL, - HRK, - HTG, - HUF, - IDR, - ILS, - IMP, - INR, - IQD, - IRR, - ISK, - JEP, - JMD, - JOD, - JPY, - KES, - KGS, - KHR, - KMF, - KPW, - KRW, - KWD, - KYD, - KZT, - LAK, - LBP, - LKR, - LRD, - LSL, - LYD, - MAD, - MDL, - MGA, - MKD, - MMK, - MNT, - MOP, - MRO, - MUR, - MVR, - MWK, - MXN, - MYR, - MZN, - NAD, - NGN, - NIO, - NOK, - NPR, - NZD, - OMR, - PAB, - PEN, - PGK, - PHP, - PKR, - PLN, - PYG, - QAR, - RON, - RSD, - RUB, - RWF, - SAR, - SBD, - SCR, - SDG, - SEK, - SGD, - SHP, - SLL, - SOS, - SPL, - SRD, - STD, - SVC, - SYP, - SZL, - THB, - TJS, - TMT, - TND, - TOP, - TRY, - TTD, - TVD, - TWD, - TZS, - UAH, - UGX, - USD, - UYU, - UZS, - VEF, - VND, - VUV, - WST, - XAF, - XCD, - XDR, - XOF, - XPF, - YER, - ZAR, - ZMW, - ZWD - } - - [Serializable] - public class CurrentGamesRequest : PlayFabRequestCommon - { - /// - /// Region to check for Game Server Instances. - /// - public Region? Region { get; set;} - /// - /// Build to match against. - /// - public string BuildVersion { get; set;} - /// - /// Game mode to look for. - /// - public string GameMode { get; set;} - /// - /// Statistic name to find statistic-based matches. - /// - public string StatisticName { get; set;} - /// - /// Filter to include and/or exclude Game Server Instances associated with certain tags. - /// - public CollectionFilter TagFilter { get; set;} - } - - [Serializable] - public class CurrentGamesResult : PlayFabResultCommon - { - /// - /// array of games found - /// - public List Games { get; set;} - /// - /// total number of players across all servers - /// - public int PlayerCount { get; set;} - /// - /// number of games running - /// - public int GameCount { get; set;} - } - - [Serializable] - public class EmptyResult : PlayFabResultCommon - { - } - - [Serializable] - public class ExecuteCloudScriptRequest : PlayFabRequestCommon - { - /// - /// The name of the CloudScript function to execute - /// - public string FunctionName { get; set;} - /// - /// Object that is passed in to the function as the first argument - /// - public object FunctionParameter { get; set;} - /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. - /// - public CloudScriptRevisionOption? RevisionSelection { get; set;} - /// - /// The specivic revision to execute, when RevisionSelection is set to 'Specific' - /// - public int? SpecificRevision { get; set;} - /// - /// Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. - /// - public bool? GeneratePlayStreamEvent { get; set;} - } - - [Serializable] - public class ExecuteCloudScriptResult : PlayFabResultCommon - { - /// - /// The name of the function that executed - /// - public string FunctionName { get; set;} - /// - /// The revision of the CloudScript that executed - /// - public int Revision { get; set;} - /// - /// The object returned from the CloudScript function, if any - /// - public object FunctionResult { get; set;} - /// - /// Entries logged during the function execution. These include both entries logged in the function code using log.info() and log.error() and error entries for API and HTTP request failures. - /// - public List Logs { get; set;} - public double ExecutionTimeSeconds { get; set;} - /// - /// Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP requests. - /// - public double ProcessorTimeSeconds { get; set;} - public uint MemoryConsumedBytes { get; set;} - /// - /// Number of PlayFab API requests issued by the CloudScript function - /// - public int APIRequestsIssued { get; set;} - /// - /// Number of external HTTP requests issued by the CloudScript function - /// - public int HttpRequestsIssued { get; set;} - /// - /// Information about the error, if any, that occured during execution - /// - public ScriptExecutionError Error { get; set;} - } - - [Serializable] - public class FacebookPlayFabIdPair - { - /// - /// Unique Facebook identifier for a user. - /// - public string FacebookId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class FriendInfo - { - /// - /// PlayFab unique identifier for this friend. - /// - public string FriendPlayFabId { get; set;} - /// - /// PlayFab unique username for this friend. - /// - public string Username { get; set;} - /// - /// Title-specific display name for this friend. - /// - public string TitleDisplayName { get; set;} - /// - /// Tags which have been associated with this friend. - /// - public List Tags { get; set;} - /// - /// Unique lobby identifier of the Game Server Instance to which this player is currently connected. - /// - public string CurrentMatchmakerLobbyId { get; set;} - /// - /// Available Facebook information (if the user and PlayFab friend are also connected in Facebook). - /// - public UserFacebookInfo FacebookInfo { get; set;} - /// - /// Available Steam information (if the user and PlayFab friend are also connected in Steam). - /// - public UserSteamInfo SteamInfo { get; set;} - /// - /// Available Game Center information (if the user and PlayFab friend are also connected in Game Center). - /// - public UserGameCenterInfo GameCenterInfo { get; set;} - } - - [Serializable] - public class GameCenterPlayFabIdPair - { - /// - /// Unique Game Center identifier for a user. - /// - public string GameCenterId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Game Center identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GameInfo - { - /// - /// region to which this server is associated - /// - public Region? Region { get; set;} - /// - /// unique lobby identifier for this game server - /// - public string LobbyID { get; set;} - /// - /// build version this server is running - /// - public string BuildVersion { get; set;} - /// - /// game mode this server is running - /// - public string GameMode { get; set;} - /// - /// stastic used to match this game in player statistic matchmaking - /// - public string StatisticName { get; set;} - /// - /// maximum players this server can support - /// - public int? MaxPlayers { get; set;} - /// - /// array of current player IDs on this server - /// - public List PlayerUserIds { get; set;} - /// - /// duration in seconds this server has been running - /// - public uint RunTime { get; set;} - /// - /// game specific string denoting server configuration - /// - public GameInstanceState? GameServerState { get; set;} - /// - /// game session custom data - /// - public string GameServerData { get; set;} - /// - /// game session tags - /// - public Dictionary Tags { get; set;} - /// - /// last heartbeat of the game server instance, used in external game server provider mode - /// - public DateTime? LastHeartbeat { get; set;} - } - - public enum GameInstanceState - { - Open, - Closed - } - - [Serializable] - public class GameServerRegionsRequest : PlayFabRequestCommon - { - /// - /// version of game server for which stats are being requested - /// - public string BuildVersion { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - } - - [Serializable] - public class GameServerRegionsResult : PlayFabResultCommon - { - /// - /// array of regions found matching the request parameters - /// - public List Regions { get; set;} - } - - [Serializable] - public class GenericPlayFabIdPair - { - /// - /// Unique generic service identifier for a user. - /// - public GenericServiceId GenericId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GenericServiceId - { - /// - /// Name of the service for which the player has a unique identifier. - /// - public string ServiceName { get; set;} - /// - /// Unique identifier of the player in that service. - /// - public string UserId { get; set;} - } - - [Serializable] - public class GetAccountInfoRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. - /// - public string PlayFabId { get; set;} - /// - /// PlayFab Username for the account to find (if no PlayFabId is specified). - /// - public string Username { get; set;} - /// - /// User email address for the account to find (if no Username is specified). - /// - public string Email { get; set;} - /// - /// Title-specific username for the account to find (if no Email is set). - /// - public string TitleDisplayName { get; set;} - } - - [Serializable] - public class GetAccountInfoResult : PlayFabResultCommon - { - /// - /// Account information for the local user. - /// - public UserAccountInfo AccountInfo { get; set;} - } - - [Serializable] - public class GetCatalogItemsRequest : PlayFabRequestCommon - { - /// - /// Which catalog is being requested. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetCatalogItemsResult : PlayFabResultCommon - { - /// - /// Array of items which can be purchased. - /// - public List Catalog { get; set;} - } - - [Serializable] - public class GetCharacterDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Specific keys to search for in the custom user data. - /// - public List Keys { get; set;} - /// - /// The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this. - /// - public uint? IfChangedFromDataVersion { get; set;} - } - - [Serializable] - public class GetCharacterDataResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// User specific data for this title. - /// - public Dictionary Data { get; set;} - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class GetCharacterInventoryRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Used to limit results to only those from a specific catalog version. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetCharacterInventoryResult : PlayFabResultCommon - { - /// - /// Unique identifier of the character for this inventory. - /// - public string CharacterId { get; set;} - /// - /// Array of inventory items belonging to the character. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the character. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - } - - [Serializable] - public class GetCharacterLeaderboardRequest : PlayFabRequestCommon - { - /// - /// Optional character type on which to filter the leaderboard entries. - /// - public string CharacterType { get; set;} - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// First entry in the leaderboard to be retrieved. - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - } - - [Serializable] - public class GetCharacterLeaderboardResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetCharacterStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class GetCharacterStatisticsResult : PlayFabResultCommon - { - /// - /// The requested character statistics. - /// - public Dictionary CharacterStatistics { get; set;} - } - - [Serializable] - public class GetCloudScriptUrlRequest : PlayFabRequestCommon - { - /// - /// Cloud Script Version to use. Defaults to 1. - /// - public int? Version { get; set;} - /// - /// Specifies whether the URL returned should be the one for the most recently uploaded Revision of the Cloud Script (true), or the Revision most recently set to live (false). Defaults to false. - /// - public bool? Testing { get; set;} - } - - [Serializable] - public class GetCloudScriptUrlResult : PlayFabResultCommon - { - /// - /// URL of the Cloud Script logic server. - /// - public string Url { get; set;} - } - - [Serializable] - public class GetContentDownloadUrlRequest : PlayFabRequestCommon - { - /// - /// Key of the content item to fetch, usually formatted as a path, e.g. images/a.png - /// - public string Key { get; set;} - /// - /// HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. - /// - public string HttpMethod { get; set;} - /// - /// True if download through CDN. CDN provides better download bandwidth and time. However, if you want latest, non-cached version of the content, set this to false. Default is true. - /// - public bool? ThruCDN { get; set;} - } - - [Serializable] - public class GetContentDownloadUrlResult : PlayFabResultCommon - { - /// - /// URL for downloading content via HTTP GET or HEAD method. The URL will expire in 1 hour. - /// - public string URL { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardAroundCurrentUserRequest : PlayFabRequestCommon - { - /// - /// Statistic used to rank players for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardAroundCurrentUserResult : PlayFabResultCommon - { - /// - /// Ordered listing of users and their positions in the requested leaderboard. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardAroundPlayerRequest : PlayFabRequestCommon - { - /// - /// Statistic used to rank players for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - /// - /// PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. - /// - public string PlayFabId { get; set;} - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardAroundPlayerResult : PlayFabResultCommon - { - /// - /// Ordered listing of users and their positions in the requested leaderboard. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardRequest : PlayFabRequestCommon - { - /// - /// Statistic used to rank friends for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Position in the leaderboard to start this listing (defaults to the first entry). - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendsListRequest : PlayFabRequestCommon - { - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendsListResult : PlayFabResultCommon - { - /// - /// Array of friends found. - /// - public List Friends { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCharacterRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character on which to center the leaderboard. - /// - public string CharacterId { get; set;} - /// - /// Optional character type on which to filter the leaderboard entries. - /// - public string CharacterType { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCharacterResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCurrentUserRequest : PlayFabRequestCommon - { - /// - /// Statistic used to rank players for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCurrentUserResult : PlayFabResultCommon - { - /// - /// Ordered listing of users and their positions in the requested leaderboard. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundPlayerRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. - /// - public string PlayFabId { get; set;} - /// - /// Statistic used to rank players for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundPlayerResult : PlayFabResultCommon - { - /// - /// Ordered listing of users and their positions in the requested leaderboard. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardForUsersCharactersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardForUsersCharactersResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardRequest : PlayFabRequestCommon - { - /// - /// Statistic used to rank players for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Position in the leaderboard to start this listing (defaults to the first entry). - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. Default 10, maximum 100. - /// - public int? MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardResult : PlayFabResultCommon - { - /// - /// Ordered listing of users and their positions in the requested leaderboard. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetPhotonAuthenticationTokenRequest : PlayFabRequestCommon - { - /// - /// The Photon applicationId for the game you wish to log into. - /// - public string PhotonApplicationId { get; set;} - } - - [Serializable] - public class GetPhotonAuthenticationTokenResult : PlayFabResultCommon - { - /// - /// The Photon authentication token for this game-session. - /// - public string PhotonCustomAuthenticationToken { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoRequest : PlayFabRequestCommon - { - /// - /// PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player. - /// - public string PlayFabId { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoRequestParams - { - /// - /// Whether to get the player's account Info. Defaults to false - /// - public bool GetUserAccountInfo { get; set;} - /// - /// Whether to get the player's inventory. Defaults to false - /// - public bool GetUserInventory { get; set;} - /// - /// Whether to get the player's virtual currency balances. Defaults to false - /// - public bool GetUserVirtualCurrency { get; set;} - /// - /// Whether to get the player's custom data. Defaults to false - /// - public bool GetUserData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if UserDataKeys is false - /// - public List UserDataKeys { get; set;} - /// - /// Whether to get the player's read only data. Defaults to false - /// - public bool GetUserReadOnlyData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is false - /// - public List UserReadOnlyDataKeys { get; set;} - /// - /// Whether to get character inventories. Defaults to false. - /// - public bool GetCharacterInventories { get; set;} - /// - /// Whether to get the list of characters. Defaults to false. - /// - public bool GetCharacterList { get; set;} - /// - /// Whether to get title data. Defaults to false. - /// - public bool GetTitleData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false - /// - public List TitleDataKeys { get; set;} - /// - /// Whether to get player statistics. Defaults to false. - /// - public bool GetPlayerStatistics { get; set;} - /// - /// Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false - /// - public List PlayerStatisticNames { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Results for requested info. - /// - public GetPlayerCombinedInfoResultPayload InfoResultPayload { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoResultPayload - { - /// - /// Account information for the user. This is always retrieved. - /// - public UserAccountInfo AccountInfo { get; set;} - /// - /// Array of inventory items in the user's current inventory. - /// - public List UserInventory { get; set;} - /// - /// Dictionary of virtual currency balance(s) belonging to the user. - /// - public Dictionary UserVirtualCurrency { get; set;} - /// - /// Dictionary of remaining times and timestamps for virtual currencies. - /// - public Dictionary UserVirtualCurrencyRechargeTimes { get; set;} - /// - /// User specific custom data. - /// - public Dictionary UserData { get; set;} - /// - /// The version of the UserData that was returned. - /// - public uint UserDataVersion { get; set;} - /// - /// User specific read-only data. - /// - public Dictionary UserReadOnlyData { get; set;} - /// - /// The version of the Read-Only UserData that was returned. - /// - public uint UserReadOnlyDataVersion { get; set;} - /// - /// List of characters for the user. - /// - public List CharacterList { get; set;} - /// - /// Inventories for each character for the user. - /// - public List CharacterInventories { get; set;} - /// - /// Title data for this title. - /// - public Dictionary TitleData { get; set;} - /// - /// List of statistics for this player. - /// - public List PlayerStatistics { get; set;} - } - - [Serializable] - public class GetPlayerSegmentsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetPlayerSegmentsResult : PlayFabResultCommon - { - /// - /// Array of segments the requested player currently belongs to. - /// - public List Segments { get; set;} - } - - [Serializable] - public class GetPlayerStatisticsRequest : PlayFabRequestCommon - { - /// - /// statistics to return (current version will be returned for each) - /// - public List StatisticNames { get; set;} - /// - /// statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be returned) - /// - public List StatisticNameVersions { get; set;} - } - - [Serializable] - public class GetPlayerStatisticsResult : PlayFabResultCommon - { - /// - /// User statistics for the requested user. - /// - public List Statistics { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsResult : PlayFabResultCommon - { - /// - /// version change history of the statistic - /// - public List StatisticVersions { get; set;} - } - - [Serializable] - public class GetPlayerTagsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Optional namespace to filter results by - /// - public string Namespace { get; set;} - } - - [Serializable] - public class GetPlayerTagsResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Canonical tags (including namespace and tag's name) for the requested user - /// - public List Tags { get; set;} - } - - [Serializable] - public class GetPlayerTradesRequest : PlayFabRequestCommon - { - /// - /// Returns only trades with the given status. If null, returns all trades. - /// - public TradeStatus? StatusFilter { get; set;} - } - - [Serializable] - public class GetPlayerTradesResponse : PlayFabResultCommon - { - /// - /// The trades for this player which are currently available to be accepted. - /// - public List OpenedTrades { get; set;} - /// - /// History of trades which this player has accepted. - /// - public List AcceptedTrades { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromFacebookIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. - /// - public List FacebookIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromFacebookIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Facebook identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGameCenterIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Game Center identifiers (the Player Identifier) for which the title needs to get PlayFab identifiers. - /// - public List GameCenterIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGameCenterIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Game Center identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGenericIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a maximum of 10 in a single request. - /// - public List GenericIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGenericIDsResult : PlayFabResultCommon - { - /// - /// Mapping of generic service identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGoogleIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. - /// - public List GoogleIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromGoogleIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Google identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromKongregateIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. - /// - public List KongregateIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromKongregateIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Kongregate identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromSteamIDsRequest : PlayFabRequestCommon - { - /// - /// Deprecated: Please use SteamStringIDs - /// - [Obsolete("Use 'SteamStringIDs' instead", true)] - public List SteamIDs { get; set;} - /// - /// Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. - /// - public List SteamStringIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromSteamIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Steam identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromTwitchIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers. - /// - public List TwitchIds { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromTwitchIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Twitch identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPublisherDataRequest : PlayFabRequestCommon - { - /// - /// array of keys to get back data from the Publisher data blob, set by the admin tools - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetPublisherDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetPurchaseRequest : PlayFabRequestCommon - { - /// - /// Purchase order identifier. - /// - public string OrderId { get; set;} - } - - [Serializable] - public class GetPurchaseResult : PlayFabResultCommon - { - /// - /// Purchase order identifier. - /// - public string OrderId { get; set;} - /// - /// Payment provider used for transaction (If not VC) - /// - public string PaymentProvider { get; set;} - /// - /// Provider transaction ID (If not VC) - /// - public string TransactionId { get; set;} - /// - /// PlayFab transaction status - /// - public string TransactionStatus { get; set;} - /// - /// Date and time of the purchase. - /// - public DateTime PurchaseDate { get; set;} - /// - /// Array of items purchased. - /// - public List Items { get; set;} - } - - [Serializable] - public class GetSegmentResult : PlayFabResultCommon - { - /// - /// Unique identifier for this segment. - /// - public string Id { get; set;} - /// - /// Segment name. - /// - public string Name { get; set;} - /// - /// Identifier of the segments AB Test, if it is attached to one. - /// - public string ABTestParent { get; set;} - } - - [Serializable] - public class GetSharedGroupDataRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array indicates that no keys should be returned). - /// - public List Keys { get; set;} - /// - /// If true, return the list of all members of the shared group. - /// - public bool? GetMembers { get; set;} - } - - [Serializable] - public class GetSharedGroupDataResult : PlayFabResultCommon - { - /// - /// Data for the requested keys. - /// - public Dictionary Data { get; set;} - /// - /// List of PlayFabId identifiers for the members of this group, if requested. - /// - public List Members { get; set;} - } - - [Serializable] - public class GetStoreItemsRequest : PlayFabRequestCommon - { - /// - /// catalog version to store items from. Use default catalog version if null - /// - public string CatalogVersion { get; set;} - /// - /// Unqiue identifier for the store which is being requested. - /// - public string StoreId { get; set;} - } - - [Serializable] - public class GetStoreItemsResult : PlayFabResultCommon - { - /// - /// Array of items which can be purchased from this store. - /// - public List Store { get; set;} - /// - /// How the store was last updated (Admin or a third party). - /// - public SourceType? Source { get; set;} - /// - /// The base catalog that this store is a part of. - /// - public string CatalogVersion { get; set;} - /// - /// The ID of this store. - /// - public string StoreId { get; set;} - /// - /// Additional data about the store. - /// - public StoreMarketingModel MarketingData { get; set;} - } - - [Serializable] - public class GetTimeRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetTimeResult : PlayFabResultCommon - { - /// - /// Current server time when the request was received, in UTC - /// - public DateTime Time { get; set;} - } - - [Serializable] - public class GetTitleDataRequest : PlayFabRequestCommon - { - /// - /// Specific keys to search for in the title data (leave null to get all keys) - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetTitleDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetTitleNewsRequest : PlayFabRequestCommon - { - /// - /// Limits the results to the last n entries. Defaults to 10 if not set. - /// - public int? Count { get; set;} - } - - [Serializable] - public class GetTitleNewsResult : PlayFabResultCommon - { - /// - /// Array of news items. - /// - public List News { get; set;} - } - - [Serializable] - public class GetTradeStatusRequest : PlayFabRequestCommon - { - /// - /// Player who opened trade. - /// - public string OfferingPlayerId { get; set;} - /// - /// Trade identifier as returned by OpenTradeOffer. - /// - public string TradeId { get; set;} - } - - [Serializable] - public class GetTradeStatusResponse : PlayFabResultCommon - { - /// - /// Information about the requested trade. - /// - public TradeInfo Trade { get; set;} - } - - [Serializable] - public class GetUserCombinedInfoRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. - /// - public string PlayFabId { get; set;} - /// - /// PlayFab Username for the account to find (if no PlayFabId is specified). - /// - public string Username { get; set;} - /// - /// User email address for the account to find (if no Username is specified). - /// - public string Email { get; set;} - /// - /// Title-specific username for the account to find (if no Email is set). - /// - public string TitleDisplayName { get; set;} - /// - /// If set to false, account info will not be returned. Defaults to true. - /// - public bool? GetAccountInfo { get; set;} - /// - /// If set to false, inventory will not be returned. Defaults to true. Inventory will never be returned for users other than yourself. - /// - public bool? GetInventory { get; set;} - /// - /// If set to false, virtual currency balances will not be returned. Defaults to true. Currency balances will never be returned for users other than yourself. - /// - public bool? GetVirtualCurrency { get; set;} - /// - /// If set to false, custom user data will not be returned. Defaults to true. - /// - public bool? GetUserData { get; set;} - /// - /// User custom data keys to return. If set to null, all keys will be returned. For users other than yourself, only public data will be returned. - /// - public List UserDataKeys { get; set;} - /// - /// If set to false, read-only user data will not be returned. Defaults to true. - /// - public bool? GetReadOnlyData { get; set;} - /// - /// User read-only custom data keys to return. If set to null, all keys will be returned. For users other than yourself, only public data will be returned. - /// - public List ReadOnlyDataKeys { get; set;} - } - - [Serializable] - public class GetUserCombinedInfoResult : PlayFabResultCommon - { - /// - /// Unique PlayFab identifier of the owner of the combined info. - /// - public string PlayFabId { get; set;} - /// - /// Account information for the user. - /// - public UserAccountInfo AccountInfo { get; set;} - /// - /// Array of inventory items in the user's current inventory. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - /// - /// User specific custom data. - /// - public Dictionary Data { get; set;} - /// - /// The version of the UserData that was returned. - /// - public uint DataVersion { get; set;} - /// - /// User specific read-only data. - /// - public Dictionary ReadOnlyData { get; set;} - /// - /// The version of the Read-Only UserData that was returned. - /// - public uint ReadOnlyDataVersion { get; set;} - } - - [Serializable] - public class GetUserDataRequest : PlayFabRequestCommon - { - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. - /// - public List Keys { get; set;} - /// - /// Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. When specified to a PlayFab id of another player, then this will only return public keys for that account. - /// - public string PlayFabId { get; set;} - /// - /// The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this. - /// - public uint? IfChangedFromDataVersion { get; set;} - } - - [Serializable] - public class GetUserDataResult : PlayFabResultCommon - { - /// - /// User specific data for this title. - /// - public Dictionary Data { get; set;} - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class GetUserInventoryRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetUserInventoryResult : PlayFabResultCommon - { - /// - /// Array of inventory items belonging to the user. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - } - - [Serializable] - public class GetUserStatisticsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetUserStatisticsResult : PlayFabResultCommon - { - /// - /// User statistics for the active title. - /// - public Dictionary UserStatistics { get; set;} - } - - [Serializable] - public class GooglePlayFabIdPair - { - /// - /// Unique Google identifier for a user. - /// - public string GoogleId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GrantCharacterToUserRequest : PlayFabRequestCommon - { - /// - /// Catalog version from which items are to be granted. - /// - public string CatalogVersion { get; set;} - /// - /// Catalog item identifier of the item in the user's inventory that corresponds to the character in the catalog to be created. - /// - public string ItemId { get; set;} - /// - /// Non-unique display name of the character being granted. - /// - public string CharacterName { get; set;} - } - - [Serializable] - public class GrantCharacterToUserResult : PlayFabResultCommon - { - /// - /// Unique identifier tagged to this character. - /// - public string CharacterId { get; set;} - /// - /// Type of character that was created. - /// - public string CharacterType { get; set;} - /// - /// Indicates whether this character was created successfully. - /// - public bool Result { get; set;} - } - - /// - /// A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. - /// - [Serializable] - public class ItemInstance - { - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class ItemPurchaseRequest : PlayFabRequestCommon - { - /// - /// Unique ItemId of the item to purchase. - /// - public string ItemId { get; set;} - /// - /// How many of this item to purchase. - /// - public uint Quantity { get; set;} - /// - /// Title-specific text concerning this purchase. - /// - public string Annotation { get; set;} - /// - /// Items to be upgraded as a result of this purchase (upgraded items are hidden, as they are "replaced" by the new items). - /// - public List UpgradeFromItems { get; set;} - } - - [Serializable] - public class KongregatePlayFabIdPair - { - /// - /// Unique Kongregate identifier for a user. - /// - public string KongregateId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Kongregate identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class LinkAndroidDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Android device identifier for the user's device. - /// - public string AndroidDeviceId { get; set;} - /// - /// Specific Operating System version for the user's device. - /// - public string OS { get; set;} - /// - /// Specific model of the user's device. - /// - public string AndroidDevice { get; set;} - /// - /// If another user is already linked to the device, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkAndroidDeviceIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkCustomIDRequest : PlayFabRequestCommon - { - /// - /// Custom unique identifier for the user, generated by the title. - /// - public string CustomId { get; set;} - /// - /// If another user is already linked to the custom ID, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkCustomIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkFacebookAccountRequest : PlayFabRequestCommon - { - /// - /// Unique identifier from Facebook for the user. - /// - public string AccessToken { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkFacebookAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkGameCenterAccountRequest : PlayFabRequestCommon - { - /// - /// Game Center identifier for the player account to be linked. - /// - public string GameCenterId { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkGameCenterAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkGoogleAccountRequest : PlayFabRequestCommon - { - /// - /// Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user. - /// - public string AccessToken { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkGoogleAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkIOSDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Vendor-specific iOS identifier for the user's device. - /// - public string DeviceId { get; set;} - /// - /// Specific Operating System version for the user's device. - /// - public string OS { get; set;} - /// - /// Specific model of the user's device. - /// - public string DeviceModel { get; set;} - /// - /// If another user is already linked to the device, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkIOSDeviceIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkKongregateAccountRequest : PlayFabRequestCommon - { - /// - /// Numeric user ID assigned by Kongregate - /// - public string KongregateId { get; set;} - /// - /// Valid session auth ticket issued by Kongregate - /// - public string AuthTicket { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkKongregateAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkSteamAccountRequest : PlayFabRequestCommon - { - /// - /// Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte 0x08 should become "08"). - /// - public string SteamTicket { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkSteamAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class LinkTwitchAccountRequest : PlayFabRequestCommon - { - /// - /// Valid token issued by Twitch - /// - public string AccessToken { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } - - [Serializable] - public class LinkTwitchAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class ListUsersCharactersRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class ListUsersCharactersResult : PlayFabResultCommon - { - /// - /// The requested list of characters. - /// - public List Characters { get; set;} - } - - [Serializable] - public class LogEventRequest : PlayFabRequestCommon - { - /// - /// Optional timestamp for this event. If null, the a timestamp is auto-assigned to the event on the server. - /// - public DateTime? Timestamp { get; set;} - /// - /// A unique event name which will be used as the table name in the Redshift database. The name will be made lower case, and cannot not contain spaces. The use of underscores is recommended, for readability. Events also cannot match reserved terms. The PlayFab reserved terms are 'log_in' and 'purchase', 'create' and 'request', while the Redshift reserved terms can be found here: http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html. - /// - public string EventName { get; set;} - /// - /// Contains all the data for this event. Event Values can be strings, booleans or numerics (float, double, integer, long) and must be consistent on a per-event basis (if the Value for Key 'A' in Event 'Foo' is an integer the first time it is sent, it must be an integer in all subsequent 'Foo' events). As with event names, Keys must also not use reserved words (see above). Finally, the size of the Body for an event must be less than 32KB (UTF-8 format). - /// - public Dictionary Body { get; set;} - /// - /// Flag to set event Body as profile details in the Redshift database as well as a standard event. - /// - public bool ProfileSetEvent { get; set;} - } - - [Serializable] - public class LogEventResult : PlayFabResultCommon - { - } - - [Serializable] - public class LoginResult : PlayFabResultCommon - { - /// - /// Unique token authorizing the user and game at the server level, for the current session. - /// - public string SessionTicket { get; set;} - /// - /// Player's unique PlayFabId. - /// - public string PlayFabId { get; set;} - /// - /// True if the account was newly created on this login. - /// - public bool NewlyCreated { get; set;} - /// - /// Settings specific to this user. - /// - public UserSettings SettingsForUser { get; set;} - /// - /// The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue - /// - public DateTime? LastLoginTime { get; set;} - /// - /// Results for requested info. - /// - public GetPlayerCombinedInfoResultPayload InfoResultPayload { get; set;} - } - - [Serializable] - public class LoginWithAndroidDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Android device identifier for the user's device. - /// - public string AndroidDeviceId { get; set;} - /// - /// Specific Operating System version for the user's device. - /// - public string OS { get; set;} - /// - /// Specific model of the user's device. - /// - public string AndroidDevice { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Android device. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithCustomIDRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Custom unique identifier for the user, generated by the title. - /// - public string CustomId { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Custom ID. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithEmailAddressRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Email address for the account. - /// - public string Email { get; set;} - /// - /// Password for the PlayFab account (6-100 characters) - /// - public string Password { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithFacebookRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Unique identifier from Facebook for the user. - /// - public string AccessToken { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Facebook account. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithGameCenterRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Unique Game Center player id. - /// - public string PlayerId { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Game Center id. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithGoogleAccountRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user. - /// - public string AccessToken { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Google account. - /// - public bool? CreateAccount { get; set;} - /// - /// Deprecated - Do not use - /// - [Obsolete("No longer available", true)] - public string PublisherId { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithIOSDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Vendor-specific iOS identifier for the user's device. - /// - public string DeviceId { get; set;} - /// - /// Specific Operating System version for the user's device. - /// - public string OS { get; set;} - /// - /// Specific model of the user's device. - /// - public string DeviceModel { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this iOS device. - /// - public bool? CreateAccount { get; set;} - } - - [Serializable] - public class LoginWithKongregateRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Numeric user ID assigned by Kongregate - /// - public string KongregateId { get; set;} - /// - /// Token issued by Kongregate's client API for the user. - /// - public string AuthTicket { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Kongregate account. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithPlayFabRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// PlayFab username for the account. - /// - public string Username { get; set;} - /// - /// Password for the PlayFab account (6-100 characters) - /// - public string Password { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithSteamRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte 0x08 should become "08"). - /// - public string SteamTicket { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Steam account. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LoginWithTwitchRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Token issued by Twitch's API for the user. - /// - public string AccessToken { get; set;} - /// - /// Automatically create a PlayFab account if one is not currently linked to this Twitch account. - /// - public bool? CreateAccount { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class LogStatement - { - /// - /// 'Debug', 'Info', or 'Error' - /// - public string Level { get; set;} - public string Message { get; set;} - /// - /// Optional object accompanying the message as contextual information - /// - public object Data { get; set;} - } - - [Serializable] - public class MatchmakeRequest : PlayFabRequestCommon - { - /// - /// Build version to match against. [Note: Required if LobbyId is not specified] - /// - public string BuildVersion { get; set;} - /// - /// Region to match make against. [Note: Required if LobbyId is not specified] - /// - public Region? Region { get; set;} - /// - /// Game mode to match make against. [Note: Required if LobbyId is not specified] - /// - public string GameMode { get; set;} - /// - /// Lobby identifier to match make against. This is used to select a specific Game Server Instance. - /// - public string LobbyId { get; set;} - /// - /// Player statistic to use in finding a match. May be null for no stat-based matching. - /// - public string StatisticName { get; set;} - /// - /// Character to use for stats based matching. Leave null to use account stats. - /// - public string CharacterId { get; set;} - /// - /// Start a game session if one with an open slot is not found. Defaults to true. - /// - public bool? StartNewIfNoneFound { get; set;} - /// - /// Filter to include and/or exclude Game Server Instances associated with certain Tags - /// - public CollectionFilter TagFilter { get; set;} - /// - /// Deprecated - Do not use - /// - [Obsolete("No longer available", true)] - public bool? EnableQueue { get; set;} - } - - [Serializable] - public class MatchmakeResult : PlayFabResultCommon - { - /// - /// unique lobby identifier of the server matched - /// - public string LobbyID { get; set;} - /// - /// IP address of the server - /// - public string ServerHostname { get; set;} - /// - /// port number to use for non-http communications with the server - /// - public int? ServerPort { get; set;} - /// - /// server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) - /// - public string Ticket { get; set;} - /// - /// timestamp for when the server will expire, if applicable - /// - public string Expires { get; set;} - /// - /// time in milliseconds the application is configured to wait on matchmaking results - /// - public int? PollWaitTimeMS { get; set;} - /// - /// result of match making process - /// - public MatchmakeStatus? Status { get; set;} - } - - public enum MatchmakeStatus - { - Complete, - Waiting, - GameNotFound, - NoAvailableSlots, - SessionClosed - } - - [Serializable] - public class ModifyUserVirtualCurrencyResult : PlayFabResultCommon - { - /// - /// User currency was subtracted from. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which was modified. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int BalanceChange { get; set;} - /// - /// Balance of the virtual currency after modification. - /// - public int Balance { get; set;} - } - - [Serializable] - public class OpenTradeRequest : PlayFabRequestCommon - { - /// - /// Player inventory items offered for trade. If not set, the trade is effectively a gift request - /// - public List OfferedInventoryInstanceIds { get; set;} - /// - /// Catalog items accepted for the trade. If not set, the trade is effectively a gift. - /// - public List RequestedCatalogItemIds { get; set;} - /// - /// Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may not be accepted by any player. - /// - public List AllowedPlayerIds { get; set;} - } - - [Serializable] - public class OpenTradeResponse : PlayFabResultCommon - { - /// - /// The information about the trade that was just opened. - /// - public TradeInfo Trade { get; set;} - } - - [Serializable] - public class PayForPurchaseRequest : PlayFabRequestCommon - { - /// - /// Purchase order identifier returned from StartPurchase. - /// - public string OrderId { get; set;} - /// - /// Payment provider to use to fund the purchase. - /// - public string ProviderName { get; set;} - /// - /// Currency to use to fund the purchase. - /// - public string Currency { get; set;} - /// - /// Payment provider transaction identifier. Required for Facebook Payments. - /// - public string ProviderTransactionId { get; set;} - } - - [Serializable] - public class PayForPurchaseResult : PlayFabResultCommon - { - /// - /// Purchase order identifier. - /// - public string OrderId { get; set;} - /// - /// Status of the transaction. - /// - public TransactionStatus? Status { get; set;} - /// - /// Virtual currency cost of the transaction. - /// - public Dictionary VCAmount { get; set;} - /// - /// Real world currency for the transaction. - /// - public string PurchaseCurrency { get; set;} - /// - /// Real world cost of the transaction. - /// - public uint PurchasePrice { get; set;} - /// - /// Local credit applied to the transaction (provider specific). - /// - public uint CreditApplied { get; set;} - /// - /// Provider used for the transaction. - /// - public string ProviderData { get; set;} - /// - /// URL to the purchase provider page that details the purchase. - /// - public string PurchaseConfirmationPageURL { get; set;} - /// - /// Current virtual currency totals for the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// A token generated by the provider to authenticate the request (provider-specific). - /// - public string ProviderToken { get; set;} - } - - [Serializable] - public class PaymentOption - { - /// - /// Specific currency to use to fund the purchase. - /// - public string Currency { get; set;} - /// - /// Name of the purchase provider for this option. - /// - public string ProviderName { get; set;} - /// - /// Amount of the specified currency needed for the purchase. - /// - public uint Price { get; set;} - /// - /// Amount of existing credit the user has with the provider. - /// - public uint StoreCredit { get; set;} - } - - [Serializable] - public class PlayerLeaderboardEntry - { - /// - /// PlayFab unique identifier of the user for this leaderboard entry. - /// - public string PlayFabId { get; set;} - /// - /// Title-specific display name of the user for this leaderboard entry. - /// - public string DisplayName { get; set;} - /// - /// Specific value of the user's statistic. - /// - public int StatValue { get; set;} - /// - /// User's overall position in the leaderboard. - /// - public int Position { get; set;} - } - - [Serializable] - public class PlayerStatisticVersion - { - /// - /// name of the statistic when the version became active - /// - public string StatisticName { get; set;} - /// - /// version of the statistic - /// - public uint Version { get; set;} - /// - /// time at which the statistic version was scheduled to become active, based on the configured ResetInterval - /// - public DateTime? ScheduledActivationTime { get; set;} - /// - /// time when the statistic version became active - /// - public DateTime ActivationTime { get; set;} - /// - /// time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval - /// - public DateTime? ScheduledDeactivationTime { get; set;} - /// - /// time when the statistic version became inactive due to statistic version incrementing - /// - public DateTime? DeactivationTime { get; set;} - } - - [Serializable] - public class PurchaseItemRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the item to purchase. - /// - public string ItemId { get; set;} - /// - /// Virtual currency to use to purchase the item. - /// - public string VirtualCurrency { get; set;} - /// - /// Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices). - /// - public int Price { get; set;} - /// - /// Catalog version for the items to be purchased (defaults to most recent version. - /// - public string CatalogVersion { get; set;} - /// - /// Store to buy this item through. If not set, prices default to those in the catalog. - /// - public string StoreId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class PurchaseItemResult : PlayFabResultCommon - { - /// - /// Details for the items purchased. - /// - public List Items { get; set;} - } - - [Serializable] - public class RedeemCouponRequest : PlayFabRequestCommon - { - /// - /// Generated coupon code to redeem. - /// - public string CouponCode { get; set;} - /// - /// Catalog version of the coupon. If null, uses the default catalog - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class RedeemCouponResult : PlayFabResultCommon - { - /// - /// Items granted to the player as a result of redeeming the coupon. - /// - public List GrantedItems { get; set;} - } - - public enum Region - { - USCentral, - USEast, - EUWest, - Singapore, - Japan, - Brazil, - Australia - } - - [Serializable] - public class RegionInfo - { - /// - /// unique identifier for the region - /// - public Region? Region { get; set;} - /// - /// name of the region - /// - public string Name { get; set;} - /// - /// indicates whether the server specified is available in this region - /// - public bool Available { get; set;} - /// - /// url to ping to get roundtrip time - /// - public string PingUrl { get; set;} - } - - [Serializable] - public class RegisterForIOSPushNotificationRequest : PlayFabRequestCommon - { - /// - /// Unique token generated by the Apple Push Notification service when the title registered to receive push notifications. - /// - public string DeviceToken { get; set;} - /// - /// If true, send a test push message immediately after sucessful registration. Defaults to false. - /// - public bool? SendPushNotificationConfirmation { get; set;} - /// - /// Message to display when confirming push notification. - /// - public string ConfirmationMessage { get; set;} - } - - [Serializable] - public class RegisterForIOSPushNotificationResult : PlayFabResultCommon - { - } - - [Serializable] - public class RegisterPlayFabUserRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// PlayFab username for the account (3-20 characters) - /// - public string Username { get; set;} - /// - /// User email address attached to their account - /// - public string Email { get; set;} - /// - /// Password for the PlayFab account (6-100 characters) - /// - public string Password { get; set;} - /// - /// An optional parameter that specifies whether both the username and email parameters are required. If true, both parameters are required; if false, the user must supply either the username or email parameter. The default value is true. - /// - public bool? RequireBothUsernameAndEmail { get; set;} - /// - /// An optional parameter for setting the display name for this title. - /// - public string DisplayName { get; set;} - /// - /// The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. - /// - [Obsolete("No longer available", true)] - public string Origination { get; set;} - } - - [Serializable] - public class RegisterPlayFabUserResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier for this newly created account. - /// - public string PlayFabId { get; set;} - /// - /// Unique token identifying the user and game at the server level, for the current session. - /// - public string SessionTicket { get; set;} - /// - /// PlayFab unique user name. - /// - public string Username { get; set;} - /// - /// Settings specific to this user. - /// - public UserSettings SettingsForUser { get; set;} - } - - [Serializable] - public class RemoveFriendRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the friend account which is to be removed. - /// - public string FriendPlayFabId { get; set;} - } - - [Serializable] - public class RemoveFriendResult : PlayFabResultCommon - { - } - - [Serializable] - public class RemoveGenericIDRequest : PlayFabRequestCommon - { - /// - /// Generic service identifier to be removed from the player. - /// - public GenericServiceId GenericId { get; set;} - } - - [Serializable] - public class RemoveGenericIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class RemoveSharedGroupMembersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - } - - [Serializable] - public class RemoveSharedGroupMembersResult : PlayFabResultCommon - { - } - - [Serializable] - public class ReportPlayerClientRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab identifier of the reported player. - /// - public string ReporteeId { get; set;} - /// - /// Optional additional comment by reporting player. - /// - public string Comment { get; set;} - } - - [Serializable] - public class ReportPlayerClientResult : PlayFabResultCommon - { - /// - /// Indicates whether this action completed successfully. - /// - public bool Updated { get; set;} - /// - /// The number of remaining reports which may be filed today. - /// - public int SubmissionsRemaining { get; set;} - } - - [Serializable] - public class RestoreIOSPurchasesRequest : PlayFabRequestCommon - { - /// - /// Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. - /// - public string ReceiptData { get; set;} - } - - [Serializable] - public class RestoreIOSPurchasesResult : PlayFabResultCommon - { - } - - [Serializable] - public class RunCloudScriptRequest : PlayFabRequestCommon - { - /// - /// server action to trigger - /// - public string ActionId { get; set;} - /// - /// parameters to pass into the action (If you use this, don't use ParamsEncoded) - /// - public object Params { get; set;} - /// - /// json-encoded parameters to pass into the action (If you use this, don't use Params) - /// - public string ParamsEncoded { get; set;} - } - - [Serializable] - public class RunCloudScriptResult : PlayFabResultCommon - { - /// - /// id of Cloud Script run - /// - public string ActionId { get; set;} - /// - /// version of Cloud Script run - /// - public int Version { get; set;} - /// - /// revision of Cloud Script run - /// - public int Revision { get; set;} - /// - /// return values from the server action as a dynamic object - /// - public object Results { get; set;} - /// - /// return values from the server action as a JSON encoded string - /// - public string ResultsEncoded { get; set;} - /// - /// any log statements generated during the run of this action - /// - public string ActionLog { get; set;} - /// - /// time this script took to run, in seconds - /// - public double ExecutionTime { get; set;} - } - - [Serializable] - public class ScriptExecutionError - { - /// - /// Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError - /// - public string Error { get; set;} - /// - /// Details about the error - /// - public string Message { get; set;} - /// - /// Point during the execution of the script at which the error occurred, if any - /// - public string StackTrace { get; set;} - } - - [Serializable] - public class SendAccountRecoveryEmailRequest : PlayFabRequestCommon - { - /// - /// User email address attached to their account - /// - public string Email { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - /// - /// Deprecated - Do not use - /// - [Obsolete("No longer available", true)] - public string PublisherId { get; set;} - } - - [Serializable] - public class SendAccountRecoveryEmailResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetFriendTagsRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the friend account to which the tag(s) should be applied. - /// - public string FriendPlayFabId { get; set;} - /// - /// Array of tags to set on the friend account. - /// - public List Tags { get; set;} - } - - [Serializable] - public class SetFriendTagsResult : PlayFabResultCommon - { - } - - [Serializable] - public class SharedGroupDataRecord - { - /// - /// Data stored for the specified group data key. - /// - public string Value { get; set;} - /// - /// Unique PlayFab identifier of the user to last update this value. - /// - public string LastUpdatedBy { get; set;} - /// - /// Timestamp for when this data was last updated. - /// - public DateTime LastUpdated { get; set;} - /// - /// Indicates whether this data can be read by all users (public) or only members of the group (private). - /// - public UserDataPermission? Permission { get; set;} - } - - public enum SourceType - { - Admin, - BackEnd, - GameClient, - GameServer, - Partner - } - - [Serializable] - public class StartGameRequest : PlayFabRequestCommon - { - /// - /// version information for the build of the game server which is to be started - /// - public string BuildVersion { get; set;} - /// - /// the region to associate this server with for match filtering - /// - public Region Region { get; set;} - /// - /// the title-defined game mode this server is to be running (defaults to 0 if there is only one mode) - /// - public string GameMode { get; set;} - /// - /// player statistic for others to use in finding this game. May be null for no stat-based matching - /// - public string StatisticName { get; set;} - /// - /// character to use for stats based matching. Leave null to use account stats - /// - public string CharacterId { get; set;} - /// - /// custom command line argument when starting game server process - /// - public string CustomCommandLineData { get; set;} - } - - [Serializable] - public class StartGameResult : PlayFabResultCommon - { - /// - /// unique identifier for the lobby of the server started - /// - public string LobbyID { get; set;} - /// - /// server IP address - /// - public string ServerHostname { get; set;} - /// - /// port on the server to be used for communication - /// - public int? ServerPort { get; set;} - /// - /// unique identifier for the server - /// - public string Ticket { get; set;} - /// - /// timestamp for when the server should expire, if applicable - /// - public string Expires { get; set;} - /// - /// password required to log into the server - /// - public string Password { get; set;} - } - - [Serializable] - public class StartPurchaseRequest : PlayFabRequestCommon - { - /// - /// Catalog version for the items to be purchased. Defaults to most recent catalog. - /// - public string CatalogVersion { get; set;} - /// - /// Store through which to purchase items. If not set, prices will be pulled from the catalog itself. - /// - public string StoreId { get; set;} - /// - /// Array of items to purchase. - /// - public List Items { get; set;} - } - - [Serializable] - public class StartPurchaseResult : PlayFabResultCommon - { - /// - /// Purchase order identifier. - /// - public string OrderId { get; set;} - /// - /// Cart items to be purchased. - /// - public List Contents { get; set;} - /// - /// Available methods by which the user can pay. - /// - public List PaymentOptions { get; set;} - /// - /// Current virtual currency totals for the user. - /// - public Dictionary VirtualCurrencyBalances { get; set;} - } - - [Serializable] - public class StatisticNameVersion - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// the version of the statistic to be returned - /// - public uint Version { get; set;} - } - - [Serializable] - public class StatisticUpdate - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. - /// - public uint? Version { get; set;} - /// - /// statistic value for the player - /// - public int Value { get; set;} - } - - [Serializable] - public class StatisticValue - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// statistic value for the player - /// - public int Value { get; set;} - /// - /// for updates to an existing statistic value for a player, the version of the statistic when it was loaded - /// - public uint Version { get; set;} - } - - [Serializable] - public class SteamPlayFabIdPair - { - /// - /// Deprecated: Please use SteamStringId - /// - [Obsolete("Use 'SteamStringId' instead", true)] - public ulong SteamId { get; set;} - /// - /// Unique Steam identifier for a user. - /// - public string SteamStringId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. - /// - public string PlayFabId { get; set;} - } - - /// - /// A store entry that list a catalog item at a particular price - /// - [Serializable] - public class StoreItem - { - /// - /// Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog - /// - public string ItemId { get; set;} - /// - /// Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// Override prices for this item for specific currencies - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// Store specific custom data. The data only exists as part of this store; it is not transferred to item instances - /// - public object CustomData { get; set;} - /// - /// Intended display position for this item. Note that 0 is the first position - /// - public uint? DisplayPosition { get; set;} - } - - /// - /// Marketing data about a specific store - /// - [Serializable] - public class StoreMarketingModel - { - /// - /// Display name of a store as it will appear to users. - /// - public string DisplayName { get; set;} - /// - /// Tagline for a store. - /// - public string Description { get; set;} - /// - /// Custom data about a store. - /// - public object Metadata { get; set;} - } - - [Serializable] - public class SubtractUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// Name of the virtual currency which is to be decremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be subtracted from the user balance of the specified virtual currency. - /// - public int Amount { get; set;} - } - - public enum TitleActivationStatus - { - None, - ActivatedTitleKey, - PendingSteam, - ActivatedSteam, - RevokedSteam - } - - [Serializable] - public class TitleNewsItem - { - /// - /// Date and time when the news items was posted. - /// - public DateTime Timestamp { get; set;} - /// - /// Unique identifier of news item. - /// - public string NewsId { get; set;} - /// - /// Title of the news item. - /// - public string Title { get; set;} - /// - /// News item text. - /// - public string Body { get; set;} - } - - [Serializable] - public class TradeInfo - { - /// - /// Describes the current state of this trade. - /// - public TradeStatus? Status { get; set;} - /// - /// The identifier for this trade. - /// - public string TradeId { get; set;} - /// - /// The PlayFabId for the offering player. - /// - public string OfferingPlayerId { get; set;} - /// - /// The itemInstance Ids that are being offered. - /// - public List OfferedInventoryInstanceIds { get; set;} - /// - /// The catalogItem Ids of the item instances being offered. - /// - public List OfferedCatalogItemIds { get; set;} - /// - /// The catalogItem Ids requested in exchange. - /// - public List RequestedCatalogItemIds { get; set;} - /// - /// An optional list of players allowed to complete this trade. If null, anybody can complete the trade. - /// - public List AllowedPlayerIds { get; set;} - /// - /// The PlayFab ID of the player who accepted the trade. If null, no one has accepted the trade. - /// - public string AcceptedPlayerId { get; set;} - /// - /// Item instances from the accepting player that are used to fulfill the trade. If null, no one has accepted the trade. - /// - public List AcceptedInventoryInstanceIds { get; set;} - /// - /// The UTC time when this trade was created. - /// - public DateTime? OpenedAt { get; set;} - /// - /// If set, The UTC time when this trade was fulfilled. - /// - public DateTime? FilledAt { get; set;} - /// - /// If set, The UTC time when this trade was canceled. - /// - public DateTime? CancelledAt { get; set;} - /// - /// If set, The UTC time when this trade was made invalid. - /// - public DateTime? InvalidatedAt { get; set;} - } - - public enum TradeStatus - { - Invalid, - Opening, - Open, - Accepting, - Accepted, - Filled, - Cancelled - } - - public enum TransactionStatus - { - CreateCart, - Init, - Approved, - Succeeded, - FailedByProvider, - DisputePending, - RefundPending, - Refunded, - RefundFailed, - ChargedBack, - FailedByUber, - FailedByPlayFab, - Revoked, - TradePending, - Traded, - Upgraded, - StackPending, - Stacked, - Other, - Failed - } - - [Serializable] - public class TwitchPlayFabIdPair - { - /// - /// Unique Twitch identifier for a user. - /// - public string TwitchId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Twitch identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class UnlinkAndroidDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Android device identifier for the user's device. If not specified, the most recently signed in Android Device ID will be used. - /// - public string AndroidDeviceId { get; set;} - } - - [Serializable] - public class UnlinkAndroidDeviceIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkCustomIDRequest : PlayFabRequestCommon - { - /// - /// Custom unique identifier for the user, generated by the title. If not specified, the most recently signed in Custom ID will be used. - /// - public string CustomId { get; set;} - } - - [Serializable] - public class UnlinkCustomIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkFacebookAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkFacebookAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkGameCenterAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkGameCenterAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkGoogleAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkGoogleAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkIOSDeviceIDRequest : PlayFabRequestCommon - { - /// - /// Vendor-specific iOS identifier for the user's device. If not specified, the most recently signed in iOS Device ID will be used. - /// - public string DeviceId { get; set;} - } - - [Serializable] - public class UnlinkIOSDeviceIDResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkKongregateAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkKongregateAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkSteamAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkSteamAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlinkTwitchAccountRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class UnlinkTwitchAccountResult : PlayFabResultCommon - { - } - - [Serializable] - public class UnlockContainerInstanceRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// ItemInstanceId of the container to unlock. - /// - public string ContainerItemInstanceId { get; set;} - /// - /// ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this parameter is required. - /// - public string KeyItemInstanceId { get; set;} - /// - /// Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog associated with the item instance. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class UnlockContainerItemRequest : PlayFabRequestCommon - { - /// - /// Catalog ItemId of the container type to unlock. - /// - public string ContainerItemId { get; set;} - /// - /// Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary catalog. - /// - public string CatalogVersion { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class UnlockContainerItemResult : PlayFabResultCommon - { - /// - /// Unique instance identifier of the container unlocked. - /// - public string UnlockedItemInstanceId { get; set;} - /// - /// Unique instance identifier of the key used to unlock the container, if applicable. - /// - public string UnlockedWithItemInstanceId { get; set;} - /// - /// Items granted to the player as a result of unlocking the container. - /// - public List GrantedItems { get; set;} - /// - /// Virtual currency granted to the player as a result of unlocking the container. - /// - public Dictionary VirtualCurrency { get; set;} - } - - [Serializable] - public class UpdateCharacterDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateCharacterDataResult : PlayFabResultCommon - { - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class UpdateCharacterStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Statistics to be updated with the provided values. - /// - public Dictionary CharacterStatistics { get; set;} - } - - [Serializable] - public class UpdateCharacterStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdatePlayerStatisticsRequest : PlayFabRequestCommon - { - /// - /// Statistics to be updated with the provided values - /// - public List Statistics { get; set;} - } - - [Serializable] - public class UpdatePlayerStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateSharedGroupDataRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys in this request. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateSharedGroupDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateUserDataRequest : PlayFabRequestCommon - { - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. This is used for requests by one player for information about another player; those requests will only return Public keys. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateUserDataResult : PlayFabResultCommon - { - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class UpdateUserStatisticsRequest : PlayFabRequestCommon - { - /// - /// Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern. - /// - public Dictionary UserStatistics { get; set;} - } - - [Serializable] - public class UpdateUserStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateUserTitleDisplayNameRequest : PlayFabRequestCommon - { - /// - /// New title display name for the user - must be between 3 and 25 characters. - /// - public string DisplayName { get; set;} - } - - [Serializable] - public class UpdateUserTitleDisplayNameResult : PlayFabResultCommon - { - /// - /// Current title display name for the user (this will be the original display name if the rename attempt failed). - /// - public string DisplayName { get; set;} - } - - [Serializable] - public class UserAccountInfo - { - /// - /// Unique identifier for the user account - /// - public string PlayFabId { get; set;} - /// - /// Timestamp indicating when the user account was created - /// - public DateTime Created { get; set;} - /// - /// User account name in the PlayFab service - /// - public string Username { get; set;} - /// - /// Title-specific information for the user account - /// - public UserTitleInfo TitleInfo { get; set;} - /// - /// Personal information for the user which is considered more sensitive - /// - public UserPrivateAccountInfo PrivateInfo { get; set;} - /// - /// User Facebook information, if a Facebook account has been linked - /// - public UserFacebookInfo FacebookInfo { get; set;} - /// - /// User Steam information, if a Steam account has been linked - /// - public UserSteamInfo SteamInfo { get; set;} - /// - /// User Gamecenter information, if a Gamecenter account has been linked - /// - public UserGameCenterInfo GameCenterInfo { get; set;} - /// - /// User iOS device information, if an iOS device has been linked - /// - public UserIosDeviceInfo IosDeviceInfo { get; set;} - /// - /// User Android device information, if an Android device has been linked - /// - public UserAndroidDeviceInfo AndroidDeviceInfo { get; set;} - /// - /// User Kongregate account information, if a Kongregate account has been linked - /// - public UserKongregateInfo KongregateInfo { get; set;} - /// - /// User Twitch account information, if a Twitch account has been linked - /// - public UserTwitchInfo TwitchInfo { get; set;} - /// - /// User PSN account information, if a PSN account has been linked - /// - public UserPsnInfo PsnInfo { get; set;} - /// - /// User Google account information, if a Google account has been linked - /// - public UserGoogleInfo GoogleInfo { get; set;} - /// - /// User XBox account information, if a XBox account has been linked - /// - public UserXboxInfo XboxInfo { get; set;} - /// - /// Custom ID information, if a custom ID has been assigned - /// - public UserCustomIdInfo CustomIdInfo { get; set;} - } - - [Serializable] - public class UserAndroidDeviceInfo - { - /// - /// Android device ID - /// - public string AndroidDeviceId { get; set;} - } - - [Serializable] - public class UserCustomIdInfo - { - /// - /// Custom ID - /// - public string CustomId { get; set;} - } - - /// - /// Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - /// - public enum UserDataPermission - { - Private, - Public - } - - [Serializable] - public class UserDataRecord - { - /// - /// Data stored for the specified user data key. - /// - public string Value { get; set;} - /// - /// Timestamp for when this data was last updated. - /// - public DateTime LastUpdated { get; set;} - /// - /// Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UserFacebookInfo - { - /// - /// Facebook identifier - /// - public string FacebookId { get; set;} - /// - /// Facebook full name - /// - public string FullName { get; set;} - } - - [Serializable] - public class UserGameCenterInfo - { - /// - /// Gamecenter identifier - /// - public string GameCenterId { get; set;} - } - - [Serializable] - public class UserGoogleInfo - { - /// - /// Google ID - /// - public string GoogleId { get; set;} - /// - /// Email address of the Google account - /// - public string GoogleEmail { get; set;} - /// - /// Locale of the Google account - /// - public string GoogleLocale { get; set;} - /// - /// Gender information of the Google account - /// - public string GoogleGender { get; set;} - } - - [Serializable] - public class UserIosDeviceInfo - { - /// - /// iOS device ID - /// - public string IosDeviceId { get; set;} - } - - [Serializable] - public class UserKongregateInfo - { - /// - /// Kongregate ID - /// - public string KongregateId { get; set;} - /// - /// Kongregate Username - /// - public string KongregateName { get; set;} - } - - public enum UserOrigination - { - Organic, - Steam, - Google, - Amazon, - Facebook, - Kongregate, - GamersFirst, - Unknown, - IOS, - LoadTest, - Android, - PSN, - GameCenter, - CustomId, - XboxLive, - Parse, - Twitch - } - - [Serializable] - public class UserPrivateAccountInfo - { - /// - /// user email address - /// - public string Email { get; set;} - } - - [Serializable] - public class UserPsnInfo - { - /// - /// PSN account ID - /// - public string PsnAccountId { get; set;} - /// - /// PSN online ID - /// - public string PsnOnlineId { get; set;} - } - - [Serializable] - public class UserSettings - { - /// - /// Boolean for whether this player is eligible for ad tracking. - /// - public bool NeedsAttribution { get; set;} - } - - [Serializable] - public class UserSteamInfo - { - /// - /// Steam identifier - /// - public string SteamId { get; set;} - /// - /// the country in which the player resides, from Steam data - /// - public string SteamCountry { get; set;} - /// - /// currency type set in the user Steam account - /// - public Currency? SteamCurrency { get; set;} - /// - /// what stage of game ownership the user is listed as being in, from Steam - /// - public TitleActivationStatus? SteamActivationStatus { get; set;} - } - - [Serializable] - public class UserTitleInfo - { - /// - /// name of the user, as it is displayed in-game - /// - public string DisplayName { get; set;} - /// - /// source by which the user first joined the game, if known - /// - public UserOrigination? Origination { get; set;} - /// - /// timestamp indicating when the user was first associated with this game (this can differ significantly from when the user first registered with PlayFab) - /// - public DateTime Created { get; set;} - /// - /// timestamp for the last user login for this title - /// - public DateTime? LastLogin { get; set;} - /// - /// timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other events, such as issuing a beta key to the user, can associate the title to the user) - /// - public DateTime? FirstLogin { get; set;} - /// - /// boolean indicating whether or not the user is currently banned for a title - /// - public bool? isBanned { get; set;} - } - - [Serializable] - public class UserTwitchInfo - { - /// - /// Twitch ID - /// - public string TwitchId { get; set;} - /// - /// Twitch Username - /// - public string TwitchUserName { get; set;} - } - - [Serializable] - public class UserXboxInfo - { - /// - /// XBox user ID - /// - public string XboxUserId { get; set;} - } - - [Serializable] - public class ValidateAmazonReceiptRequest : PlayFabRequestCommon - { - /// - /// ReceiptId returned by the Amazon App Store in-app purchase API - /// - public string ReceiptId { get; set;} - /// - /// AmazonId of the user making the purchase as returned by the Amazon App Store in-app purchase API - /// - public string UserId { get; set;} - /// - /// Catalog version to use when granting receipt item. If null, defaults to primary catalog. - /// - public string CatalogVersion { get; set;} - /// - /// Currency used for the purchase. - /// - public string CurrencyCode { get; set;} - /// - /// Amount of the stated currency paid for the object. - /// - public int PurchasePrice { get; set;} - } - - [Serializable] - public class ValidateAmazonReceiptResult : PlayFabResultCommon - { - } - - [Serializable] - public class ValidateGooglePlayPurchaseRequest : PlayFabRequestCommon - { - /// - /// Original JSON string returned by the Google Play IAB API. - /// - public string ReceiptJson { get; set;} - /// - /// Signature returned by the Google Play IAB API. - /// - public string Signature { get; set;} - /// - /// Currency used for the purchase. - /// - public string CurrencyCode { get; set;} - /// - /// Amount of the stated currency paid for the object. - /// - public uint? PurchasePrice { get; set;} - } - - [Serializable] - public class ValidateGooglePlayPurchaseResult : PlayFabResultCommon - { - } - - [Serializable] - public class ValidateIOSReceiptRequest : PlayFabRequestCommon - { - /// - /// Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. - /// - public string ReceiptData { get; set;} - /// - /// Currency used for the purchase. - /// - public string CurrencyCode { get; set;} - /// - /// Amount of the stated currency paid for the object. - /// - public int PurchasePrice { get; set;} - } - - [Serializable] - public class ValidateIOSReceiptResult : PlayFabResultCommon - { - } - - [Serializable] - public class VirtualCurrencyRechargeTime - { - /// - /// Time remaining (in seconds) before the next recharge increment of the virtual currency. - /// - public int SecondsToRecharge { get; set;} - /// - /// Server timestamp in UTC indicating the next time the virtual currency will be incremented. - /// - public DateTime RechargeTime { get; set;} - /// - /// Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen below this value. - /// - public int RechargeMax { get; set;} - } - - [Serializable] - public class WriteClientCharacterEventRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom event properties. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } - - [Serializable] - public class WriteClientPlayerEventRequest : PlayFabRequestCommon - { - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } - - [Serializable] - public class WriteEventResponse : PlayFabResultCommon - { - /// - /// The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. - /// - public string EventId { get; set;} - } - - [Serializable] - public class WriteTitleEventRequest : PlayFabRequestCommon - { - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom event properties. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs.meta deleted file mode 100755 index e89f150a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabClientModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3a0a4ef9b600e6540b14561880293235 -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs deleted file mode 100755 index e02f7f1e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs +++ /dev/null @@ -1,257 +0,0 @@ -#if !DISABLE_PLAYFABCLIENT_API -using PlayFab.ClientModels; - -namespace PlayFab.Events -{ - public partial class PlayFabEvents - { - public event PlayFabResultEvent OnLoginResultEvent; - - public event PlayFabRequestEvent OnGetPhotonAuthenticationTokenRequestEvent; - public event PlayFabResultEvent OnGetPhotonAuthenticationTokenResultEvent; - public event PlayFabRequestEvent OnLoginWithAndroidDeviceIDRequestEvent; - public event PlayFabRequestEvent OnLoginWithCustomIDRequestEvent; - public event PlayFabRequestEvent OnLoginWithEmailAddressRequestEvent; - public event PlayFabRequestEvent OnLoginWithFacebookRequestEvent; - public event PlayFabRequestEvent OnLoginWithGameCenterRequestEvent; - public event PlayFabRequestEvent OnLoginWithGoogleAccountRequestEvent; - public event PlayFabRequestEvent OnLoginWithIOSDeviceIDRequestEvent; - public event PlayFabRequestEvent OnLoginWithKongregateRequestEvent; - public event PlayFabRequestEvent OnLoginWithPlayFabRequestEvent; - public event PlayFabRequestEvent OnLoginWithSteamRequestEvent; - public event PlayFabRequestEvent OnLoginWithTwitchRequestEvent; - public event PlayFabRequestEvent OnRegisterPlayFabUserRequestEvent; - public event PlayFabResultEvent OnRegisterPlayFabUserResultEvent; - public event PlayFabRequestEvent OnAddGenericIDRequestEvent; - public event PlayFabResultEvent OnAddGenericIDResultEvent; - public event PlayFabRequestEvent OnAddUsernamePasswordRequestEvent; - public event PlayFabResultEvent OnAddUsernamePasswordResultEvent; - public event PlayFabRequestEvent OnGetAccountInfoRequestEvent; - public event PlayFabResultEvent OnGetAccountInfoResultEvent; - public event PlayFabRequestEvent OnGetPlayerCombinedInfoRequestEvent; - public event PlayFabResultEvent OnGetPlayerCombinedInfoResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromFacebookIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromFacebookIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromGameCenterIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromGameCenterIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromGenericIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromGenericIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromGoogleIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromGoogleIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromKongregateIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromKongregateIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromSteamIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromSteamIDsResultEvent; - public event PlayFabRequestEvent OnGetPlayFabIDsFromTwitchIDsRequestEvent; - public event PlayFabResultEvent OnGetPlayFabIDsFromTwitchIDsResultEvent; - public event PlayFabRequestEvent OnGetUserCombinedInfoRequestEvent; - public event PlayFabResultEvent OnGetUserCombinedInfoResultEvent; - public event PlayFabRequestEvent OnLinkAndroidDeviceIDRequestEvent; - public event PlayFabResultEvent OnLinkAndroidDeviceIDResultEvent; - public event PlayFabRequestEvent OnLinkCustomIDRequestEvent; - public event PlayFabResultEvent OnLinkCustomIDResultEvent; - public event PlayFabRequestEvent OnLinkFacebookAccountRequestEvent; - public event PlayFabResultEvent OnLinkFacebookAccountResultEvent; - public event PlayFabRequestEvent OnLinkGameCenterAccountRequestEvent; - public event PlayFabResultEvent OnLinkGameCenterAccountResultEvent; - public event PlayFabRequestEvent OnLinkGoogleAccountRequestEvent; - public event PlayFabResultEvent OnLinkGoogleAccountResultEvent; - public event PlayFabRequestEvent OnLinkIOSDeviceIDRequestEvent; - public event PlayFabResultEvent OnLinkIOSDeviceIDResultEvent; - public event PlayFabRequestEvent OnLinkKongregateRequestEvent; - public event PlayFabResultEvent OnLinkKongregateResultEvent; - public event PlayFabRequestEvent OnLinkSteamAccountRequestEvent; - public event PlayFabResultEvent OnLinkSteamAccountResultEvent; - public event PlayFabRequestEvent OnLinkTwitchRequestEvent; - public event PlayFabResultEvent OnLinkTwitchResultEvent; - public event PlayFabRequestEvent OnRemoveGenericIDRequestEvent; - public event PlayFabResultEvent OnRemoveGenericIDResultEvent; - public event PlayFabRequestEvent OnReportPlayerRequestEvent; - public event PlayFabResultEvent OnReportPlayerResultEvent; - public event PlayFabRequestEvent OnSendAccountRecoveryEmailRequestEvent; - public event PlayFabResultEvent OnSendAccountRecoveryEmailResultEvent; - public event PlayFabRequestEvent OnUnlinkAndroidDeviceIDRequestEvent; - public event PlayFabResultEvent OnUnlinkAndroidDeviceIDResultEvent; - public event PlayFabRequestEvent OnUnlinkCustomIDRequestEvent; - public event PlayFabResultEvent OnUnlinkCustomIDResultEvent; - public event PlayFabRequestEvent OnUnlinkFacebookAccountRequestEvent; - public event PlayFabResultEvent OnUnlinkFacebookAccountResultEvent; - public event PlayFabRequestEvent OnUnlinkGameCenterAccountRequestEvent; - public event PlayFabResultEvent OnUnlinkGameCenterAccountResultEvent; - public event PlayFabRequestEvent OnUnlinkGoogleAccountRequestEvent; - public event PlayFabResultEvent OnUnlinkGoogleAccountResultEvent; - public event PlayFabRequestEvent OnUnlinkIOSDeviceIDRequestEvent; - public event PlayFabResultEvent OnUnlinkIOSDeviceIDResultEvent; - public event PlayFabRequestEvent OnUnlinkKongregateRequestEvent; - public event PlayFabResultEvent OnUnlinkKongregateResultEvent; - public event PlayFabRequestEvent OnUnlinkSteamAccountRequestEvent; - public event PlayFabResultEvent OnUnlinkSteamAccountResultEvent; - public event PlayFabRequestEvent OnUnlinkTwitchRequestEvent; - public event PlayFabResultEvent OnUnlinkTwitchResultEvent; - public event PlayFabRequestEvent OnUpdateUserTitleDisplayNameRequestEvent; - public event PlayFabResultEvent OnUpdateUserTitleDisplayNameResultEvent; - public event PlayFabRequestEvent OnGetFriendLeaderboardRequestEvent; - public event PlayFabResultEvent OnGetFriendLeaderboardResultEvent; - public event PlayFabRequestEvent OnGetFriendLeaderboardAroundCurrentUserRequestEvent; - public event PlayFabResultEvent OnGetFriendLeaderboardAroundCurrentUserResultEvent; - public event PlayFabRequestEvent OnGetFriendLeaderboardAroundPlayerRequestEvent; - public event PlayFabResultEvent OnGetFriendLeaderboardAroundPlayerResultEvent; - public event PlayFabRequestEvent OnGetLeaderboardRequestEvent; - public event PlayFabResultEvent OnGetLeaderboardResultEvent; - public event PlayFabRequestEvent OnGetLeaderboardAroundCurrentUserRequestEvent; - public event PlayFabResultEvent OnGetLeaderboardAroundCurrentUserResultEvent; - public event PlayFabRequestEvent OnGetLeaderboardAroundPlayerRequestEvent; - public event PlayFabResultEvent OnGetLeaderboardAroundPlayerResultEvent; - public event PlayFabRequestEvent OnGetPlayerStatisticsRequestEvent; - public event PlayFabResultEvent OnGetPlayerStatisticsResultEvent; - public event PlayFabRequestEvent OnGetPlayerStatisticVersionsRequestEvent; - public event PlayFabResultEvent OnGetPlayerStatisticVersionsResultEvent; - public event PlayFabRequestEvent OnGetUserDataRequestEvent; - public event PlayFabResultEvent OnGetUserDataResultEvent; - public event PlayFabRequestEvent OnGetUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnGetUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnGetUserPublisherReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnGetUserPublisherReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnGetUserReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnGetUserReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnGetUserStatisticsRequestEvent; - public event PlayFabResultEvent OnGetUserStatisticsResultEvent; - public event PlayFabRequestEvent OnUpdatePlayerStatisticsRequestEvent; - public event PlayFabResultEvent OnUpdatePlayerStatisticsResultEvent; - public event PlayFabRequestEvent OnUpdateUserDataRequestEvent; - public event PlayFabResultEvent OnUpdateUserDataResultEvent; - public event PlayFabRequestEvent OnUpdateUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnUpdateUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnUpdateUserStatisticsRequestEvent; - public event PlayFabResultEvent OnUpdateUserStatisticsResultEvent; - public event PlayFabRequestEvent OnGetCatalogItemsRequestEvent; - public event PlayFabResultEvent OnGetCatalogItemsResultEvent; - public event PlayFabRequestEvent OnGetPublisherDataRequestEvent; - public event PlayFabResultEvent OnGetPublisherDataResultEvent; - public event PlayFabRequestEvent OnGetStoreItemsRequestEvent; - public event PlayFabResultEvent OnGetStoreItemsResultEvent; - public event PlayFabRequestEvent OnGetTimeRequestEvent; - public event PlayFabResultEvent OnGetTimeResultEvent; - public event PlayFabRequestEvent OnGetTitleDataRequestEvent; - public event PlayFabResultEvent OnGetTitleDataResultEvent; - public event PlayFabRequestEvent OnGetTitleNewsRequestEvent; - public event PlayFabResultEvent OnGetTitleNewsResultEvent; - public event PlayFabRequestEvent OnAddUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnAddUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnConfirmPurchaseRequestEvent; - public event PlayFabResultEvent OnConfirmPurchaseResultEvent; - public event PlayFabRequestEvent OnConsumeItemRequestEvent; - public event PlayFabResultEvent OnConsumeItemResultEvent; - public event PlayFabRequestEvent OnGetCharacterInventoryRequestEvent; - public event PlayFabResultEvent OnGetCharacterInventoryResultEvent; - public event PlayFabRequestEvent OnGetPurchaseRequestEvent; - public event PlayFabResultEvent OnGetPurchaseResultEvent; - public event PlayFabRequestEvent OnGetUserInventoryRequestEvent; - public event PlayFabResultEvent OnGetUserInventoryResultEvent; - public event PlayFabRequestEvent OnPayForPurchaseRequestEvent; - public event PlayFabResultEvent OnPayForPurchaseResultEvent; - public event PlayFabRequestEvent OnPurchaseItemRequestEvent; - public event PlayFabResultEvent OnPurchaseItemResultEvent; - public event PlayFabRequestEvent OnRedeemCouponRequestEvent; - public event PlayFabResultEvent OnRedeemCouponResultEvent; - public event PlayFabRequestEvent OnStartPurchaseRequestEvent; - public event PlayFabResultEvent OnStartPurchaseResultEvent; - public event PlayFabRequestEvent OnSubtractUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnSubtractUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnUnlockContainerInstanceRequestEvent; - public event PlayFabResultEvent OnUnlockContainerInstanceResultEvent; - public event PlayFabRequestEvent OnUnlockContainerItemRequestEvent; - public event PlayFabResultEvent OnUnlockContainerItemResultEvent; - public event PlayFabRequestEvent OnAddFriendRequestEvent; - public event PlayFabResultEvent OnAddFriendResultEvent; - public event PlayFabRequestEvent OnGetFriendsListRequestEvent; - public event PlayFabResultEvent OnGetFriendsListResultEvent; - public event PlayFabRequestEvent OnRemoveFriendRequestEvent; - public event PlayFabResultEvent OnRemoveFriendResultEvent; - public event PlayFabRequestEvent OnSetFriendTagsRequestEvent; - public event PlayFabResultEvent OnSetFriendTagsResultEvent; - public event PlayFabRequestEvent OnRegisterForIOSPushNotificationRequestEvent; - public event PlayFabResultEvent OnRegisterForIOSPushNotificationResultEvent; - public event PlayFabRequestEvent OnRestoreIOSPurchasesRequestEvent; - public event PlayFabResultEvent OnRestoreIOSPurchasesResultEvent; - public event PlayFabRequestEvent OnValidateIOSReceiptRequestEvent; - public event PlayFabResultEvent OnValidateIOSReceiptResultEvent; - public event PlayFabRequestEvent OnGetCurrentGamesRequestEvent; - public event PlayFabResultEvent OnGetCurrentGamesResultEvent; - public event PlayFabRequestEvent OnGetGameServerRegionsRequestEvent; - public event PlayFabResultEvent OnGetGameServerRegionsResultEvent; - public event PlayFabRequestEvent OnMatchmakeRequestEvent; - public event PlayFabResultEvent OnMatchmakeResultEvent; - public event PlayFabRequestEvent OnStartGameRequestEvent; - public event PlayFabResultEvent OnStartGameResultEvent; - public event PlayFabRequestEvent OnAndroidDevicePushNotificationRegistrationRequestEvent; - public event PlayFabResultEvent OnAndroidDevicePushNotificationRegistrationResultEvent; - public event PlayFabRequestEvent OnValidateGooglePlayPurchaseRequestEvent; - public event PlayFabResultEvent OnValidateGooglePlayPurchaseResultEvent; - public event PlayFabRequestEvent OnLogEventRequestEvent; - public event PlayFabResultEvent OnLogEventResultEvent; - public event PlayFabRequestEvent OnWriteCharacterEventRequestEvent; - public event PlayFabResultEvent OnWriteCharacterEventResultEvent; - public event PlayFabRequestEvent OnWritePlayerEventRequestEvent; - public event PlayFabResultEvent OnWritePlayerEventResultEvent; - public event PlayFabRequestEvent OnWriteTitleEventRequestEvent; - public event PlayFabResultEvent OnWriteTitleEventResultEvent; - public event PlayFabRequestEvent OnAddSharedGroupMembersRequestEvent; - public event PlayFabResultEvent OnAddSharedGroupMembersResultEvent; - public event PlayFabRequestEvent OnCreateSharedGroupRequestEvent; - public event PlayFabResultEvent OnCreateSharedGroupResultEvent; - public event PlayFabRequestEvent OnGetSharedGroupDataRequestEvent; - public event PlayFabResultEvent OnGetSharedGroupDataResultEvent; - public event PlayFabRequestEvent OnRemoveSharedGroupMembersRequestEvent; - public event PlayFabResultEvent OnRemoveSharedGroupMembersResultEvent; - public event PlayFabRequestEvent OnUpdateSharedGroupDataRequestEvent; - public event PlayFabResultEvent OnUpdateSharedGroupDataResultEvent; - public event PlayFabRequestEvent OnExecuteCloudScriptRequestEvent; - public event PlayFabResultEvent OnExecuteCloudScriptResultEvent; - public event PlayFabRequestEvent OnGetCloudScriptUrlRequestEvent; - public event PlayFabResultEvent OnGetCloudScriptUrlResultEvent; - public event PlayFabRequestEvent OnRunCloudScriptRequestEvent; - public event PlayFabResultEvent OnRunCloudScriptResultEvent; - public event PlayFabRequestEvent OnGetContentDownloadUrlRequestEvent; - public event PlayFabResultEvent OnGetContentDownloadUrlResultEvent; - public event PlayFabRequestEvent OnGetAllUsersCharactersRequestEvent; - public event PlayFabResultEvent OnGetAllUsersCharactersResultEvent; - public event PlayFabRequestEvent OnGetCharacterLeaderboardRequestEvent; - public event PlayFabResultEvent OnGetCharacterLeaderboardResultEvent; - public event PlayFabRequestEvent OnGetCharacterStatisticsRequestEvent; - public event PlayFabResultEvent OnGetCharacterStatisticsResultEvent; - public event PlayFabRequestEvent OnGetLeaderboardAroundCharacterRequestEvent; - public event PlayFabResultEvent OnGetLeaderboardAroundCharacterResultEvent; - public event PlayFabRequestEvent OnGetLeaderboardForUserCharactersRequestEvent; - public event PlayFabResultEvent OnGetLeaderboardForUserCharactersResultEvent; - public event PlayFabRequestEvent OnGrantCharacterToUserRequestEvent; - public event PlayFabResultEvent OnGrantCharacterToUserResultEvent; - public event PlayFabRequestEvent OnUpdateCharacterStatisticsRequestEvent; - public event PlayFabResultEvent OnUpdateCharacterStatisticsResultEvent; - public event PlayFabRequestEvent OnGetCharacterDataRequestEvent; - public event PlayFabResultEvent OnGetCharacterDataResultEvent; - public event PlayFabRequestEvent OnGetCharacterReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnGetCharacterReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnUpdateCharacterDataRequestEvent; - public event PlayFabResultEvent OnUpdateCharacterDataResultEvent; - public event PlayFabRequestEvent OnValidateAmazonIAPReceiptRequestEvent; - public event PlayFabResultEvent OnValidateAmazonIAPReceiptResultEvent; - public event PlayFabRequestEvent OnAcceptTradeRequestEvent; - public event PlayFabResultEvent OnAcceptTradeResultEvent; - public event PlayFabRequestEvent OnCancelTradeRequestEvent; - public event PlayFabResultEvent OnCancelTradeResultEvent; - public event PlayFabRequestEvent OnGetPlayerTradesRequestEvent; - public event PlayFabResultEvent OnGetPlayerTradesResultEvent; - public event PlayFabRequestEvent OnGetTradeStatusRequestEvent; - public event PlayFabResultEvent OnGetTradeStatusResultEvent; - public event PlayFabRequestEvent OnOpenTradeRequestEvent; - public event PlayFabResultEvent OnOpenTradeResultEvent; - public event PlayFabRequestEvent OnAttributeInstallRequestEvent; - public event PlayFabResultEvent OnAttributeInstallResultEvent; - public event PlayFabRequestEvent OnGetPlayerSegmentsRequestEvent; - public event PlayFabResultEvent OnGetPlayerSegmentsResultEvent; - public event PlayFabRequestEvent OnGetPlayerTagsRequestEvent; - public event PlayFabResultEvent OnGetPlayerTagsResultEvent; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs.meta deleted file mode 100755 index b0bbdf0f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabEvents.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: da33df462ae2fa04cb401398dc2b8a5d -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs deleted file mode 100755 index 1eb244a0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs +++ /dev/null @@ -1,74 +0,0 @@ -#if !DISABLE_PLAYFABCLIENT_API -using PlayFab.ClientModels; -using UnityEngine; - -namespace PlayFab.Internal -{ - public static class PlayFabIdfa - { - public static void DoAttributeInstall() - { - var attribRequest = new AttributeInstallRequest(); - switch (PlayFabSettings.AdvertisingIdType) - { - case PlayFabSettings.AD_TYPE_ANDROID_ID: attribRequest.Android_Id = PlayFabSettings.AdvertisingIdValue; break; - case PlayFabSettings.AD_TYPE_IDFA: attribRequest.Idfa = PlayFabSettings.AdvertisingIdValue; break; - } - PlayFabClientAPI.AttributeInstall(attribRequest, OnAttributeInstall, null); - } - - public static void OnAttributeInstall(AttributeInstallResult result) - { - // This is for internal testing. - PlayFabSettings.AdvertisingIdType += "_Successful"; - } - -#if DISABLE_IDFA || (!UNITY_IOS && !UNITY_ANDROID) - public static void OnPlayFabLogin() - { - if (!PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) - DoAttributeInstall(); - } -#elif (!UNITY_5_3 && !UNITY_5_4 && !UNITY_5_5) // This section for 5.3 or newer - public static void OnPlayFabLogin() - { - if (PlayFabSettings.DisableAdvertising) - return; - if (PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) - DoAttributeInstall(); - // else - // TODO: Restore the old Pre-V2 plugin which extracted these ids (RequestAdvertisingIdentifierAsync doesn't exist) - } -#else - public static void OnPlayFabLogin() - { - if (PlayFabSettings.DisableAdvertising) - return; - if (PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) - DoAttributeInstall(); - else - GetAdvertIdFromUnity(); - } - - private static void GetAdvertIdFromUnity() - { - Application.RequestAdvertisingIdentifierAsync( - (advertisingId, trackingEnabled, error) => - { - PlayFabSettings.DisableAdvertising = !trackingEnabled; - if (!trackingEnabled) - return; -#if UNITY_ANDROID - PlayFabSettings.AdvertisingIdType = PlayFabSettings.AD_TYPE_ANDROID_ID; -#elif UNITY_IOS - PlayFabSettings.AdvertisingIdType = PlayFabSettings.AD_TYPE_IDFA; -#endif - PlayFabSettings.AdvertisingIdValue = advertisingId; - DoAttributeInstall(); - } - ); - } -#endif - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs.meta deleted file mode 100755 index 55aeec9b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabIdfa.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f35f23adf76a2324b8ce1d2df6296171 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs deleted file mode 100755 index 0410e907..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if !DISABLE_PLAYFABCLIENT_API -using System; -using UnityEngine; -using System.Collections; -using PlayFab.Internal; - -namespace PlayFab -{ - public static partial class PlayFabSettings - { - public const string AD_TYPE_IDFA = "Idfa"; - public const string AD_TYPE_ANDROID_ID = "Android_Id"; - - internal static string LogicServerUrl = null; // Deprecated - public static string AdvertisingIdType = null; // Set this to the appropriate AD_TYPE_X constant above - public static string AdvertisingIdValue = null; - public static bool DisableAdvertising = false; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs.meta deleted file mode 100755 index 96d511c2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Client/PlayFabSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7d2be3735609f4745b11340cf06070d8 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker.meta deleted file mode 100755 index 143b4fea..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8a412908d5a194e469d8ca0be97748d7 -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs deleted file mode 100755 index 750b95fe..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using PlayFab.MatchmakerModels; - -namespace PlayFab.Events -{ - public partial class PlayFabEvents - { - public event PlayFabRequestEvent OnMatchmakerAuthUserRequestEvent; - public event PlayFabResultEvent OnMatchmakerAuthUserResultEvent; - public event PlayFabRequestEvent OnMatchmakerPlayerJoinedRequestEvent; - public event PlayFabResultEvent OnMatchmakerPlayerJoinedResultEvent; - public event PlayFabRequestEvent OnMatchmakerPlayerLeftRequestEvent; - public event PlayFabResultEvent OnMatchmakerPlayerLeftResultEvent; - public event PlayFabRequestEvent OnMatchmakerStartGameRequestEvent; - public event PlayFabResultEvent OnMatchmakerStartGameResultEvent; - public event PlayFabRequestEvent OnMatchmakerUserInfoRequestEvent; - public event PlayFabResultEvent OnMatchmakerUserInfoResultEvent; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs.meta deleted file mode 100755 index b9bc6a96..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabEvents.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1055058934189914bac79666a289e9fd -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs deleted file mode 100755 index e378b22e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs +++ /dev/null @@ -1,68 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using System; -using PlayFab.MatchmakerModels; -using PlayFab.Internal; -using PlayFab.Json; - -namespace PlayFab -{ - /// - /// Enables the use of an external match-making service in conjunction with PlayFab hosted Game Server instances - /// - public static class PlayFabMatchmakerAPI - { - - /// - /// Validates a user with the PlayFab service - /// - public static void AuthUser(AuthUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Matchmaker/AuthUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified - /// - public static void PlayerJoined(PlayerJoinedRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Matchmaker/PlayerJoined", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified - /// - public static void PlayerLeft(PlayerLeftRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Matchmaker/PlayerLeft", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance - /// - public static void StartGame(StartGameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Matchmaker/StartGame", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the relevant details for a specified user, which the external match-making service can then use to compute effective matches - /// - public static void UserInfo(UserInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Matchmaker/UserInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs.meta deleted file mode 100755 index e6f48d33..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerAPI.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c712eeedbc85dfa4c80d30f8a2ed6cd9 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs deleted file mode 100755 index 1adced25..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs +++ /dev/null @@ -1,306 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using PlayFab.SharedModels; - -namespace PlayFab.MatchmakerModels -{ - [Serializable] - public class AuthUserRequest : PlayFabRequestCommon - { - /// - /// Session Ticket provided by the client. - /// - public string AuthorizationTicket { get; set;} - } - - [Serializable] - public class AuthUserResponse : PlayFabResultCommon - { - /// - /// Boolean indicating if the user has been authorized to use the external match-making service. - /// - public bool Authorized { get; set;} - /// - /// PlayFab unique identifier of the account that has been authorized. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class DeregisterGameRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the Game Server Instance that is being deregistered. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class DeregisterGameResponse : PlayFabResultCommon - { - } - - /// - /// A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. - /// - [Serializable] - public class ItemInstance - { - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class PlayerJoinedRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Server Instance the user is joining. - /// - public string LobbyId { get; set;} - /// - /// PlayFab unique identifier for the user joining. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class PlayerJoinedResponse : PlayFabResultCommon - { - } - - [Serializable] - public class PlayerLeftRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Server Instance the user is leaving. - /// - public string LobbyId { get; set;} - /// - /// PlayFab unique identifier for the user leaving. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class PlayerLeftResponse : PlayFabResultCommon - { - } - - public enum Region - { - USCentral, - USEast, - EUWest, - Singapore, - Japan, - Brazil, - Australia - } - - [Serializable] - public class RegisterGameRequest : PlayFabRequestCommon - { - /// - /// IP address of the Game Server Instance. - /// - public string ServerHost { get; set;} - /// - /// Port number for communication with the Game Server Instance. - /// - public string ServerPort { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public string Build { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public Region Region { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public string GameMode { get; set;} - /// - /// Tags for the Game Server Instance - /// - public Dictionary Tags { get; set;} - } - - [Serializable] - public class RegisterGameResponse : PlayFabResultCommon - { - /// - /// Unique identifier generated for the Game Server Instance that is registered. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class StartGameRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the previously uploaded build executable which is to be started. - /// - public string Build { get; set;} - /// - /// Region with which to associate the server, for filtering. - /// - public Region Region { get; set;} - /// - /// Game mode for this Game Server Instance. - /// - public string GameMode { get; set;} - /// - /// Custom command line argument when starting game server process. - /// - public string CustomCommandLineData { get; set;} - /// - /// HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an application/json body of { "EventName": "game_ended", "GameID": "" }. - /// - public string ExternalMatchmakerEventEndpoint { get; set;} - } - - [Serializable] - public class StartGameResponse : PlayFabResultCommon - { - /// - /// Unique identifier for the game/lobby in the new Game Server Instance. - /// - public string GameID { get; set;} - /// - /// IP address of the new Game Server Instance. - /// - public string ServerHostname { get; set;} - /// - /// Port number for communication with the Game Server Instance. - /// - public uint ServerPort { get; set;} - } - - [Serializable] - public class UserInfoRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose information is being requested. - /// - public string PlayFabId { get; set;} - /// - /// Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a catalog version of this or higher). - /// - public int MinCatalogVersion { get; set;} - } - - [Serializable] - public class UserInfoResponse : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose information was requested. - /// - public string PlayFabId { get; set;} - /// - /// PlayFab unique user name. - /// - public string Username { get; set;} - /// - /// Title specific display name, if set. - /// - public string TitleDisplayName { get; set;} - /// - /// Array of inventory items in the user's current inventory. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - /// - /// Boolean indicating whether the user is a developer. - /// - public bool IsDeveloper { get; set;} - /// - /// Steam unique identifier, if the user has an associated Steam account. - /// - public string SteamId { get; set;} - } - - [Serializable] - public class VirtualCurrencyRechargeTime - { - /// - /// Time remaining (in seconds) before the next recharge increment of the virtual currency. - /// - public int SecondsToRecharge { get; set;} - /// - /// Server timestamp in UTC indicating the next time the virtual currency will be incremented. - /// - public DateTime RechargeTime { get; set;} - /// - /// Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen below this value. - /// - public int RechargeMax { get; set;} - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs.meta deleted file mode 100755 index ca305967..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Matchmaker/PlayFabMatchmakerModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c7c60a1006c1e64499804ca82b2412ed -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server.meta deleted file mode 100755 index 6b50bbf5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: be1738c19ed8d48468d5163ea56f2b1e -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs deleted file mode 100755 index 30920f61..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs +++ /dev/null @@ -1,226 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using PlayFab.ServerModels; - -namespace PlayFab.Events -{ - public partial class PlayFabEvents - { - public event PlayFabRequestEvent OnServerAuthenticateSessionTicketRequestEvent; - public event PlayFabResultEvent OnServerAuthenticateSessionTicketResultEvent; - public event PlayFabRequestEvent OnServerBanUsersRequestEvent; - public event PlayFabResultEvent OnServerBanUsersResultEvent; - public event PlayFabRequestEvent OnServerGetPlayFabIDsFromFacebookIDsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayFabIDsFromFacebookIDsResultEvent; - public event PlayFabRequestEvent OnServerGetPlayFabIDsFromSteamIDsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayFabIDsFromSteamIDsResultEvent; - public event PlayFabRequestEvent OnServerGetUserAccountInfoRequestEvent; - public event PlayFabResultEvent OnServerGetUserAccountInfoResultEvent; - public event PlayFabRequestEvent OnServerGetUserBansRequestEvent; - public event PlayFabResultEvent OnServerGetUserBansResultEvent; - public event PlayFabRequestEvent OnServerRevokeAllBansForUserRequestEvent; - public event PlayFabResultEvent OnServerRevokeAllBansForUserResultEvent; - public event PlayFabRequestEvent OnServerRevokeBansRequestEvent; - public event PlayFabResultEvent OnServerRevokeBansResultEvent; - public event PlayFabRequestEvent OnServerSendPushNotificationRequestEvent; - public event PlayFabResultEvent OnServerSendPushNotificationResultEvent; - public event PlayFabRequestEvent OnServerUpdateBansRequestEvent; - public event PlayFabResultEvent OnServerUpdateBansResultEvent; - public event PlayFabRequestEvent OnServerDeleteUsersRequestEvent; - public event PlayFabResultEvent OnServerDeleteUsersResultEvent; - public event PlayFabRequestEvent OnServerGetFriendLeaderboardRequestEvent; - public event PlayFabResultEvent OnServerGetFriendLeaderboardResultEvent; - public event PlayFabRequestEvent OnServerGetLeaderboardRequestEvent; - public event PlayFabResultEvent OnServerGetLeaderboardResultEvent; - public event PlayFabRequestEvent OnServerGetLeaderboardAroundUserRequestEvent; - public event PlayFabResultEvent OnServerGetLeaderboardAroundUserResultEvent; - public event PlayFabRequestEvent OnServerGetPlayerCombinedInfoRequestEvent; - public event PlayFabResultEvent OnServerGetPlayerCombinedInfoResultEvent; - public event PlayFabRequestEvent OnServerGetPlayerStatisticsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayerStatisticsResultEvent; - public event PlayFabRequestEvent OnServerGetPlayerStatisticVersionsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayerStatisticVersionsResultEvent; - public event PlayFabRequestEvent OnServerGetUserDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserInternalDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserInternalDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserPublisherInternalDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserPublisherInternalDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserPublisherReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserPublisherReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerGetUserReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerGetUserStatisticsRequestEvent; - public event PlayFabResultEvent OnServerGetUserStatisticsResultEvent; - public event PlayFabRequestEvent OnServerUpdatePlayerStatisticsRequestEvent; - public event PlayFabResultEvent OnServerUpdatePlayerStatisticsResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserInternalDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserInternalDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserPublisherDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserPublisherDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserPublisherInternalDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserPublisherInternalDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserPublisherReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserPublisherReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserStatisticsRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserStatisticsResultEvent; - public event PlayFabRequestEvent OnServerGetCatalogItemsRequestEvent; - public event PlayFabResultEvent OnServerGetCatalogItemsResultEvent; - public event PlayFabRequestEvent OnServerGetPublisherDataRequestEvent; - public event PlayFabResultEvent OnServerGetPublisherDataResultEvent; - public event PlayFabRequestEvent OnServerGetTimeRequestEvent; - public event PlayFabResultEvent OnServerGetTimeResultEvent; - public event PlayFabRequestEvent OnServerGetTitleDataRequestEvent; - public event PlayFabResultEvent OnServerGetTitleDataResultEvent; - public event PlayFabRequestEvent OnServerGetTitleInternalDataRequestEvent; - public event PlayFabResultEvent OnServerGetTitleInternalDataResultEvent; - public event PlayFabRequestEvent OnServerGetTitleNewsRequestEvent; - public event PlayFabResultEvent OnServerGetTitleNewsResultEvent; - public event PlayFabRequestEvent OnServerSetPublisherDataRequestEvent; - public event PlayFabResultEvent OnServerSetPublisherDataResultEvent; - public event PlayFabRequestEvent OnServerSetTitleDataRequestEvent; - public event PlayFabResultEvent OnServerSetTitleDataResultEvent; - public event PlayFabRequestEvent OnServerSetTitleInternalDataRequestEvent; - public event PlayFabResultEvent OnServerSetTitleInternalDataResultEvent; - public event PlayFabRequestEvent OnServerAddCharacterVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnServerAddCharacterVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnServerAddUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnServerAddUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnServerConsumeItemRequestEvent; - public event PlayFabResultEvent OnServerConsumeItemResultEvent; - public event PlayFabRequestEvent OnServerEvaluateRandomResultTableRequestEvent; - public event PlayFabResultEvent OnServerEvaluateRandomResultTableResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterInventoryRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterInventoryResultEvent; - public event PlayFabRequestEvent OnServerGetRandomResultTablesRequestEvent; - public event PlayFabResultEvent OnServerGetRandomResultTablesResultEvent; - public event PlayFabRequestEvent OnServerGetUserInventoryRequestEvent; - public event PlayFabResultEvent OnServerGetUserInventoryResultEvent; - public event PlayFabRequestEvent OnServerGrantItemsToCharacterRequestEvent; - public event PlayFabResultEvent OnServerGrantItemsToCharacterResultEvent; - public event PlayFabRequestEvent OnServerGrantItemsToUserRequestEvent; - public event PlayFabResultEvent OnServerGrantItemsToUserResultEvent; - public event PlayFabRequestEvent OnServerGrantItemsToUsersRequestEvent; - public event PlayFabResultEvent OnServerGrantItemsToUsersResultEvent; - public event PlayFabRequestEvent OnServerModifyItemUsesRequestEvent; - public event PlayFabResultEvent OnServerModifyItemUsesResultEvent; - public event PlayFabRequestEvent OnServerMoveItemToCharacterFromCharacterRequestEvent; - public event PlayFabResultEvent OnServerMoveItemToCharacterFromCharacterResultEvent; - public event PlayFabRequestEvent OnServerMoveItemToCharacterFromUserRequestEvent; - public event PlayFabResultEvent OnServerMoveItemToCharacterFromUserResultEvent; - public event PlayFabRequestEvent OnServerMoveItemToUserFromCharacterRequestEvent; - public event PlayFabResultEvent OnServerMoveItemToUserFromCharacterResultEvent; - public event PlayFabRequestEvent OnServerRedeemCouponRequestEvent; - public event PlayFabResultEvent OnServerRedeemCouponResultEvent; - public event PlayFabRequestEvent OnServerReportPlayerRequestEvent; - public event PlayFabResultEvent OnServerReportPlayerResultEvent; - public event PlayFabRequestEvent OnServerRevokeInventoryItemRequestEvent; - public event PlayFabResultEvent OnServerRevokeInventoryItemResultEvent; - public event PlayFabRequestEvent OnServerSubtractCharacterVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnServerSubtractCharacterVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnServerSubtractUserVirtualCurrencyRequestEvent; - public event PlayFabResultEvent OnServerSubtractUserVirtualCurrencyResultEvent; - public event PlayFabRequestEvent OnServerUnlockContainerInstanceRequestEvent; - public event PlayFabResultEvent OnServerUnlockContainerInstanceResultEvent; - public event PlayFabRequestEvent OnServerUnlockContainerItemRequestEvent; - public event PlayFabResultEvent OnServerUnlockContainerItemResultEvent; - public event PlayFabRequestEvent OnServerUpdateUserInventoryItemCustomDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateUserInventoryItemCustomDataResultEvent; - public event PlayFabRequestEvent OnServerAddFriendRequestEvent; - public event PlayFabResultEvent OnServerAddFriendResultEvent; - public event PlayFabRequestEvent OnServerGetFriendsListRequestEvent; - public event PlayFabResultEvent OnServerGetFriendsListResultEvent; - public event PlayFabRequestEvent OnServerRemoveFriendRequestEvent; - public event PlayFabResultEvent OnServerRemoveFriendResultEvent; - public event PlayFabRequestEvent OnServerDeregisterGameRequestEvent; - public event PlayFabResultEvent OnServerDeregisterGameResultEvent; - public event PlayFabRequestEvent OnServerNotifyMatchmakerPlayerLeftRequestEvent; - public event PlayFabResultEvent OnServerNotifyMatchmakerPlayerLeftResultEvent; - public event PlayFabRequestEvent OnServerRedeemMatchmakerTicketRequestEvent; - public event PlayFabResultEvent OnServerRedeemMatchmakerTicketResultEvent; - public event PlayFabRequestEvent OnServerRefreshGameServerInstanceHeartbeatRequestEvent; - public event PlayFabResultEvent OnServerRefreshGameServerInstanceHeartbeatResultEvent; - public event PlayFabRequestEvent OnServerRegisterGameRequestEvent; - public event PlayFabResultEvent OnServerRegisterGameResultEvent; - public event PlayFabRequestEvent OnServerSetGameServerInstanceDataRequestEvent; - public event PlayFabResultEvent OnServerSetGameServerInstanceDataResultEvent; - public event PlayFabRequestEvent OnServerSetGameServerInstanceStateRequestEvent; - public event PlayFabResultEvent OnServerSetGameServerInstanceStateResultEvent; - public event PlayFabRequestEvent OnServerSetGameServerInstanceTagsRequestEvent; - public event PlayFabResultEvent OnServerSetGameServerInstanceTagsResultEvent; - public event PlayFabRequestEvent OnServerAwardSteamAchievementRequestEvent; - public event PlayFabResultEvent OnServerAwardSteamAchievementResultEvent; - public event PlayFabRequestEvent OnServerLogEventRequestEvent; - public event PlayFabResultEvent OnServerLogEventResultEvent; - public event PlayFabRequestEvent OnServerWriteCharacterEventRequestEvent; - public event PlayFabResultEvent OnServerWriteCharacterEventResultEvent; - public event PlayFabRequestEvent OnServerWritePlayerEventRequestEvent; - public event PlayFabResultEvent OnServerWritePlayerEventResultEvent; - public event PlayFabRequestEvent OnServerWriteTitleEventRequestEvent; - public event PlayFabResultEvent OnServerWriteTitleEventResultEvent; - public event PlayFabRequestEvent OnServerAddSharedGroupMembersRequestEvent; - public event PlayFabResultEvent OnServerAddSharedGroupMembersResultEvent; - public event PlayFabRequestEvent OnServerCreateSharedGroupRequestEvent; - public event PlayFabResultEvent OnServerCreateSharedGroupResultEvent; - public event PlayFabRequestEvent OnServerDeleteSharedGroupRequestEvent; - public event PlayFabResultEvent OnServerDeleteSharedGroupResultEvent; - public event PlayFabRequestEvent OnServerGetSharedGroupDataRequestEvent; - public event PlayFabResultEvent OnServerGetSharedGroupDataResultEvent; - public event PlayFabRequestEvent OnServerRemoveSharedGroupMembersRequestEvent; - public event PlayFabResultEvent OnServerRemoveSharedGroupMembersResultEvent; - public event PlayFabRequestEvent OnServerUpdateSharedGroupDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateSharedGroupDataResultEvent; - public event PlayFabRequestEvent OnServerExecuteCloudScriptRequestEvent; - public event PlayFabResultEvent OnServerExecuteCloudScriptResultEvent; - public event PlayFabRequestEvent OnServerGetContentDownloadUrlRequestEvent; - public event PlayFabResultEvent OnServerGetContentDownloadUrlResultEvent; - public event PlayFabRequestEvent OnServerDeleteCharacterFromUserRequestEvent; - public event PlayFabResultEvent OnServerDeleteCharacterFromUserResultEvent; - public event PlayFabRequestEvent OnServerGetAllUsersCharactersRequestEvent; - public event PlayFabResultEvent OnServerGetAllUsersCharactersResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterLeaderboardRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterLeaderboardResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterStatisticsRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterStatisticsResultEvent; - public event PlayFabRequestEvent OnServerGetLeaderboardAroundCharacterRequestEvent; - public event PlayFabResultEvent OnServerGetLeaderboardAroundCharacterResultEvent; - public event PlayFabRequestEvent OnServerGetLeaderboardForUserCharactersRequestEvent; - public event PlayFabResultEvent OnServerGetLeaderboardForUserCharactersResultEvent; - public event PlayFabRequestEvent OnServerGrantCharacterToUserRequestEvent; - public event PlayFabResultEvent OnServerGrantCharacterToUserResultEvent; - public event PlayFabRequestEvent OnServerUpdateCharacterStatisticsRequestEvent; - public event PlayFabResultEvent OnServerUpdateCharacterStatisticsResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterDataRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterDataResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterInternalDataRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterInternalDataResultEvent; - public event PlayFabRequestEvent OnServerGetCharacterReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerGetCharacterReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateCharacterDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateCharacterDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateCharacterInternalDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateCharacterInternalDataResultEvent; - public event PlayFabRequestEvent OnServerUpdateCharacterReadOnlyDataRequestEvent; - public event PlayFabResultEvent OnServerUpdateCharacterReadOnlyDataResultEvent; - public event PlayFabRequestEvent OnServerAddPlayerTagRequestEvent; - public event PlayFabResultEvent OnServerAddPlayerTagResultEvent; - public event PlayFabRequestEvent OnServerGetAllActionGroupsRequestEvent; - public event PlayFabResultEvent OnServerGetAllActionGroupsResultEvent; - public event PlayFabRequestEvent OnServerGetAllSegmentsRequestEvent; - public event PlayFabResultEvent OnServerGetAllSegmentsResultEvent; - public event PlayFabRequestEvent OnServerGetPlayerSegmentsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayerSegmentsResultEvent; - public event PlayFabRequestEvent OnServerGetPlayersInSegmentRequestEvent; - public event PlayFabResultEvent OnServerGetPlayersInSegmentResultEvent; - public event PlayFabRequestEvent OnServerGetPlayerTagsRequestEvent; - public event PlayFabResultEvent OnServerGetPlayerTagsResultEvent; - public event PlayFabRequestEvent OnServerRemovePlayerTagRequestEvent; - public event PlayFabResultEvent OnServerRemovePlayerTagResultEvent; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs.meta deleted file mode 100755 index 91d46c90..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabEvents.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0d5076be1f923f141a2a5ea2a53a1385 -timeCreated: 1468524875 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs deleted file mode 100755 index 7f765349..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs +++ /dev/null @@ -1,1119 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using System; -using PlayFab.ServerModels; -using PlayFab.Internal; -using PlayFab.Json; - -namespace PlayFab -{ - /// - /// Provides functionality to allow external (developer-controlled) servers to interact with user inventories and data in a trusted manner, and to handle matchmaking and client connection orchestration - /// - public static class PlayFabServerAPI - { - - /// - /// Validated a client's session ticket, and if successful, returns details for that user - /// - public static void AuthenticateSessionTicket(AuthenticateSessionTicketRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AuthenticateSessionTicket", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. - /// - public static void BanUsers(BanUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/BanUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. - /// - public static void GetPlayFabIDsFromFacebookIDs(GetPlayFabIDsFromFacebookIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayFabIDsFromFacebookIDs", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. - /// - public static void GetPlayFabIDsFromSteamIDs(GetPlayFabIDsFromSteamIDsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayFabIDsFromSteamIDs", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the relevant details for a specified user - /// - public static void GetUserAccountInfo(GetUserAccountInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserAccountInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Gets all bans for a user. - /// - public static void GetUserBans(GetUserBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revoke all active bans for a user. - /// - public static void RevokeAllBansForUser(RevokeAllBansForUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RevokeAllBansForUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revoke all active bans specified with BanId. - /// - public static void RevokeBans(RevokeBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RevokeBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. - /// - public static void SendPushNotification(SendPushNotificationRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SendPushNotification", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates information of a list of existing bans specified with Ban Ids. - /// - public static void UpdateBans(UpdateBansRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateBans", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. - /// - public static void DeleteUsers(DeleteUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/DeleteUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetFriendLeaderboard(GetFriendLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetFriendLeaderboard", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetLeaderboard(GetLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetLeaderboard", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user - /// - public static void GetLeaderboardAroundUser(GetLeaderboardAroundUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetLeaderboardAroundUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. - /// - public static void GetPlayerCombinedInfo(GetPlayerCombinedInfoRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayerCombinedInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the current version and values for the indicated statistics, for the local player. - /// - public static void GetPlayerStatistics(GetPlayerStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayerStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the information on the available versions of the specified statistic. - /// - public static void GetPlayerStatisticVersions(GetPlayerStatisticVersionsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayerStatisticVersions", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which cannot be accessed by the client - /// - public static void GetUserInternalData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void GetUserPublisherData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which cannot be accessed by the client - /// - public static void GetUserPublisherInternalData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserPublisherInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the publisher-specific custom data for the user which can only be read by the client - /// - public static void GetUserPublisherReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserPublisherReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which can only be read by the client - /// - public static void GetUserReadOnlyData(GetUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details of all title-specific statistics for the user - /// - [Obsolete("Use 'GetPlayerStatistics' instead", true)] - public static void GetUserStatistics(GetUserStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the user - /// - public static void UpdatePlayerStatistics(UpdatePlayerStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdatePlayerStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which cannot be accessed by the client - /// - public static void UpdateUserInternalData(UpdateUserInternalDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which is readable and writable by the client - /// - public static void UpdateUserPublisherData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which cannot be accessed by the client - /// - public static void UpdateUserPublisherInternalData(UpdateUserInternalDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserPublisherInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the publisher-specific custom data for the user which can only be read by the client - /// - public static void UpdateUserPublisherReadOnlyData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserPublisherReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user which can only be read by the client - /// - public static void UpdateUserReadOnlyData(UpdateUserDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. - /// - [Obsolete("Use 'UpdatePlayerStatistics' instead", true)] - public static void UpdateUserStatistics(UpdateUserStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified version of the title's catalog of virtual goods, including all defined properties - /// - public static void GetCatalogItems(GetCatalogItemsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCatalogItems", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom publisher settings - /// - public static void GetPublisherData(GetPublisherDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the current server time - /// - public static void GetTime(GetTimeRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetTime", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom title settings - /// - public static void GetTitleData(GetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetTitleData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the key-value store of custom internal title settings - /// - public static void GetTitleInternalData(GetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetTitleInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title news feed, as configured in the developer portal - /// - public static void GetTitleNews(GetTitleNewsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetTitleNews", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value store of custom publisher settings - /// - public static void SetPublisherData(SetPublisherDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetPublisherData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value store of custom title settings - /// - public static void SetTitleData(SetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetTitleData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value store of custom title settings - /// - public static void SetTitleInternalData(SetTitleDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetTitleInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Increments the character's balance of the specified virtual currency by the stated amount - /// - public static void AddCharacterVirtualCurrency(AddCharacterVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AddCharacterVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Increments the user's balance of the specified virtual currency by the stated amount - /// - public static void AddUserVirtualCurrency(AddUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AddUserVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. - /// - public static void ConsumeItem(ConsumeItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/ConsumeItem", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. - /// - public static void EvaluateRandomResultTable(EvaluateRandomResultTableRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/EvaluateRandomResultTable", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified character's current inventory of virtual goods - /// - public static void GetCharacterInventory(GetCharacterInventoryRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterInventory", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights - /// - public static void GetRandomResultTables(GetRandomResultTablesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetRandomResultTables", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the specified user's current inventory of virtual goods - /// - public static void GetUserInventory(GetUserInventoryRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetUserInventory", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the specified items to the specified character's inventory - /// - public static void GrantItemsToCharacter(GrantItemsToCharacterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GrantItemsToCharacter", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the specified items to the specified user's inventory - /// - public static void GrantItemsToUser(GrantItemsToUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GrantItemsToUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the specified items to the specified user inventories - /// - public static void GrantItemsToUsers(GrantItemsToUsersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GrantItemsToUsers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Modifies the number of remaining uses of a player's inventory item - /// - public static void ModifyItemUses(ModifyItemUsesRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/ModifyItemUses", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Moves an item from a character's inventory into another of the users's character's inventory. - /// - public static void MoveItemToCharacterFromCharacter(MoveItemToCharacterFromCharacterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/MoveItemToCharacterFromCharacter", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Moves an item from a user's inventory into their character's inventory. - /// - public static void MoveItemToCharacterFromUser(MoveItemToCharacterFromUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/MoveItemToCharacterFromUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Moves an item from a character's inventory into the owning user's inventory. - /// - public static void MoveItemToUserFromCharacter(MoveItemToUserFromCharacterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/MoveItemToUserFromCharacter", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. - /// - public static void RedeemCoupon(RedeemCouponRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RedeemCoupon", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially toxic players. - /// - public static void ReportPlayer(ReportPlayerServerRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/ReportPlayer", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Revokes access to an item in a user's inventory - /// - public static void RevokeInventoryItem(RevokeInventoryItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RevokeInventoryItem", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Decrements the character's balance of the specified virtual currency by the stated amount - /// - public static void SubtractCharacterVirtualCurrency(SubtractCharacterVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SubtractCharacterVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Decrements the user's balance of the specified virtual currency by the stated amount - /// - public static void SubtractUserVirtualCurrency(SubtractUserVirtualCurrencyRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SubtractUserVirtualCurrency", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. - /// - public static void UnlockContainerInstance(UnlockContainerInstanceRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UnlockContainerInstance", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. - /// - public static void UnlockContainerItem(UnlockContainerItemRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UnlockContainerItem", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the key-value pair data tagged to the specified item, which is read-only from the client. - /// - public static void UpdateUserInventoryItemCustomData(UpdateUserInventoryItemDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateUserInventoryItemCustomData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds the Friend user to the friendlist of the user with PlayFabId. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. - /// - public static void AddFriend(AddFriendRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AddFriend", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. - /// - public static void GetFriendsList(GetFriendsListRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetFriendsList", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Removes the specified friend from the the user's friend list - /// - public static void RemoveFriend(RemoveFriendRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RemoveFriend", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Inform the matchmaker that a Game Server Instance is removed. - /// - public static void DeregisterGame(DeregisterGameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/DeregisterGame", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Informs the PlayFab match-making service that the user specified has left the Game Server Instance - /// - public static void NotifyMatchmakerPlayerLeft(NotifyMatchmakerPlayerLeftRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/NotifyMatchmakerPlayerLeft", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Validates a Game Server session ticket and returns details about the user - /// - public static void RedeemMatchmakerTicket(RedeemMatchmakerTicketRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RedeemMatchmakerTicket", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. - /// - public static void RefreshGameServerInstanceHeartbeat(RefreshGameServerInstanceHeartbeatRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RefreshGameServerInstanceHeartbeat", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Inform the matchmaker that a new Game Server Instance is added. - /// - public static void RegisterGame(RegisterGameRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RegisterGame", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Sets the custom data of the indicated Game Server Instance - /// - public static void SetGameServerInstanceData(SetGameServerInstanceDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetGameServerInstanceData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Set the state of the indicated Game Server Instance. - /// - public static void SetGameServerInstanceState(SetGameServerInstanceStateRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetGameServerInstanceState", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Set custom tags for the specified Game Server Instance - /// - public static void SetGameServerInstanceTags(SetGameServerInstanceTagsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/SetGameServerInstanceTags", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Awards the specified users the specified Steam achievements - /// - public static void AwardSteamAchievement(AwardSteamAchievementRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AwardSteamAchievement", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Logs a custom analytics event - /// - [Obsolete("Use 'WritePlayerEvent' instead", true)] - public static void LogEvent(LogEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/LogEvent", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Writes a character-based event into PlayStream. - /// - public static void WriteCharacterEvent(WriteServerCharacterEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/WriteCharacterEvent", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Writes a player-based event into PlayStream. - /// - public static void WritePlayerEvent(WriteServerPlayerEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/WritePlayerEvent", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Writes a title-based event into PlayStream. - /// - public static void WriteTitleEvent(WriteTitleEventRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/WriteTitleEvent", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. - /// - public static void AddSharedGroupMembers(AddSharedGroupMembersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AddSharedGroupMembers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. - /// - public static void CreateSharedGroup(CreateSharedGroupRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/CreateSharedGroup", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Deletes a shared group, freeing up the shared group ID to be reused for a new group - /// - public static void DeleteSharedGroup(DeleteSharedGroupRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/DeleteSharedGroup", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. - /// - public static void GetSharedGroupData(GetSharedGroupDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetSharedGroupData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. - /// - public static void RemoveSharedGroupMembers(RemoveSharedGroupMembersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RemoveSharedGroupMembers", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. - /// - public static void UpdateSharedGroupData(UpdateSharedGroupDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateSharedGroupData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. - /// - public static void ExecuteCloudScript(ExecuteCloudScriptServerRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/ExecuteCloudScript", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - public static void ExecuteCloudScript(ExecuteCloudScriptServerRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - Action wrappedResultCallback = (wrappedResult) => - { - var wrappedJson = JsonWrapper.SerializeObject(wrappedResult.FunctionResult, PlayFabUtil.ApiSerializerStrategy); - try { - wrappedResult.FunctionResult = JsonWrapper.DeserializeObject(wrappedJson, PlayFabUtil.ApiSerializerStrategy); - } - catch (Exception) - { - wrappedResult.FunctionResult = wrappedJson; - wrappedResult.Logs.Add(new LogStatement{ Level = "Warning", Data = wrappedJson, Message = "Sdk Message: Could not deserialize result as: " + typeof (TOut).Name }); - } - resultCallback(wrappedResult); - }; - ExecuteCloudScript(request, wrappedResultCallback, errorCallback, customData); - } - - /// - /// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service - /// - public static void GetContentDownloadUrl(GetContentDownloadUrlRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetContentDownloadUrl", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Deletes the specific character ID from the specified user. - /// - public static void DeleteCharacterFromUser(DeleteCharacterFromUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/DeleteCharacterFromUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. - /// - public static void GetAllUsersCharacters(ListUsersCharactersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetAllUsersCharacters", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard - /// - public static void GetCharacterLeaderboard(GetCharacterLeaderboardRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterLeaderboard", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the details of all title-specific statistics for the specific character - /// - public static void GetCharacterStatistics(GetCharacterStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of ranked characters for the given statistic, centered on the requested user - /// - public static void GetLeaderboardAroundCharacter(GetLeaderboardAroundCharacterRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetLeaderboardAroundCharacter", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves a list of all of the user's characters for the given statistic. - /// - public static void GetLeaderboardForUserCharacters(GetLeaderboardForUsersCharactersRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetLeaderboardForUserCharacters", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. - /// - public static void GrantCharacterToUser(GrantCharacterToUserRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GrantCharacterToUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the values of the specified title-specific statistics for the specific character - /// - public static void UpdateCharacterStatistics(UpdateCharacterStatisticsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateCharacterStatistics", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user which is readable and writable by the client - /// - public static void GetCharacterData(GetCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user's character which cannot be accessed by the client - /// - public static void GetCharacterInternalData(GetCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves the title-specific custom data for the user's character which can only be read by the client - /// - public static void GetCharacterReadOnlyData(GetCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetCharacterReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user's chjaracter which is readable and writable by the client - /// - public static void UpdateCharacterData(UpdateCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateCharacterData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user's character which cannot be accessed by the client - /// - public static void UpdateCharacterInternalData(UpdateCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateCharacterInternalData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Updates the title-specific custom data for the user's character which can only be read by the client - /// - public static void UpdateCharacterReadOnlyData(UpdateCharacterDataRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/UpdateCharacterReadOnlyData", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. - /// - public static void AddPlayerTag(AddPlayerTagRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/AddPlayerTag", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieve a list of all PlayStream actions groups. - /// - public static void GetAllActionGroups(GetAllActionGroupsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetAllActionGroups", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. - /// - public static void GetAllSegments(GetAllSegmentsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetAllSegments", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// List all segments that a player currently belongs to at this moment in time. - /// - public static void GetPlayerSegments(GetPlayersSegmentsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayerSegments", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. - /// - public static void GetPlayersInSegment(GetPlayersInSegmentRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayersInSegment", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Get all tags with a given Namespace (optional) from a player profile. - /// - public static void GetPlayerTags(GetPlayerTagsRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/GetPlayerTags", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - /// - /// Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. - /// - public static void RemovePlayerTag(RemovePlayerTagRequest request, Action resultCallback, Action errorCallback, object customData = null) - { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - PlayFabHttp.MakeApiCall("/Server/RemovePlayerTag", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData); - } - - - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs.meta deleted file mode 100755 index 259a32e7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerAPI.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d1e12172e1632754fa9cf42f58d7bc9e -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs deleted file mode 100755 index 582158b0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs +++ /dev/null @@ -1,3870 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using PlayFab.SharedModels; - -namespace PlayFab.ServerModels -{ - [Serializable] - public class AdCampaignAttribution - { - /// - /// Attribution network name - /// - public string Platform { get; set;} - /// - /// Attribution campaign identifier - /// - public string CampaignId { get; set;} - /// - /// UTC time stamp of attribution - /// - public DateTime AttributedAt { get; set;} - } - - [Serializable] - public class AddCharacterVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose virtual currency balance is to be incremented. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Name of the virtual currency which is to be incremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int Amount { get; set;} - } - - [Serializable] - public class AddFriendRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the player to add a new friend. - /// - public string PlayFabId { get; set;} - /// - /// The PlayFab identifier of the user being added. - /// - public string FriendPlayFabId { get; set;} - /// - /// The PlayFab username of the user being added - /// - public string FriendUsername { get; set;} - /// - /// Email address of the user being added. - /// - public string FriendEmail { get; set;} - /// - /// Title-specific display name of the user to being added. - /// - public string FriendTitleDisplayName { get; set;} - } - - [Serializable] - public class AddPlayerTagRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique tag for player profile. - /// - public string TagName { get; set;} - } - - [Serializable] - public class AddPlayerTagResult : PlayFabResultCommon - { - } - - [Serializable] - public class AddSharedGroupMembersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - } - - [Serializable] - public class AddSharedGroupMembersResult : PlayFabResultCommon - { - } - - [Serializable] - public class AddUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose virtual currency balance is to be increased. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which is to be incremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int Amount { get; set;} - } - - [Serializable] - public class AuthenticateSessionTicketRequest : PlayFabRequestCommon - { - /// - /// Session ticket as issued by a PlayFab client login API. - /// - public string SessionTicket { get; set;} - } - - [Serializable] - public class AuthenticateSessionTicketResult : PlayFabResultCommon - { - /// - /// Account info for the user whose session ticket was supplied. - /// - public UserAccountInfo UserInfo { get; set;} - } - - [Serializable] - public class AwardSteamAchievementItem - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique Steam achievement name. - /// - public string AchievementName { get; set;} - /// - /// Result of the award attempt (only valid on response, not on request). - /// - public bool Result { get; set;} - } - - [Serializable] - public class AwardSteamAchievementRequest : PlayFabRequestCommon - { - /// - /// Array of achievements to grant and the users to whom they are to be granted. - /// - public List Achievements { get; set;} - } - - [Serializable] - public class AwardSteamAchievementResult : PlayFabResultCommon - { - /// - /// Array of achievements granted. - /// - public List AchievementResults { get; set;} - } - - /// - /// Contains information for a ban. - /// - [Serializable] - public class BanInfo - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// The unique Ban Id associated with this ban. - /// - public string BanId { get; set;} - /// - /// The IP address on which the ban was applied. May affect multiple players. - /// - public string IPAddress { get; set;} - /// - /// The MAC address on which the ban was applied. May affect multiple players. - /// - public string MACAddress { get; set;} - /// - /// The time when this ban was applied. - /// - public DateTime? Created { get; set;} - /// - /// The time when this ban expires. Permanent bans do not have expiration date. - /// - public DateTime? Expires { get; set;} - /// - /// The reason why this ban was applied. - /// - public string Reason { get; set;} - /// - /// The active state of this ban. Expired bans may still have this value set to true but they will have no effect. - /// - public bool Active { get; set;} - } - - /// - /// Represents a single ban request. - /// - [Serializable] - public class BanRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// IP address to be banned. May affect multiple players. - /// - public string IPAddress { get; set;} - /// - /// MAC address to be banned. May affect multiple players. - /// - public string MACAddress { get; set;} - /// - /// The reason for this ban. Maximum 140 characters. - /// - public string Reason { get; set;} - /// - /// The duration in hours for the ban. Leave this blank for a permanent ban. - /// - public uint? DurationInHours { get; set;} - } - - [Serializable] - public class BanUsersRequest : PlayFabRequestCommon - { - /// - /// List of ban requests to be applied. Maximum 100. - /// - public List Bans { get; set;} - } - - [Serializable] - public class BanUsersResult : PlayFabResultCommon - { - /// - /// Information on the bans that were applied - /// - public List BanData { get; set;} - } - - /// - /// A purchasable item from the item catalog - /// - [Serializable] - public class CatalogItem - { - /// - /// unique identifier for this item - /// - public string ItemId { get; set;} - /// - /// class to which the item belongs - /// - public string ItemClass { get; set;} - /// - /// catalog version for this item - /// - public string CatalogVersion { get; set;} - /// - /// text name for the item, to show in-game - /// - public string DisplayName { get; set;} - /// - /// text description of item, to show in-game - /// - public string Description { get; set;} - /// - /// price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) - /// - public Dictionary VirtualCurrencyPrices { get; set;} - /// - /// override prices for this item for specific currencies - /// - public Dictionary RealCurrencyPrices { get; set;} - /// - /// list of item tags - /// - public List Tags { get; set;} - /// - /// game specific custom data - /// - public string CustomData { get; set;} - /// - /// defines the consumable properties (number of uses, timeout) for the item - /// - public CatalogItemConsumableInfo Consumable { get; set;} - /// - /// defines the container properties for the item - what items it contains, including random drop tables and virtual currencies, and what item (if any) is required to open it via the UnlockContainerItem API - /// - public CatalogItemContainerInfo Container { get; set;} - /// - /// defines the bundle properties for the item - bundles are items which contain other items, including random drop tables and virtual currencies - /// - public CatalogItemBundleInfo Bundle { get; set;} - /// - /// if true, then an item instance of this type can be used to grant a character to a user. - /// - public bool CanBecomeCharacter { get; set;} - /// - /// if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded - /// - public bool IsStackable { get; set;} - /// - /// if true, then an item instance of this type can be traded between players using the trading APIs - /// - public bool IsTradable { get; set;} - /// - /// URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. - /// - public string ItemImageUrl { get; set;} - /// - /// BETA: If true, then only a fixed number can ever be granted. - /// - public bool IsLimitedEdition { get; set;} - /// - /// BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. - /// - public int InitialLimitedEditionCount { get; set;} - } - - [Serializable] - public class CatalogItemBundleInfo - { - /// - /// unique ItemId values for all items which will be added to the player inventory when the bundle is added - /// - public List BundledItems { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) - /// - public List BundledResultTables { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the bundle is added - /// - public Dictionary BundledVirtualCurrencies { get; set;} - } - - [Serializable] - public class CatalogItemConsumableInfo - { - /// - /// number of times this object can be used, after which it will be removed from the player inventory - /// - public uint? UsageCount { get; set;} - /// - /// duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed - /// - public uint? UsagePeriod { get; set;} - /// - /// all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values added together, and share the result - when that period has elapsed, all the items in the group will be removed - /// - public string UsagePeriodGroup { get; set;} - } - - /// - /// Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. - /// - [Serializable] - public class CatalogItemContainerInfo - { - /// - /// ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will open the container, adding the contents to the player inventory and currency balances) - /// - public string KeyItemId { get; set;} - /// - /// unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked - /// - public List ItemContents { get; set;} - /// - /// unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) - /// - public List ResultTableContents { get; set;} - /// - /// virtual currency types and balances which will be added to the player inventory when the container is unlocked - /// - public Dictionary VirtualCurrencyContents { get; set;} - } - - [Serializable] - public class CharacterInventory - { - /// - /// The id of this character. - /// - public string CharacterId { get; set;} - /// - /// The inventory of this character. - /// - public List Inventory { get; set;} - } - - [Serializable] - public class CharacterLeaderboardEntry - { - /// - /// PlayFab unique identifier of the user for this leaderboard entry. - /// - public string PlayFabId { get; set;} - /// - /// PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. - /// - public string CharacterId { get; set;} - /// - /// Title-specific display name of the character for this leaderboard entry. - /// - public string CharacterName { get; set;} - /// - /// Title-specific display name of the user for this leaderboard entry. - /// - public string DisplayName { get; set;} - /// - /// Name of the character class for this entry. - /// - public string CharacterType { get; set;} - /// - /// Specific value of the user's statistic. - /// - public int StatValue { get; set;} - /// - /// User's overall position in the leaderboard. - /// - public int Position { get; set;} - } - - [Serializable] - public class CharacterResult : PlayFabResultCommon - { - /// - /// The id for this character on this player. - /// - public string CharacterId { get; set;} - /// - /// The name of this character. - /// - public string CharacterName { get; set;} - /// - /// The type-string that was given to this character on creation. - /// - public string CharacterType { get; set;} - } - - public enum CloudScriptRevisionOption - { - Live, - Latest, - Specific - } - - [Serializable] - public class ConsumeItemRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique instance identifier of the item to be consumed. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses to consume from the item. - /// - public int ConsumeCount { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class ConsumeItemResult : PlayFabResultCommon - { - /// - /// Unique instance identifier of the item with uses consumed. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses remaining on the item. - /// - public int RemainingUses { get; set;} - } - - [Serializable] - public class CreateSharedGroupRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). - /// - public string SharedGroupId { get; set;} - } - - [Serializable] - public class CreateSharedGroupResult : PlayFabResultCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - } - - public enum Currency - { - AED, - AFN, - ALL, - AMD, - ANG, - AOA, - ARS, - AUD, - AWG, - AZN, - BAM, - BBD, - BDT, - BGN, - BHD, - BIF, - BMD, - BND, - BOB, - BRL, - BSD, - BTN, - BWP, - BYR, - BZD, - CAD, - CDF, - CHF, - CLP, - CNY, - COP, - CRC, - CUC, - CUP, - CVE, - CZK, - DJF, - DKK, - DOP, - DZD, - EGP, - ERN, - ETB, - EUR, - FJD, - FKP, - GBP, - GEL, - GGP, - GHS, - GIP, - GMD, - GNF, - GTQ, - GYD, - HKD, - HNL, - HRK, - HTG, - HUF, - IDR, - ILS, - IMP, - INR, - IQD, - IRR, - ISK, - JEP, - JMD, - JOD, - JPY, - KES, - KGS, - KHR, - KMF, - KPW, - KRW, - KWD, - KYD, - KZT, - LAK, - LBP, - LKR, - LRD, - LSL, - LYD, - MAD, - MDL, - MGA, - MKD, - MMK, - MNT, - MOP, - MRO, - MUR, - MVR, - MWK, - MXN, - MYR, - MZN, - NAD, - NGN, - NIO, - NOK, - NPR, - NZD, - OMR, - PAB, - PEN, - PGK, - PHP, - PKR, - PLN, - PYG, - QAR, - RON, - RSD, - RUB, - RWF, - SAR, - SBD, - SCR, - SDG, - SEK, - SGD, - SHP, - SLL, - SOS, - SPL, - SRD, - STD, - SVC, - SYP, - SZL, - THB, - TJS, - TMT, - TND, - TOP, - TRY, - TTD, - TVD, - TWD, - TZS, - UAH, - UGX, - USD, - UYU, - UZS, - VEF, - VND, - VUV, - WST, - XAF, - XCD, - XDR, - XOF, - XPF, - YER, - ZAR, - ZMW, - ZWD - } - - [Serializable] - public class DeleteCharacterFromUserRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// If true, the character's inventory will be transferred up to the owning user; otherwise, this request will purge those items. - /// - public bool SaveCharacterInventory { get; set;} - } - - [Serializable] - public class DeleteCharacterFromUserResult : PlayFabResultCommon - { - } - - [Serializable] - public class DeleteSharedGroupRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - } - - [Serializable] - public class DeleteUsersRequest : PlayFabRequestCommon - { - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - /// - /// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected. - /// - public string TitleId { get; set;} - } - - [Serializable] - public class DeleteUsersResult : PlayFabResultCommon - { - } - - [Serializable] - public class DeregisterGameRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the Game Server Instance that is being deregistered. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class DeregisterGameResponse : PlayFabResultCommon - { - } - - [Serializable] - public class EmptyResult : PlayFabResultCommon - { - } - - [Serializable] - public class EvaluateRandomResultTableRequest : PlayFabRequestCommon - { - /// - /// The unique identifier of the Random Result Table to use. - /// - public string TableId { get; set;} - /// - /// Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses default/primary catalog. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class EvaluateRandomResultTableResult : PlayFabResultCommon - { - /// - /// Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. - /// - public string ResultItemId { get; set;} - } - - [Serializable] - public class ExecuteCloudScriptResult : PlayFabResultCommon - { - /// - /// The name of the function that executed - /// - public string FunctionName { get; set;} - /// - /// The revision of the CloudScript that executed - /// - public int Revision { get; set;} - /// - /// The object returned from the CloudScript function, if any - /// - public object FunctionResult { get; set;} - /// - /// Entries logged during the function execution. These include both entries logged in the function code using log.info() and log.error() and error entries for API and HTTP request failures. - /// - public List Logs { get; set;} - public double ExecutionTimeSeconds { get; set;} - /// - /// Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP requests. - /// - public double ProcessorTimeSeconds { get; set;} - public uint MemoryConsumedBytes { get; set;} - /// - /// Number of PlayFab API requests issued by the CloudScript function - /// - public int APIRequestsIssued { get; set;} - /// - /// Number of external HTTP requests issued by the CloudScript function - /// - public int HttpRequestsIssued { get; set;} - /// - /// Information about the error, if any, that occured during execution - /// - public ScriptExecutionError Error { get; set;} - } - - [Serializable] - public class ExecuteCloudScriptServerRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// The name of the CloudScript function to execute - /// - public string FunctionName { get; set;} - /// - /// Object that is passed in to the function as the first argument - /// - public object FunctionParameter { get; set;} - /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. - /// - public CloudScriptRevisionOption? RevisionSelection { get; set;} - /// - /// The specivic revision to execute, when RevisionSelection is set to 'Specific' - /// - public int? SpecificRevision { get; set;} - /// - /// Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. - /// - public bool? GeneratePlayStreamEvent { get; set;} - } - - [Serializable] - public class FacebookPlayFabIdPair - { - /// - /// Unique Facebook identifier for a user. - /// - public string FacebookId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class FriendInfo - { - /// - /// PlayFab unique identifier for this friend. - /// - public string FriendPlayFabId { get; set;} - /// - /// PlayFab unique username for this friend. - /// - public string Username { get; set;} - /// - /// Title-specific display name for this friend. - /// - public string TitleDisplayName { get; set;} - /// - /// Tags which have been associated with this friend. - /// - public List Tags { get; set;} - /// - /// Unique lobby identifier of the Game Server Instance to which this player is currently connected. - /// - public string CurrentMatchmakerLobbyId { get; set;} - /// - /// Available Facebook information (if the user and PlayFab friend are also connected in Facebook). - /// - public UserFacebookInfo FacebookInfo { get; set;} - /// - /// Available Steam information (if the user and PlayFab friend are also connected in Steam). - /// - public UserSteamInfo SteamInfo { get; set;} - /// - /// Available Game Center information (if the user and PlayFab friend are also connected in Game Center). - /// - public UserGameCenterInfo GameCenterInfo { get; set;} - } - - public enum GameInstanceState - { - Open, - Closed - } - - [Serializable] - public class GetActionGroupResult : PlayFabResultCommon - { - /// - /// Action Group name - /// - public string Name { get; set;} - /// - /// Action Group ID - /// - public string Id { get; set;} - } - - [Serializable] - public class GetAllActionGroupsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetAllActionGroupsResult : PlayFabResultCommon - { - /// - /// List of Action Groups. - /// - public List ActionGroups { get; set;} - } - - [Serializable] - public class GetAllSegmentsRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetAllSegmentsResult : PlayFabResultCommon - { - /// - /// Array of segments for this title. - /// - public List Segments { get; set;} - } - - [Serializable] - public class GetCatalogItemsRequest : PlayFabRequestCommon - { - /// - /// Which catalog is being requested. If null, uses the default catalog. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetCatalogItemsResult : PlayFabResultCommon - { - /// - /// Array of items which can be purchased. - /// - public List Catalog { get; set;} - } - - [Serializable] - public class GetCharacterDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Specific keys to search for in the custom user data. - /// - public List Keys { get; set;} - /// - /// The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this. - /// - public uint? IfChangedFromDataVersion { get; set;} - } - - [Serializable] - public class GetCharacterDataResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - /// - /// User specific data for this title. - /// - public Dictionary Data { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class GetCharacterInventoryRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Used to limit results to only those from a specific catalog version. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class GetCharacterInventoryResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique identifier of the character for this inventory. - /// - public string CharacterId { get; set;} - /// - /// Array of inventory items belonging to the character. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the character. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - } - - [Serializable] - public class GetCharacterLeaderboardRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Optional character type on which to filter the leaderboard entries. - /// - public string CharacterType { get; set;} - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// First entry in the leaderboard to be retrieved. - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetCharacterLeaderboardResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetCharacterStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - } - - [Serializable] - public class GetCharacterStatisticsResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose character statistics are being returned. - /// - public string PlayFabId { get; set;} - /// - /// Unique identifier of the character for the statistics. - /// - public string CharacterId { get; set;} - /// - /// Character statistics for the requested user. - /// - public Dictionary CharacterStatistics { get; set;} - } - - [Serializable] - public class GetContentDownloadUrlRequest : PlayFabRequestCommon - { - /// - /// Key of the content item to fetch, usually formatted as a path, e.g. images/a.png - /// - public string Key { get; set;} - /// - /// HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. - /// - public string HttpMethod { get; set;} - /// - /// True if download through CDN. CDN provides better download bandwidth and time. However, if you want latest, non-cached version of the content, set this to false. Default is true. - /// - public bool? ThruCDN { get; set;} - } - - [Serializable] - public class GetContentDownloadUrlResult : PlayFabResultCommon - { - /// - /// URL for downloading content via HTTP GET or HEAD method. The URL will expire in 1 hour. - /// - public string URL { get; set;} - } - - [Serializable] - public class GetFriendLeaderboardRequest : PlayFabRequestCommon - { - /// - /// The player whose friend leaderboard to get - /// - public string PlayFabId { get; set;} - /// - /// Statistic used to rank friends for this leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Position in the leaderboard to start this listing (defaults to the first entry). - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendsListRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the player whose friend list to get. - /// - public string PlayFabId { get; set;} - /// - /// Indicates whether Steam service friends should be included in the response. Default is true. - /// - public bool? IncludeSteamFriends { get; set;} - /// - /// Indicates whether Facebook friends should be included in the response. Default is true. - /// - public bool? IncludeFacebookFriends { get; set;} - } - - [Serializable] - public class GetFriendsListResult : PlayFabResultCommon - { - /// - /// Array of friends found. - /// - public List Friends { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCharacterRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Optional character type on which to filter the leaderboard entries. - /// - public string CharacterType { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundCharacterResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundUserRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardAroundUserResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardForUsersCharactersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardForUsersCharactersResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetLeaderboardRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the title-specific statistic for the leaderboard. - /// - public string StatisticName { get; set;} - /// - /// First entry in the leaderboard to be retrieved. - /// - public int StartPosition { get; set;} - /// - /// Maximum number of entries to retrieve. - /// - public int MaxResultsCount { get; set;} - } - - [Serializable] - public class GetLeaderboardResult : PlayFabResultCommon - { - /// - /// Ordered list of leaderboard entries. - /// - public List Leaderboard { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoRequest : PlayFabRequestCommon - { - /// - /// PlayFabId of the user whose data will be returned - /// - public string PlayFabId { get; set;} - /// - /// Flags for which pieces of info to return for the user. - /// - public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoRequestParams - { - /// - /// Whether to get the player's account Info. Defaults to false - /// - public bool GetUserAccountInfo { get; set;} - /// - /// Whether to get the player's inventory. Defaults to false - /// - public bool GetUserInventory { get; set;} - /// - /// Whether to get the player's virtual currency balances. Defaults to false - /// - public bool GetUserVirtualCurrency { get; set;} - /// - /// Whether to get the player's custom data. Defaults to false - /// - public bool GetUserData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if UserDataKeys is false - /// - public List UserDataKeys { get; set;} - /// - /// Whether to get the player's read only data. Defaults to false - /// - public bool GetUserReadOnlyData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is false - /// - public List UserReadOnlyDataKeys { get; set;} - /// - /// Whether to get character inventories. Defaults to false. - /// - public bool GetCharacterInventories { get; set;} - /// - /// Whether to get the list of characters. Defaults to false. - /// - public bool GetCharacterList { get; set;} - /// - /// Whether to get title data. Defaults to false. - /// - public bool GetTitleData { get; set;} - /// - /// Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false - /// - public List TitleDataKeys { get; set;} - /// - /// Whether to get player statistics. Defaults to false. - /// - public bool GetPlayerStatistics { get; set;} - /// - /// Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false - /// - public List PlayerStatisticNames { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Results for requested info. - /// - public GetPlayerCombinedInfoResultPayload InfoResultPayload { get; set;} - } - - [Serializable] - public class GetPlayerCombinedInfoResultPayload - { - /// - /// Account information for the user. This is always retrieved. - /// - public UserAccountInfo AccountInfo { get; set;} - /// - /// Array of inventory items in the user's current inventory. - /// - public List UserInventory { get; set;} - /// - /// Dictionary of virtual currency balance(s) belonging to the user. - /// - public Dictionary UserVirtualCurrency { get; set;} - /// - /// Dictionary of remaining times and timestamps for virtual currencies. - /// - public Dictionary UserVirtualCurrencyRechargeTimes { get; set;} - /// - /// User specific custom data. - /// - public Dictionary UserData { get; set;} - /// - /// The version of the UserData that was returned. - /// - public uint UserDataVersion { get; set;} - /// - /// User specific read-only data. - /// - public Dictionary UserReadOnlyData { get; set;} - /// - /// The version of the Read-Only UserData that was returned. - /// - public uint UserReadOnlyDataVersion { get; set;} - /// - /// List of characters for the user. - /// - public List CharacterList { get; set;} - /// - /// Inventories for each character for the user. - /// - public List CharacterInventories { get; set;} - /// - /// Title data for this title. - /// - public Dictionary TitleData { get; set;} - /// - /// List of statistics for this player. - /// - public List PlayerStatistics { get; set;} - } - - [Serializable] - public class GetPlayerSegmentsResult : PlayFabResultCommon - { - /// - /// Array of segments the requested player currently belongs to. - /// - public List Segments { get; set;} - } - - [Serializable] - public class GetPlayersInSegmentRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for this segment. - /// - public string SegmentId { get; set;} - /// - /// Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). - /// - public uint? SecondsToLive { get; set;} - /// - /// Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. - /// - public uint? MaxBatchSize { get; set;} - /// - /// Continuation token if retrieving subsequent pages of results. - /// - public string ContinuationToken { get; set;} - } - - [Serializable] - public class GetPlayersInSegmentResult : PlayFabResultCommon - { - /// - /// Count of profiles matching this segment. - /// - public int ProfilesInSegment { get; set;} - /// - /// Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. - /// - public string ContinuationToken { get; set;} - /// - /// Array of player profiles in this segment. - /// - public List PlayerProfiles { get; set;} - } - - [Serializable] - public class GetPlayersSegmentsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetPlayerStatisticsRequest : PlayFabRequestCommon - { - /// - /// user for whom statistics are being requested - /// - public string PlayFabId { get; set;} - /// - /// statistics to return - /// - public List StatisticNames { get; set;} - /// - /// statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be returned) - /// - public List StatisticNameVersions { get; set;} - } - - [Serializable] - public class GetPlayerStatisticsResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose statistics are being returned - /// - public string PlayFabId { get; set;} - /// - /// User statistics for the requested user. - /// - public List Statistics { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsRequest : PlayFabRequestCommon - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - } - - [Serializable] - public class GetPlayerStatisticVersionsResult : PlayFabResultCommon - { - /// - /// version change history of the statistic - /// - public List StatisticVersions { get; set;} - } - - [Serializable] - public class GetPlayerTagsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Optional namespace to filter results by - /// - public string Namespace { get; set;} - } - - [Serializable] - public class GetPlayerTagsResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Canonical tags (including namespace and tag's name) for the requested user - /// - public List Tags { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromFacebookIDsRequest : PlayFabRequestCommon - { - /// - /// Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. - /// - public List FacebookIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromFacebookIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Facebook identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromSteamIDsRequest : PlayFabRequestCommon - { - /// - /// Deprecated: Please use SteamStringIDs - /// - [Obsolete("Use 'SteamStringIDs' instead", true)] - public List SteamIDs { get; set;} - /// - /// Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. - /// - public List SteamStringIDs { get; set;} - } - - [Serializable] - public class GetPlayFabIDsFromSteamIDsResult : PlayFabResultCommon - { - /// - /// Mapping of Steam identifiers to PlayFab identifiers. - /// - public List Data { get; set;} - } - - [Serializable] - public class GetPublisherDataRequest : PlayFabRequestCommon - { - /// - /// array of keys to get back data from the Publisher data blob, set by the admin tools - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetPublisherDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetRandomResultTablesRequest : PlayFabRequestCommon - { - /// - /// Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses default/primary catalog. - /// - public string CatalogVersion { get; set;} - /// - /// The unique identifier of the Random Result Table to use. - /// - public List TableIDs { get; set;} - } - - [Serializable] - public class GetRandomResultTablesResult : PlayFabResultCommon - { - /// - /// array of random result tables currently available - /// - public Dictionary Tables { get; set;} - } - - [Serializable] - public class GetSegmentResult : PlayFabResultCommon - { - /// - /// Unique identifier for this segment. - /// - public string Id { get; set;} - /// - /// Segment name. - /// - public string Name { get; set;} - /// - /// Identifier of the segments AB Test, if it is attached to one. - /// - public string ABTestParent { get; set;} - } - - [Serializable] - public class GetSharedGroupDataRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array indicates that no keys should be returned). - /// - public List Keys { get; set;} - /// - /// If true, return the list of all members of the shared group. - /// - public bool? GetMembers { get; set;} - } - - [Serializable] - public class GetSharedGroupDataResult : PlayFabResultCommon - { - /// - /// Data for the requested keys. - /// - public Dictionary Data { get; set;} - /// - /// List of PlayFabId identifiers for the members of this group, if requested. - /// - public List Members { get; set;} - } - - [Serializable] - public class GetTimeRequest : PlayFabRequestCommon - { - } - - [Serializable] - public class GetTimeResult : PlayFabResultCommon - { - /// - /// Current server time when the request was received, in UTC - /// - public DateTime Time { get; set;} - } - - [Serializable] - public class GetTitleDataRequest : PlayFabRequestCommon - { - /// - /// Specific keys to search for in the title data (leave null to get all keys) - /// - public List Keys { get; set;} - } - - [Serializable] - public class GetTitleDataResult : PlayFabResultCommon - { - /// - /// a dictionary object of key / value pairs - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetTitleNewsRequest : PlayFabRequestCommon - { - /// - /// Limits the results to the last n entries. Defaults to 10 if not set. - /// - public int? Count { get; set;} - } - - [Serializable] - public class GetTitleNewsResult : PlayFabResultCommon - { - /// - /// Array of news items. - /// - public List News { get; set;} - } - - [Serializable] - public class GetUserAccountInfoRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserAccountInfoResult : PlayFabResultCommon - { - /// - /// Account details for the user whose information was requested. - /// - public UserAccountInfo UserInfo { get; set;} - } - - [Serializable] - public class GetUserBansRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserBansResult : PlayFabResultCommon - { - /// - /// Information about the bans - /// - public List BanData { get; set;} - } - - [Serializable] - public class GetUserDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Specific keys to search for in the custom user data. - /// - public List Keys { get; set;} - /// - /// The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this. - /// - public uint? IfChangedFromDataVersion { get; set;} - } - - [Serializable] - public class GetUserDataResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose custom data is being returned. - /// - public string PlayFabId { get; set;} - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - /// - /// User specific data for this title. - /// - public Dictionary Data { get; set;} - } - - [Serializable] - public class GetUserInventoryRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserInventoryResult : PlayFabResultCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Array of inventory items belonging to the user. - /// - public List Inventory { get; set;} - /// - /// Array of virtual currency balance(s) belonging to the user. - /// - public Dictionary VirtualCurrency { get; set;} - /// - /// Array of remaining times and timestamps for virtual currencies. - /// - public Dictionary VirtualCurrencyRechargeTimes { get; set;} - } - - [Serializable] - public class GetUserStatisticsRequest : PlayFabRequestCommon - { - /// - /// User for whom statistics are being requested. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class GetUserStatisticsResult : PlayFabResultCommon - { - /// - /// PlayFab unique identifier of the user whose statistics are being returned. - /// - public string PlayFabId { get; set;} - /// - /// User statistics for the requested user. - /// - public Dictionary UserStatistics { get; set;} - } - - [Serializable] - public class GrantCharacterToUserRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Non-unique display name of the character being granted. - /// - public string CharacterName { get; set;} - /// - /// Type of the character being granted; statistics can be sliced based on this value. - /// - public string CharacterType { get; set;} - } - - [Serializable] - public class GrantCharacterToUserResult : PlayFabResultCommon - { - /// - /// Unique identifier tagged to this character. - /// - public string CharacterId { get; set;} - } - - /// - /// Result of granting an item to a user - /// - [Serializable] - public class GrantedItemInstance - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Result of this operation. - /// - public bool Result { get; set;} - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class GrantItemsToCharacterRequest : PlayFabRequestCommon - { - /// - /// Catalog version from which items are to be granted. - /// - public string CatalogVersion { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// String detailing any additional information concerning this operation. - /// - public string Annotation { get; set;} - /// - /// Array of itemIds to grant to the user. - /// - public List ItemIds { get; set;} - } - - [Serializable] - public class GrantItemsToCharacterResult : PlayFabResultCommon - { - /// - /// Array of items granted to users. - /// - public List ItemGrantResults { get; set;} - } - - [Serializable] - public class GrantItemsToUserRequest : PlayFabRequestCommon - { - /// - /// Catalog version from which items are to be granted. - /// - public string CatalogVersion { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// String detailing any additional information concerning this operation. - /// - public string Annotation { get; set;} - /// - /// Array of itemIds to grant to the user. - /// - public List ItemIds { get; set;} - } - - [Serializable] - public class GrantItemsToUserResult : PlayFabResultCommon - { - /// - /// Array of items granted to users. - /// - public List ItemGrantResults { get; set;} - } - - [Serializable] - public class GrantItemsToUsersRequest : PlayFabRequestCommon - { - /// - /// Catalog version from which items are to be granted. - /// - public string CatalogVersion { get; set;} - /// - /// Array of items to grant and the users to whom the items are to be granted. - /// - public List ItemGrants { get; set;} - } - - [Serializable] - public class GrantItemsToUsersResult : PlayFabResultCommon - { - /// - /// Array of items granted to users. - /// - public List ItemGrantResults { get; set;} - } - - [Serializable] - public class ItemGrant - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique identifier of the catalog item to be granted to the user. - /// - public string ItemId { get; set;} - /// - /// String detailing any additional information concerning this operation. - /// - public string Annotation { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - } - - /// - /// A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. - /// - [Serializable] - public class ItemInstance - { - /// - /// Unique identifier for the inventory item, as defined in the catalog. - /// - public string ItemId { get; set;} - /// - /// Unique item identifier for this specific instance of the item. - /// - public string ItemInstanceId { get; set;} - /// - /// Class name for the inventory item, as defined in the catalog. - /// - public string ItemClass { get; set;} - /// - /// Timestamp for when this instance was purchased. - /// - public DateTime? PurchaseDate { get; set;} - /// - /// Timestamp for when this instance will expire. - /// - public DateTime? Expiration { get; set;} - /// - /// Total number of remaining uses, if this is a consumable item. - /// - public int? RemainingUses { get; set;} - /// - /// The number of uses that were added or removed to this item in this call. - /// - public int? UsesIncrementedBy { get; set;} - /// - /// Game specific comment associated with this instance when it was added to the user inventory. - /// - public string Annotation { get; set;} - /// - /// Catalog version for the inventory item, when this instance was created. - /// - public string CatalogVersion { get; set;} - /// - /// Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container. - /// - public string BundleParent { get; set;} - /// - /// CatalogItem.DisplayName at the time this item was purchased. - /// - public string DisplayName { get; set;} - /// - /// Currency type for the cost of the catalog item. - /// - public string UnitCurrency { get; set;} - /// - /// Cost of the catalog item in the given currency. - /// - public uint UnitPrice { get; set;} - /// - /// Array of unique items that were awarded when this catalog item was purchased. - /// - public List BundleContents { get; set;} - /// - /// A set of custom key-value pairs on the inventory item. - /// - public Dictionary CustomData { get; set;} - } - - [Serializable] - public class ListUsersCharactersRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class ListUsersCharactersResult : PlayFabResultCommon - { - /// - /// The requested list of characters. - /// - public List Characters { get; set;} - } - - [Serializable] - public class LogEventRequest : PlayFabRequestCommon - { - /// - /// PlayFab User Id of the player associated with this event. For non-player associated events, this must be null and EntityId must be set. - /// - public string PlayFabId { get; set;} - /// - /// For non player-associated events, a unique ID for the entity associated with this event. For player associated events, this must be null and PlayFabId must be set. - /// - public string EntityId { get; set;} - /// - /// For non player-associated events, the type of entity associated with this event. For player associated events, this must be null. - /// - public string EntityType { get; set;} - /// - /// Optional timestamp for this event. If null, the a timestamp is auto-assigned to the event on the server. - /// - public DateTime? Timestamp { get; set;} - /// - /// A unique event name which will be used as the table name in the Redshift database. The name will be made lower case, and cannot not contain spaces. The use of underscores is recommended, for readability. Events also cannot match reserved terms. The PlayFab reserved terms are 'log_in' and 'purchase', 'create' and 'request', while the Redshift reserved terms can be found here: http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html. - /// - public string EventName { get; set;} - /// - /// Contains all the data for this event. Event Values can be strings, booleans or numerics (float, double, integer, long) and must be consistent on a per-event basis (if the Value for Key 'A' in Event 'Foo' is an integer the first time it is sent, it must be an integer in all subsequent 'Foo' events). As with event names, Keys must also not use reserved words (see above). Finally, the size of the Body for an event must be less than 32KB (UTF-8 format). - /// - public Dictionary Body { get; set;} - /// - /// Flag to set event Body as profile details in the Redshift database as well as a standard event. - /// - public bool ProfileSetEvent { get; set;} - } - - [Serializable] - public class LogEventResult : PlayFabResultCommon - { - } - - public enum LoginIdentityProvider - { - Unknown, - PlayFab, - Custom, - GameCenter, - GooglePlay, - Steam, - XBoxLive, - PSN, - Kongregate, - Facebook, - IOSDevice, - AndroidDevice, - Twitch - } - - [Serializable] - public class LogStatement - { - /// - /// 'Debug', 'Info', or 'Error' - /// - public string Level { get; set;} - public string Message { get; set;} - /// - /// Optional object accompanying the message as contextual information - /// - public object Data { get; set;} - } - - [Serializable] - public class ModifyCharacterVirtualCurrencyResult : PlayFabResultCommon - { - /// - /// Name of the virtual currency which was modified. - /// - public string VirtualCurrency { get; set;} - /// - /// Balance of the virtual currency after modification. - /// - public int Balance { get; set;} - } - - [Serializable] - public class ModifyItemUsesRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose item is being modified. - /// - public string PlayFabId { get; set;} - /// - /// Unique instance identifier of the item to be modified. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses to add to the item. Can be negative to remove uses. - /// - public int UsesToAdd { get; set;} - } - - [Serializable] - public class ModifyItemUsesResult : PlayFabResultCommon - { - /// - /// Unique instance identifier of the item with uses consumed. - /// - public string ItemInstanceId { get; set;} - /// - /// Number of uses remaining on the item. - /// - public int RemainingUses { get; set;} - } - - [Serializable] - public class ModifyUserVirtualCurrencyResult : PlayFabResultCommon - { - /// - /// User currency was subtracted from. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which was modified. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded. - /// - public int BalanceChange { get; set;} - /// - /// Balance of the virtual currency after modification. - /// - public int Balance { get; set;} - } - - [Serializable] - public class MoveItemToCharacterFromCharacterRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique identifier of the character that currently has the item. - /// - public string GivingCharacterId { get; set;} - /// - /// Unique identifier of the character that will be receiving the item. - /// - public string ReceivingCharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - } - - [Serializable] - public class MoveItemToCharacterFromCharacterResult : PlayFabResultCommon - { - } - - [Serializable] - public class MoveItemToCharacterFromUserRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - } - - [Serializable] - public class MoveItemToCharacterFromUserResult : PlayFabResultCommon - { - } - - [Serializable] - public class MoveItemToUserFromCharacterRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - } - - [Serializable] - public class MoveItemToUserFromCharacterResult : PlayFabResultCommon - { - } - - [Serializable] - public class NotifyMatchmakerPlayerLeftRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Instance the user is leaving. - /// - public string LobbyId { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class NotifyMatchmakerPlayerLeftResult : PlayFabResultCommon - { - /// - /// State of user leaving the Game Server Instance. - /// - public PlayerConnectionState? PlayerState { get; set;} - } - - public enum PlayerConnectionState - { - Unassigned, - Connecting, - Participating, - Participated, - Reconnecting - } - - [Serializable] - public class PlayerLeaderboardEntry - { - /// - /// PlayFab unique identifier of the user for this leaderboard entry. - /// - public string PlayFabId { get; set;} - /// - /// Title-specific display name of the user for this leaderboard entry. - /// - public string DisplayName { get; set;} - /// - /// Specific value of the user's statistic. - /// - public int StatValue { get; set;} - /// - /// User's overall position in the leaderboard. - /// - public int Position { get; set;} - } - - [Serializable] - public class PlayerLinkedAccount - { - /// - /// Authentication platform - /// - public LoginIdentityProvider? Platform { get; set;} - /// - /// Platform user identifier - /// - public string PlatformUserId { get; set;} - /// - /// Linked account's username - /// - public string Username { get; set;} - /// - /// Linked account's email - /// - public string Email { get; set;} - } - - [Serializable] - public class PlayerProfile - { - /// - /// PlayFab Player ID - /// - public string PlayerId { get; set;} - /// - /// Title ID this profile applies to - /// - public string TitleId { get; set;} - /// - /// Player Display Name - /// - public string DisplayName { get; set;} - /// - /// Publisher this player belongs to - /// - public string PublisherId { get; set;} - /// - /// Player account origination - /// - public LoginIdentityProvider? Origination { get; set;} - /// - /// Player record created - /// - public DateTime? Created { get; set;} - /// - /// Last login - /// - public DateTime? LastLogin { get; set;} - /// - /// Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. - /// - public DateTime? BannedUntil { get; set;} - /// - /// Dictionary of player's statistics using only the latest version's value - /// - public Dictionary Statistics { get; set;} - /// - /// A sum of player's total purchases in USD across all currencies. - /// - public uint? TotalValueToDateInUSD { get; set;} - /// - /// Dictionary of player's total purchases by currency. - /// - public Dictionary ValuesToDate { get; set;} - /// - /// List of player's tags for segmentation. - /// - public List Tags { get; set;} - /// - /// Dictionary of player's virtual currency balances - /// - public Dictionary VirtualCurrencyBalances { get; set;} - /// - /// Array of ad campaigns player has been attributed to - /// - public List AdCampaignAttributions { get; set;} - /// - /// Array of configured push notification end points - /// - public List PushNotificationRegistrations { get; set;} - /// - /// Array of third party accounts linked to this player - /// - public List LinkedAccounts { get; set;} - /// - /// Array of player statistics - /// - public List PlayerStatistics { get; set;} - } - - [Serializable] - public class PlayerStatistic - { - /// - /// Statistic ID - /// - public string Id { get; set;} - /// - /// Statistic version (0 if not a versioned statistic) - /// - public int StatisticVersion { get; set;} - /// - /// Current statistic value - /// - public int StatisticValue { get; set;} - /// - /// Statistic name - /// - public string Name { get; set;} - } - - [Serializable] - public class PlayerStatisticVersion - { - /// - /// name of the statistic when the version became active - /// - public string StatisticName { get; set;} - /// - /// version of the statistic - /// - public uint Version { get; set;} - /// - /// time at which the statistic version was scheduled to become active, based on the configured ResetInterval - /// - public DateTime? ScheduledActivationTime { get; set;} - /// - /// time when the statistic version became active - /// - public DateTime ActivationTime { get; set;} - /// - /// time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval - /// - public DateTime? ScheduledDeactivationTime { get; set;} - /// - /// time when the statistic version became inactive due to statistic version incrementing - /// - public DateTime? DeactivationTime { get; set;} - } - - public enum PushNotificationPlatform - { - ApplePushNotificationService, - GoogleCloudMessaging - } - - [Serializable] - public class PushNotificationRegistration - { - /// - /// Push notification platform - /// - public PushNotificationPlatform? Platform { get; set;} - /// - /// Notification configured endpoint - /// - public string NotificationEndpointARN { get; set;} - } - - [Serializable] - public class RandomResultTableListing - { - /// - /// Catalog version this table is associated with - /// - public string CatalogVersion { get; set;} - /// - /// Unique name for this drop table - /// - public string TableId { get; set;} - /// - /// Child nodes that indicate what kind of drop table item this actually is. - /// - public List Nodes { get; set;} - } - - [Serializable] - public class RedeemCouponRequest : PlayFabRequestCommon - { - /// - /// Generated coupon code to redeem. - /// - public string CouponCode { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Catalog version of the coupon. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class RedeemCouponResult : PlayFabResultCommon - { - /// - /// Items granted to the player as a result of redeeming the coupon. - /// - public List GrantedItems { get; set;} - } - - [Serializable] - public class RedeemMatchmakerTicketRequest : PlayFabRequestCommon - { - /// - /// Server authorization ticket passed back from a call to Matchmake or StartGame. - /// - public string Ticket { get; set;} - /// - /// Unique identifier of the Game Server Instance that is asking for validation of the authorization ticket. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class RedeemMatchmakerTicketResult : PlayFabResultCommon - { - /// - /// Boolean indicating whether the ticket was validated by the PlayFab service. - /// - public bool TicketIsValid { get; set;} - /// - /// Error value if the ticket was not validated. - /// - public string Error { get; set;} - /// - /// User account information for the user validated. - /// - public UserAccountInfo UserInfo { get; set;} - } - - [Serializable] - public class RefreshGameServerInstanceHeartbeatRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Server Instance for which the heartbeat is updated. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class RefreshGameServerInstanceHeartbeatResult : PlayFabResultCommon - { - } - - public enum Region - { - USCentral, - USEast, - EUWest, - Singapore, - Japan, - Brazil, - Australia - } - - [Serializable] - public class RegisterGameRequest : PlayFabRequestCommon - { - /// - /// IP address of the Game Server Instance. - /// - public string ServerHost { get; set;} - /// - /// Port number for communication with the Game Server Instance. - /// - public string ServerPort { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public string Build { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public Region Region { get; set;} - /// - /// Unique identifier of the build running on the Game Server Instance. - /// - public string GameMode { get; set;} - /// - /// Tags for the Game Server Instance - /// - public Dictionary Tags { get; set;} - } - - [Serializable] - public class RegisterGameResponse : PlayFabResultCommon - { - /// - /// Unique identifier generated for the Game Server Instance that is registered. - /// - public string LobbyId { get; set;} - } - - [Serializable] - public class RemoveFriendRequest : PlayFabRequestCommon - { - /// - /// PlayFab identifier of the friend account which is to be removed. - /// - public string FriendPlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class RemovePlayerTagRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique tag for player profile. - /// - public string TagName { get; set;} - } - - [Serializable] - public class RemovePlayerTagResult : PlayFabResultCommon - { - } - - [Serializable] - public class RemoveSharedGroupMembersRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// An array of unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public List PlayFabIds { get; set;} - } - - [Serializable] - public class RemoveSharedGroupMembersResult : PlayFabResultCommon - { - } - - [Serializable] - public class ReportPlayerServerRequest : PlayFabRequestCommon - { - /// - /// PlayFabId of the reporting player. - /// - public string ReporterId { get; set;} - /// - /// PlayFabId of the reported player. - /// - public string ReporteeId { get; set;} - /// - /// Title player was reported in, optional if report not for specific title. - /// - public string TitleId { get; set;} - /// - /// Optional additional comment by reporting player. - /// - public string Comment { get; set;} - } - - [Serializable] - public class ReportPlayerServerResult : PlayFabResultCommon - { - /// - /// Indicates whether this action completed successfully. - /// - public bool Updated { get; set;} - /// - /// The number of remaining reports which may be filed today by this reporting player. - /// - public int SubmissionsRemaining { get; set;} - } - - [Serializable] - public class ResultTableNode - { - /// - /// Whether this entry in the table is an item or a link to another table - /// - public ResultTableNodeType ResultItemType { get; set;} - /// - /// Either an ItemId, or the TableId of another random result table - /// - public string ResultItem { get; set;} - /// - /// How likely this is to be rolled - larger numbers add more weight - /// - public int Weight { get; set;} - } - - public enum ResultTableNodeType - { - ItemId, - TableId - } - - [Serializable] - public class RevokeAllBansForUserRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class RevokeAllBansForUserResult : PlayFabResultCommon - { - /// - /// Information on the bans that were revoked. - /// - public List BanData { get; set;} - } - - [Serializable] - public class RevokeBansRequest : PlayFabRequestCommon - { - /// - /// Ids of the bans to be revoked. Maximum 100. - /// - public List BanIds { get; set;} - } - - [Serializable] - public class RevokeBansResult : PlayFabResultCommon - { - /// - /// Information on the bans that were revoked - /// - public List BanData { get; set;} - } - - [Serializable] - public class RevokeInventoryItemRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - } - - [Serializable] - public class RevokeInventoryResult : PlayFabResultCommon - { - } - - [Serializable] - public class ScriptExecutionError - { - /// - /// Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError - /// - public string Error { get; set;} - /// - /// Details about the error - /// - public string Message { get; set;} - /// - /// Point during the execution of the script at which the error occurred, if any - /// - public string StackTrace { get; set;} - } - - [Serializable] - public class SendPushNotificationRequest : PlayFabRequestCommon - { - /// - /// PlayFabId of the recipient of the push notification. - /// - public string Recipient { get; set;} - /// - /// Text of message to send. - /// - public string Message { get; set;} - /// - /// Subject of message to send (may not be displayed in all platforms. - /// - public string Subject { get; set;} - } - - [Serializable] - public class SendPushNotificationResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetGameServerInstanceDataRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Instance to be updated. - /// - public string LobbyId { get; set;} - /// - /// Custom data to set for the specified game server instance. - /// - public string GameServerData { get; set;} - } - - [Serializable] - public class SetGameServerInstanceDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetGameServerInstanceStateRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Instance to be updated. - /// - public string LobbyId { get; set;} - /// - /// State to set for the specified game server instance. - /// - public GameInstanceState State { get; set;} - } - - [Serializable] - public class SetGameServerInstanceStateResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetGameServerInstanceTagsRequest : PlayFabRequestCommon - { - /// - /// Unique identifier of the Game Server Instance to be updated. - /// - public string LobbyId { get; set;} - /// - /// Tags to set for the specified Game Server Instance. Note that this is the complete list of tags to be associated with the Game Server Instance. - /// - public Dictionary Tags { get; set;} - } - - [Serializable] - public class SetGameServerInstanceTagsResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetPublisherDataRequest : PlayFabRequestCommon - { - /// - /// key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. - /// - public string Key { get; set;} - /// - /// new value to set. Set to null to remove a value - /// - public string Value { get; set;} - } - - [Serializable] - public class SetPublisherDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class SetTitleDataRequest : PlayFabRequestCommon - { - /// - /// key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. - /// - public string Key { get; set;} - /// - /// new value to set. Set to null to remove a value - /// - public string Value { get; set;} - } - - [Serializable] - public class SetTitleDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class SharedGroupDataRecord - { - /// - /// Data stored for the specified group data key. - /// - public string Value { get; set;} - /// - /// PlayFabId of the user to last update this value. - /// - public string LastUpdatedBy { get; set;} - /// - /// Timestamp for when this data was last updated. - /// - public DateTime LastUpdated { get; set;} - /// - /// Indicates whether this data can be read by all users (public) or only members of the group (private). - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class StatisticNameVersion - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// the version of the statistic to be returned - /// - public uint Version { get; set;} - } - - [Serializable] - public class StatisticUpdate - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. - /// - public uint? Version { get; set;} - /// - /// statistic value for the player - /// - public int Value { get; set;} - } - - [Serializable] - public class StatisticValue - { - /// - /// unique name of the statistic - /// - public string StatisticName { get; set;} - /// - /// statistic value for the player - /// - public int Value { get; set;} - /// - /// for updates to an existing statistic value for a player, the version of the statistic when it was loaded - /// - public uint Version { get; set;} - } - - [Serializable] - public class SteamPlayFabIdPair - { - /// - /// Deprecated: Please use SteamStringId - /// - [Obsolete("Use 'SteamStringId' instead", true)] - public ulong SteamId { get; set;} - /// - /// Unique Steam identifier for a user. - /// - public string SteamStringId { get; set;} - /// - /// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. - /// - public string PlayFabId { get; set;} - } - - [Serializable] - public class SubtractCharacterVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Name of the virtual currency which is to be decremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be subtracted from the user balance of the specified virtual currency. - /// - public int Amount { get; set;} - } - - [Serializable] - public class SubtractUserVirtualCurrencyRequest : PlayFabRequestCommon - { - /// - /// PlayFab unique identifier of the user whose virtual currency balance is to be decreased. - /// - public string PlayFabId { get; set;} - /// - /// Name of the virtual currency which is to be decremented. - /// - public string VirtualCurrency { get; set;} - /// - /// Amount to be subtracted from the user balance of the specified virtual currency. - /// - public int Amount { get; set;} - } - - public enum TitleActivationStatus - { - None, - ActivatedTitleKey, - PendingSteam, - ActivatedSteam, - RevokedSteam - } - - [Serializable] - public class TitleNewsItem - { - /// - /// Date and time when the news items was posted. - /// - public DateTime Timestamp { get; set;} - /// - /// Unique identifier of news item. - /// - public string NewsId { get; set;} - /// - /// Title of the news item. - /// - public string Title { get; set;} - /// - /// News item text. - /// - public string Body { get; set;} - } - - [Serializable] - public class UnlockContainerInstanceRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// ItemInstanceId of the container to unlock. - /// - public string ContainerItemInstanceId { get; set;} - /// - /// ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this parameter is required. - /// - public string KeyItemInstanceId { get; set;} - /// - /// Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog associated with the item instance. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class UnlockContainerItemRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Catalog ItemId of the container type to unlock. - /// - public string ContainerItemId { get; set;} - /// - /// Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary catalog. - /// - public string CatalogVersion { get; set;} - } - - [Serializable] - public class UnlockContainerItemResult : PlayFabResultCommon - { - /// - /// Unique instance identifier of the container unlocked. - /// - public string UnlockedItemInstanceId { get; set;} - /// - /// Unique instance identifier of the key used to unlock the container, if applicable. - /// - public string UnlockedWithItemInstanceId { get; set;} - /// - /// Items granted to the player as a result of unlocking the container. - /// - public List GrantedItems { get; set;} - /// - /// Virtual currency granted to the player as a result of unlocking the container. - /// - public Dictionary VirtualCurrency { get; set;} - } - - /// - /// Represents a single update ban request. - /// - [Serializable] - public class UpdateBanRequest : PlayFabRequestCommon - { - /// - /// The id of the ban to be updated. - /// - public string BanId { get; set;} - /// - /// The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. - /// - public string Reason { get; set;} - /// - /// The updated expiration date for the ban. Null for no change. - /// - public DateTime? Expires { get; set;} - /// - /// The updated IP address for the ban. Null for no change. - /// - public string IPAddress { get; set;} - /// - /// The updated MAC address for the ban. Null for no change. - /// - public string MACAddress { get; set;} - /// - /// Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. - /// - public bool? Permanent { get; set;} - /// - /// The updated active state for the ban. Null for no change. - /// - public bool? Active { get; set;} - } - - [Serializable] - public class UpdateBansRequest : PlayFabRequestCommon - { - /// - /// List of bans to be updated. Maximum 100. - /// - public List Bans { get; set;} - } - - [Serializable] - public class UpdateBansResult : PlayFabResultCommon - { - /// - /// Information on the bans that were updated - /// - public List BanData { get; set;} - } - - [Serializable] - public class UpdateCharacterDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateCharacterDataResult : PlayFabResultCommon - { - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class UpdateCharacterStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Statistics to be updated with the provided values. - /// - public Dictionary CharacterStatistics { get; set;} - } - - [Serializable] - public class UpdateCharacterStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdatePlayerStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Statistics to be updated with the provided values - /// - public List Statistics { get; set;} - } - - [Serializable] - public class UpdatePlayerStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateSharedGroupDataRequest : PlayFabRequestCommon - { - /// - /// Unique identifier for the shared group. - /// - public string SharedGroupId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys in this request. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateSharedGroupDataResult : PlayFabResultCommon - { - } - - [Serializable] - public class UpdateUserDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - /// - /// Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UpdateUserDataResult : PlayFabResultCommon - { - /// - /// Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data. - /// - public uint DataVersion { get; set;} - } - - [Serializable] - public class UpdateUserInternalDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - } - - [Serializable] - public class UpdateUserInventoryItemDataRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// Unique PlayFab assigned instance identifier of the item - /// - public string ItemInstanceId { get; set;} - /// - /// Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character. - /// - public Dictionary Data { get; set;} - /// - /// Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly. - /// - public List KeysToRemove { get; set;} - } - - [Serializable] - public class UpdateUserStatisticsRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Statistics to be updated with the provided values. - /// - public Dictionary UserStatistics { get; set;} - } - - [Serializable] - public class UpdateUserStatisticsResult : PlayFabResultCommon - { - } - - [Serializable] - public class UserAccountInfo - { - /// - /// Unique identifier for the user account - /// - public string PlayFabId { get; set;} - /// - /// Timestamp indicating when the user account was created - /// - public DateTime Created { get; set;} - /// - /// User account name in the PlayFab service - /// - public string Username { get; set;} - /// - /// Title-specific information for the user account - /// - public UserTitleInfo TitleInfo { get; set;} - /// - /// Personal information for the user which is considered more sensitive - /// - public UserPrivateAccountInfo PrivateInfo { get; set;} - /// - /// User Facebook information, if a Facebook account has been linked - /// - public UserFacebookInfo FacebookInfo { get; set;} - /// - /// User Steam information, if a Steam account has been linked - /// - public UserSteamInfo SteamInfo { get; set;} - /// - /// User Gamecenter information, if a Gamecenter account has been linked - /// - public UserGameCenterInfo GameCenterInfo { get; set;} - /// - /// User iOS device information, if an iOS device has been linked - /// - public UserIosDeviceInfo IosDeviceInfo { get; set;} - /// - /// User Android device information, if an Android device has been linked - /// - public UserAndroidDeviceInfo AndroidDeviceInfo { get; set;} - /// - /// User Kongregate account information, if a Kongregate account has been linked - /// - public UserKongregateInfo KongregateInfo { get; set;} - /// - /// User Twitch account information, if a Twitch account has been linked - /// - public UserTwitchInfo TwitchInfo { get; set;} - /// - /// User PSN account information, if a PSN account has been linked - /// - public UserPsnInfo PsnInfo { get; set;} - /// - /// User Google account information, if a Google account has been linked - /// - public UserGoogleInfo GoogleInfo { get; set;} - /// - /// User XBox account information, if a XBox account has been linked - /// - public UserXboxInfo XboxInfo { get; set;} - /// - /// Custom ID information, if a custom ID has been assigned - /// - public UserCustomIdInfo CustomIdInfo { get; set;} - } - - [Serializable] - public class UserAndroidDeviceInfo - { - /// - /// Android device ID - /// - public string AndroidDeviceId { get; set;} - } - - [Serializable] - public class UserCustomIdInfo - { - /// - /// Custom ID - /// - public string CustomId { get; set;} - } - - /// - /// Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - /// - public enum UserDataPermission - { - Private, - Public - } - - [Serializable] - public class UserDataRecord - { - /// - /// Data stored for the specified user data key. - /// - public string Value { get; set;} - /// - /// Timestamp for when this data was last updated. - /// - public DateTime LastUpdated { get; set;} - /// - /// Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. - /// - public UserDataPermission? Permission { get; set;} - } - - [Serializable] - public class UserFacebookInfo - { - /// - /// Facebook identifier - /// - public string FacebookId { get; set;} - /// - /// Facebook full name - /// - public string FullName { get; set;} - } - - [Serializable] - public class UserGameCenterInfo - { - /// - /// Gamecenter identifier - /// - public string GameCenterId { get; set;} - } - - [Serializable] - public class UserGoogleInfo - { - /// - /// Google ID - /// - public string GoogleId { get; set;} - /// - /// Email address of the Google account - /// - public string GoogleEmail { get; set;} - /// - /// Locale of the Google account - /// - public string GoogleLocale { get; set;} - /// - /// Gender information of the Google account - /// - public string GoogleGender { get; set;} - } - - [Serializable] - public class UserIosDeviceInfo - { - /// - /// iOS device ID - /// - public string IosDeviceId { get; set;} - } - - [Serializable] - public class UserKongregateInfo - { - /// - /// Kongregate ID - /// - public string KongregateId { get; set;} - /// - /// Kongregate Username - /// - public string KongregateName { get; set;} - } - - public enum UserOrigination - { - Organic, - Steam, - Google, - Amazon, - Facebook, - Kongregate, - GamersFirst, - Unknown, - IOS, - LoadTest, - Android, - PSN, - GameCenter, - CustomId, - XboxLive, - Parse, - Twitch - } - - [Serializable] - public class UserPrivateAccountInfo - { - /// - /// user email address - /// - public string Email { get; set;} - } - - [Serializable] - public class UserPsnInfo - { - /// - /// PSN account ID - /// - public string PsnAccountId { get; set;} - /// - /// PSN online ID - /// - public string PsnOnlineId { get; set;} - } - - [Serializable] - public class UserSteamInfo - { - /// - /// Steam identifier - /// - public string SteamId { get; set;} - /// - /// the country in which the player resides, from Steam data - /// - public string SteamCountry { get; set;} - /// - /// currency type set in the user Steam account - /// - public Currency? SteamCurrency { get; set;} - /// - /// what stage of game ownership the user is listed as being in, from Steam - /// - public TitleActivationStatus? SteamActivationStatus { get; set;} - } - - [Serializable] - public class UserTitleInfo - { - /// - /// name of the user, as it is displayed in-game - /// - public string DisplayName { get; set;} - /// - /// source by which the user first joined the game, if known - /// - public UserOrigination? Origination { get; set;} - /// - /// timestamp indicating when the user was first associated with this game (this can differ significantly from when the user first registered with PlayFab) - /// - public DateTime Created { get; set;} - /// - /// timestamp for the last user login for this title - /// - public DateTime? LastLogin { get; set;} - /// - /// timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other events, such as issuing a beta key to the user, can associate the title to the user) - /// - public DateTime? FirstLogin { get; set;} - /// - /// boolean indicating whether or not the user is currently banned for a title - /// - public bool? isBanned { get; set;} - } - - [Serializable] - public class UserTwitchInfo - { - /// - /// Twitch ID - /// - public string TwitchId { get; set;} - /// - /// Twitch Username - /// - public string TwitchUserName { get; set;} - } - - [Serializable] - public class UserXboxInfo - { - /// - /// XBox user ID - /// - public string XboxUserId { get; set;} - } - - [Serializable] - public class VirtualCurrencyRechargeTime - { - /// - /// Time remaining (in seconds) before the next recharge increment of the virtual currency. - /// - public int SecondsToRecharge { get; set;} - /// - /// Server timestamp in UTC indicating the next time the virtual currency will be incremented. - /// - public DateTime RechargeTime { get; set;} - /// - /// Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen below this value. - /// - public int RechargeMax { get; set;} - } - - [Serializable] - public class WriteEventResponse : PlayFabResultCommon - { - /// - /// The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. - /// - public string EventId { get; set;} - } - - [Serializable] - public class WriteServerCharacterEventRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// Unique PlayFab assigned ID for a specific character owned by a user - /// - public string CharacterId { get; set;} - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom event properties. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } - - [Serializable] - public class WriteServerPlayerEventRequest : PlayFabRequestCommon - { - /// - /// Unique PlayFab assigned ID of the user on whom the operation will be performed. - /// - public string PlayFabId { get; set;} - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } - - [Serializable] - public class WriteTitleEventRequest : PlayFabRequestCommon - { - /// - /// The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in). - /// - public string EventName { get; set;} - /// - /// The time (in UTC) associated with this event. The value dafaults to the current time. - /// - public DateTime? Timestamp { get; set;} - /// - /// Custom event properties. Each property consists of a name (string) and a value (JSON object). - /// - public Dictionary Body { get; set;} - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs.meta deleted file mode 100755 index cafb56b4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabServerModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 85069115b99da8c4688d838452001d89 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs deleted file mode 100755 index 4c3ed672..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs +++ /dev/null @@ -1,24 +0,0 @@ -#if ENABLE_PLAYFABSERVER_API -using System; -using UnityEngine; -using System.Collections; -using PlayFab.Internal; - -namespace PlayFab -{ - public static partial class PlayFabSettings - { - //Future place for custom settings for Server API -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - public static string ProductionEnvironmentPlayStreamUrl - { - set { PlayFabShared.ProductionEnvironmentPlayStreamUrl = value; } - internal get - { - return string.IsNullOrEmpty(PlayFabShared.ProductionEnvironmentPlayStreamUrl) ? "http://playstreamlive.playfab.com/signalr" : PlayFabShared.ProductionEnvironmentPlayStreamUrl; - } - } -#endif - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs.meta deleted file mode 100755 index a9673ed0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayFabSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: aa6554107920d6e41bdb8c1755dfb35a -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream.meta deleted file mode 100755 index 81205fa6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 52cbe8a69f4df0f4d958d37b5b7416b9 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs deleted file mode 100755 index f26a5448..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs +++ /dev/null @@ -1,257 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using PlayFab.Internal; - -namespace PlayFab -{ - /// - /// APIs which allow game servers to subscribe to PlayStream events for a specific title - /// This API is server only, and should NEVER be used on clients. - /// - public static class PlayFabPlayStreamAPI - { - /// - /// The event when successfully subcribed to PlayStream. - /// - public static event Action OnSubscribed; - - /// - /// The event when failed to subcribe events from PlayStream server. - /// - public static event Action OnFailed; - - /// - /// This is the event when a PlayStream event is received from the server. - /// - public static event Action OnPlayStreamEvent; - - #region Connection Status Events - - /// - /// The debug event when reconnected to the PlayStream server. - /// - public static event Action OnReconnected; - - /// - /// The debug event when received anything from the PlayStream server. This gives the raw message received from the server and should be used for debug purposes. - /// - public static event Action OnReceived; - - /// - /// The debug event when an error occurs. - /// - public static event Action OnError; - - /// - /// The debug event when disconnected from the PlayStream server. - /// - public static event Action OnDisconnected; - - #endregion - - /// - /// Start the SignalR connection asynchronously and subscribe to PlayStream events if successfully connected. - /// Optionally pass an filter id to only be subscribed to specific types of PlayStream events. Event filters can be configured on GameManager. - /// - public static void Start(string eventFilterId = null) - { - Action connetionCallback = () => - { - OnConnectedCallback(eventFilterId); - }; - PlayFabHttp.InitializeSignalR(PlayFabSettings.ProductionEnvironmentPlayStreamUrl, "EventStreamsHub", connetionCallback, OnReceivedCallback, OnReconnectedCallback, OnDisconnectedCallback, OnErrorCallback); - } - - /// - /// Sends a disconnect request to the server and stop the SignalR connection. - /// - public static void Stop() - { - PlayFabHttp.StopSignalR(); - } - - #region Connection Callbacks - - private static void OnConnectedCallback(string filter) - { - PlayFabHttp.SubscribeSignalR("notifyNewMessage", OnPlayStreamNotificationCallback); - PlayFabHttp.SubscribeSignalR("notifySubscriptionError", OnSubscriptionErrorCallback); - PlayFabHttp.SubscribeSignalR("notifySubscriptionSuccess", OnSubscriptionSuccessCallback); - var queueRequest = new - { - TitleId = PlayFabSettings.TitleId, - TitleSecret = PlayFabSettings.DeveloperSecretKey, - BackFill = false, - EventFilter = filter - }; - PlayFabHttp.InvokeSignalR("SubscribeToQueue", null, queueRequest); - } - - private static void OnPlayStreamNotificationCallback(object[] data) - { - var notif = Json.JsonWrapper.DeserializeObject(data[0].ToString()); - if (OnPlayStreamEvent != null) - { - OnPlayStreamEvent(notif); - } - } - - private static void OnSubscriptionErrorCallback(object[] data) - { - var message = data[0] as string; - if (OnFailed != null) - { - if (message == "Invalid Title Secret Key!") - { - OnFailed(SubscriptionError.InvalidSecretKey); - } - else - { - OnFailed(SubscriptionError.FailWithUnexpected(message)); - } - } - } - - private static void OnSubscriptionSuccessCallback(object[] data) - { - if (OnSubscribed != null) - { - OnSubscribed(); - } - } - - private static void OnReconnectedCallback() - { - if (OnReconnected != null) - { - OnReconnected(); - } - } - - private static void OnReceivedCallback(string msg) - { - if (OnReceived != null) - { - OnReceived(msg); - } - } - - private static void OnErrorCallback(Exception ex) - { - var timeoutEx = ex as TimeoutException; - if (timeoutEx != null) - { - if (OnFailed != null) - { - OnFailed(SubscriptionError.ConnectionTimeout); - } - } - else - { - if (OnError != null) - { - OnError(ex); - } - } - } - - private static void OnDisconnectedCallback() - { - if (OnDisconnected != null) - { - OnDisconnected(); - } - } - - - #endregion - - } - - /// - /// The server message wrapper for PlayStream events. - /// Should be used to deserialize EventObject into its appropriate types by EventName, TntityType, and EventNamespace. Do not modify. - /// - public sealed class PlayStreamNotification - { - //metadata sent by server - public string EventName; - public string EntityType; - public string EventNamespace; - public string PlayerId; - public string TitleId; - - public PlayStreamEvent EventObject; - public PlayerProfile Profile; - public List TriggerResults; - public List SegmentMatchResults; - - public class PlayStreamEvent - { - public object EventData; - public object InternalState; - } - - public class PlayerProfile - { - public string PlayerId; - public string TitleId; - public object DisplayName; - public string Origination; - public object Created; - public object LastLogin; - public object BannedUntil; - public Dictionary Statistics; - public Dictionary VirtualCurrencyBalances; - public List AdCampaignAttributions; - public List PushNotificationRegistrations; - public List LinkedAccounts; - - public class LinkedAccount - { - public string Platform; - public string PlatformUserId; - } - } - } - - /// - /// The error code of PlayStream subscription result. - /// - public struct SubscriptionError - { - public ErrorCode Code; - public string Message; - - public enum ErrorCode - { - Unexpected = 400, - ConnectionTimeout = 401, - InvalidSecretKey = 402 - } - - public static SubscriptionError ConnectionTimeout - { - get - { - return new SubscriptionError() { Message = "Connection Timeout", Code = ErrorCode.ConnectionTimeout }; - } - } - - public static SubscriptionError InvalidSecretKey - { - get - { - return new SubscriptionError() { Message = "Invalid Secret Key", Code = ErrorCode.InvalidSecretKey }; - } - } - - public static SubscriptionError FailWithUnexpected(string message) - { - return new SubscriptionError() { Message = message, Code = ErrorCode.Unexpected }; - } - } -} - -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs.meta deleted file mode 100755 index 6480d8fe..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/PlayFabPlayStreamAPI.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7b4032a9d541c284493b2d4cf97bec03 -timeCreated: 1466807206 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md deleted file mode 100755 index 19633de9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md +++ /dev/null @@ -1,3 +0,0 @@ -PlayStreamAPI should be used on GameServers to subscribe to PlayStream events. NEVER use it on client build because this api uses Developer Secret Key to connect to PlayStream server. It is up to the server how it wants to handle the event messages. The PlayStream event data models are provided and they should be used for both clients and servers. -Start receiving PlayStream events by subscribing to OnPlayStreamEvents, and it will automatically start the connection. -An example is provided in https://github.com/PlayFab/PlayFabGameServer. \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md.meta deleted file mode 100755 index 729a3d87..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Server/PlayStream/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 91a34a647239c7047840065a5ba1cb42 -timeCreated: 1468867046 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared.meta deleted file mode 100755 index f48d4b6a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7f23e4a650becd44fa8fccf00ba8529b -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor.meta deleted file mode 100755 index 4bfc2ceb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 8d731e8907f844532878b81596fe3852 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs deleted file mode 100755 index 1a8fef03..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs +++ /dev/null @@ -1,52 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.IO; - -[InitializeOnLoad] -public class AndroidManifestManager -{ - static AndroidManifestManager() - { -#if UNITY_ANDROID - if (PlayerSettings.bundleIdentifier != "com.playfab.sampleproj") { - CustomizeManifest (); - } -#endif - } - - public static void CustomizeManifest() - { - string appId = PlayerSettings.bundleIdentifier; - - if (String.IsNullOrEmpty(appId) || appId == "com.Company.ProductName") - { - EditorUtility.DisplayDialog("Android Manifest Reminder", "Your project does not currently have a bundle identifier set. If you wish to publish on Android, you must manually edit your Android manifest at Assets/Plugins/Android/AndroindManifest.xml and replace all occurances of {APP_BUNDLE_ID} with your bundle identifier", "OK"); - return; - } - - TextAsset manifestAsset = (TextAsset)AssetDatabase.LoadMainAssetAtPath("Assets/Plugins/Android/AndroindManifest.xml"); - if (manifestAsset == null) - { - // No manifest to fix up - return; - } - - String manifestStr = manifestAsset.text; - String fixedManifest = manifestStr.Replace("{APP_BUNDLE_ID}", appId); - if (fixedManifest == manifestStr) - { - // no changes made - return; - } - - AssetDatabase.RenameAsset("Assets/Plugins/Android/AndroindManifest.xml", "Assets/Plugins/Android/AndroindManifest.xml.back"); - - String path = Application.dataPath + "/Plugins/Android/AndroindManifest.xml"; - File.WriteAllText(path, fixedManifest); - - AssetDatabase.MoveAssetToTrash("Assets/PlayFabSDK/Editor/AndroidManifestManager.cs"); - - AssetDatabase.Refresh(); - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs.meta deleted file mode 100755 index e15c4e7a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/AndroidManifestManager.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5c0c16bd431a544c7b2d1a5d6171f445 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs deleted file mode 100755 index 6bb66918..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace PlayFab.Editor -{ - public class PlayFabHelp : EditorWindow - { - [MenuItem("PlayFab/GettingStarted")] - private static void GettingStarted() - { - Application.OpenURL("https://playfab.com/docs/getting-started-with-playfab/"); - } - - [MenuItem("PlayFab/Docs")] - private static void Documentation() - { - Application.OpenURL("https://api.playfab.com/documentation"); - } - - [MenuItem("PlayFab/Dashboard")] - private static void Dashboard() - { - Application.OpenURL("https://developer.playfab.com/"); - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs.meta deleted file mode 100755 index b9a59d8f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFabHelp.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e51e733dabbc847fa839b19c01bc577c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png deleted file mode 100755 index 8c8e7f16..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png.meta deleted file mode 100755 index 7e524a1b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Editor/PlayFablogo.png.meta +++ /dev/null @@ -1,47 +0,0 @@ -fileFormatVersion: 2 -guid: ec8f5065b10fb4f04bebf82a992c442e -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 16 - mipBias: -1 - wrapMode: -1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 8 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal.meta deleted file mode 100755 index 3590aa8a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 91910e31dc88043ea918915ee9d665d9 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs deleted file mode 100755 index 3cc490d9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using PlayFab.Internal; -using PlayFab.Json; - -namespace PlayFab.Json -{ - public interface ISerializer - { - T DeserializeObject(string json); - T DeserializeObject(string json, object jsonSerializerStrategy); - object DeserializeObject(string json); - - string SerializeObject(object json); - string SerializeObject(object json, object jsonSerializerStrategy); - } - - - public class JsonWrapper - { - private static ISerializer _instance = new SimpleJsonInstance(); - - /// - /// Use this property to override the Serialization for the SDK. - /// - public static ISerializer Instance - { - get { return _instance; } - set { _instance = value; } - } - - public static T DeserializeObject(string json) - { - return _instance.DeserializeObject(json); - } - - public static T DeserializeObject(string json, object jsonSerializerStrategy) - { - return _instance.DeserializeObject(json, jsonSerializerStrategy); - } - - public static object DeserializeObject(string json) - { - return _instance.DeserializeObject(json); - } - - public static string SerializeObject(object json) - { - return _instance.SerializeObject(json); - } - - public static string SerializeObject(object json, object jsonSerializerStrategy) - { - return _instance.SerializeObject(json, jsonSerializerStrategy); - } - } - - public class SimpleJsonInstance : ISerializer - { - public T DeserializeObject(string json) - { - return PlayFabSimpleJson.DeserializeObject(json); - } - - public T DeserializeObject(string json, object jsonSerializerStrategy) - { - return PlayFabSimpleJson.DeserializeObject(json, (IJsonSerializerStrategy)jsonSerializerStrategy); - } - - public object DeserializeObject(string json) - { - return PlayFabSimpleJson.DeserializeObject(json); - } - - public string SerializeObject(object json) - { - return PlayFabSimpleJson.SerializeObject(json); - } - - public string SerializeObject(object json, object jsonSerializerStrategy) - { - return PlayFabSimpleJson.SerializeObject(json, (IJsonSerializerStrategy)jsonSerializerStrategy); - } - } -} - -#region Delete this whole section after a few months -namespace PlayFab.Json -{ - [Obsolete("Use PlayFab.SimpleJson")] - public static class JsonConvert - { - [Obsolete("Use PlayFab.Json.JsonWrapper.SerializeObject()")] - public static string SerializeObject(object obj) - { - return JsonWrapper.SerializeObject(obj, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.SerializeObject()")] - public static string SerializeObject(object obj, IJsonSerializerStrategy strategy) - { - return JsonWrapper.SerializeObject(obj, strategy); - } - - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static T DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static object DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json); - } - } - - public static class SimpleJson - { - [Obsolete("Use PlayFab.Json.JsonWrapper.SerializeObject()")] - public static string SerializeObject(object obj) - { - return JsonWrapper.SerializeObject(obj, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static T DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static T DeserializeObject(string json, IJsonSerializerStrategy strategy) - { - return JsonWrapper.DeserializeObject(json, strategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static object DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json); - } - } -} - -namespace PlayFab -{ - public static class SimpleJson - { - [Obsolete("Use PlayFab.Json.JsonWrapper.SerializeObject()")] - public static string SerializeObject(object obj) - { - return JsonWrapper.SerializeObject(obj, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.SerializeObject()")] - public static string SerializeObject(object obj, IJsonSerializerStrategy strategy) - { - return JsonWrapper.SerializeObject(obj, strategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static T DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json, PlayFabUtil.ApiSerializerStrategy); - } - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static T DeserializeObject(string json, IJsonSerializerStrategy strategy) - { - return JsonWrapper.DeserializeObject(json, strategy); - } - - - [Obsolete("Use PlayFab.Json.JsonWrapper.DeserializeObject()")] - public static object DeserializeObject(string json) - { - return JsonWrapper.DeserializeObject(json); - } - } -} -#endregion Delete this whole section after a few months - diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs.meta deleted file mode 100755 index 285cd843..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/ISerializer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1337f8c156b41834691b131f3b6774f9 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs deleted file mode 100755 index 5936fceb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs +++ /dev/null @@ -1,39 +0,0 @@ -using PlayFab; - -namespace PlayFab.Internal -{ - public class Log - { - public static void Debug(string text, params object[] args) - { - if ((PlayFabSettings.LogLevel & PlayFabLogLevel.Debug) != 0) - { - UnityEngine.Debug.Log(PlayFabUtil.timeStamp + " DEBUG: " + PlayFabUtil.Format(text, args)); - } - } - - public static void Info(string text, params object[] args) - { - if ((PlayFabSettings.LogLevel & PlayFabLogLevel.Info) != 0) - { - UnityEngine.Debug.Log(PlayFabUtil.timeStamp + " INFO: " + PlayFabUtil.Format(text, args)); - } - } - - public static void Warning(string text, params object[] args) - { - if ((PlayFabSettings.LogLevel & PlayFabLogLevel.Warning) != 0) - { - UnityEngine.Debug.LogWarning(PlayFabUtil.timeStamp + " WARNING: " + PlayFabUtil.Format(text, args)); - } - } - - public static void Error(string text, params object[] args) - { - if ((PlayFabSettings.LogLevel & PlayFabLogLevel.Error) != 0) - { - UnityEngine.Debug.LogError(PlayFabUtil.timeStamp + " ERROR: " + PlayFabUtil.Format(text, args)); - } - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs.meta deleted file mode 100755 index ebf6395e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Log.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5b55790eeab1b3c41a4f1381cbea1213 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp.meta deleted file mode 100755 index 188ddcdd..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 6de758a294727f04c82bf319fdd54c60 -folderAsset: yes -timeCreated: 1462746198 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs deleted file mode 100755 index c94eedb2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using PlayFab.SharedModels; - -namespace PlayFab.Internal -{ - public interface IPlayFabHttp - { - bool SessionStarted { get; set; } - string AuthKey { get; set; } - void InitializeHttp(); - - // Mirroring MonoBehaviour - Relayed from PlayFabHTTP - void Update(); - void OnDestroy(); - - void MakeApiCall(CallRequestContainer reqContainer); - - int GetPendingMessages(); - } - - public enum AuthType - { - None, - PreLoginSession, // Not yet defined - LoginSession, // "X-Authorization" - DevSecretKey, // "X-SecretKey" - } - - - public enum HttpRequestState - { - Sent, - Received, - Idle, - Error - } - - public class CallRequestContainer - { -#if !UNITY_WSA && !UNITY_WP8 - public HttpRequestState HttpState = HttpRequestState.Idle; - public System.Net.HttpWebRequest HttpRequest = null; -#endif -#if PLAYFAB_REQUEST_TIMING - public PlayFabHttp.RequestTiming Timing; - public System.Diagnostics.Stopwatch Stopwatch; -#endif - - // This class stores the state of the request and all associated data - public string ApiEndpoint = null; - public string FullUrl = null; - public AuthType AuthKey = AuthType.None; - public byte[] Payload = null; - public string JsonResponse = null; - public PlayFabRequestCommon ApiRequest; - public PlayFabResultCommon ApiResult; - public PlayFabError Error; - public Action DeserializeResultJson; - public Action InvokeSuccessCallback; - public Action ErrorCallback; - public object CustomData = null; - - public CallRequestContainer() - { -#if PLAYFAB_REQUEST_TIMING - Stopwatch = System.Diagnostics.Stopwatch.StartNew(); -#endif - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs.meta deleted file mode 100755 index 00621125..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/IPlayFabHttp.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: aeac58284b4b1cd4ab93ab0e71ba8540 -timeCreated: 1462745280 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs deleted file mode 100755 index d9d62d1e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs +++ /dev/null @@ -1,356 +0,0 @@ -using PlayFab.Json; -using PlayFab.Public; -using PlayFab.SharedModels; -using System; -using System.Collections.Generic; -using System.Text; -using UnityEngine; - -namespace PlayFab.Internal -{ - /// - /// This is a wrapper for Http So we can better separate the functionaity of Http Requests delegated to WWW or HttpWebRequest - /// - public class PlayFabHttp : SingletonMonoBehaviour - { - private static IPlayFabHttp _internalHttp; //This is the default; - private static List _apiCallQueue = new List(); // Starts initialized, and is nulled when it's flushed - - public delegate void ApiProcessingEvent(TEventArgs e); - public delegate void ApiProcessErrorEvent(PlayFabRequestCommon request, PlayFabError error); - public static event ApiProcessingEvent ApiProcessingEventHandler; - public static event ApiProcessErrorEvent ApiProcessingErrorEventHandler; - -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - private static IPlayFabSignalR _internalSignalR; -#endif - - private static IPlayFabLogger _logger; - -#if PLAYFAB_REQUEST_TIMING - public struct RequestTiming - { - public DateTime StartTimeUtc; - public string ApiEndpoint; - public int WorkerRequestMs; - public int MainThreadRequestMs; - } - - public delegate void ApiRequestTimingEvent(RequestTiming time); - public static event ApiRequestTimingEvent ApiRequestTimingEventHandler; -#endif - - /// - /// Return the number of api calls that are waiting for results from the server - /// - /// - public static int GetPendingMessages() - { - return _internalHttp == null ? 0 : _internalHttp.GetPendingMessages(); - } - - /// - /// Optional redirect to allow mocking of _internalHttp calls, or use a custom _internalHttp utility - /// - public static void SetHttp(THttpObject httpObj) where THttpObject : IPlayFabHttp - { - _internalHttp = httpObj; - } - - /// - /// Optional redirect to allow mocking of AuthKey - /// - /// - public static void SetAuthKey(string authKey) - { - _internalHttp.AuthKey = authKey; - } - - /// - /// This initializes the GameObject and ensures it is in the scene. - /// - public static void InitializeHttp() - { - if (_internalHttp != null) - return; - - Application.runInBackground = true; // Http requests respond even if you lose focus -#if !UNITY_WSA && !UNITY_WP8 - if (PlayFabSettings.RequestType == WebRequestType.HttpWebRequest) - _internalHttp = new PlayFabWebRequest(); -#endif - if (_internalHttp == null) - _internalHttp = new PlayFabWww(); - - _internalHttp.InitializeHttp(); - CreateInstance(); // Invoke the SingletonMonoBehaviour - } - - /// - /// This initializes the GameObject and ensures it is in the scene. - /// TODO: Allow redirecting to a custom logger. - /// - public static void InitializeLogger() - { - if (_logger != null) - return; - - _logger = new PlayFabLogger(); - } - -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - public static void InitializeSignalR(string baseUrl, string hubName, Action onConnected, ActiononReceived, Action onReconnected, Action onDisconnected, Action onError) - { - CreateInstance(); - if (_internalSignalR != null) return; - _internalSignalR = new PlayFabSignalR (onConnected); - _internalSignalR.OnReceived += onReceived; - _internalSignalR.OnReconnected += onReconnected; - _internalSignalR.OnDisconnected += onDisconnected; - _internalSignalR.OnError += onError; - - _internalSignalR.Start(baseUrl, hubName); - } - - public static void SubscribeSignalR(string onInvoked, Action callbacks) - { - _internalSignalR.Subscribe(onInvoked, callbacks); - } - - public static void InvokeSignalR(string methodName, Action callback, params object[] args) - { - _internalSignalR.Invoke(methodName, callback, args); - } - - public static void StopSignalR() - { - _internalSignalR.Stop(); - } -#endif - - /// - /// Internal method for Make API Calls - /// - /// - /// - /// - /// - /// - /// - /// - protected internal static void MakeApiCall(string apiEndpoint, - PlayFabRequestCommon request, AuthType authType, Action resultCallback, - Action errorCallback, object customData = null, bool allowQueueing = false) - where TResult : PlayFabResultCommon - { - InitializeHttp(); - SendEvent(request, null, ApiProcessingEventType.Pre); - - var reqContainer = new CallRequestContainer(); -#if PLAYFAB_REQUEST_TIMING - reqContainer.Timing.StartTimeUtc = DateTime.UtcNow; - reqContainer.Timing.ApiEndpoint = apiEndpoint; -#endif - reqContainer.ApiEndpoint = apiEndpoint; - reqContainer.FullUrl = PlayFabSettings.GetFullUrl(apiEndpoint); - reqContainer.CustomData = customData; - reqContainer.Payload = Encoding.UTF8.GetBytes(JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy)); - reqContainer.AuthKey = authType; - reqContainer.ApiRequest = request; - reqContainer.ErrorCallback = errorCallback; - - // These closures preserve the TResult generic information in a way that's safe for all the devices - reqContainer.DeserializeResultJson = () => - { - reqContainer.ApiResult = JsonWrapper.DeserializeObject(reqContainer.JsonResponse, PlayFabUtil.ApiSerializerStrategy); - }; - reqContainer.InvokeSuccessCallback = () => - { - if (resultCallback != null) - resultCallback((TResult)reqContainer.ApiResult); - }; - - if (allowQueueing && _apiCallQueue != null && !_internalHttp.SessionStarted) - { - for (var i = _apiCallQueue.Count - 1; i >= 0; i--) - if (_apiCallQueue[i].ApiEndpoint == apiEndpoint) - _apiCallQueue.RemoveAt(i); - _apiCallQueue.Add(reqContainer); - } - else - { - _internalHttp.MakeApiCall(reqContainer); - } - } - - /// - /// MonoBehaviour OnEnable Method - /// - public void OnEnable() - { - if (_logger != null) - { - _logger.OnEnable(); - } - } - - /// - /// MonoBehaviour OnDisable - /// - public void OnDisable() - { - if (_logger != null) - { - _logger.OnDisable(); - } - } - - /// - /// MonoBehaviour OnDestroy - /// - public void OnDestroy() - { - if (_internalHttp != null) - { - _internalHttp.OnDestroy(); - } -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - if (_internalSignalR != null) - { - _internalSignalR.Stop(); - } -#endif - if (_logger != null) - { - _logger.OnDestroy(); - } - } - - /// - /// MonoBehaviour Update - /// - public void Update() - { - if (_internalHttp != null) - { - if (!_internalHttp.SessionStarted && _apiCallQueue != null) - { - foreach (var eachRequest in _apiCallQueue) - _internalHttp.MakeApiCall(eachRequest); // Flush the queue - _apiCallQueue = null; // null this after it's flushed - } - _internalHttp.Update(); - } - -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - if (_internalSignalR != null) - { - _internalSignalR.Update(); - } -#endif - } - - #region Helpers - public static bool IsClientLoggedIn() - { - return _internalHttp != null && !string.IsNullOrEmpty(_internalHttp.AuthKey); - } - - protected internal static PlayFabError GeneratePlayFabError(string json, object customData) - { - JsonObject errorDict = null; - Dictionary> errorDetails = null; - try - { - // Deserialize the error - errorDict = JsonWrapper.DeserializeObject(json, PlayFabUtil.ApiSerializerStrategy); - } - catch (Exception) { /* Unusual, but shouldn't actually matter */ } - try - { - if (errorDict != null && errorDict.ContainsKey("errorDetails")) - errorDetails = JsonWrapper.DeserializeObject>>(errorDict["errorDetails"].ToString()); - } - catch (Exception) { /* Unusual, but shouldn't actually matter */ } - - return new PlayFabError - { - HttpCode = errorDict != null && errorDict.ContainsKey("code") ? Convert.ToInt32(errorDict["code"]) : 400, - HttpStatus = errorDict != null && errorDict.ContainsKey("status") ? (string)errorDict["status"] : "BadRequest", - Error = errorDict != null && errorDict.ContainsKey("errorCode") ? (PlayFabErrorCode)Convert.ToInt32(errorDict["errorCode"]) : PlayFabErrorCode.ServiceUnavailable, - ErrorMessage = errorDict != null && errorDict.ContainsKey("errorMessage") ? (string)errorDict["errorMessage"] : json, - ErrorDetails = errorDetails, - CustomData = customData - }; - } - - protected internal static void SendErrorEvent(PlayFabRequestCommon request, PlayFabError error) - { - if (ApiProcessingErrorEventHandler == null) - return; - - try - { - ApiProcessingErrorEventHandler(request, error); - } - catch (Exception e) - { - Debug.LogException(e); - } - } - - protected internal static void SendEvent(PlayFabRequestCommon request, PlayFabResultCommon result, ApiProcessingEventType eventType) - { - if (ApiProcessingEventHandler == null) - return; - try - { - ApiProcessingEventHandler(new ApiProcessingEventArgs - { - EventType = eventType, - Request = request, - Result = result - }); - } - catch (Exception e) - { - Debug.LogException(e); - } - } - - protected internal static void ClearAllEvents() - { - ApiProcessingEventHandler = null; - ApiProcessingErrorEventHandler = null; - } - -#if PLAYFAB_REQUEST_TIMING - protected internal static void SendRequestTiming(RequestTiming rt) { - if (ApiRequestTimingEventHandler != null) { - ApiRequestTimingEventHandler(rt); - } - } -#endif - #endregion - } - - #region Event Classes - public enum ApiProcessingEventType - { - Pre, - Post - } - - public class ApiProcessingEventArgs : EventArgs - { - public ApiProcessingEventType EventType { get; set; } - public PlayFabRequestCommon Request { get; set; } - public PlayFabResultCommon Result { get; set; } - - public TRequest GetRequest() where TRequest : PlayFabRequestCommon - { - return Request as TRequest; - } - } - #endregion -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs.meta deleted file mode 100755 index 646a626b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 97a8a3caac8b73541aa8a9a1e330f479 -timeCreated: 1462575707 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs deleted file mode 100755 index 4f611ac4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using PlayFab.Json; -using PlayFab.SharedModels; -using UnityEngine; - -#if !UNITY_WSA && !UNITY_WP8 -using Ionic.Zlib; -#endif - -namespace PlayFab.Internal -{ - public class PlayFabWww : IPlayFabHttp - { - private int _pendingWwwMessages = 0; - public bool SessionStarted { get; set; } - public string AuthKey { get; set; } - - public void InitializeHttp() { } - public void Update() { } - public void OnDestroy() { } - - public void MakeApiCall(CallRequestContainer reqContainer) - { - //Set headers - var headers = new Dictionary { { "Content-Type", "application/json" } }; - if (reqContainer.AuthKey == AuthType.DevSecretKey) - { -#if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API - headers.Add("X-SecretKey", PlayFabSettings.DeveloperSecretKey); -#endif - } - else if (reqContainer.AuthKey == AuthType.LoginSession) - { - headers.Add("X-Authorization", AuthKey); - } - - headers.Add("X-ReportErrorAsSuccess", "true"); - headers.Add("X-PlayFabSDK", PlayFabSettings.VersionString); - -#if !UNITY_WSA && !UNITY_WP8 && !UNITY_WEBGL - if (PlayFabSettings.CompressApiData) - { - headers.Add("Content-Encoding", "GZIP"); - headers.Add("Accept-Encoding", "GZIP"); - - using (var stream = new MemoryStream()) - { - using (GZipStream zipstream = new GZipStream(stream, CompressionMode.Compress, CompressionLevel.BestCompression)) - { - zipstream.Write(reqContainer.Payload, 0, reqContainer.Payload.Length); - } - reqContainer.Payload = stream.ToArray(); - } - } -#endif - - //Debug.LogFormat("Posting {0} to Url: {1}", req.Trim(), url); - var www = new WWW(reqContainer.FullUrl, reqContainer.Payload, headers); - -#if PLAYFAB_REQUEST_TIMING - var stopwatch = System.Diagnostics.Stopwatch.StartNew(); -#endif - - // Start the www corouting to Post, and get a response or error which is then passed to the callbacks. - Action wwwSuccessCallback = (response) => - { - try - { -#if PLAYFAB_REQUEST_TIMING - var startTime = DateTime.UtcNow; -#endif - var httpResult = JsonWrapper.DeserializeObject(response, PlayFabUtil.ApiSerializerStrategy); - - if (httpResult.code == 200) - { - // We have a good response from the server - reqContainer.JsonResponse = JsonWrapper.SerializeObject(httpResult.data, PlayFabUtil.ApiSerializerStrategy); - reqContainer.DeserializeResultJson(); - reqContainer.ApiResult.Request = reqContainer.ApiRequest; - reqContainer.ApiResult.CustomData = reqContainer.CustomData; - -#if !DISABLE_PLAYFABCLIENT_API - ClientModels.UserSettings userSettings = null; - var res = reqContainer.ApiResult as ClientModels.LoginResult; - var regRes = reqContainer.ApiResult as ClientModels.RegisterPlayFabUserResult; - if (res != null) - { - userSettings = res.SettingsForUser; - AuthKey = res.SessionTicket; - } - else if (regRes != null) - { - userSettings = regRes.SettingsForUser; - AuthKey = regRes.SessionTicket; - } - - if (userSettings != null && AuthKey != null && userSettings.NeedsAttribution) - { - PlayFabIdfa.OnPlayFabLogin(); - } - - var cloudScriptUrl = reqContainer.ApiResult as ClientModels.GetCloudScriptUrlResult; - if (cloudScriptUrl != null) - { - PlayFabSettings.LogicServerUrl = cloudScriptUrl.Url; - } -#endif - try - { - PlayFabHttp.SendEvent(reqContainer.ApiRequest, reqContainer.ApiResult, ApiProcessingEventType.Post); - } - catch (Exception e) - { - Debug.LogException(e); - } - -#if PLAYFAB_REQUEST_TIMING - stopwatch.Stop(); - var timing = new PlayFabHttp.RequestTiming { - StartTimeUtc = startTime, - ApiEndpoint = reqContainer.ApiEndpoint, - WorkerRequestMs = (int)stopwatch.ElapsedMilliseconds, - MainThreadRequestMs = (int)stopwatch.ElapsedMilliseconds - }; - PlayFabHttp.SendRequestTiming(timing); -#endif - try - { - reqContainer.InvokeSuccessCallback(); - } - catch (Exception e) - { - Debug.LogException(e); - } - } - else - { - if (reqContainer.ErrorCallback != null) - { - reqContainer.Error = PlayFabHttp.GeneratePlayFabError(response, reqContainer.CustomData); - PlayFabHttp.SendErrorEvent(reqContainer.ApiRequest, reqContainer.Error); - reqContainer.ErrorCallback(reqContainer.Error); - } - } - } - catch (Exception e) - { - Debug.LogException(e); - } - }; - - Action wwwErrorCallback = (errorCb) => - { - reqContainer.JsonResponse = errorCb; - if (reqContainer.ErrorCallback != null) - { - reqContainer.Error = PlayFabHttp.GeneratePlayFabError(reqContainer.JsonResponse, reqContainer.CustomData); - PlayFabHttp.SendErrorEvent(reqContainer.ApiRequest, reqContainer.Error); - reqContainer.ErrorCallback(reqContainer.Error); - } - }; - - PlayFabHttp.instance.StartCoroutine(Post(www, wwwSuccessCallback, wwwErrorCallback)); - } - - private IEnumerator Post(WWW www, Action wwwSuccessCallback, Action wwwErrorCallback) - { - yield return www; - if (!string.IsNullOrEmpty(www.error)) - { - wwwErrorCallback(www.error); - } - else - { - try - { -#if !UNITY_WSA && !UNITY_WP8 && !UNITY_WEBGL - string encoding; - if (www.responseHeaders.TryGetValue("Content-Encoding", out encoding) && encoding.ToLower() == "gzip") - { - var stream = new MemoryStream(www.bytes); - using (var gZipStream = new GZipStream(stream, CompressionMode.Decompress, false)) - { - var buffer = new byte[4096]; - using (var output = new MemoryStream()) - { - int read; - while ((read = gZipStream.Read(buffer, 0, buffer.Length)) > 0) - { - output.Write(buffer, 0, read); - } - output.Seek(0, SeekOrigin.Begin); - var streamReader = new System.IO.StreamReader(output); - var jsonResponse = streamReader.ReadToEnd(); - //Debug.Log(jsonResponse); - wwwSuccessCallback(jsonResponse); - } - } - } - else -#endif - { - wwwSuccessCallback(www.text); - } - } - catch (Exception e) - { - wwwErrorCallback("Unhandled error in PlayFabWWW: " + e); - } - } - } - - public int GetPendingMessages() - { - return _pendingWwwMessages; - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs.meta deleted file mode 100755 index 6159d82f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 71ae810a641b9644187c8824db5ff1fe -timeCreated: 1462745593 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs deleted file mode 100755 index 7986d228..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs +++ /dev/null @@ -1,445 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -using System; -using UnityEngine; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Threading; -using PlayFab.SharedModels; -#if !DISABLE_PLAYFABCLIENT_API -using PlayFab.ClientModels; -#endif -using PlayFab.Json; - -namespace PlayFab.Internal -{ - public class PlayFabWebRequest : IPlayFabHttp - { - private static readonly Queue ResultQueue = new Queue(); - private static readonly Queue _tempActions = new Queue(); - private static readonly List ActiveRequests = new List(); - - private static Thread _requestQueueThread; - private static readonly object _ThreadLock = new object(); - private static readonly TimeSpan ThreadKillTimeout = TimeSpan.FromSeconds(60); - private static DateTime _threadKillTime = DateTime.UtcNow + ThreadKillTimeout; // Kill the thread after 1 minute of inactivity - private static bool _isApplicationPlaying; - private static int _activeCallCount; - - private static string _unityVersion; - - private static string _authKey; - private static bool _sessionStarted; - public bool SessionStarted { get { return _sessionStarted; } set { _sessionStarted = value; } } - public string AuthKey { get { return _authKey; } set { _authKey = value; } } - - public void InitializeHttp() - { - SetupCertificates(); - _isApplicationPlaying = true; - _unityVersion = Application.unityVersion; - } - - public void OnDestroy() - { - _isApplicationPlaying = false; - lock (ResultQueue) - { - ResultQueue.Clear(); - } - lock (ActiveRequests) - { - ActiveRequests.Clear(); - } - lock (_ThreadLock) - { - _requestQueueThread = null; - } - } - - private void SetupCertificates() - { - // These are performance Optimizations for HttpWebRequests. - ServicePointManager.DefaultConnectionLimit = 10; - ServicePointManager.Expect100Continue = false; - - //Support for SSL - var rcvc = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications); //(sender, cert, chain, ssl) => true - ServicePointManager.ServerCertificateValidationCallback = rcvc; - } - - private static bool AcceptAllCertifications(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) - { - return true; - } - - public void MakeApiCall(CallRequestContainer reqContainer) - { - reqContainer.HttpState = HttpRequestState.Idle; - - lock (ActiveRequests) - { - ActiveRequests.Insert(0, reqContainer); - } - - ActivateThreadWorker(); - } - - private static void ActivateThreadWorker() - { - lock (_ThreadLock) - { - if (_requestQueueThread != null) - { - return; - } - _requestQueueThread = new Thread(WorkerThreadMainLoop); - _requestQueueThread.Start(); - } - } - - private static void WorkerThreadMainLoop() - { - try - { - bool active; - lock (_ThreadLock) - { - // Kill the thread after 1 minute of inactivity - _threadKillTime = DateTime.UtcNow + ThreadKillTimeout; - } - - List localActiveRequests = new List(); - do - { - //process active requests - lock (ActiveRequests) - { - localActiveRequests.AddRange(ActiveRequests); - ActiveRequests.Clear(); - _activeCallCount = localActiveRequests.Count; - } - - var activeCalls = localActiveRequests.Count; - for (var i = activeCalls - 1; i >= 0; i--) // We must iterate backwards, because we remove at index i in some cases - { - switch (localActiveRequests[i].HttpState) - { - case HttpRequestState.Error: - localActiveRequests.RemoveAt(i); break; - case HttpRequestState.Idle: - Post(localActiveRequests[i]); break; - case HttpRequestState.Sent: - if (localActiveRequests[i].HttpRequest.HaveResponse) // Else we'll try again next tick - ProcessHttpResponse(localActiveRequests[i]); - break; - case HttpRequestState.Received: - ProcessJsonResponse(localActiveRequests[i]); - localActiveRequests.RemoveAt(i); - break; - } - } - - #region Expire Thread. - // Check if we've been inactive - lock (_ThreadLock) - { - var now = DateTime.UtcNow; - if (activeCalls > 0 && _isApplicationPlaying) - { - // Still active, reset the _threadKillTime - _threadKillTime = now + ThreadKillTimeout; - } - // Kill the thread after 1 minute of inactivity - active = now <= _threadKillTime; - if (!active) - { - _requestQueueThread = null; - } - // This thread will be stopped, so null this now, inside lock (_threadLock) - } - #endregion - - Thread.Sleep(1); - } while (active); - - } - catch (Exception e) - { - Debug.LogException(e); - _requestQueueThread = null; - } - } - - private static void Post(CallRequestContainer reqContainer) - { - try - { - reqContainer.HttpRequest = (HttpWebRequest)WebRequest.Create(reqContainer.FullUrl); - reqContainer.HttpRequest.UserAgent = "UnityEngine-Unity; Version: " + _unityVersion; - reqContainer.HttpRequest.SendChunked = false; - reqContainer.HttpRequest.Proxy = null; - // Prevents hitting a proxy if no proxy is available. TODO: Add support for proxy's. - reqContainer.HttpRequest.Headers.Add("X-ReportErrorAsSuccess", "true"); - // Without this, we have to catch WebException instead, and manually decode the result - reqContainer.HttpRequest.Headers.Add("X-PlayFabSDK", PlayFabSettings.VersionString); - - switch (reqContainer.AuthKey) - { -#if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API - case AuthType.DevSecretKey: reqContainer.HttpRequest.Headers.Add("X-SecretKey", PlayFabSettings.DeveloperSecretKey); break; -#endif - case AuthType.LoginSession: reqContainer.HttpRequest.Headers.Add("X-Authorization", _authKey); break; - } - - reqContainer.HttpRequest.ContentType = "application/json"; - reqContainer.HttpRequest.Method = "POST"; - reqContainer.HttpRequest.KeepAlive = PlayFabSettings.RequestKeepAlive; - reqContainer.HttpRequest.Timeout = PlayFabSettings.RequestTimeout; - reqContainer.HttpRequest.AllowWriteStreamBuffering = false; - reqContainer.HttpRequest.Proxy = null; - reqContainer.HttpRequest.ContentLength = reqContainer.Payload.LongLength; - reqContainer.HttpRequest.ReadWriteTimeout = PlayFabSettings.RequestTimeout; - - //Debug.Log("Get Stream"); - // Get Request Stream and send data in the body. - using (var stream = reqContainer.HttpRequest.GetRequestStream()) - { - //Debug.Log("Post Stream"); - stream.Write(reqContainer.Payload, 0, reqContainer.Payload.Length); - //Debug.Log("After Post stream"); - } - - reqContainer.HttpState = HttpRequestState.Sent; - } - catch (WebException e) - { - reqContainer.JsonResponse = ResponseToString(e.Response) ?? e.Status + ": WebException making http request to: " + reqContainer.FullUrl; - var enhancedError = new WebException(reqContainer.JsonResponse, e); - Debug.LogException(enhancedError); - QueueRequestError(reqContainer); - } - catch (Exception e) - { - reqContainer.JsonResponse = "Unhandled exception in Post : " + reqContainer.FullUrl; - var enhancedError = new Exception(reqContainer.JsonResponse, e); - Debug.LogException(enhancedError); - QueueRequestError(reqContainer); - } - } - - private static void ProcessHttpResponse(CallRequestContainer reqContainer) - { - try - { -#if PLAYFAB_REQUEST_TIMING - reqContainer.Timing.WorkerRequestMs = (int)reqContainer.Stopwatch.ElapsedMilliseconds; -#endif - // Get and check the response - var httpResponse = (HttpWebResponse)reqContainer.HttpRequest.GetResponse(); - if (httpResponse.StatusCode == HttpStatusCode.OK) - { - reqContainer.JsonResponse = ResponseToString(httpResponse); - } - - if (httpResponse.StatusCode != HttpStatusCode.OK || string.IsNullOrEmpty(reqContainer.JsonResponse)) - { - reqContainer.JsonResponse = reqContainer.JsonResponse ?? "No response from server"; - QueueRequestError(reqContainer); - return; - } - else - { - // Response Recieved Successfully, now process. - } - - reqContainer.HttpState = HttpRequestState.Received; - } - catch (Exception e) - { - var msg = "Unhandled exception in ProcessHttpResponse : " + reqContainer.FullUrl; - reqContainer.JsonResponse = reqContainer.JsonResponse ?? msg; - var enhancedError = new Exception(msg, e); - Debug.LogException(enhancedError); - QueueRequestError(reqContainer); - } - } - - /// - /// Set the reqContainer into an error state, and queue it to invoke the ErrorCallback for that request - /// - private static void QueueRequestError(CallRequestContainer reqContainer) - { - reqContainer.Error = PlayFabHttp.GeneratePlayFabError(reqContainer.JsonResponse, reqContainer.CustomData); // Decode the server-json error - reqContainer.HttpState = HttpRequestState.Error; - lock (ResultQueue) - { - //Queue The result callbacks to run on the main thread. - ResultQueue.Enqueue(() => - { - PlayFabHttp.SendErrorEvent(reqContainer.ApiRequest, reqContainer.Error); - if (reqContainer.ErrorCallback != null) - reqContainer.ErrorCallback(reqContainer.Error); - }); - } - } - - private static void ProcessJsonResponse(CallRequestContainer reqContainer) - { - try - { - var httpResult = JsonWrapper.DeserializeObject(reqContainer.JsonResponse, - PlayFabUtil.ApiSerializerStrategy); - -#if PLAYFAB_REQUEST_TIMING - reqContainer.Timing.WorkerRequestMs = (int)reqContainer.Stopwatch.ElapsedMilliseconds; -#endif - - //This would happen if playfab returned a 500 internal server error or a bad json response. - if (httpResult == null || httpResult.code != 200) - { - QueueRequestError(reqContainer); - return; - } - - reqContainer.JsonResponse = JsonWrapper.SerializeObject(httpResult.data, PlayFabUtil.ApiSerializerStrategy); - reqContainer.DeserializeResultJson(); // Assigns Result with a properly typed object - reqContainer.ApiResult.Request = reqContainer.ApiRequest; - reqContainer.ApiResult.CustomData = reqContainer.CustomData; - -#if !DISABLE_PLAYFABCLIENT_API - ClientModels.UserSettings userSettings = null; - var res = reqContainer.ApiResult as ClientModels.LoginResult; - var regRes = reqContainer.ApiResult as ClientModels.RegisterPlayFabUserResult; - if (res != null) - { - userSettings = res.SettingsForUser; - _authKey = res.SessionTicket; - } - else if (regRes != null) - { - userSettings = regRes.SettingsForUser; - _authKey = regRes.SessionTicket; - } - - if (userSettings != null && _authKey != null && userSettings.NeedsAttribution) - { - lock (ResultQueue) - { - ResultQueue.Enqueue(PlayFabIdfa.OnPlayFabLogin); - } - } - - var cloudScriptUrl = reqContainer.ApiResult as ClientModels.GetCloudScriptUrlResult; - if (cloudScriptUrl != null) - { - PlayFabSettings.LogicServerUrl = cloudScriptUrl.Url; - } -#endif - lock (ResultQueue) - { - //Queue The result callbacks to run on the main thread. - ResultQueue.Enqueue(() => - { -#if PLAYFAB_REQUEST_TIMING - reqContainer.Stopwatch.Stop(); - reqContainer.Timing.MainThreadRequestMs = (int)reqContainer.Stopwatch.ElapsedMilliseconds; - PlayFabHttp.SendRequestTiming(reqContainer.Timing); -#endif - try - { - PlayFabHttp.SendEvent(reqContainer.ApiRequest, reqContainer.ApiResult, ApiProcessingEventType.Post); - reqContainer.InvokeSuccessCallback(); - } - catch (Exception e) - { - Debug.LogException(e); // Log the user's callback exception back to them without halting PlayFabHttp - } - }); - } - } - catch (Exception e) - { - var msg = "Unhandled exception in ProcessJsonResponse : " + reqContainer.FullUrl; - reqContainer.JsonResponse = reqContainer.JsonResponse ?? msg; - var enhancedError = new Exception(msg, e); - Debug.LogException(enhancedError); - QueueRequestError(reqContainer); - } - } - - public void Update() - { - lock (ResultQueue) - { - while (ResultQueue.Count > 0) - { - var actionToQueue = ResultQueue.Dequeue(); - _tempActions.Enqueue(actionToQueue); - } - } - - while (_tempActions.Count > 0) - { - var finishedRequest = _tempActions.Dequeue(); - finishedRequest(); - } - } - - private static string ResponseToString(WebResponse webResponse) - { - if (webResponse == null) - return null; - - try - { - using (var responseStream = webResponse.GetResponseStream()) - { - if (responseStream == null) - return null; - using (var stream = new StreamReader(responseStream)) - { - return stream.ReadToEnd(); - } - } - } - catch (WebException webException) - { - try - { - using (var responseStream = webException.Response.GetResponseStream()) - { - if (responseStream == null) - return null; - using (var stream = new StreamReader(responseStream)) - { - return stream.ReadToEnd(); - } - } - } - catch (Exception e) - { - Debug.LogException(e); - return null; - } - } - catch (Exception e) - { - Debug.LogException(e); - return null; - } - } - - public int GetPendingMessages() - { - var count = 0; - lock (ActiveRequests) - count += ActiveRequests.Count + _activeCallCount; - lock (ResultQueue) - count += ResultQueue.Count; - return count; - } - } -} - -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs.meta deleted file mode 100755 index 3ebab9de..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 18fd1a0daadd68d45aebf8c19cac2bda -timeCreated: 1466016486 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR.meta deleted file mode 100755 index 2f763ca7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c0e416b0df627eb4f94865bc99d3af67 -folderAsset: yes -timeCreated: 1468866823 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs deleted file mode 100755 index 518d147b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace PlayFab.Internal -{ - public interface IPlayFabSignalR - { - event Action OnReceived; - event Action OnReconnected; - event Action OnDisconnected; - event Action OnError; - - void Start(string url, string hubName); - void Stop(); - - void Update(); - - void Invoke(string api, Action resultCallback, params object[] args); - void Subscribe(string onInvoked, Action resultCallback); - } - -} - diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs.meta deleted file mode 100755 index 3deaa8dd..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/IPlayFabSignalR.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 841f003c4a052b94f9d1b6997f958634 -timeCreated: 1468883959 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs deleted file mode 100755 index 865ce1f8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs +++ /dev/null @@ -1,251 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.Threading; -using SignalR.Client._20.Hubs; - -namespace PlayFab.Internal -{ - public class PlayFabSignalR : IPlayFabSignalR - { - public PlayFabSignalR(Action onConnected) - { - OnConnected += onConnected; - } - - public event Action OnReceived; - public event Action OnReconnected; - public event Action OnDisconnected; - public event Action OnError; - - #region Private - - private string _url; - private string _hubName; - - private event Action OnConnected; - private static readonly Queue ResultQueue = new Queue(); - private static readonly Queue TempActions = new Queue(); - - private ConnectionState _connState = ConnectionState.Unstarted; - private readonly object _connLock = new object(); - private HubConnection _connection; - private IHubProxy _proxy; - - private Thread _startThread; - private TimeSpan _defaultTimeout = TimeSpan.FromSeconds(110); - private DateTime _startTime; - - #endregion - - public void Start(string url, string hubName) - { - lock (_connLock) - { - if (_connState != ConnectionState.Unstarted) - { - return; - } - _connState = ConnectionState.Pending; - } - - _startTime = DateTime.UtcNow; - - _url = url; - _hubName = hubName; - _startThread = new Thread(_ThreadedStartConnection); - _startThread.Start(); - } - - public void Stop() - { - lock (_connLock) - { - if (_connection != null) - { - _connection.Stop(); - } - _connState = ConnectionState.Unstarted; - } - - lock (ResultQueue) - { - ResultQueue.Clear(); - } - } - - public void Subscribe(string methodName, Action callback) - { - Action onData = objs => - { - Action enqueuedAction = () => - { - callback(objs); - }; - - lock (ResultQueue) - { - ResultQueue.Enqueue(enqueuedAction); - } - }; - - lock (_connLock) - { - _proxy.Subscribe(methodName).Data += onData; - } - } - - public void Invoke(string methodName, Action callback, params object[] args) - { - EventHandler> invokeCallback = (sender, e) => - { - lock (ResultQueue) - { - ResultQueue.Enqueue(callback); - } - }; - - lock (_connLock) - { - _proxy.Invoke(methodName, args).Finished += invokeCallback; - } - } - - public void Update() - { - lock (ResultQueue) - { - while (ResultQueue.Count > 0) - { - var actionToQueue = ResultQueue.Dequeue(); - if (actionToQueue != null) - { - TempActions.Enqueue(actionToQueue); - } - } - } - - while (TempActions.Count > 0) - { - var finishedRequest = TempActions.Dequeue(); - if (finishedRequest != null) - { - finishedRequest.Invoke(); - } - } - - lock (_connLock) - { - if (_connState != ConnectionState.Pending) return; - } - - AbortThreadIfTimeout(); - } - - private void AbortThreadIfTimeout() - { - if ((DateTime.UtcNow - _startTime) <= _defaultTimeout) return; - lock (_connLock) - { - if (_startThread == null) return; - } - - _startThread.Abort(); - _startThread = null; - lock (_connLock) - { - _connState = ConnectionState.Unstarted; - } - if (OnError != null) - { - OnError(new TimeoutException("Connection timeout after " + _defaultTimeout.TotalSeconds + "s")); - } - } - - private void _ThreadedStartConnection() - { - var startedConnection = new HubConnection(_url); - - var startedProxy = startedConnection.CreateProxy(_hubName); - - startedConnection.Start(); - - lock (_connLock) - { - _proxy = startedProxy; - _connection = startedConnection; - - _connection.Reconnected += ReconnectedAction; - _connection.Received += ReceivedAction; - _connection.Error += ErrorAction; - _connection.Closed += ClosedAction; - _connState = ConnectionState.Running; - } - lock (ResultQueue) - { - ResultQueue.Enqueue(OnConnected); - } - } - - #region Connection callbacks - - private void ReconnectedAction() - { - lock (ResultQueue) - { - ResultQueue.Enqueue(OnReconnected); - } - } - - private void ReceivedAction(string receivedMsg) - { - Action receivedCallback = () => - { - if (OnReceived != null) - { - OnReceived(receivedMsg); - } - }; - lock (ResultQueue) - { - ResultQueue.Enqueue(receivedCallback); - } - } - - private void ErrorAction(Exception ex) - { - Action errorAction = () => - { - if (OnError != null) - { - OnError(ex); - } - - }; - - lock (ResultQueue) - { - ResultQueue.Enqueue(errorAction); - } - } - - private void ClosedAction() - { - lock (ResultQueue) - { - ResultQueue.Enqueue(OnDisconnected); - } - } - - #endregion Connection callbacks - - private enum ConnectionState - { - Unstarted, - Pending, - Running - } - } -} - -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs.meta deleted file mode 100755 index 2b949541..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/PlayFabSignalR/PlayFabSignalR.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1e62f84c69a775c43ac1db6ffcd3ef1e -timeCreated: 1469049373 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs deleted file mode 100755 index f5a46f9b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs +++ /dev/null @@ -1,2089 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011, The Outercurve Foundation. -// -// Licensed under the MIT License (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.opensource.org/licenses/mit-license.php -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Nathan Totten (ntotten.com), Jim Zimmerman (jimzimmerman.com) and Prabir Shrestha (prabir.me) -// https://github.com/facebook-csharp-sdk/simple-json -//----------------------------------------------------------------------- - -// VERSION: - -// NOTE: uncomment the following line to make SimpleJson class internal. -//#define SIMPLE_JSON_INTERNAL - -// NOTE: uncomment the following line to make JsonArray and JsonObject class internal. -//#define SIMPLE_JSON_OBJARRAYINTERNAL - -// NOTE: uncomment the following line to enable dynamic support. -//#define SIMPLE_JSON_DYNAMIC - -// NOTE: uncomment the following line to enable DataContract support. -//#define SIMPLE_JSON_DATACONTRACT - -// NOTE: uncomment the following line to enable IReadOnlyCollection and IReadOnlyList support. -//#define SIMPLE_JSON_READONLY_COLLECTIONS - -// NOTE: uncomment the following line if you are compiling under Window Metro style application/library. -// usually already defined in properties -#if UNITY_WSA && UNITY_WP8 -#define NETFX_CORE -#endif - -// If you are targetting WinStore, WP8 and NET4.5+ PCL make sure to -#if UNITY_WP8 || UNITY_WP8_1 || UNITY_WSA -// #define SIMPLE_JSON_TYPEINFO -#endif - -// original json parsing code from http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html - -#if NETFX_CORE -#define SIMPLE_JSON_TYPEINFO -#endif - -using System; -using System.CodeDom.Compiler; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -#if SIMPLE_JSON_DYNAMIC -using System.Dynamic; -#endif -using System.Globalization; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text; - -// ReSharper disable LoopCanBeConvertedToQuery -// ReSharper disable RedundantExplicitArrayCreation -// ReSharper disable SuggestUseVarKeywordEvident -namespace PlayFab.Json -{ - public enum NullValueHandling - { - Include, // Include null values when serializing and deserializing objects - Ignore // Ignore null values when serializing and deserializing objects - } - - /// - /// Customize the json output of a field or property - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] - public class JsonProperty : Attribute - { - public string PropertyName = null; - public NullValueHandling NullValueHandling = NullValueHandling.Include; - } - - /// - /// Represents the json array. - /// - [GeneratedCode("simple-json", "1.0.0")] - [EditorBrowsable(EditorBrowsableState.Never)] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] -#if SIMPLE_JSON_OBJARRAYINTERNAL - internal -#else - public -#endif - class JsonArray : List - { - /// - /// Initializes a new instance of the class. - /// - public JsonArray() { } - - /// - /// Initializes a new instance of the class. - /// - /// The capacity of the json array. - public JsonArray(int capacity) : base(capacity) { } - - /// - /// The json representation of the array. - /// - /// The json representation of the array. - public override string ToString() - { - return PlayFabSimpleJson.SerializeObject(this) ?? string.Empty; - } - } - - /// - /// Represents the json object. - /// - [GeneratedCode("simple-json", "1.0.0")] - [EditorBrowsable(EditorBrowsableState.Never)] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] -#if SIMPLE_JSON_OBJARRAYINTERNAL - internal -#else - public -#endif - class JsonObject : -#if SIMPLE_JSON_DYNAMIC - DynamicObject, -#endif - IDictionary - { - private const int DICTIONARY_DEFAULT_SIZE = 16; - /// - /// The internal member dictionary. - /// - private readonly Dictionary _members; - - /// - /// Initializes a new instance of . - /// - public JsonObject() - { - _members = new Dictionary(DICTIONARY_DEFAULT_SIZE); - } - - /// - /// Initializes a new instance of . - /// - /// The implementation to use when comparing keys, or null to use the default for the type of the key. - public JsonObject(IEqualityComparer comparer) - { - _members = new Dictionary(comparer); - } - - /// - /// Gets the at the specified index. - /// - /// - public object this[int index] - { - get { return GetAtIndex(_members, index); } - } - - internal static object GetAtIndex(IDictionary obj, int index) - { - if (obj == null) - throw new ArgumentNullException("obj"); - if (index >= obj.Count) - throw new ArgumentOutOfRangeException("index"); - int i = 0; - foreach (KeyValuePair o in obj) - if (i++ == index) return o.Value; - return null; - } - - /// - /// Adds the specified key. - /// - /// The key. - /// The value. - public void Add(string key, object value) - { - _members.Add(key, value); - } - - /// - /// Determines whether the specified key contains key. - /// - /// The key. - /// - /// true if the specified key contains key; otherwise, false. - /// - public bool ContainsKey(string key) - { - return _members.ContainsKey(key); - } - - /// - /// Gets the keys. - /// - /// The keys. - public ICollection Keys - { - get { return _members.Keys; } - } - - /// - /// Removes the specified key. - /// - /// The key. - /// - public bool Remove(string key) - { - return _members.Remove(key); - } - - /// - /// Tries the get value. - /// - /// The key. - /// The value. - /// - public bool TryGetValue(string key, out object value) - { - return _members.TryGetValue(key, out value); - } - - /// - /// Gets the values. - /// - /// The values. - public ICollection Values - { - get { return _members.Values; } - } - - /// - /// Gets or sets the with the specified key. - /// - /// - public object this[string key] - { - get { return _members[key]; } - set { _members[key] = value; } - } - - /// - /// Adds the specified item. - /// - /// The item. - public void Add(KeyValuePair item) - { - _members.Add(item.Key, item.Value); - } - - /// - /// Clears this instance. - /// - public void Clear() - { - _members.Clear(); - } - - /// - /// Determines whether [contains] [the specified item]. - /// - /// The item. - /// - /// true if [contains] [the specified item]; otherwise, false. - /// - public bool Contains(KeyValuePair item) - { - return _members.ContainsKey(item.Key) && _members[item.Key] == item.Value; - } - - /// - /// Copies to. - /// - /// The array. - /// Index of the array. - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - if (array == null) throw new ArgumentNullException("array"); - int num = Count; - foreach (KeyValuePair kvp in _members) - { - array[arrayIndex++] = kvp; - if (--num <= 0) - return; - } - } - - /// - /// Gets the count. - /// - /// The count. - public int Count - { - get { return _members.Count; } - } - - /// - /// Gets a value indicating whether this instance is read only. - /// - /// - /// true if this instance is read only; otherwise, false. - /// - public bool IsReadOnly - { - get { return false; } - } - - /// - /// Removes the specified item. - /// - /// The item. - /// - public bool Remove(KeyValuePair item) - { - return _members.Remove(item.Key); - } - - /// - /// Gets the enumerator. - /// - /// - public IEnumerator> GetEnumerator() - { - return _members.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - IEnumerator IEnumerable.GetEnumerator() - { - return _members.GetEnumerator(); - } - - /// - /// Returns a json that represents the current . - /// - /// - /// A json that represents the current . - /// - public override string ToString() - { - return PlayFabSimpleJson.SerializeObject(_members); - } - -#if SIMPLE_JSON_DYNAMIC - /// - /// Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. - /// - /// Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. - /// The result of the type conversion operation. - /// - /// Alwasy returns true. - /// - public override bool TryConvert(ConvertBinder binder, out object result) - { - // - if (binder == null) - throw new ArgumentNullException("binder"); - // - Type targetType = binder.Type; - - if ((targetType == typeof(IEnumerable)) || - (targetType == typeof(IEnumerable>)) || - (targetType == typeof(IDictionary)) || - (targetType == typeof(IDictionary))) - { - result = this; - return true; - } - - return base.TryConvert(binder, out result); - } - - /// - /// Provides the implementation for operations that delete an object member. This method is not intended for use in C# or Visual Basic. - /// - /// Provides information about the deletion. - /// - /// Alwasy returns true. - /// - public override bool TryDeleteMember(DeleteMemberBinder binder) - { - // - if (binder == null) - throw new ArgumentNullException("binder"); - // - return _members.Remove(binder.Name); - } - - /// - /// Provides the implementation for operations that get a value by index. Classes derived from the class can override this method to specify dynamic behavior for indexing operations. - /// - /// Provides information about the operation. - /// The indexes that are used in the operation. For example, for the sampleObject[3] operation in C# (sampleObject(3) in Visual Basic), where sampleObject is derived from the DynamicObject class, is equal to 3. - /// The result of the index operation. - /// - /// Alwasy returns true. - /// - public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result) - { - if (indexes == null) throw new ArgumentNullException("indexes"); - if (indexes.Length == 1) - { - result = ((IDictionary)this)[(string)indexes[0]]; - return true; - } - result = null; - return true; - } - - /// - /// Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. - /// - /// Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - /// The result of the get operation. For example, if the method is called for a property, you can assign the property value to . - /// - /// Alwasy returns true. - /// - public override bool TryGetMember(GetMemberBinder binder, out object result) - { - object value; - if (_members.TryGetValue(binder.Name, out value)) - { - result = value; - return true; - } - result = null; - return true; - } - - /// - /// Provides the implementation for operations that set a value by index. Classes derived from the class can override this method to specify dynamic behavior for operations that access objects by a specified index. - /// - /// Provides information about the operation. - /// The indexes that are used in the operation. For example, for the sampleObject[3] = 10 operation in C# (sampleObject(3) = 10 in Visual Basic), where sampleObject is derived from the class, is equal to 3. - /// The value to set to the object that has the specified index. For example, for the sampleObject[3] = 10 operation in C# (sampleObject(3) = 10 in Visual Basic), where sampleObject is derived from the class, is equal to 10. - /// - /// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. - /// - public override bool TrySetIndex(SetIndexBinder binder, object[] indexes, object value) - { - if (indexes == null) throw new ArgumentNullException("indexes"); - if (indexes.Length == 1) - { - ((IDictionary)this)[(string)indexes[0]] = value; - return true; - } - return base.TrySetIndex(binder, indexes, value); - } - - /// - /// Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. - /// - /// Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - /// The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". - /// - /// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - /// - public override bool TrySetMember(SetMemberBinder binder, object value) - { - // - if (binder == null) - throw new ArgumentNullException("binder"); - // - _members[binder.Name] = value; - return true; - } - - /// - /// Returns the enumeration of all dynamic member names. - /// - /// - /// A sequence that contains dynamic member names. - /// - public override IEnumerable GetDynamicMemberNames() - { - foreach (var key in Keys) - yield return key; - } -#endif - } - - /// - /// This class encodes and decodes JSON strings. - /// Spec. details, see http://www.json.org/ - /// - /// JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList<object>) and JsonObject(IDictionary<string,object>). - /// All numbers are parsed to doubles. - /// - [GeneratedCode("simple-json", "1.0.0")] -#if SIMPLE_JSON_INTERNAL - internal -#else - public -#endif - static class PlayFabSimpleJson - { - private enum TokenType : byte - { - NONE = 0, - CURLY_OPEN = 1, - CURLY_CLOSE = 2, - SQUARED_OPEN = 3, - SQUARED_CLOSE = 4, - COLON = 5, - COMMA = 6, - STRING = 7, - NUMBER = 8, - TRUE = 9, - FALSE = 10, - NULL = 11, - } - private const int BUILDER_INIT = 2000; - - private static readonly char[] EscapeTable; - private static readonly char[] EscapeCharacters = new char[] { '"', '\\', '\b', '\f', '\n', '\r', '\t' }; - // private static readonly string EscapeCharactersString = new string(EscapeCharacters); - internal static readonly List NumberTypes = new List { - typeof(bool), typeof(byte), typeof(ushort), typeof(uint), typeof(ulong), typeof(sbyte), typeof(short), typeof(int), typeof(long), typeof(double), typeof(float), typeof(decimal) - }; - - // Performance stuff - [ThreadStatic] - private static StringBuilder _serializeObjectBuilder; - [ThreadStatic] - private static StringBuilder _parseStringBuilder; - - static PlayFabSimpleJson() - { - EscapeTable = new char[93]; - EscapeTable['"'] = '"'; - EscapeTable['\\'] = '\\'; - EscapeTable['\b'] = 'b'; - EscapeTable['\f'] = 'f'; - EscapeTable['\n'] = 'n'; - EscapeTable['\r'] = 'r'; - EscapeTable['\t'] = 't'; - } - - /// - /// Parses the string json into a value - /// - /// A JSON string. - /// An IList<object>, a IDictionary<string,object>, a double, a string, null, true, or false - public static object DeserializeObject(string json) - { - object obj; - if (TryDeserializeObject(json, out obj)) - return obj; - throw new SerializationException("Invalid JSON string"); - } - - /// - /// Try parsing the json string into a value. - /// - /// - /// A JSON string. - /// - /// - /// The object. - /// - /// - /// Returns true if successfull otherwise false. - /// - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification = "Need to support .NET 2")] - public static bool TryDeserializeObject(string json, out object obj) - { - bool success = true; - if (json != null) - { - int index = 0; - obj = ParseValue(json, ref index, ref success); - } - else - obj = null; - - return success; - } - - public static object DeserializeObject(string json, Type type, IJsonSerializerStrategy jsonSerializerStrategy) - { - object jsonObject = DeserializeObject(json); - if (type == null || jsonObject != null && ReflectionUtils.IsAssignableFrom(jsonObject.GetType(), type)) - return jsonObject; - return (jsonSerializerStrategy ?? CurrentJsonSerializerStrategy).DeserializeObject(jsonObject, type); - } - - public static object DeserializeObject(string json, Type type) - { - return DeserializeObject(json, type, null); - } - - public static T DeserializeObject(string json, IJsonSerializerStrategy jsonSerializerStrategy) - { - return (T)DeserializeObject(json, typeof(T), jsonSerializerStrategy); - } - - public static T DeserializeObject(string json) - { - return (T)DeserializeObject(json, typeof(T), null); - } - - /// - /// Converts a IDictionary<string,object> / IList<object> object into a JSON string - /// - /// A IDictionary<string,object> / IList<object> - /// Serializer strategy to use - /// A JSON encoded string, or null if object 'json' is not serializable - public static string SerializeObject(object json, IJsonSerializerStrategy jsonSerializerStrategy = null) - { - if (_serializeObjectBuilder == null) - _serializeObjectBuilder = new StringBuilder(BUILDER_INIT); - _serializeObjectBuilder.Length = 0; - - if (jsonSerializerStrategy == null) - jsonSerializerStrategy = CurrentJsonSerializerStrategy; - - bool success = SerializeValue(jsonSerializerStrategy, json, _serializeObjectBuilder); - return (success ? _serializeObjectBuilder.ToString() : null); - } - - public static string EscapeToJavascriptString(string jsonString) - { - if (string.IsNullOrEmpty(jsonString)) - return jsonString; - - StringBuilder sb = new StringBuilder(); - char c; - - for (int i = 0; i < jsonString.Length;) - { - c = jsonString[i++]; - - if (c == '\\') - { - int remainingLength = jsonString.Length - i; - if (remainingLength >= 2) - { - char lookahead = jsonString[i]; - if (lookahead == '\\') - { - sb.Append('\\'); - ++i; - } - else if (lookahead == '"') - { - sb.Append("\""); - ++i; - } - else if (lookahead == 't') - { - sb.Append('\t'); - ++i; - } - else if (lookahead == 'b') - { - sb.Append('\b'); - ++i; - } - else if (lookahead == 'n') - { - sb.Append('\n'); - ++i; - } - else if (lookahead == 'r') - { - sb.Append('\r'); - ++i; - } - } - } - else - { - sb.Append(c); - } - } - return sb.ToString(); - } - - static IDictionary ParseObject(string json, ref int index, ref bool success) - { - IDictionary table = new JsonObject(); - TokenType token; - - // { - NextToken(json, ref index); - - bool done = false; - while (!done) - { - token = LookAhead(json, index); - if (token == TokenType.NONE) - { - success = false; - return null; - } - else if (token == TokenType.COMMA) - NextToken(json, ref index); - else if (token == TokenType.CURLY_CLOSE) - { - NextToken(json, ref index); - return table; - } - else - { - // name - string name = ParseString(json, ref index, ref success); - if (!success) - { - success = false; - return null; - } - // : - token = NextToken(json, ref index); - if (token != TokenType.COLON) - { - success = false; - return null; - } - // value - object value = ParseValue(json, ref index, ref success); - if (!success) - { - success = false; - return null; - } - table[name] = value; - } - } - return table; - } - - static JsonArray ParseArray(string json, ref int index, ref bool success) - { - JsonArray array = new JsonArray(); - - // [ - NextToken(json, ref index); - - bool done = false; - while (!done) - { - TokenType token = LookAhead(json, index); - if (token == TokenType.NONE) - { - success = false; - return null; - } - else if (token == TokenType.COMMA) - NextToken(json, ref index); - else if (token == TokenType.SQUARED_CLOSE) - { - NextToken(json, ref index); - break; - } - else - { - object value = ParseValue(json, ref index, ref success); - if (!success) - return null; - array.Add(value); - } - } - return array; - } - - static object ParseValue(string json, ref int index, ref bool success) - { - switch (LookAhead(json, index)) - { - case TokenType.STRING: - return ParseString(json, ref index, ref success); - case TokenType.NUMBER: - return ParseNumber(json, ref index, ref success); - case TokenType.CURLY_OPEN: - return ParseObject(json, ref index, ref success); - case TokenType.SQUARED_OPEN: - return ParseArray(json, ref index, ref success); - case TokenType.TRUE: - NextToken(json, ref index); - return true; - case TokenType.FALSE: - NextToken(json, ref index); - return false; - case TokenType.NULL: - NextToken(json, ref index); - return null; - case TokenType.NONE: - break; - } - success = false; - return null; - } - - static string ParseString(string json, ref int index, ref bool success) - { - if (_parseStringBuilder == null) - _parseStringBuilder = new StringBuilder(BUILDER_INIT); - _parseStringBuilder.Length = 0; - - EatWhitespace(json, ref index); - - // " - char c = json[index++]; - bool complete = false; - while (!complete) - { - if (index == json.Length) - break; - - c = json[index++]; - if (c == '"') - { - complete = true; - break; - } - else if (c == '\\') - { - if (index == json.Length) - break; - c = json[index++]; - if (c == '"') - _parseStringBuilder.Append('"'); - else if (c == '\\') - _parseStringBuilder.Append('\\'); - else if (c == '/') - _parseStringBuilder.Append('/'); - else if (c == 'b') - _parseStringBuilder.Append('\b'); - else if (c == 'f') - _parseStringBuilder.Append('\f'); - else if (c == 'n') - _parseStringBuilder.Append('\n'); - else if (c == 'r') - _parseStringBuilder.Append('\r'); - else if (c == 't') - _parseStringBuilder.Append('\t'); - else if (c == 'u') - { - int remainingLength = json.Length - index; - if (remainingLength >= 4) - { - // parse the 32 bit hex into an integer codepoint - uint codePoint; - if (!(success = UInt32.TryParse(json.Substring(index, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out codePoint))) - return ""; - - // convert the integer codepoint to a unicode char and add to string - if (0xD800 <= codePoint && codePoint <= 0xDBFF) // if high surrogate - { - index += 4; // skip 4 chars - remainingLength = json.Length - index; - if (remainingLength >= 6) - { - uint lowCodePoint; - if (json.Substring(index, 2) == "\\u" && UInt32.TryParse(json.Substring(index + 2, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out lowCodePoint)) - { - if (0xDC00 <= lowCodePoint && lowCodePoint <= 0xDFFF) // if low surrogate - { - _parseStringBuilder.Append((char)codePoint); - _parseStringBuilder.Append((char)lowCodePoint); - index += 6; // skip 6 chars - continue; - } - } - } - success = false; // invalid surrogate pair - return ""; - } - _parseStringBuilder.Append(ConvertFromUtf32((int)codePoint)); - // skip 4 chars - index += 4; - } - else - break; - } - } - else - _parseStringBuilder.Append(c); - } - if (!complete) - { - success = false; - return null; - } - return _parseStringBuilder.ToString(); - } - - private static string ConvertFromUtf32(int utf32) - { - // http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System/System/Char.cs.htm - if (utf32 < 0 || utf32 > 0x10FFFF) - throw new ArgumentOutOfRangeException("utf32", "The argument must be from 0 to 0x10FFFF."); - if (0xD800 <= utf32 && utf32 <= 0xDFFF) - throw new ArgumentOutOfRangeException("utf32", "The argument must not be in surrogate pair range."); - if (utf32 < 0x10000) - return new string((char)utf32, 1); - utf32 -= 0x10000; - return new string(new char[] { (char)((utf32 >> 10) + 0xD800), (char)(utf32 % 0x0400 + 0xDC00) }); - } - - static object ParseNumber(string json, ref int index, ref bool success) - { - EatWhitespace(json, ref index); - int lastIndex = GetLastIndexOfNumber(json, index); - int charLength = (lastIndex - index) + 1; - object returnNumber; - string str = json.Substring(index, charLength); - if (str.IndexOf(".", StringComparison.OrdinalIgnoreCase) != -1 || str.IndexOf("e", StringComparison.OrdinalIgnoreCase) != -1) - { - double number; - success = double.TryParse(json.Substring(index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); - returnNumber = number; - } - else if (str.IndexOf("-", StringComparison.OrdinalIgnoreCase) == -1) - { - ulong number; - success = ulong.TryParse(json.Substring(index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); - returnNumber = number; - } - else - { - long number; - success = long.TryParse(json.Substring(index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); - returnNumber = number; - } - index = lastIndex + 1; - return returnNumber; - } - - static int GetLastIndexOfNumber(string json, int index) - { - int lastIndex; - for (lastIndex = index; lastIndex < json.Length; lastIndex++) - if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1) break; - return lastIndex - 1; - } - - static void EatWhitespace(string json, ref int index) - { - for (; index < json.Length; index++) - if (" \t\n\r\b\f".IndexOf(json[index]) == -1) break; - } - - static TokenType LookAhead(string json, int index) - { - int saveIndex = index; - return NextToken(json, ref saveIndex); - } - - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - static TokenType NextToken(string json, ref int index) - { - EatWhitespace(json, ref index); - if (index == json.Length) - return TokenType.NONE; - char c = json[index]; - index++; - switch (c) - { - case '{': - return TokenType.CURLY_OPEN; - case '}': - return TokenType.CURLY_CLOSE; - case '[': - return TokenType.SQUARED_OPEN; - case ']': - return TokenType.SQUARED_CLOSE; - case ',': - return TokenType.COMMA; - case '"': - return TokenType.STRING; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - return TokenType.NUMBER; - case ':': - return TokenType.COLON; - } - index--; - int remainingLength = json.Length - index; - // false - if (remainingLength >= 5) - { - if (json[index] == 'f' && json[index + 1] == 'a' && json[index + 2] == 'l' && json[index + 3] == 's' && json[index + 4] == 'e') - { - index += 5; - return TokenType.FALSE; - } - } - // true - if (remainingLength >= 4) - { - if (json[index] == 't' && json[index + 1] == 'r' && json[index + 2] == 'u' && json[index + 3] == 'e') - { - index += 4; - return TokenType.TRUE; - } - } - // null - if (remainingLength >= 4) - { - if (json[index] == 'n' && json[index + 1] == 'u' && json[index + 2] == 'l' && json[index + 3] == 'l') - { - index += 4; - return TokenType.NULL; - } - } - return TokenType.NONE; - } - - static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, object value, StringBuilder builder) - { - bool success = true; - string stringValue = value as string; - if (value == null) - builder.Append("null"); - else if (stringValue != null) - success = SerializeString(stringValue, builder); - else - { - IDictionary dict = value as IDictionary; - Type type = value.GetType(); - Type[] genArgs = ReflectionUtils.GetGenericTypeArguments(type); - var isStringKeyDictionary = type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>) && genArgs[0] == typeof(string); - if (isStringKeyDictionary) - { - var strDictValue = value as IDictionary; - success = SerializeObject(jsonSerializerStrategy, strDictValue.Keys, strDictValue.Values, builder); - } - else if (dict != null) - { - success = SerializeObject(jsonSerializerStrategy, dict.Keys, dict.Values, builder); - } - else - { - IDictionary stringDictionary = value as IDictionary; - if (stringDictionary != null) - { - success = SerializeObject(jsonSerializerStrategy, stringDictionary.Keys, stringDictionary.Values, builder); - } - else - { - IEnumerable enumerableValue = value as IEnumerable; - if (enumerableValue != null) - success = SerializeArray(jsonSerializerStrategy, enumerableValue, builder); - else if (IsNumeric(value)) - success = SerializeNumber(value, builder); - else if (value is bool) - builder.Append((bool)value ? "true" : "false"); - else - { - object serializedObject; - success = jsonSerializerStrategy.TrySerializeNonPrimitiveObject(value, out serializedObject); - if (success) - SerializeValue(jsonSerializerStrategy, serializedObject, builder); - } - } - } - } - return success; - } - - static bool SerializeObject(IJsonSerializerStrategy jsonSerializerStrategy, IEnumerable keys, IEnumerable values, StringBuilder builder) - { - builder.Append("{"); - IEnumerator ke = keys.GetEnumerator(); - IEnumerator ve = values.GetEnumerator(); - bool first = true; - while (ke.MoveNext() && ve.MoveNext()) - { - object key = ke.Current; - object value = ve.Current; - if (!first) - builder.Append(","); - string stringKey = key as string; - if (stringKey != null) - SerializeString(stringKey, builder); - else - if (!SerializeValue(jsonSerializerStrategy, value, builder)) return false; - builder.Append(":"); - if (!SerializeValue(jsonSerializerStrategy, value, builder)) - return false; - first = false; - } - builder.Append("}"); - return true; - } - - static bool SerializeArray(IJsonSerializerStrategy jsonSerializerStrategy, IEnumerable anArray, StringBuilder builder) - { - builder.Append("["); - bool first = true; - foreach (object value in anArray) - { - if (!first) - builder.Append(","); - if (!SerializeValue(jsonSerializerStrategy, value, builder)) - return false; - first = false; - } - builder.Append("]"); - return true; - } - - static bool SerializeString(string aString, StringBuilder builder) - { - // Happy path if there's nothing to be escaped. IndexOfAny is highly optimized (and unmanaged) - if (aString.IndexOfAny(EscapeCharacters) == -1) - { - builder.Append('"'); - builder.Append(aString); - builder.Append('"'); - - return true; - } - - builder.Append('"'); - int safeCharacterCount = 0; - char[] charArray = aString.ToCharArray(); - - for (int i = 0; i < charArray.Length; i++) - { - char c = charArray[i]; - - // Non ascii characters are fine, buffer them up and send them to the builder - // in larger chunks if possible. The escape table is a 1:1 translation table - // with \0 [default(char)] denoting a safe character. - if (c >= EscapeTable.Length || EscapeTable[c] == default(char)) - { - safeCharacterCount++; - } - else - { - if (safeCharacterCount > 0) - { - builder.Append(charArray, i - safeCharacterCount, safeCharacterCount); - safeCharacterCount = 0; - } - - builder.Append('\\'); - builder.Append(EscapeTable[c]); - } - } - - if (safeCharacterCount > 0) - { - builder.Append(charArray, charArray.Length - safeCharacterCount, safeCharacterCount); - } - - builder.Append('"'); - return true; - } - - static bool SerializeNumber(object number, StringBuilder builder) - { - if (number is decimal) - builder.Append(((decimal)number).ToString("R", CultureInfo.InvariantCulture)); - else if (number is double) - builder.Append(((double)number).ToString("R", CultureInfo.InvariantCulture)); - else if (number is float) - builder.Append(((float)number).ToString("R", CultureInfo.InvariantCulture)); - else if (NumberTypes.IndexOf(number.GetType()) != -1) - builder.Append(number); - return true; - } - - /// - /// Determines if a given object is numeric in any way - /// (can be integer, double, null, etc). - /// - static bool IsNumeric(object value) - { - if (value is sbyte) return true; - if (value is byte) return true; - if (value is short) return true; - if (value is ushort) return true; - if (value is int) return true; - if (value is uint) return true; - if (value is long) return true; - if (value is ulong) return true; - if (value is float) return true; - if (value is double) return true; - if (value is decimal) return true; - return false; - } - - private static IJsonSerializerStrategy _currentJsonSerializerStrategy; - public static IJsonSerializerStrategy CurrentJsonSerializerStrategy - { - get - { - return _currentJsonSerializerStrategy ?? - (_currentJsonSerializerStrategy = -#if SIMPLE_JSON_DATACONTRACT - DataContractJsonSerializerStrategy -#else - PocoJsonSerializerStrategy -#endif -); - } - set - { - _currentJsonSerializerStrategy = value; - } - } - - private static PocoJsonSerializerStrategy _pocoJsonSerializerStrategy; - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static PocoJsonSerializerStrategy PocoJsonSerializerStrategy - { - get - { - return _pocoJsonSerializerStrategy ?? (_pocoJsonSerializerStrategy = new PocoJsonSerializerStrategy()); - } - } - -#if SIMPLE_JSON_DATACONTRACT - - private static DataContractJsonSerializerStrategy _dataContractJsonSerializerStrategy; - [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Advanced)] - public static DataContractJsonSerializerStrategy DataContractJsonSerializerStrategy - { - get - { - return _dataContractJsonSerializerStrategy ?? (_dataContractJsonSerializerStrategy = new DataContractJsonSerializerStrategy()); - } - } - -#endif - } - - [GeneratedCode("simple-json", "1.0.0")] -#if SIMPLE_JSON_INTERNAL - internal -#else - public -#endif - interface IJsonSerializerStrategy - { - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification = "Need to support .NET 2")] - bool TrySerializeNonPrimitiveObject(object input, out object output); - object DeserializeObject(object value, Type type); - } - - [GeneratedCode("simple-json", "1.0.0")] -#if SIMPLE_JSON_INTERNAL - internal -#else - public -#endif - class PocoJsonSerializerStrategy : IJsonSerializerStrategy - { - internal IDictionary ConstructorCache; - internal IDictionary> GetCache; - internal IDictionary>> SetCache; - - internal static readonly Type[] EmptyTypes = new Type[0]; - internal static readonly Type[] ArrayConstructorParameterTypes = new Type[] { typeof(int) }; - - private static readonly string[] Iso8601Format = new string[] - { - @"yyyy-MM-dd\THH:mm:ss.FFFFFFF\Z", - @"yyyy-MM-dd\THH:mm:ss\Z", - @"yyyy-MM-dd\THH:mm:ssK" - }; - - public PocoJsonSerializerStrategy() - { - ConstructorCache = new ReflectionUtils.ThreadSafeDictionary(ContructorDelegateFactory); - GetCache = new ReflectionUtils.ThreadSafeDictionary>(GetterValueFactory); - SetCache = new ReflectionUtils.ThreadSafeDictionary>>(SetterValueFactory); - } - - protected virtual string MapClrMemberNameToJsonFieldName(MemberInfo memberInfo) - { - // TODO: Optimize and/or cache - foreach (JsonProperty eachAttr in memberInfo.GetCustomAttributes(typeof(JsonProperty), true)) - if (!string.IsNullOrEmpty(eachAttr.PropertyName)) - return eachAttr.PropertyName; - return memberInfo.Name; - } - - protected virtual void MapClrMemberNameToJsonFieldName(MemberInfo memberInfo, out string jsonName, out JsonProperty jsonProp) - { - jsonName = memberInfo.Name; - jsonProp = null; - // TODO: Optimize and/or cache - foreach (JsonProperty eachAttr in memberInfo.GetCustomAttributes(typeof(JsonProperty), true)) - { - jsonProp = eachAttr; - if (!string.IsNullOrEmpty(eachAttr.PropertyName)) - jsonName = eachAttr.PropertyName; - } - } - - internal virtual ReflectionUtils.ConstructorDelegate ContructorDelegateFactory(Type key) - { - return ReflectionUtils.GetContructor(key, key.IsArray ? ArrayConstructorParameterTypes : EmptyTypes); - } - - internal virtual IDictionary GetterValueFactory(Type type) - { - IDictionary result = new Dictionary(); - foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) - { - if (propertyInfo.CanRead) - { - MethodInfo getMethod = ReflectionUtils.GetGetterMethodInfo(propertyInfo); - if (getMethod.IsStatic || !getMethod.IsPublic) - continue; - result[propertyInfo] = ReflectionUtils.GetGetMethod(propertyInfo); - } - } - foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) - { - if (fieldInfo.IsStatic || !fieldInfo.IsPublic) - continue; - result[fieldInfo] = ReflectionUtils.GetGetMethod(fieldInfo); - } - return result; - } - - internal virtual IDictionary> SetterValueFactory(Type type) - { - IDictionary> result = new Dictionary>(); - foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) - { - if (propertyInfo.CanWrite) - { - MethodInfo setMethod = ReflectionUtils.GetSetterMethodInfo(propertyInfo); - if (setMethod.IsStatic || !setMethod.IsPublic) - continue; - result[MapClrMemberNameToJsonFieldName(propertyInfo)] = new KeyValuePair(propertyInfo.PropertyType, ReflectionUtils.GetSetMethod(propertyInfo)); - } - } - foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) - { - if (fieldInfo.IsInitOnly || fieldInfo.IsStatic || !fieldInfo.IsPublic) - continue; - result[MapClrMemberNameToJsonFieldName(fieldInfo)] = new KeyValuePair(fieldInfo.FieldType, ReflectionUtils.GetSetMethod(fieldInfo)); - } - return result; - } - - public virtual bool TrySerializeNonPrimitiveObject(object input, out object output) - { - return TrySerializeKnownTypes(input, out output) || TrySerializeUnknownTypes(input, out output); - } - - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual object DeserializeObject(object value, Type type) - { - if (type == null) throw new ArgumentNullException("type"); - if (value != null && type.IsInstanceOfType(value)) return value; - - string str = value as string; - if (type == typeof(Guid) && string.IsNullOrEmpty(str)) - return default(Guid); - - if (value == null) - return null; - - object obj = null; - - if (str != null) - { - if (str.Length != 0) // We know it can't be null now. - { - if (type == typeof(DateTime) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTime))) - return DateTime.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); - if (type == typeof(DateTimeOffset) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTimeOffset))) - return DateTimeOffset.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); - if (type == typeof(Guid) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid))) - return new Guid(str); - if (type == typeof(Uri)) - { - bool isValid = Uri.IsWellFormedUriString(str, UriKind.RelativeOrAbsolute); - - Uri result; - if (isValid && Uri.TryCreate(str, UriKind.RelativeOrAbsolute, out result)) - return result; - - return null; - } - - if (type == typeof(string)) - return str; - - return Convert.ChangeType(str, type, CultureInfo.InvariantCulture); - } - else - { - if (type == typeof(Guid)) - obj = default(Guid); - else if (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)) - obj = null; - else - obj = str; - } - // Empty string case - if (!ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)) - return str; - } - else if (value is bool) - return value; - - bool valueIsLong = value is long; - bool valueIsUlong = value is ulong; - bool valueIsDouble = value is double; - Type nullableType = Nullable.GetUnderlyingType(type); - if (nullableType != null && PlayFabSimpleJson.NumberTypes.IndexOf(nullableType) != -1) - type = nullableType; // Just use the regular type for the conversion - bool isNumberType = PlayFabSimpleJson.NumberTypes.IndexOf(type) != -1; - bool isEnumType = type.GetTypeInfo().IsEnum; - if ((valueIsLong && type == typeof(long)) || (valueIsUlong && type == typeof(ulong)) || (valueIsDouble && type == typeof(double))) - return value; - if ((valueIsLong || valueIsUlong || valueIsDouble) && isEnumType) - return Enum.ToObject(type, Convert.ChangeType(value, Enum.GetUnderlyingType(type), CultureInfo.InvariantCulture)); - if ((valueIsLong || valueIsUlong || valueIsDouble) && isNumberType) - return Convert.ChangeType(value, type, CultureInfo.InvariantCulture); - - IDictionary objects = value as IDictionary; - if (objects != null) - { - IDictionary jsonObject = objects; - - if (ReflectionUtils.IsTypeDictionary(type)) - { - // if dictionary then - Type[] types = ReflectionUtils.GetGenericTypeArguments(type); - Type keyType = types[0]; - Type valueType = types[1]; - - Type genericType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType); - - IDictionary dict = (IDictionary)ConstructorCache[genericType](); - - foreach (KeyValuePair kvp in jsonObject) - dict.Add(kvp.Key, DeserializeObject(kvp.Value, valueType)); - - obj = dict; - } - else - { - if (type == typeof(object)) - obj = value; - else - { - obj = ConstructorCache[type](); - foreach (KeyValuePair> setter in SetCache[type]) - { - object jsonValue; - if (jsonObject.TryGetValue(setter.Key, out jsonValue)) - { - jsonValue = DeserializeObject(jsonValue, setter.Value.Key); - setter.Value.Value(obj, jsonValue); - } - } - } - } - } - else - { - IList valueAsList = value as IList; - if (valueAsList != null) - { - IList jsonObject = valueAsList; - IList list = null; - - if (type.IsArray) - { - list = (IList)ConstructorCache[type](jsonObject.Count); - int i = 0; - foreach (object o in jsonObject) - list[i++] = DeserializeObject(o, type.GetElementType()); - } - else if (ReflectionUtils.IsTypeGenericeCollectionInterface(type) || ReflectionUtils.IsAssignableFrom(typeof(IList), type) || type == typeof(object)) - { - Type innerType = ReflectionUtils.GetGenericListElementType(type); - ReflectionUtils.ConstructorDelegate ctrDelegate = null; - if (type != typeof(object)) - ctrDelegate = ConstructorCache[type]; - if (ctrDelegate == null) - ctrDelegate = ConstructorCache[typeof(List<>).MakeGenericType(innerType)]; - list = (IList)ctrDelegate(); - foreach (object o in jsonObject) - list.Add(DeserializeObject(o, innerType)); - } - obj = list; - } - return obj; - } - if (ReflectionUtils.IsNullableType(type)) - return ReflectionUtils.ToNullableType(obj, type); - return obj; - } - - protected virtual object SerializeEnum(Enum p) - { - return Convert.ToDouble(p, CultureInfo.InvariantCulture); - } - - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification = "Need to support .NET 2")] - protected virtual bool TrySerializeKnownTypes(object input, out object output) - { - bool returnValue = true; - if (input is DateTime) - output = ((DateTime)input).ToUniversalTime().ToString(Iso8601Format[0], CultureInfo.InvariantCulture); - else if (input is DateTimeOffset) - output = ((DateTimeOffset)input).ToUniversalTime().ToString(Iso8601Format[0], CultureInfo.InvariantCulture); - else if (input is Guid) - output = ((Guid)input).ToString("D"); - else if (input is Uri) - output = input.ToString(); - else - { - Enum inputEnum = input as Enum; - if (inputEnum != null) - output = SerializeEnum(inputEnum); - else - { - returnValue = false; - output = null; - } - } - return returnValue; - } - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification = "Need to support .NET 2")] - protected virtual bool TrySerializeUnknownTypes(object input, out object output) - { - if (input == null) throw new ArgumentNullException("input"); - output = null; - Type type = input.GetType(); - if (type.FullName == null) - return false; - IDictionary obj = new JsonObject(); - IDictionary getters = GetCache[type]; - foreach (KeyValuePair getter in getters) - { - if (getter.Value == null) - continue; - string jsonKey; - JsonProperty jsonProp; - MapClrMemberNameToJsonFieldName(getter.Key, out jsonKey, out jsonProp); - if (obj.ContainsKey(jsonKey)) - throw new Exception("The given key is defined multiple times in the same type: " + input.GetType().Name + "." + jsonKey); - object value = getter.Value(input); - if (jsonProp == null || jsonProp.NullValueHandling == NullValueHandling.Include || value != null) - obj.Add(jsonKey, value); - } - output = obj; - return true; - } - } - -#if SIMPLE_JSON_DATACONTRACT - [GeneratedCode("simple-json", "1.0.0")] -#if SIMPLE_JSON_INTERNAL - internal -#else - public -#endif - class DataContractJsonSerializerStrategy : PocoJsonSerializerStrategy - { - public DataContractJsonSerializerStrategy() - { - GetCache = new ReflectionUtils.ThreadSafeDictionary>(GetterValueFactory); - SetCache = new ReflectionUtils.ThreadSafeDictionary>>(SetterValueFactory); - } - - internal override IDictionary GetterValueFactory(Type type) - { - bool hasDataContract = ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; - if (!hasDataContract) - return base.GetterValueFactory(type); - string jsonKey; - IDictionary result = new Dictionary(); - foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) - { - if (propertyInfo.CanRead) - { - MethodInfo getMethod = ReflectionUtils.GetGetterMethodInfo(propertyInfo); - if (!getMethod.IsStatic && CanAdd(propertyInfo, out jsonKey)) - result[jsonKey] = ReflectionUtils.GetGetMethod(propertyInfo); - } - } - foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) - { - if (!fieldInfo.IsStatic && CanAdd(fieldInfo, out jsonKey)) - result[jsonKey] = ReflectionUtils.GetGetMethod(fieldInfo); - } - return result; - } - - internal override IDictionary> SetterValueFactory(Type type) - { - bool hasDataContract = ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; - if (!hasDataContract) - return base.SetterValueFactory(type); - string jsonKey; - IDictionary> result = new Dictionary>(); - foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) - { - if (propertyInfo.CanWrite) - { - MethodInfo setMethod = ReflectionUtils.GetSetterMethodInfo(propertyInfo); - if (!setMethod.IsStatic && CanAdd(propertyInfo, out jsonKey)) - result[jsonKey] = new KeyValuePair(propertyInfo.PropertyType, ReflectionUtils.GetSetMethod(propertyInfo)); - } - } - foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) - { - if (!fieldInfo.IsInitOnly && !fieldInfo.IsStatic && CanAdd(fieldInfo, out jsonKey)) - result[jsonKey] = new KeyValuePair(fieldInfo.FieldType, ReflectionUtils.GetSetMethod(fieldInfo)); - } - // todo implement sorting for DATACONTRACT. - return result; - } - - private static bool CanAdd(MemberInfo info, out string jsonKey) - { - jsonKey = null; - if (ReflectionUtils.GetAttribute(info, typeof(IgnoreDataMemberAttribute)) != null) - return false; - DataMemberAttribute dataMemberAttribute = (DataMemberAttribute)ReflectionUtils.GetAttribute(info, typeof(DataMemberAttribute)); - if (dataMemberAttribute == null) - return false; - jsonKey = string.IsNullOrEmpty(dataMemberAttribute.Name) ? info.Name : dataMemberAttribute.Name; - return true; - } - } - -#endif - - // This class is meant to be copied into other libraries. So we want to exclude it from Code Analysis rules - // that might be in place in the target project. - [GeneratedCode("reflection-utils", "1.0.0")] -#if SIMPLE_JSON_REFLECTION_UTILS_PUBLIC - public -#else - internal -#endif - class ReflectionUtils - { - private static readonly object[] EmptyObjects = new object[0]; - - public delegate object GetDelegate(object source); - public delegate void SetDelegate(object source, object value); - public delegate object ConstructorDelegate(params object[] args); - - public delegate TValue ThreadSafeDictionaryValueFactory(TKey key); - - [ThreadStatic] - private static object[] _1ObjArray; - -#if SIMPLE_JSON_TYPEINFO - public static TypeInfo GetTypeInfo(Type type) - { - return type.GetTypeInfo(); - } -#else - public static Type GetTypeInfo(Type type) - { - return type; - } -#endif - - public static Attribute GetAttribute(MemberInfo info, Type type) - { -#if SIMPLE_JSON_TYPEINFO - if (info == null || type == null || !info.IsDefined(type)) - return null; - return info.GetCustomAttribute(type); -#else - if (info == null || type == null || !Attribute.IsDefined(info, type)) - return null; - return Attribute.GetCustomAttribute(info, type); -#endif - } - - public static Type GetGenericListElementType(Type type) - { - if (type == typeof(object)) - return type; - - IEnumerable interfaces; -#if SIMPLE_JSON_TYPEINFO - interfaces = type.GetTypeInfo().ImplementedInterfaces; -#else - interfaces = type.GetInterfaces(); -#endif - foreach (Type implementedInterface in interfaces) - { - if (IsTypeGeneric(implementedInterface) && - implementedInterface.GetGenericTypeDefinition() == typeof(IList<>)) - { - return GetGenericTypeArguments(implementedInterface)[0]; - } - } - return GetGenericTypeArguments(type)[0]; - } - - public static Attribute GetAttribute(Type objectType, Type attributeType) - { - -#if SIMPLE_JSON_TYPEINFO - if (objectType == null || attributeType == null || !objectType.GetTypeInfo().IsDefined(attributeType)) - return null; - return objectType.GetTypeInfo().GetCustomAttribute(attributeType); -#else - if (objectType == null || attributeType == null || !Attribute.IsDefined(objectType, attributeType)) - return null; - return Attribute.GetCustomAttribute(objectType, attributeType); -#endif - } - - public static Type[] GetGenericTypeArguments(Type type) - { -#if SIMPLE_JSON_TYPEINFO - return type.GetTypeInfo().GenericTypeArguments; -#else - return type.GetGenericArguments(); -#endif - } - - public static bool IsTypeGeneric(Type type) - { - return GetTypeInfo(type).IsGenericType; - } - - public static bool IsTypeGenericeCollectionInterface(Type type) - { - if (!IsTypeGeneric(type)) - return false; - - Type genericDefinition = type.GetGenericTypeDefinition(); - - return (genericDefinition == typeof(IList<>) - || genericDefinition == typeof(ICollection<>) - || genericDefinition == typeof(IEnumerable<>) -#if SIMPLE_JSON_READONLY_COLLECTIONS - || genericDefinition == typeof(IReadOnlyCollection<>) - || genericDefinition == typeof(IReadOnlyList<>) -#endif -); - } - - public static bool IsAssignableFrom(Type type1, Type type2) - { - return GetTypeInfo(type1).IsAssignableFrom(GetTypeInfo(type2)); - } - - public static bool IsTypeDictionary(Type type) - { -#if SIMPLE_JSON_TYPEINFO - if (typeof(IDictionary<,>).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) - return true; -#else - if (typeof(System.Collections.IDictionary).IsAssignableFrom(type)) - return true; -#endif - if (!GetTypeInfo(type).IsGenericType) - return false; - - Type genericDefinition = type.GetGenericTypeDefinition(); - return genericDefinition == typeof(IDictionary<,>) || genericDefinition == typeof(Dictionary<,>); - } - - public static bool IsNullableType(Type type) - { - return GetTypeInfo(type).IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); - } - - public static object ToNullableType(object obj, Type nullableType) - { - return obj == null ? null : Convert.ChangeType(obj, Nullable.GetUnderlyingType(nullableType), CultureInfo.InvariantCulture); - } - - public static bool IsValueType(Type type) - { - return GetTypeInfo(type).IsValueType; - } - - public static IEnumerable GetConstructors(Type type) - { -#if SIMPLE_JSON_TYPEINFO - return type.GetTypeInfo().DeclaredConstructors; -#else - return type.GetConstructors(); -#endif - } - - public static ConstructorInfo GetConstructorInfo(Type type, params Type[] argsType) - { - IEnumerable constructorInfos = GetConstructors(type); - int i; - bool matches; - foreach (ConstructorInfo constructorInfo in constructorInfos) - { - ParameterInfo[] parameters = constructorInfo.GetParameters(); - if (argsType.Length != parameters.Length) - continue; - - i = 0; - matches = true; - foreach (ParameterInfo parameterInfo in constructorInfo.GetParameters()) - { - if (parameterInfo.ParameterType != argsType[i]) - { - matches = false; - break; - } - } - - if (matches) - return constructorInfo; - } - - return null; - } - - public static IEnumerable GetProperties(Type type) - { -#if SIMPLE_JSON_TYPEINFO - return type.GetRuntimeProperties(); -#else - return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); -#endif - } - - public static IEnumerable GetFields(Type type) - { -#if SIMPLE_JSON_TYPEINFO - return type.GetRuntimeFields(); -#else - return type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); -#endif - } - - public static MethodInfo GetGetterMethodInfo(PropertyInfo propertyInfo) - { -#if SIMPLE_JSON_TYPEINFO - return propertyInfo.GetMethod; -#else - return propertyInfo.GetGetMethod(true); -#endif - } - - public static MethodInfo GetSetterMethodInfo(PropertyInfo propertyInfo) - { -#if SIMPLE_JSON_TYPEINFO - return propertyInfo.SetMethod; -#else - return propertyInfo.GetSetMethod(true); -#endif - } - - public static ConstructorDelegate GetContructor(ConstructorInfo constructorInfo) - { - return GetConstructorByReflection(constructorInfo); - } - - public static ConstructorDelegate GetContructor(Type type, params Type[] argsType) - { - return GetConstructorByReflection(type, argsType); - } - - public static ConstructorDelegate GetConstructorByReflection(ConstructorInfo constructorInfo) - { - return delegate (object[] args) - { - var x = constructorInfo; - return x.Invoke(args); - }; - } - - public static ConstructorDelegate GetConstructorByReflection(Type type, params Type[] argsType) - { - ConstructorInfo constructorInfo = GetConstructorInfo(type, argsType); - return constructorInfo == null ? null : GetConstructorByReflection(constructorInfo); - } - - public static GetDelegate GetGetMethod(PropertyInfo propertyInfo) - { - return GetGetMethodByReflection(propertyInfo); - } - - public static GetDelegate GetGetMethod(FieldInfo fieldInfo) - { - return GetGetMethodByReflection(fieldInfo); - } - - public static GetDelegate GetGetMethodByReflection(PropertyInfo propertyInfo) - { - MethodInfo methodInfo = GetGetterMethodInfo(propertyInfo); - return delegate (object source) { return methodInfo.Invoke(source, EmptyObjects); }; - } - - public static GetDelegate GetGetMethodByReflection(FieldInfo fieldInfo) - { - return delegate (object source) { return fieldInfo.GetValue(source); }; - } - - public static SetDelegate GetSetMethod(PropertyInfo propertyInfo) - { - return GetSetMethodByReflection(propertyInfo); - } - - public static SetDelegate GetSetMethod(FieldInfo fieldInfo) - { - return GetSetMethodByReflection(fieldInfo); - } - - public static SetDelegate GetSetMethodByReflection(PropertyInfo propertyInfo) - { - MethodInfo methodInfo = GetSetterMethodInfo(propertyInfo); - return delegate (object source, object value) - { - if (_1ObjArray == null) - _1ObjArray = new object[1]; - _1ObjArray[0] = value; - methodInfo.Invoke(source, _1ObjArray); - }; - } - - public static SetDelegate GetSetMethodByReflection(FieldInfo fieldInfo) - { - return delegate (object source, object value) { fieldInfo.SetValue(source, value); }; - } - - public sealed class ThreadSafeDictionary : IDictionary - { - private readonly object _lock = new object(); - private readonly ThreadSafeDictionaryValueFactory _valueFactory; - private Dictionary _dictionary; - - public ThreadSafeDictionary(ThreadSafeDictionaryValueFactory valueFactory) - { - _valueFactory = valueFactory; - } - - private TValue Get(TKey key) - { - if (_dictionary == null) - return AddValue(key); - TValue value; - if (!_dictionary.TryGetValue(key, out value)) - return AddValue(key); - return value; - } - - private TValue AddValue(TKey key) - { - TValue value = _valueFactory(key); - lock (_lock) - { - if (_dictionary == null) - { - _dictionary = new Dictionary(); - _dictionary[key] = value; - } - else - { - TValue val; - if (_dictionary.TryGetValue(key, out val)) - return val; - Dictionary dict = new Dictionary(_dictionary); - dict[key] = value; - _dictionary = dict; - } - } - return value; - } - - public void Add(TKey key, TValue value) - { - throw new NotImplementedException(); - } - - public bool ContainsKey(TKey key) - { - return _dictionary.ContainsKey(key); - } - - public ICollection Keys - { - get { return _dictionary.Keys; } - } - - public bool Remove(TKey key) - { - throw new NotImplementedException(); - } - - public bool TryGetValue(TKey key, out TValue value) - { - value = this[key]; - return true; - } - - public ICollection Values - { - get { return _dictionary.Values; } - } - - public TValue this[TKey key] - { - get { return Get(key); } - set { throw new NotImplementedException(); } - } - - public void Add(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void Clear() - { - throw new NotImplementedException(); - } - - public bool Contains(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - public int Count - { - get { return _dictionary.Count; } - } - - public bool IsReadOnly - { - get { throw new NotImplementedException(); } - } - - public bool Remove(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public IEnumerator> GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - } - } -} - -// ReSharper restore LoopCanBeConvertedToQuery -// ReSharper restore RedundantExplicitArrayCreation -// ReSharper restore SuggestUseVarKeywordEvident diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs.meta deleted file mode 100755 index 38d3b82f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bce6184794650f24fa8ac244b25edc17 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs deleted file mode 100755 index a093f980..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs +++ /dev/null @@ -1,58 +0,0 @@ -using UnityEngine; - -namespace PlayFab.Internal -{ - //public to be accessible by Unity engine - public class SingletonMonoBehaviour : MonoBehaviour where T : SingletonMonoBehaviour - { - private static T _instance; - - public static T instance - { - get - { - CreateInstance(); - return _instance; - } - } - - public static void CreateInstance() - { - if (_instance == null) - { - //find existing instance - _instance = GameObject.FindObjectOfType(); - if (_instance == null) - { - //create new instance - GameObject go = new GameObject(typeof(T).Name); - _instance = go.AddComponent(); - } - //initialize instance if necessary - if (!_instance.initialized) - { - _instance.Initialize(); - _instance.initialized = true; - } - } - } - - public virtual void Awake () - { - if (Application.isPlaying) - { - DontDestroyOnLoad(this); - } - - //check if instance already exists when reloading original scene - if (_instance != null) - { - DestroyImmediate (gameObject); - } - } - - protected bool initialized { get; set; } - - protected virtual void Initialize() { } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs.meta deleted file mode 100755 index 4a1f14a2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/SingletonMonoBehaviour.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f6a51fa1ed684497db153f40961979c4 -timeCreated: 1462682373 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs deleted file mode 100755 index cbe848c7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs +++ /dev/null @@ -1,145 +0,0 @@ -using PlayFab.Json; -using System; -using System.Globalization; -using System.IO; -using System.Text; -#if NETFX_CORE -using System.Reflection; -#endif - -namespace PlayFab.Internal -{ - internal static class PlayFabUtil - { - public static readonly string[] _defaultDateTimeFormats = new string[]{ // All parseable ISO 8601 formats for DateTime.[Try]ParseExact - Lets us deserialize any legacy timestamps in one of these formats - // These are the standard format with ISO 8601 UTC markers (T/Z) - "yyyy-MM-ddTHH:mm:ss.FFFFFFZ", - "yyyy-MM-ddTHH:mm:ss.FFFFZ", - "yyyy-MM-ddTHH:mm:ss.FFFZ", // DEFAULT_UTC_OUTPUT_INDEX - "yyyy-MM-ddTHH:mm:ss.FFZ", - "yyyy-MM-ddTHH:mm:ssZ", - - // These are the standard format without ISO 8601 UTC markers (T/Z) - "yyyy-MM-dd HH:mm:ss.FFFFFF", - "yyyy-MM-dd HH:mm:ss.FFFF", - "yyyy-MM-dd HH:mm:ss.FFF", - "yyyy-MM-dd HH:mm:ss.FF", // DEFAULT_LOCAL_OUTPUT_INDEX - "yyyy-MM-dd HH:mm:ss", - - // These are the result of an input bug, which we now have to support as long as the db has entries formatted like this - "yyyy-MM-dd HH:mm.ss.FFFF", - "yyyy-MM-dd HH:mm.ss.FFF", - "yyyy-MM-dd HH:mm.ss.FF", - "yyyy-MM-dd HH:mm.ss", - }; - public const int DEFAULT_UTC_OUTPUT_INDEX = 2; // The default format everybody should use - public const int DEFAULT_LOCAL_OUTPUT_INDEX = 8; // The default format if you want to use local time (This doesn't have universal support in all PlayFab code) - private static DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind; - - public static string timeStamp - { - get { return DateTime.Now.ToString(_defaultDateTimeFormats[DEFAULT_LOCAL_OUTPUT_INDEX]); } - } - - public static string utcTimeStamp - { - get { return DateTime.UtcNow.ToString(_defaultDateTimeFormats[DEFAULT_UTC_OUTPUT_INDEX]); } - } - - public static string Format(string text, params object[] args) - { - return args.Length > 0 ? string.Format(text, args) : text; - } - - public static MyJsonSerializerStrategy ApiSerializerStrategy = new MyJsonSerializerStrategy(); - public class MyJsonSerializerStrategy : PocoJsonSerializerStrategy - { - /// - /// Convert the json value into the destination field/property - /// - public override object DeserializeObject(object value, Type type) - { - string valueStr = value as string; - if (valueStr == null) // For all of our custom conversions, value is a string - return base.DeserializeObject(value, type); - - Type underType = Nullable.GetUnderlyingType(type); - if (underType != null) - return DeserializeObject(value, underType); - else if (type.GetTypeInfo().IsEnum) - return Enum.Parse(type, (string)value, true); - else if (type == typeof(DateTime)) - { - DateTime output; - bool result = DateTime.TryParseExact(valueStr, _defaultDateTimeFormats, CultureInfo.CurrentCulture, _dateTimeStyles, out output); - if (result) - return output; - } - else if (type == typeof(DateTimeOffset)) - { - DateTimeOffset output; - bool result = DateTimeOffset.TryParseExact(valueStr, _defaultDateTimeFormats, CultureInfo.CurrentCulture, _dateTimeStyles, out output); - if (result) - return output; - } - else if (type == typeof(TimeSpan)) - { - double seconds; - if (double.TryParse(valueStr, out seconds)) - return TimeSpan.FromSeconds(seconds); - } - return base.DeserializeObject(value, type); - } - - /// - /// Set output to a string that represents the input object - /// - protected override bool TrySerializeKnownTypes(object input, out object output) - { - if (input.GetType().GetTypeInfo().IsEnum) - { - output = input.ToString(); - return true; - } - else if (input is DateTime) - { - output = ((DateTime)input).ToString(_defaultDateTimeFormats[DEFAULT_UTC_OUTPUT_INDEX], CultureInfo.CurrentCulture); - return true; - } - else if (input is DateTimeOffset) - { - output = ((DateTimeOffset)input).ToString(_defaultDateTimeFormats[DEFAULT_UTC_OUTPUT_INDEX], CultureInfo.CurrentCulture); - return true; - } - else if (input is TimeSpan) - { - output = ((TimeSpan)input).TotalSeconds; - return true; - } - return base.TrySerializeKnownTypes(input, out output); - } - } - - [ThreadStatic] - private static StringBuilder _sb; - /// - /// A threadsafe way to block and load a text file - /// - /// Load a text file, and return the file as text. - /// Used for small (usually json) files. - /// - public static string ReadAllFileText(string filename) - { - if (_sb == null) - _sb = new StringBuilder(); - _sb.Length = 0; - - var fs = new FileStream(filename, FileMode.Open); - var br = new BinaryReader(fs); - while (br.BaseStream.Position != br.BaseStream.Length) - _sb.Append(br.ReadChar()); - - return _sb.ToString(); - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs.meta deleted file mode 100755 index 199e91ed..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/Util.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b3bfc0fbdbe1a36429699dfc30c9e488 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs deleted file mode 100755 index 8496dadc..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -#if UNITY_WSA && UNITY_WP8 -#define NETFX_CORE -#endif - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; - -public static class UUnitWsaReflectionExtensions -{ -#if !NETFX_CORE - public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object instance) - { - return Delegate.CreateDelegate(delegateType, instance, methodInfo); - } - public static Type GetTypeInfo(this Type type) - { - return type; - } - public static Type AsType(this Type type) - { - return type; - } - public static string GetDelegateName(this Delegate delegateInstance) - { - return delegateInstance.Method.Name; - } -#else - public static bool IsInstanceOfType(this Type type, object obj) - { - return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); - } - public static string GetDelegateName(this Delegate delegateInstance) - { - return delegateInstance.ToString(); - } - public static MethodInfo GetMethod(this Type type, string methodName) - { - return type.GetTypeInfo().GetDeclaredMethod(methodName); - } - public static IEnumerable GetFields(this TypeInfo typeInfo) - { - return typeInfo.DeclaredFields; - } - public static TypeInfo GetTypeInfo(this TypeInfo typeInfo) - { - return typeInfo; - } - public static IEnumerable GetConstructors(this TypeInfo typeInfo) - { - return typeInfo.DeclaredConstructors; - } - public static IEnumerable GetMethods(this TypeInfo typeInfo, BindingFlags ignored) - { - return typeInfo.DeclaredMethods; - } - public static IEnumerable GetTypes(this Assembly assembly) - { - return assembly.DefinedTypes; - } -#endif -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs.meta deleted file mode 100755 index aa63e032..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Internal/wsaReflectionExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1b20d57e2279b3a408268b20c2be2208 -timeCreated: 1468890373 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib.meta deleted file mode 100755 index e0b6f530..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bf69cdb213bea65428a0983a56b85ba3 -folderAsset: yes -timeCreated: 1462682372 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs deleted file mode 100755 index a121d372..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs +++ /dev/null @@ -1,816 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// CRC32.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2011 Dino Chiesa. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// Last Saved: <2011-August-02 18:25:54> -// -// ------------------------------------------------------------------ -// -// This module defines the CRC32 class, which can do the CRC32 algorithm, using -// arbitrary starting polynomials, and bit reversal. The bit reversal is what -// distinguishes this CRC-32 used in BZip2 from the CRC-32 that is used in PKZIP -// files, or GZIP files. This class does both. -// -// ------------------------------------------------------------------ - - -using System; -using Interop = System.Runtime.InteropServices; - -namespace Ionic.Crc -{ - /// - /// Computes a CRC-32. The CRC-32 algorithm is parameterized - you - /// can set the polynomial and enable or disable bit - /// reversal. This can be used for GZIP, BZip2, or ZIP. - /// - /// - /// This type is used internally by DotNetZip; it is generally not used - /// directly by applications wishing to create, read, or manipulate zip - /// archive files. - /// - - [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000C")] - [Interop.ComVisible(true)] -#if !NETCF - [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] -#endif - public class CRC32 - { - /// - /// Indicates the total number of bytes applied to the CRC. - /// - public Int64 TotalBytesRead - { - get - { - return _TotalBytesRead; - } - } - - /// - /// Indicates the current CRC for all blocks slurped in. - /// - public Int32 Crc32Result - { - get - { - return unchecked((Int32)(~_register)); - } - } - - /// - /// Returns the CRC32 for the specified stream. - /// - /// The stream over which to calculate the CRC32 - /// the CRC32 calculation - public Int32 GetCrc32(System.IO.Stream input) - { - return GetCrc32AndCopy(input, null); - } - - /// - /// Returns the CRC32 for the specified stream, and writes the input into the - /// output stream. - /// - /// The stream over which to calculate the CRC32 - /// The stream into which to deflate the input - /// the CRC32 calculation - public Int32 GetCrc32AndCopy(System.IO.Stream input, System.IO.Stream output) - { - if (input == null) - throw new Exception("The input stream must not be null."); - - unchecked - { - byte[] buffer = new byte[BUFFER_SIZE]; - int readSize = BUFFER_SIZE; - - _TotalBytesRead = 0; - int count = input.Read(buffer, 0, readSize); - if (output != null) output.Write(buffer, 0, count); - _TotalBytesRead += count; - while (count > 0) - { - SlurpBlock(buffer, 0, count); - count = input.Read(buffer, 0, readSize); - if (output != null) output.Write(buffer, 0, count); - _TotalBytesRead += count; - } - - return (Int32)(~_register); - } - } - - - /// - /// Get the CRC32 for the given (word,byte) combo. This is a - /// computation defined by PKzip for PKZIP 2.0 (weak) encryption. - /// - /// The word to start with. - /// The byte to combine it with. - /// The CRC-ized result. - public Int32 ComputeCrc32(Int32 W, byte B) - { - return _InternalComputeCrc32((UInt32)W, B); - } - - internal Int32 _InternalComputeCrc32(UInt32 W, byte B) - { - return (Int32)(crc32Table[(W ^ B) & 0xFF] ^ (W >> 8)); - } - - - /// - /// Update the value for the running CRC32 using the given block of bytes. - /// This is useful when using the CRC32() class in a Stream. - /// - /// block of bytes to slurp - /// starting point in the block - /// how many bytes within the block to slurp - public void SlurpBlock(byte[] block, int offset, int count) - { - if (block == null) - throw new Exception("The data buffer must not be null."); - - // bzip algorithm - for (int i = 0; i < count; i++) - { - int x = offset + i; - byte b = block[x]; - if (this.reverseBits) - { - UInt32 temp = (_register >> 24) ^ b; - _register = (_register << 8) ^ crc32Table[temp]; - } - else - { - UInt32 temp = (_register & 0x000000FF) ^ b; - _register = (_register >> 8) ^ crc32Table[temp]; - } - } - _TotalBytesRead += count; - } - - - /// - /// Process one byte in the CRC. - /// - /// the byte to include into the CRC . - public void UpdateCRC(byte b) - { - if (this.reverseBits) - { - UInt32 temp = (_register >> 24) ^ b; - _register = (_register << 8) ^ crc32Table[temp]; - } - else - { - UInt32 temp = (_register & 0x000000FF) ^ b; - _register = (_register >> 8) ^ crc32Table[temp]; - } - } - - /// - /// Process a run of N identical bytes into the CRC. - /// - /// - /// - /// This method serves as an optimization for updating the CRC when a - /// run of identical bytes is found. Rather than passing in a buffer of - /// length n, containing all identical bytes b, this method accepts the - /// byte value and the length of the (virtual) buffer - the length of - /// the run. - /// - /// - /// the byte to include into the CRC. - /// the number of times that byte should be repeated. - public void UpdateCRC(byte b, int n) - { - while (n-- > 0) - { - if (this.reverseBits) - { - uint temp = (_register >> 24) ^ b; - _register = (_register << 8) ^ crc32Table[(temp >= 0) - ? temp - : (temp + 256)]; - } - else - { - UInt32 temp = (_register & 0x000000FF) ^ b; - _register = (_register >> 8) ^ crc32Table[(temp >= 0) - ? temp - : (temp + 256)]; - - } - } - } - - - - private static uint ReverseBits(uint data) - { - unchecked - { - uint ret = data; - ret = (ret & 0x55555555) << 1 | (ret >> 1) & 0x55555555; - ret = (ret & 0x33333333) << 2 | (ret >> 2) & 0x33333333; - ret = (ret & 0x0F0F0F0F) << 4 | (ret >> 4) & 0x0F0F0F0F; - ret = (ret << 24) | ((ret & 0xFF00) << 8) | ((ret >> 8) & 0xFF00) | (ret >> 24); - return ret; - } - } - - private static byte ReverseBits(byte data) - { - unchecked - { - uint u = (uint)data * 0x00020202; - uint m = 0x01044010; - uint s = u & m; - uint t = (u << 2) & (m << 1); - return (byte)((0x01001001 * (s + t)) >> 24); - } - } - - - - private void GenerateLookupTable() - { - crc32Table = new UInt32[256]; - unchecked - { - UInt32 dwCrc; - byte i = 0; - do - { - dwCrc = i; - for (byte j = 8; j > 0; j--) - { - if ((dwCrc & 1) == 1) - { - dwCrc = (dwCrc >> 1) ^ dwPolynomial; - } - else - { - dwCrc >>= 1; - } - } - if (reverseBits) - { - crc32Table[ReverseBits(i)] = ReverseBits(dwCrc); - } - else - { - crc32Table[i] = dwCrc; - } - i++; - } while (i!=0); - } - -#if VERBOSE - Console.WriteLine(); - Console.WriteLine("private static readonly UInt32[] crc32Table = {"); - for (int i = 0; i < crc32Table.Length; i+=4) - { - Console.Write(" "); - for (int j=0; j < 4; j++) - { - Console.Write(" 0x{0:X8}U,", crc32Table[i+j]); - } - Console.WriteLine(); - } - Console.WriteLine("};"); - Console.WriteLine(); -#endif - } - - - private uint gf2_matrix_times(uint[] matrix, uint vec) - { - uint sum = 0; - int i=0; - while (vec != 0) - { - if ((vec & 0x01)== 0x01) - sum ^= matrix[i]; - vec >>= 1; - i++; - } - return sum; - } - - private void gf2_matrix_square(uint[] square, uint[] mat) - { - for (int i = 0; i < 32; i++) - square[i] = gf2_matrix_times(mat, mat[i]); - } - - - - /// - /// Combines the given CRC32 value with the current running total. - /// - /// - /// This is useful when using a divide-and-conquer approach to - /// calculating a CRC. Multiple threads can each calculate a - /// CRC32 on a segment of the data, and then combine the - /// individual CRC32 values at the end. - /// - /// the crc value to be combined with this one - /// the length of data the CRC value was calculated on - public void Combine(int crc, int length) - { - uint[] even = new uint[32]; // even-power-of-two zeros operator - uint[] odd = new uint[32]; // odd-power-of-two zeros operator - - if (length == 0) - return; - - uint crc1= ~_register; - uint crc2= (uint) crc; - - // put operator for one zero bit in odd - odd[0] = this.dwPolynomial; // the CRC-32 polynomial - uint row = 1; - for (int i = 1; i < 32; i++) - { - odd[i] = row; - row <<= 1; - } - - // put operator for two zero bits in even - gf2_matrix_square(even, odd); - - // put operator for four zero bits in odd - gf2_matrix_square(odd, even); - - uint len2 = (uint) length; - - // apply len2 zeros to crc1 (first square will put the operator for one - // zero byte, eight zero bits, in even) - do { - // apply zeros operator for this bit of len2 - gf2_matrix_square(even, odd); - - if ((len2 & 1)== 1) - crc1 = gf2_matrix_times(even, crc1); - len2 >>= 1; - - if (len2 == 0) - break; - - // another iteration of the loop with odd and even swapped - gf2_matrix_square(odd, even); - if ((len2 & 1)==1) - crc1 = gf2_matrix_times(odd, crc1); - len2 >>= 1; - - - } while (len2 != 0); - - crc1 ^= crc2; - - _register= ~crc1; - - //return (int) crc1; - return; - } - - - /// - /// Create an instance of the CRC32 class using the default settings: no - /// bit reversal, and a polynomial of 0xEDB88320. - /// - public CRC32() : this(false) - { - } - - /// - /// Create an instance of the CRC32 class, specifying whether to reverse - /// data bits or not. - /// - /// - /// specify true if the instance should reverse data bits. - /// - /// - /// - /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - /// want a CRC32 with compatibility with BZip2, you should pass true - /// here. In the CRC-32 used by GZIP and PKZIP, the bits are not - /// reversed; Therefore if you want a CRC32 with compatibility with - /// those, you should pass false. - /// - /// - public CRC32(bool reverseBits) : - this( unchecked((int)0xEDB88320), reverseBits) - { - } - - - /// - /// Create an instance of the CRC32 class, specifying the polynomial and - /// whether to reverse data bits or not. - /// - /// - /// The polynomial to use for the CRC, expressed in the reversed (LSB) - /// format: the highest ordered bit in the polynomial value is the - /// coefficient of the 0th power; the second-highest order bit is the - /// coefficient of the 1 power, and so on. Expressed this way, the - /// polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. - /// - /// - /// specify true if the instance should reverse data bits. - /// - /// - /// - /// - /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - /// want a CRC32 with compatibility with BZip2, you should pass true - /// here for the reverseBits parameter. In the CRC-32 used by - /// GZIP and PKZIP, the bits are not reversed; Therefore if you want a - /// CRC32 with compatibility with those, you should pass false for the - /// reverseBits parameter. - /// - /// - public CRC32(int polynomial, bool reverseBits) - { - this.reverseBits = reverseBits; - this.dwPolynomial = (uint) polynomial; - this.GenerateLookupTable(); - } - - /// - /// Reset the CRC-32 class - clear the CRC "remainder register." - /// - /// - /// - /// Use this when employing a single instance of this class to compute - /// multiple, distinct CRCs on multiple, distinct data blocks. - /// - /// - public void Reset() - { - _register = 0xFFFFFFFFU; - } - - // private member vars - private UInt32 dwPolynomial; - private Int64 _TotalBytesRead; - private bool reverseBits; - private UInt32[] crc32Table; - private const int BUFFER_SIZE = 8192; - private UInt32 _register = 0xFFFFFFFFU; - } - - - /// - /// A Stream that calculates a CRC32 (a checksum) on all bytes read, - /// or on all bytes written. - /// - /// - /// - /// - /// This class can be used to verify the CRC of a ZipEntry when - /// reading from a stream, or to calculate a CRC when writing to a - /// stream. The stream should be used to either read, or write, but - /// not both. If you intermix reads and writes, the results are not - /// defined. - /// - /// - /// - /// This class is intended primarily for use internally by the - /// DotNetZip library. - /// - /// - public class CrcCalculatorStream : System.IO.Stream, System.IDisposable - { - private static readonly Int64 UnsetLengthLimit = -99; - - internal System.IO.Stream _innerStream; - private CRC32 _Crc32; - private Int64 _lengthLimit = -99; - private bool _leaveOpen; - - /// - /// The default constructor. - /// - /// - /// - /// Instances returned from this constructor will leave the underlying - /// stream open upon Close(). The stream uses the default CRC32 - /// algorithm, which implies a polynomial of 0xEDB88320. - /// - /// - /// The underlying stream - public CrcCalculatorStream(System.IO.Stream stream) - : this(true, CrcCalculatorStream.UnsetLengthLimit, stream, null) - { - } - - /// - /// The constructor allows the caller to specify how to handle the - /// underlying stream at close. - /// - /// - /// - /// The stream uses the default CRC32 algorithm, which implies a - /// polynomial of 0xEDB88320. - /// - /// - /// The underlying stream - /// true to leave the underlying stream - /// open upon close of the CrcCalculatorStream; false otherwise. - public CrcCalculatorStream(System.IO.Stream stream, bool leaveOpen) - : this(leaveOpen, CrcCalculatorStream.UnsetLengthLimit, stream, null) - { - } - - /// - /// A constructor allowing the specification of the length of the stream - /// to read. - /// - /// - /// - /// The stream uses the default CRC32 algorithm, which implies a - /// polynomial of 0xEDB88320. - /// - /// - /// Instances returned from this constructor will leave the underlying - /// stream open upon Close(). - /// - /// - /// The underlying stream - /// The length of the stream to slurp - public CrcCalculatorStream(System.IO.Stream stream, Int64 length) - : this(true, length, stream, null) - { - if (length < 0) - throw new ArgumentException("length"); - } - - /// - /// A constructor allowing the specification of the length of the stream - /// to read, as well as whether to keep the underlying stream open upon - /// Close(). - /// - /// - /// - /// The stream uses the default CRC32 algorithm, which implies a - /// polynomial of 0xEDB88320. - /// - /// - /// The underlying stream - /// The length of the stream to slurp - /// true to leave the underlying stream - /// open upon close of the CrcCalculatorStream; false otherwise. - public CrcCalculatorStream(System.IO.Stream stream, Int64 length, bool leaveOpen) - : this(leaveOpen, length, stream, null) - { - if (length < 0) - throw new ArgumentException("length"); - } - - /// - /// A constructor allowing the specification of the length of the stream - /// to read, as well as whether to keep the underlying stream open upon - /// Close(), and the CRC32 instance to use. - /// - /// - /// - /// The stream uses the specified CRC32 instance, which allows the - /// application to specify how the CRC gets calculated. - /// - /// - /// The underlying stream - /// The length of the stream to slurp - /// true to leave the underlying stream - /// open upon close of the CrcCalculatorStream; false otherwise. - /// the CRC32 instance to use to calculate the CRC32 - public CrcCalculatorStream(System.IO.Stream stream, Int64 length, bool leaveOpen, - CRC32 crc32) - : this(leaveOpen, length, stream, crc32) - { - if (length < 0) - throw new ArgumentException("length"); - } - - - // This ctor is private - no validation is done here. This is to allow the use - // of a (specific) negative value for the _lengthLimit, to indicate that there - // is no length set. So we validate the length limit in those ctors that use an - // explicit param, otherwise we don't validate, because it could be our special - // value. - private CrcCalculatorStream - (bool leaveOpen, Int64 length, System.IO.Stream stream, CRC32 crc32) - : base() - { - _innerStream = stream; - _Crc32 = crc32 ?? new CRC32(); - _lengthLimit = length; - _leaveOpen = leaveOpen; - } - - - /// - /// Gets the total number of bytes run through the CRC32 calculator. - /// - /// - /// - /// This is either the total number of bytes read, or the total number of - /// bytes written, depending on the direction of this stream. - /// - public Int64 TotalBytesSlurped - { - get { return _Crc32.TotalBytesRead; } - } - - /// - /// Provides the current CRC for all blocks slurped in. - /// - /// - /// - /// The running total of the CRC is kept as data is written or read - /// through the stream. read this property after all reads or writes to - /// get an accurate CRC for the entire stream. - /// - /// - public Int32 Crc - { - get { return _Crc32.Crc32Result; } - } - - /// - /// Indicates whether the underlying stream will be left open when the - /// CrcCalculatorStream is Closed. - /// - /// - /// - /// Set this at any point before calling . - /// - /// - public bool LeaveOpen - { - get { return _leaveOpen; } - set { _leaveOpen = value; } - } - - /// - /// Read from the stream - /// - /// the buffer to read - /// the offset at which to start - /// the number of bytes to read - /// the number of bytes actually read - public override int Read(byte[] buffer, int offset, int count) - { - int bytesToRead = count; - - // Need to limit the # of bytes returned, if the stream is intended to have - // a definite length. This is especially useful when returning a stream for - // the uncompressed data directly to the application. The app won't - // necessarily read only the UncompressedSize number of bytes. For example - // wrapping the stream returned from OpenReader() into a StreadReader() and - // calling ReadToEnd() on it, We can "over-read" the zip data and get a - // corrupt string. The length limits that, prevents that problem. - - if (_lengthLimit != CrcCalculatorStream.UnsetLengthLimit) - { - if (_Crc32.TotalBytesRead >= _lengthLimit) return 0; // EOF - Int64 bytesRemaining = _lengthLimit - _Crc32.TotalBytesRead; - if (bytesRemaining < count) bytesToRead = (int)bytesRemaining; - } - int n = _innerStream.Read(buffer, offset, bytesToRead); - if (n > 0) _Crc32.SlurpBlock(buffer, offset, n); - return n; - } - - /// - /// Write to the stream. - /// - /// the buffer from which to write - /// the offset at which to start writing - /// the number of bytes to write - public override void Write(byte[] buffer, int offset, int count) - { - if (count > 0) _Crc32.SlurpBlock(buffer, offset, count); - _innerStream.Write(buffer, offset, count); - } - - /// - /// Indicates whether the stream supports reading. - /// - public override bool CanRead - { - get { return _innerStream.CanRead; } - } - - /// - /// Indicates whether the stream supports seeking. - /// - /// - /// - /// Always returns false. - /// - /// - public override bool CanSeek - { - get { return false; } - } - - /// - /// Indicates whether the stream supports writing. - /// - public override bool CanWrite - { - get { return _innerStream.CanWrite; } - } - - /// - /// Flush the stream. - /// - public override void Flush() - { - _innerStream.Flush(); - } - - /// - /// Returns the length of the underlying stream. - /// - public override long Length - { - get - { - if (_lengthLimit == CrcCalculatorStream.UnsetLengthLimit) - return _innerStream.Length; - else return _lengthLimit; - } - } - - /// - /// The getter for this property returns the total bytes read. - /// If you use the setter, it will throw - /// . - /// - public override long Position - { - get { return _Crc32.TotalBytesRead; } - set { throw new NotSupportedException(); } - } - - /// - /// Seeking is not supported on this stream. This method always throws - /// - /// - /// N/A - /// N/A - /// N/A - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - throw new NotSupportedException(); - } - - /// - /// This method always throws - /// - /// - /// N/A - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - - void IDisposable.Dispose() - { - Close(); - } - - /// - /// Closes the stream. - /// - public override void Close() - { - base.Close(); - if (!_leaveOpen) - _innerStream.Close(); - } - - } - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs.meta deleted file mode 100755 index 0dcb9294..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/CRC32.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e9dc86cc59fba3146927bf0713d12495 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs deleted file mode 100755 index 3e69e9cb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs +++ /dev/null @@ -1,1881 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// Deflate.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2011-August-03 19:52:15> -// -// ------------------------------------------------------------------ -// -// This module defines logic for handling the Deflate or compression. -// -// This code is based on multiple sources: -// - the original zlib v1.2.3 source, which is Copyright (C) 1995-2005 Jean-loup Gailly. -// - the original jzlib, which is Copyright (c) 2000-2003 ymnk, JCraft,Inc. -// -// However, this code is significantly different from both. -// The object model is not the same, and many of the behaviors are different. -// -// In keeping with the license for these other works, the copyrights for -// jzlib and zlib are here. -// -// ----------------------------------------------------------------------- -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - -using System; - -namespace Ionic.Zlib -{ - - internal enum BlockState - { - NeedMore = 0, // block not completed, need more input or more output - BlockDone, // block flush performed - FinishStarted, // finish started, need only more output at next deflate - FinishDone // finish done, accept no more input or output - } - - internal enum DeflateFlavor - { - Store, - Fast, - Slow - } - - internal sealed class DeflateManager - { - private static readonly int MEM_LEVEL_MAX = 9; - private static readonly int MEM_LEVEL_DEFAULT = 8; - - internal delegate BlockState CompressFunc(FlushType flush); - - internal class Config - { - // Use a faster search when the previous match is longer than this - internal int GoodLength; // reduce lazy search above this match length - - // Attempt to find a better match only when the current match is - // strictly smaller than this value. This mechanism is used only for - // compression levels >= 4. For levels 1,2,3: MaxLazy is actually - // MaxInsertLength. (See DeflateFast) - - internal int MaxLazy; // do not perform lazy search above this match length - - internal int NiceLength; // quit search above this match length - - // To speed up deflation, hash chains are never searched beyond this - // length. A higher limit improves compression ratio but degrades the speed. - - internal int MaxChainLength; - - internal DeflateFlavor Flavor; - - private Config(int goodLength, int maxLazy, int niceLength, int maxChainLength, DeflateFlavor flavor) - { - this.GoodLength = goodLength; - this.MaxLazy = maxLazy; - this.NiceLength = niceLength; - this.MaxChainLength = maxChainLength; - this.Flavor = flavor; - } - - public static Config Lookup(CompressionLevel level) - { - return Table[(int)level]; - } - - - static Config() - { - Table = new Config[] { - new Config(0, 0, 0, 0, DeflateFlavor.Store), - new Config(4, 4, 8, 4, DeflateFlavor.Fast), - new Config(4, 5, 16, 8, DeflateFlavor.Fast), - new Config(4, 6, 32, 32, DeflateFlavor.Fast), - - new Config(4, 4, 16, 16, DeflateFlavor.Slow), - new Config(8, 16, 32, 32, DeflateFlavor.Slow), - new Config(8, 16, 128, 128, DeflateFlavor.Slow), - new Config(8, 32, 128, 256, DeflateFlavor.Slow), - new Config(32, 128, 258, 1024, DeflateFlavor.Slow), - new Config(32, 258, 258, 4096, DeflateFlavor.Slow), - }; - } - - private static readonly Config[] Table; - } - - - private CompressFunc DeflateFunction; - - private static readonly System.String[] _ErrorMessage = new System.String[] - { - "need dictionary", - "stream end", - "", - "file error", - "stream error", - "data error", - "insufficient memory", - "buffer error", - "incompatible version", - "" - }; - - // preset dictionary flag in zlib header - private static readonly int PRESET_DICT = 0x20; - - private static readonly int INIT_STATE = 42; - private static readonly int BUSY_STATE = 113; - private static readonly int FINISH_STATE = 666; - - // The deflate compression method - private static readonly int Z_DEFLATED = 8; - - private static readonly int STORED_BLOCK = 0; - private static readonly int STATIC_TREES = 1; - private static readonly int DYN_TREES = 2; - - // The three kinds of block type - private static readonly int Z_BINARY = 0; - private static readonly int Z_ASCII = 1; - private static readonly int Z_UNKNOWN = 2; - - private static readonly int Buf_size = 8 * 2; - - private static readonly int MIN_MATCH = 3; - private static readonly int MAX_MATCH = 258; - - private static readonly int MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); - - private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); - - private static readonly int END_BLOCK = 256; - - internal ZlibCodec _codec; // the zlib encoder/decoder - internal int status; // as the name implies - internal byte[] pending; // output still pending - waiting to be compressed - internal int nextPending; // index of next pending byte to output to the stream - internal int pendingCount; // number of bytes in the pending buffer - - internal sbyte data_type; // UNKNOWN, BINARY or ASCII - internal int last_flush; // value of flush param for previous deflate call - - internal int w_size; // LZ77 window size (32K by default) - internal int w_bits; // log2(w_size) (8..16) - internal int w_mask; // w_size - 1 - - //internal byte[] dictionary; - internal byte[] window; - - // Sliding window. Input bytes are read into the second half of the window, - // and move to the first half later to keep a dictionary of at least wSize - // bytes. With this organization, matches are limited to a distance of - // wSize-MAX_MATCH bytes, but this ensures that IO is always - // performed with a length multiple of the block size. - // - // To do: use the user input buffer as sliding window. - - internal int window_size; - // Actual size of window: 2*wSize, except when the user input buffer - // is directly used as sliding window. - - internal short[] prev; - // Link to older string with same hash index. To limit the size of this - // array to 64K, this link is maintained only for the last 32K strings. - // An index in this array is thus a window index modulo 32K. - - internal short[] head; // Heads of the hash chains or NIL. - - internal int ins_h; // hash index of string to be inserted - internal int hash_size; // number of elements in hash table - internal int hash_bits; // log2(hash_size) - internal int hash_mask; // hash_size-1 - - // Number of bits by which ins_h must be shifted at each input - // step. It must be such that after MIN_MATCH steps, the oldest - // byte no longer takes part in the hash key, that is: - // hash_shift * MIN_MATCH >= hash_bits - internal int hash_shift; - - // Window position at the beginning of the current output block. Gets - // negative when the window is moved backwards. - - internal int block_start; - - Config config; - internal int match_length; // length of best match - internal int prev_match; // previous match - internal int match_available; // set if previous match exists - internal int strstart; // start of string to insert into.....???? - internal int match_start; // start of matching string - internal int lookahead; // number of valid bytes ahead in window - - // Length of the best match at previous step. Matches not greater than this - // are discarded. This is used in the lazy match evaluation. - internal int prev_length; - - // Insert new strings in the hash table only if the match length is not - // greater than this length. This saves time but degrades compression. - // max_insert_length is used only for compression levels <= 3. - - internal CompressionLevel compressionLevel; // compression level (1..9) - internal CompressionStrategy compressionStrategy; // favor or force Huffman coding - - - internal short[] dyn_ltree; // literal and length tree - internal short[] dyn_dtree; // distance tree - internal short[] bl_tree; // Huffman tree for bit lengths - - internal ZTree treeLiterals = new ZTree(); // desc for literal tree - internal ZTree treeDistances = new ZTree(); // desc for distance tree - internal ZTree treeBitLengths = new ZTree(); // desc for bit length tree - - // number of codes at each bit length for an optimal tree - internal short[] bl_count = new short[InternalConstants.MAX_BITS + 1]; - - // heap used to build the Huffman trees - internal int[] heap = new int[2 * InternalConstants.L_CODES + 1]; - - internal int heap_len; // number of elements in the heap - internal int heap_max; // element of largest frequency - - // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - // The same heap array is used to build all trees. - - // Depth of each subtree used as tie breaker for trees of equal frequency - internal sbyte[] depth = new sbyte[2 * InternalConstants.L_CODES + 1]; - - internal int _lengthOffset; // index for literals or lengths - - - // Size of match buffer for literals/lengths. There are 4 reasons for - // limiting lit_bufsize to 64K: - // - frequencies can be kept in 16 bit counters - // - if compression is not successful for the first block, all input - // data is still in the window so we can still emit a stored block even - // when input comes from standard input. (This can also be done for - // all blocks if lit_bufsize is not greater than 32K.) - // - if compression is not successful for a file smaller than 64K, we can - // even emit a stored file instead of a stored block (saving 5 bytes). - // This is applicable only for zip (not gzip or zlib). - // - creating new Huffman trees less frequently may not provide fast - // adaptation to changes in the input data statistics. (Take for - // example a binary file with poorly compressible code followed by - // a highly compressible string table.) Smaller buffer sizes give - // fast adaptation but have of course the overhead of transmitting - // trees more frequently. - - internal int lit_bufsize; - - internal int last_lit; // running index in l_buf - - // Buffer for distances. To simplify the code, d_buf and l_buf have - // the same number of elements. To use different lengths, an extra flag - // array would be necessary. - - internal int _distanceOffset; // index into pending; points to distance data?? - - internal int opt_len; // bit length of current block with optimal trees - internal int static_len; // bit length of current block with static trees - internal int matches; // number of string matches in current block - internal int last_eob_len; // bit length of EOB code for last block - - // Output buffer. bits are inserted starting at the bottom (least - // significant bits). - internal short bi_buf; - - // Number of valid bits in bi_buf. All bits above the last valid bit - // are always zero. - internal int bi_valid; - - - internal DeflateManager() - { - dyn_ltree = new short[HEAP_SIZE * 2]; - dyn_dtree = new short[(2 * InternalConstants.D_CODES + 1) * 2]; // distance tree - bl_tree = new short[(2 * InternalConstants.BL_CODES + 1) * 2]; // Huffman tree for bit lengths - } - - - // lm_init - private void _InitializeLazyMatch() - { - window_size = 2 * w_size; - - // clear the hash - workitem 9063 - Array.Clear(head, 0, hash_size); - //for (int i = 0; i < hash_size; i++) head[i] = 0; - - config = Config.Lookup(compressionLevel); - SetDeflater(); - - strstart = 0; - block_start = 0; - lookahead = 0; - match_length = prev_length = MIN_MATCH - 1; - match_available = 0; - ins_h = 0; - } - - // Initialize the tree data structures for a new zlib stream. - private void _InitializeTreeData() - { - treeLiterals.dyn_tree = dyn_ltree; - treeLiterals.staticTree = StaticTree.Literals; - - treeDistances.dyn_tree = dyn_dtree; - treeDistances.staticTree = StaticTree.Distances; - - treeBitLengths.dyn_tree = bl_tree; - treeBitLengths.staticTree = StaticTree.BitLengths; - - bi_buf = 0; - bi_valid = 0; - last_eob_len = 8; // enough lookahead for inflate - - // Initialize the first block of the first file: - _InitializeBlocks(); - } - - internal void _InitializeBlocks() - { - // Initialize the trees. - for (int i = 0; i < InternalConstants.L_CODES; i++) - dyn_ltree[i * 2] = 0; - for (int i = 0; i < InternalConstants.D_CODES; i++) - dyn_dtree[i * 2] = 0; - for (int i = 0; i < InternalConstants.BL_CODES; i++) - bl_tree[i * 2] = 0; - - dyn_ltree[END_BLOCK * 2] = 1; - opt_len = static_len = 0; - last_lit = matches = 0; - } - - // Restore the heap property by moving down the tree starting at node k, - // exchanging a node with the smallest of its two sons if necessary, stopping - // when the heap property is re-established (each father smaller than its - // two sons). - internal void pqdownheap(short[] tree, int k) - { - int v = heap[k]; - int j = k << 1; // left son of k - while (j <= heap_len) - { - // Set j to the smallest of the two sons: - if (j < heap_len && _IsSmaller(tree, heap[j + 1], heap[j], depth)) - { - j++; - } - // Exit if v is smaller than both sons - if (_IsSmaller(tree, v, heap[j], depth)) - break; - - // Exchange v with the smallest son - heap[k] = heap[j]; k = j; - // And continue down the tree, setting j to the left son of k - j <<= 1; - } - heap[k] = v; - } - - internal static bool _IsSmaller(short[] tree, int n, int m, sbyte[] depth) - { - short tn2 = tree[n * 2]; - short tm2 = tree[m * 2]; - return (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m])); - } - - - // Scan a literal or distance tree to determine the frequencies of the codes - // in the bit length tree. - internal void scan_tree(short[] tree, int max_code) - { - int n; // iterates over all tree elements - int prevlen = -1; // last emitted length - int curlen; // length of current code - int nextlen = (int)tree[0 * 2 + 1]; // length of next code - int count = 0; // repeat count of the current code - int max_count = 7; // max repeat count - int min_count = 4; // min repeat count - - if (nextlen == 0) - { - max_count = 138; min_count = 3; - } - tree[(max_code + 1) * 2 + 1] = (short)0x7fff; // guard //?? - - for (n = 0; n <= max_code; n++) - { - curlen = nextlen; nextlen = (int)tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen == nextlen) - { - continue; - } - else if (count < min_count) - { - bl_tree[curlen * 2] = (short)(bl_tree[curlen * 2] + count); - } - else if (curlen != 0) - { - if (curlen != prevlen) - bl_tree[curlen * 2]++; - bl_tree[InternalConstants.REP_3_6 * 2]++; - } - else if (count <= 10) - { - bl_tree[InternalConstants.REPZ_3_10 * 2]++; - } - else - { - bl_tree[InternalConstants.REPZ_11_138 * 2]++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) - { - max_count = 138; min_count = 3; - } - else if (curlen == nextlen) - { - max_count = 6; min_count = 3; - } - else - { - max_count = 7; min_count = 4; - } - } - } - - // Construct the Huffman tree for the bit lengths and return the index in - // bl_order of the last bit length code to send. - internal int build_bl_tree() - { - int max_blindex; // index of last bit length code of non zero freq - - // Determine the bit length frequencies for literal and distance trees - scan_tree(dyn_ltree, treeLiterals.max_code); - scan_tree(dyn_dtree, treeDistances.max_code); - - // Build the bit length tree: - treeBitLengths.build_tree(this); - // opt_len now includes the length of the tree representations, except - // the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - - // Determine the number of bit length codes to send. The pkzip format - // requires that at least 4 bit length codes be sent. (appnote.txt says - // 3 but the actual value used is 4.) - for (max_blindex = InternalConstants.BL_CODES - 1; max_blindex >= 3; max_blindex--) - { - if (bl_tree[ZTree.bl_order[max_blindex] * 2 + 1] != 0) - break; - } - // Update opt_len to include the bit length tree and counts - opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - - return max_blindex; - } - - - // Send the header for a block using dynamic Huffman trees: the counts, the - // lengths of the bit length codes, the literal tree and the distance tree. - // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - internal void send_all_trees(int lcodes, int dcodes, int blcodes) - { - int rank; // index in bl_order - - send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt - send_bits(dcodes - 1, 5); - send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt - for (rank = 0; rank < blcodes; rank++) - { - send_bits(bl_tree[ZTree.bl_order[rank] * 2 + 1], 3); - } - send_tree(dyn_ltree, lcodes - 1); // literal tree - send_tree(dyn_dtree, dcodes - 1); // distance tree - } - - // Send a literal or distance tree in compressed form, using the codes in - // bl_tree. - internal void send_tree(short[] tree, int max_code) - { - int n; // iterates over all tree elements - int prevlen = -1; // last emitted length - int curlen; // length of current code - int nextlen = tree[0 * 2 + 1]; // length of next code - int count = 0; // repeat count of the current code - int max_count = 7; // max repeat count - int min_count = 4; // min repeat count - - if (nextlen == 0) - { - max_count = 138; min_count = 3; - } - - for (n = 0; n <= max_code; n++) - { - curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen == nextlen) - { - continue; - } - else if (count < min_count) - { - do - { - send_code(curlen, bl_tree); - } - while (--count != 0); - } - else if (curlen != 0) - { - if (curlen != prevlen) - { - send_code(curlen, bl_tree); count--; - } - send_code(InternalConstants.REP_3_6, bl_tree); - send_bits(count - 3, 2); - } - else if (count <= 10) - { - send_code(InternalConstants.REPZ_3_10, bl_tree); - send_bits(count - 3, 3); - } - else - { - send_code(InternalConstants.REPZ_11_138, bl_tree); - send_bits(count - 11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) - { - max_count = 138; min_count = 3; - } - else if (curlen == nextlen) - { - max_count = 6; min_count = 3; - } - else - { - max_count = 7; min_count = 4; - } - } - } - - // Output a block of bytes on the stream. - // IN assertion: there is enough room in pending_buf. - private void put_bytes(byte[] p, int start, int len) - { - Array.Copy(p, start, pending, pendingCount, len); - pendingCount += len; - } - -#if NOTNEEDED - private void put_byte(byte c) - { - pending[pendingCount++] = c; - } - internal void put_short(int b) - { - unchecked - { - pending[pendingCount++] = (byte)b; - pending[pendingCount++] = (byte)(b >> 8); - } - } - internal void putShortMSB(int b) - { - unchecked - { - pending[pendingCount++] = (byte)(b >> 8); - pending[pendingCount++] = (byte)b; - } - } -#endif - - internal void send_code(int c, short[] tree) - { - int c2 = c * 2; - send_bits((tree[c2] & 0xffff), (tree[c2 + 1] & 0xffff)); - } - - internal void send_bits(int value, int length) - { - int len = length; - unchecked - { - if (bi_valid > (int)Buf_size - len) - { - //int val = value; - // bi_buf |= (val << bi_valid); - - bi_buf |= (short)((value << bi_valid) & 0xffff); - //put_short(bi_buf); - pending[pendingCount++] = (byte)bi_buf; - pending[pendingCount++] = (byte)(bi_buf >> 8); - - - bi_buf = (short)((uint)value >> (Buf_size - bi_valid)); - bi_valid += len - Buf_size; - } - else - { - // bi_buf |= (value) << bi_valid; - bi_buf |= (short)((value << bi_valid) & 0xffff); - bi_valid += len; - } - } - } - - // Send one empty static block to give enough lookahead for inflate. - // This takes 10 bits, of which 7 may remain in the bit buffer. - // The current inflate code requires 9 bits of lookahead. If the - // last two codes for the previous block (real code plus EOB) were coded - // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode - // the last real code. In this case we send two empty static blocks instead - // of one. (There are no problems if the previous block is stored or fixed.) - // To simplify the code, we assume the worst case of last real code encoded - // on one bit only. - internal void _tr_align() - { - send_bits(STATIC_TREES << 1, 3); - send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); - - bi_flush(); - - // Of the 10 bits for the empty block, we have already sent - // (10 - bi_valid) bits. The lookahead for the last real code (before - // the EOB of the previous block) was thus at least one plus the length - // of the EOB plus what we have just sent of the empty static block. - if (1 + last_eob_len + 10 - bi_valid < 9) - { - send_bits(STATIC_TREES << 1, 3); - send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); - bi_flush(); - } - last_eob_len = 7; - } - - - // Save the match info and tally the frequency counts. Return true if - // the current block must be flushed. - internal bool _tr_tally(int dist, int lc) - { - pending[_distanceOffset + last_lit * 2] = unchecked((byte) ( (uint)dist >> 8 ) ); - pending[_distanceOffset + last_lit * 2 + 1] = unchecked((byte)dist); - pending[_lengthOffset + last_lit] = unchecked((byte)lc); - last_lit++; - - if (dist == 0) - { - // lc is the unmatched char - dyn_ltree[lc * 2]++; - } - else - { - matches++; - // Here, lc is the match length - MIN_MATCH - dist--; // dist = match distance - 1 - dyn_ltree[(ZTree.LengthCode[lc] + InternalConstants.LITERALS + 1) * 2]++; - dyn_dtree[ZTree.DistanceCode(dist) * 2]++; - } - - if ((last_lit & 0x1fff) == 0 && (int)compressionLevel > 2) - { - // Compute an upper bound for the compressed length - int out_length = last_lit << 3; - int in_length = strstart - block_start; - int dcode; - for (dcode = 0; dcode < InternalConstants.D_CODES; dcode++) - { - out_length = (int)(out_length + (int)dyn_dtree[dcode * 2] * (5L + ZTree.ExtraDistanceBits[dcode])); - } - out_length >>= 3; - if ((matches < (last_lit / 2)) && out_length < in_length / 2) - return true; - } - - return (last_lit == lit_bufsize - 1) || (last_lit == lit_bufsize); - // dinoch - wraparound? - // We avoid equality with lit_bufsize because of wraparound at 64K - // on 16 bit machines and because stored blocks are restricted to - // 64K-1 bytes. - } - - - - // Send the block data compressed using the given Huffman trees - internal void send_compressed_block(short[] ltree, short[] dtree) - { - int distance; // distance of matched string - int lc; // match length or unmatched char (if dist == 0) - int lx = 0; // running index in l_buf - int code; // the code to send - int extra; // number of extra bits to send - - if (last_lit != 0) - { - do - { - int ix = _distanceOffset + lx * 2; - distance = ((pending[ix] << 8) & 0xff00) | - (pending[ix + 1] & 0xff); - lc = (pending[_lengthOffset + lx]) & 0xff; - lx++; - - if (distance == 0) - { - send_code(lc, ltree); // send a literal byte - } - else - { - // literal or match pair - // Here, lc is the match length - MIN_MATCH - code = ZTree.LengthCode[lc]; - - // send the length code - send_code(code + InternalConstants.LITERALS + 1, ltree); - extra = ZTree.ExtraLengthBits[code]; - if (extra != 0) - { - // send the extra length bits - lc -= ZTree.LengthBase[code]; - send_bits(lc, extra); - } - distance--; // dist is now the match distance - 1 - code = ZTree.DistanceCode(distance); - - // send the distance code - send_code(code, dtree); - - extra = ZTree.ExtraDistanceBits[code]; - if (extra != 0) - { - // send the extra distance bits - distance -= ZTree.DistanceBase[code]; - send_bits(distance, extra); - } - } - - // Check that the overlay between pending and d_buf+l_buf is ok: - } - while (lx < last_lit); - } - - send_code(END_BLOCK, ltree); - last_eob_len = ltree[END_BLOCK * 2 + 1]; - } - - - - // Set the data type to ASCII or BINARY, using a crude approximation: - // binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. - // IN assertion: the fields freq of dyn_ltree are set and the total of all - // frequencies does not exceed 64K (to fit in an int on 16 bit machines). - internal void set_data_type() - { - int n = 0; - int ascii_freq = 0; - int bin_freq = 0; - while (n < 7) - { - bin_freq += dyn_ltree[n * 2]; n++; - } - while (n < 128) - { - ascii_freq += dyn_ltree[n * 2]; n++; - } - while (n < InternalConstants.LITERALS) - { - bin_freq += dyn_ltree[n * 2]; n++; - } - data_type = (sbyte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); - } - - - - // Flush the bit buffer, keeping at most 7 bits in it. - internal void bi_flush() - { - if (bi_valid == 16) - { - pending[pendingCount++] = (byte)bi_buf; - pending[pendingCount++] = (byte)(bi_buf >> 8); - bi_buf = 0; - bi_valid = 0; - } - else if (bi_valid >= 8) - { - //put_byte((byte)bi_buf); - pending[pendingCount++] = (byte)bi_buf; - bi_buf >>= 8; - bi_valid -= 8; - } - } - - // Flush the bit buffer and align the output on a byte boundary - internal void bi_windup() - { - if (bi_valid > 8) - { - pending[pendingCount++] = (byte)bi_buf; - pending[pendingCount++] = (byte)(bi_buf >> 8); - } - else if (bi_valid > 0) - { - //put_byte((byte)bi_buf); - pending[pendingCount++] = (byte)bi_buf; - } - bi_buf = 0; - bi_valid = 0; - } - - // Copy a stored block, storing first the length and its - // one's complement if requested. - internal void copy_block(int buf, int len, bool header) - { - bi_windup(); // align on byte boundary - last_eob_len = 8; // enough lookahead for inflate - - if (header) - unchecked - { - //put_short((short)len); - pending[pendingCount++] = (byte)len; - pending[pendingCount++] = (byte)(len >> 8); - //put_short((short)~len); - pending[pendingCount++] = (byte)~len; - pending[pendingCount++] = (byte)(~len >> 8); - } - - put_bytes(window, buf, len); - } - - internal void flush_block_only(bool eof) - { - _tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof); - block_start = strstart; - _codec.flush_pending(); - } - - // Copy without compression as much as possible from the input stream, return - // the current block state. - // This function does not insert new strings in the dictionary since - // uncompressible data is probably not useful. This function is used - // only for the level=0 compression option. - // NOTE: this function should be optimized to avoid extra copying from - // window to pending_buf. - internal BlockState DeflateNone(FlushType flush) - { - // Stored blocks are limited to 0xffff bytes, pending is limited - // to pending_buf_size, and each stored block has a 5 byte header: - - int max_block_size = 0xffff; - int max_start; - - if (max_block_size > pending.Length - 5) - { - max_block_size = pending.Length - 5; - } - - // Copy as much as possible from input to output: - while (true) - { - // Fill the window as much as possible: - if (lookahead <= 1) - { - _fillWindow(); - if (lookahead == 0 && flush == FlushType.None) - return BlockState.NeedMore; - if (lookahead == 0) - break; // flush the current block - } - - strstart += lookahead; - lookahead = 0; - - // Emit a stored block if pending will be full: - max_start = block_start + max_block_size; - if (strstart == 0 || strstart >= max_start) - { - // strstart == 0 is possible when wraparound on 16-bit machine - lookahead = (int)(strstart - max_start); - strstart = (int)max_start; - - flush_block_only(false); - if (_codec.AvailableBytesOut == 0) - return BlockState.NeedMore; - } - - // Flush if we may have to slide, otherwise block_start may become - // negative and the data will be gone: - if (strstart - block_start >= w_size - MIN_LOOKAHEAD) - { - flush_block_only(false); - if (_codec.AvailableBytesOut == 0) - return BlockState.NeedMore; - } - } - - flush_block_only(flush == FlushType.Finish); - if (_codec.AvailableBytesOut == 0) - return (flush == FlushType.Finish) ? BlockState.FinishStarted : BlockState.NeedMore; - - return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; - } - - - // Send a stored block - internal void _tr_stored_block(int buf, int stored_len, bool eof) - { - send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type - copy_block(buf, stored_len, true); // with header - } - - // Determine the best encoding for the current block: dynamic trees, static - // trees or store, and output the encoded block to the zip file. - internal void _tr_flush_block(int buf, int stored_len, bool eof) - { - int opt_lenb, static_lenb; // opt_len and static_len in bytes - int max_blindex = 0; // index of last bit length code of non zero freq - - // Build the Huffman trees unless a stored block is forced - if (compressionLevel > 0) - { - // Check if the file is ascii or binary - if (data_type == Z_UNKNOWN) - set_data_type(); - - // Construct the literal and distance trees - treeLiterals.build_tree(this); - - treeDistances.build_tree(this); - - // At this point, opt_len and static_len are the total bit lengths of - // the compressed block data, excluding the tree representations. - - // Build the bit length tree for the above two trees, and get the index - // in bl_order of the last bit length code to send. - max_blindex = build_bl_tree(); - - // Determine the best encoding. Compute first the block length in bytes - opt_lenb = (opt_len + 3 + 7) >> 3; - static_lenb = (static_len + 3 + 7) >> 3; - - if (static_lenb <= opt_lenb) - opt_lenb = static_lenb; - } - else - { - opt_lenb = static_lenb = stored_len + 5; // force a stored block - } - - if (stored_len + 4 <= opt_lenb && buf != -1) - { - // 4: two words for the lengths - // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - // Otherwise we can't have processed more than WSIZE input bytes since - // the last block flush, because compression would have been - // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - // transform a block into a stored block. - _tr_stored_block(buf, stored_len, eof); - } - else if (static_lenb == opt_lenb) - { - send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3); - send_compressed_block(StaticTree.lengthAndLiteralsTreeCodes, StaticTree.distTreeCodes); - } - else - { - send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3); - send_all_trees(treeLiterals.max_code + 1, treeDistances.max_code + 1, max_blindex + 1); - send_compressed_block(dyn_ltree, dyn_dtree); - } - - // The above check is made mod 2^32, for files larger than 512 MB - // and uLong implemented on 32 bits. - - _InitializeBlocks(); - - if (eof) - { - bi_windup(); - } - } - - // Fill the window when the lookahead becomes insufficient. - // Updates strstart and lookahead. - // - // IN assertion: lookahead < MIN_LOOKAHEAD - // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - // At least one byte has been read, or avail_in == 0; reads are - // performed for at least two bytes (required for the zip translate_eol - // option -- not supported here). - private void _fillWindow() - { - int n, m; - int p; - int more; // Amount of free space at the end of the window. - - do - { - more = (window_size - lookahead - strstart); - - // Deal with !@#$% 64K limit: - if (more == 0 && strstart == 0 && lookahead == 0) - { - more = w_size; - } - else if (more == -1) - { - // Very unlikely, but possible on 16 bit machine if strstart == 0 - // and lookahead == 1 (input done one byte at time) - more--; - - // If the window is almost full and there is insufficient lookahead, - // move the upper half to the lower one to make room in the upper half. - } - else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) - { - Array.Copy(window, w_size, window, 0, w_size); - match_start -= w_size; - strstart -= w_size; // we now have strstart >= MAX_DIST - block_start -= w_size; - - // Slide the hash table (could be avoided with 32 bit values - // at the expense of memory usage). We slide even when level == 0 - // to keep the hash table consistent if we switch back to level > 0 - // later. (Using level 0 permanently is not an optimal usage of - // zlib, so we don't care about this pathological case.) - - n = hash_size; - p = n; - do - { - m = (head[--p] & 0xffff); - head[p] = (short)((m >= w_size) ? (m - w_size) : 0); - } - while (--n != 0); - - n = w_size; - p = n; - do - { - m = (prev[--p] & 0xffff); - prev[p] = (short)((m >= w_size) ? (m - w_size) : 0); - // If n is not on any hash chain, prev[n] is garbage but - // its value will never be used. - } - while (--n != 0); - more += w_size; - } - - if (_codec.AvailableBytesIn == 0) - return; - - // If there was no sliding: - // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - // more == window_size - lookahead - strstart - // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - // => more >= window_size - 2*WSIZE + 2 - // In the BIG_MEM or MMAP case (not yet supported), - // window_size == input_size + MIN_LOOKAHEAD && - // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - // Otherwise, window_size == 2*WSIZE so more >= 2. - // If there was sliding, more >= WSIZE. So in all cases, more >= 2. - - n = _codec.read_buf(window, strstart + lookahead, more); - lookahead += n; - - // Initialize the hash value now that we have some input: - if (lookahead >= MIN_MATCH) - { - ins_h = window[strstart] & 0xff; - ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; - } - // If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - // but this is not important since only literal bytes will be emitted. - } - while (lookahead < MIN_LOOKAHEAD && _codec.AvailableBytesIn != 0); - } - - // Compress as much as possible from the input stream, return the current - // block state. - // This function does not perform lazy evaluation of matches and inserts - // new strings in the dictionary only for unmatched strings or for short - // matches. It is used only for the fast compression options. - internal BlockState DeflateFast(FlushType flush) - { - // short hash_head = 0; // head of the hash chain - int hash_head = 0; // head of the hash chain - bool bflush; // set if current block must be flushed - - while (true) - { - // Make sure that we always have enough lookahead, except - // at the end of the input file. We need MAX_MATCH bytes - // for the next match, plus MIN_MATCH bytes to insert the - // string following the next match. - if (lookahead < MIN_LOOKAHEAD) - { - _fillWindow(); - if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) - { - return BlockState.NeedMore; - } - if (lookahead == 0) - break; // flush the current block - } - - // Insert the string window[strstart .. strstart+2] in the - // dictionary, and set hash_head to the head of the hash chain: - if (lookahead >= MIN_MATCH) - { - ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; - - // prev[strstart&w_mask]=hash_head=head[ins_h]; - hash_head = (head[ins_h] & 0xffff); - prev[strstart & w_mask] = head[ins_h]; - head[ins_h] = unchecked((short)strstart); - } - - // Find the longest match, discarding those <= prev_length. - // At this point we have always match_length < MIN_MATCH - - if (hash_head != 0L && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) - { - // To simplify the code, we prevent matches with the string - // of window index 0 (in particular we have to avoid a match - // of the string with itself at the start of the input file). - if (compressionStrategy != CompressionStrategy.HuffmanOnly) - { - match_length = longest_match(hash_head); - } - // longest_match() sets match_start - } - if (match_length >= MIN_MATCH) - { - // check_match(strstart, match_start, match_length); - - bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH); - - lookahead -= match_length; - - // Insert new strings in the hash table only if the match length - // is not too large. This saves time but degrades compression. - if (match_length <= config.MaxLazy && lookahead >= MIN_MATCH) - { - match_length--; // string at strstart already in hash table - do - { - strstart++; - - ins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; - // prev[strstart&w_mask]=hash_head=head[ins_h]; - hash_head = (head[ins_h] & 0xffff); - prev[strstart & w_mask] = head[ins_h]; - head[ins_h] = unchecked((short)strstart); - - // strstart never exceeds WSIZE-MAX_MATCH, so there are - // always MIN_MATCH bytes ahead. - } - while (--match_length != 0); - strstart++; - } - else - { - strstart += match_length; - match_length = 0; - ins_h = window[strstart] & 0xff; - - ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; - // If lookahead < MIN_MATCH, ins_h is garbage, but it does not - // matter since it will be recomputed at next deflate call. - } - } - else - { - // No match, output a literal byte - - bflush = _tr_tally(0, window[strstart] & 0xff); - lookahead--; - strstart++; - } - if (bflush) - { - flush_block_only(false); - if (_codec.AvailableBytesOut == 0) - return BlockState.NeedMore; - } - } - - flush_block_only(flush == FlushType.Finish); - if (_codec.AvailableBytesOut == 0) - { - if (flush == FlushType.Finish) - return BlockState.FinishStarted; - else - return BlockState.NeedMore; - } - return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; - } - - // Same as above, but achieves better compression. We use a lazy - // evaluation for matches: a match is finally adopted only if there is - // no better match at the next window position. - internal BlockState DeflateSlow(FlushType flush) - { - // short hash_head = 0; // head of hash chain - int hash_head = 0; // head of hash chain - bool bflush; // set if current block must be flushed - - // Process the input block. - while (true) - { - // Make sure that we always have enough lookahead, except - // at the end of the input file. We need MAX_MATCH bytes - // for the next match, plus MIN_MATCH bytes to insert the - // string following the next match. - - if (lookahead < MIN_LOOKAHEAD) - { - _fillWindow(); - if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) - return BlockState.NeedMore; - - if (lookahead == 0) - break; // flush the current block - } - - // Insert the string window[strstart .. strstart+2] in the - // dictionary, and set hash_head to the head of the hash chain: - - if (lookahead >= MIN_MATCH) - { - ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; - // prev[strstart&w_mask]=hash_head=head[ins_h]; - hash_head = (head[ins_h] & 0xffff); - prev[strstart & w_mask] = head[ins_h]; - head[ins_h] = unchecked((short)strstart); - } - - // Find the longest match, discarding those <= prev_length. - prev_length = match_length; - prev_match = match_start; - match_length = MIN_MATCH - 1; - - if (hash_head != 0 && prev_length < config.MaxLazy && - ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) - { - // To simplify the code, we prevent matches with the string - // of window index 0 (in particular we have to avoid a match - // of the string with itself at the start of the input file). - - if (compressionStrategy != CompressionStrategy.HuffmanOnly) - { - match_length = longest_match(hash_head); - } - // longest_match() sets match_start - - if (match_length <= 5 && (compressionStrategy == CompressionStrategy.Filtered || - (match_length == MIN_MATCH && strstart - match_start > 4096))) - { - - // If prev_match is also MIN_MATCH, match_start is garbage - // but we will ignore the current match anyway. - match_length = MIN_MATCH - 1; - } - } - - // If there was a match at the previous step and the current - // match is not better, output the previous match: - if (prev_length >= MIN_MATCH && match_length <= prev_length) - { - int max_insert = strstart + lookahead - MIN_MATCH; - // Do not insert strings in hash table beyond this. - - // check_match(strstart-1, prev_match, prev_length); - - bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); - - // Insert in hash table all strings up to the end of the match. - // strstart-1 and strstart are already inserted. If there is not - // enough lookahead, the last two strings are not inserted in - // the hash table. - lookahead -= (prev_length - 1); - prev_length -= 2; - do - { - if (++strstart <= max_insert) - { - ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; - //prev[strstart&w_mask]=hash_head=head[ins_h]; - hash_head = (head[ins_h] & 0xffff); - prev[strstart & w_mask] = head[ins_h]; - head[ins_h] = unchecked((short)strstart); - } - } - while (--prev_length != 0); - match_available = 0; - match_length = MIN_MATCH - 1; - strstart++; - - if (bflush) - { - flush_block_only(false); - if (_codec.AvailableBytesOut == 0) - return BlockState.NeedMore; - } - } - else if (match_available != 0) - { - - // If there was no match at the previous position, output a - // single literal. If there was a match but the current match - // is longer, truncate the previous match to a single literal. - - bflush = _tr_tally(0, window[strstart - 1] & 0xff); - - if (bflush) - { - flush_block_only(false); - } - strstart++; - lookahead--; - if (_codec.AvailableBytesOut == 0) - return BlockState.NeedMore; - } - else - { - // There is no previous match to compare with, wait for - // the next step to decide. - - match_available = 1; - strstart++; - lookahead--; - } - } - - if (match_available != 0) - { - bflush = _tr_tally(0, window[strstart - 1] & 0xff); - match_available = 0; - } - flush_block_only(flush == FlushType.Finish); - - if (_codec.AvailableBytesOut == 0) - { - if (flush == FlushType.Finish) - return BlockState.FinishStarted; - else - return BlockState.NeedMore; - } - - return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; - } - - - internal int longest_match(int cur_match) - { - int chain_length = config.MaxChainLength; // max hash chain length - int scan = strstart; // current string - int match; // matched string - int len; // length of current match - int best_len = prev_length; // best match length so far - int limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0; - - int niceLength = config.NiceLength; - - // Stop when cur_match becomes <= limit. To simplify the code, - // we prevent matches with the string of window index 0. - - int wmask = w_mask; - - int strend = strstart + MAX_MATCH; - byte scan_end1 = window[scan + best_len - 1]; - byte scan_end = window[scan + best_len]; - - // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - // It is easy to get rid of this optimization if necessary. - - // Do not waste too much time if we already have a good match: - if (prev_length >= config.GoodLength) - { - chain_length >>= 2; - } - - // Do not look for matches beyond the end of the input. This is necessary - // to make deflate deterministic. - if (niceLength > lookahead) - niceLength = lookahead; - - do - { - match = cur_match; - - // Skip to next match if the match length cannot increase - // or if the match length is less than 2: - if (window[match + best_len] != scan_end || - window[match + best_len - 1] != scan_end1 || - window[match] != window[scan] || - window[++match] != window[scan + 1]) - continue; - - // The check at best_len-1 can be removed because it will be made - // again later. (This heuristic is not always a win.) - // It is not necessary to compare scan[2] and match[2] since they - // are always equal when the other bytes match, given that - // the hash keys are equal and that HASH_BITS >= 8. - scan += 2; match++; - - // We check for insufficient lookahead only every 8th comparison; - // the 256th check will be made at strstart+258. - do - { - } - while (window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && - window[++scan] == window[++match] && scan < strend); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - - if (len > best_len) - { - match_start = cur_match; - best_len = len; - if (len >= niceLength) - break; - scan_end1 = window[scan + best_len - 1]; - scan_end = window[scan + best_len]; - } - } - while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length != 0); - - if (best_len <= lookahead) - return best_len; - return lookahead; - } - - - private bool Rfc1950BytesEmitted = false; - private bool _WantRfc1950HeaderBytes = true; - internal bool WantRfc1950HeaderBytes - { - get { return _WantRfc1950HeaderBytes; } - set { _WantRfc1950HeaderBytes = value; } - } - - - internal int Initialize(ZlibCodec codec, CompressionLevel level) - { - return Initialize(codec, level, ZlibConstants.WindowBitsMax); - } - - internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits) - { - return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, CompressionStrategy.Default); - } - - internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits, CompressionStrategy compressionStrategy) - { - return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, compressionStrategy); - } - - internal int Initialize(ZlibCodec codec, CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy) - { - _codec = codec; - _codec.Message = null; - - // validation - if (windowBits < 9 || windowBits > 15) - throw new ZlibException("windowBits must be in the range 9..15."); - - if (memLevel < 1 || memLevel > MEM_LEVEL_MAX) - throw new ZlibException(String.Format("memLevel must be in the range 1.. {0}", MEM_LEVEL_MAX)); - - _codec.dstate = this; - - w_bits = windowBits; - w_size = 1 << w_bits; - w_mask = w_size - 1; - - hash_bits = memLevel + 7; - hash_size = 1 << hash_bits; - hash_mask = hash_size - 1; - hash_shift = ((hash_bits + MIN_MATCH - 1) / MIN_MATCH); - - window = new byte[w_size * 2]; - prev = new short[w_size]; - head = new short[hash_size]; - - // for memLevel==8, this will be 16384, 16k - lit_bufsize = 1 << (memLevel + 6); - - // Use a single array as the buffer for data pending compression, - // the output distance codes, and the output length codes (aka tree). - // orig comment: This works just fine since the average - // output size for (length,distance) codes is <= 24 bits. - pending = new byte[lit_bufsize * 4]; - _distanceOffset = lit_bufsize; - _lengthOffset = (1 + 2) * lit_bufsize; - - // So, for memLevel 8, the length of the pending buffer is 65536. 64k. - // The first 16k are pending bytes. - // The middle slice, of 32k, is used for distance codes. - // The final 16k are length codes. - - this.compressionLevel = level; - this.compressionStrategy = strategy; - - Reset(); - return ZlibConstants.Z_OK; - } - - - internal void Reset() - { - _codec.TotalBytesIn = _codec.TotalBytesOut = 0; - _codec.Message = null; - //strm.data_type = Z_UNKNOWN; - - pendingCount = 0; - nextPending = 0; - - Rfc1950BytesEmitted = false; - - status = (WantRfc1950HeaderBytes) ? INIT_STATE : BUSY_STATE; - _codec._Adler32 = Adler.Adler32(0, null, 0, 0); - - last_flush = (int)FlushType.None; - - _InitializeTreeData(); - _InitializeLazyMatch(); - } - - - internal int End() - { - if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) - { - return ZlibConstants.Z_STREAM_ERROR; - } - // Deallocate in reverse order of allocations: - pending = null; - head = null; - prev = null; - window = null; - // free - // dstate=null; - return status == BUSY_STATE ? ZlibConstants.Z_DATA_ERROR : ZlibConstants.Z_OK; - } - - - private void SetDeflater() - { - switch (config.Flavor) - { - case DeflateFlavor.Store: - DeflateFunction = DeflateNone; - break; - case DeflateFlavor.Fast: - DeflateFunction = DeflateFast; - break; - case DeflateFlavor.Slow: - DeflateFunction = DeflateSlow; - break; - } - } - - - internal int SetParams(CompressionLevel level, CompressionStrategy strategy) - { - int result = ZlibConstants.Z_OK; - - if (compressionLevel != level) - { - Config newConfig = Config.Lookup(level); - - // change in the deflate flavor (Fast vs slow vs none)? - if (newConfig.Flavor != config.Flavor && _codec.TotalBytesIn != 0) - { - // Flush the last buffer: - result = _codec.Deflate(FlushType.Partial); - } - - compressionLevel = level; - config = newConfig; - SetDeflater(); - } - - // no need to flush with change in strategy? Really? - compressionStrategy = strategy; - - return result; - } - - - internal int SetDictionary(byte[] dictionary) - { - int length = dictionary.Length; - int index = 0; - - if (dictionary == null || status != INIT_STATE) - throw new ZlibException("Stream error."); - - _codec._Adler32 = Adler.Adler32(_codec._Adler32, dictionary, 0, dictionary.Length); - - if (length < MIN_MATCH) - return ZlibConstants.Z_OK; - if (length > w_size - MIN_LOOKAHEAD) - { - length = w_size - MIN_LOOKAHEAD; - index = dictionary.Length - length; // use the tail of the dictionary - } - Array.Copy(dictionary, index, window, 0, length); - strstart = length; - block_start = length; - - // Insert all strings in the hash table (except for the last two bytes). - // s->lookahead stays null, so s->ins_h will be recomputed at the next - // call of fill_window. - - ins_h = window[0] & 0xff; - ins_h = (((ins_h) << hash_shift) ^ (window[1] & 0xff)) & hash_mask; - - for (int n = 0; n <= length - MIN_MATCH; n++) - { - ins_h = (((ins_h) << hash_shift) ^ (window[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; - prev[n & w_mask] = head[ins_h]; - head[ins_h] = (short)n; - } - return ZlibConstants.Z_OK; - } - - - - internal int Deflate(FlushType flush) - { - int old_flush; - - if (_codec.OutputBuffer == null || - (_codec.InputBuffer == null && _codec.AvailableBytesIn != 0) || - (status == FINISH_STATE && flush != FlushType.Finish)) - { - _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_STREAM_ERROR)]; - throw new ZlibException(String.Format("Something is fishy. [{0}]", _codec.Message)); - } - if (_codec.AvailableBytesOut == 0) - { - _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; - throw new ZlibException("OutputBuffer is full (AvailableBytesOut == 0)"); - } - - old_flush = last_flush; - last_flush = (int)flush; - - // Write the zlib (rfc1950) header bytes - if (status == INIT_STATE) - { - int header = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8; - int level_flags = (((int)compressionLevel - 1) & 0xff) >> 1; - - if (level_flags > 3) - level_flags = 3; - header |= (level_flags << 6); - if (strstart != 0) - header |= PRESET_DICT; - header += 31 - (header % 31); - - status = BUSY_STATE; - //putShortMSB(header); - unchecked - { - pending[pendingCount++] = (byte)(header >> 8); - pending[pendingCount++] = (byte)header; - } - // Save the adler32 of the preset dictionary: - if (strstart != 0) - { - pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); - pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); - pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); - pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); - } - _codec._Adler32 = Adler.Adler32(0, null, 0, 0); - } - - // Flush as much pending output as possible - if (pendingCount != 0) - { - _codec.flush_pending(); - if (_codec.AvailableBytesOut == 0) - { - //System.out.println(" avail_out==0"); - // Since avail_out is 0, deflate will be called again with - // more output space, but possibly with both pending and - // avail_in equal to zero. There won't be anything to do, - // but this is not an error situation so make sure we - // return OK instead of BUF_ERROR at next call of deflate: - last_flush = -1; - return ZlibConstants.Z_OK; - } - - // Make sure there is something to do and avoid duplicate consecutive - // flushes. For repeated and useless calls with Z_FINISH, we keep - // returning Z_STREAM_END instead of Z_BUFF_ERROR. - } - else if (_codec.AvailableBytesIn == 0 && - (int)flush <= old_flush && - flush != FlushType.Finish) - { - // workitem 8557 - // - // Not sure why this needs to be an error. pendingCount == 0, which - // means there's nothing to deflate. And the caller has not asked - // for a FlushType.Finish, but... that seems very non-fatal. We - // can just say "OK" and do nothing. - - // _codec.Message = z_errmsg[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; - // throw new ZlibException("AvailableBytesIn == 0 && flush<=old_flush && flush != FlushType.Finish"); - - return ZlibConstants.Z_OK; - } - - // User must not provide more input after the first FINISH: - if (status == FINISH_STATE && _codec.AvailableBytesIn != 0) - { - _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; - throw new ZlibException("status == FINISH_STATE && _codec.AvailableBytesIn != 0"); - } - - // Start a new block or continue the current one. - if (_codec.AvailableBytesIn != 0 || lookahead != 0 || (flush != FlushType.None && status != FINISH_STATE)) - { - BlockState bstate = DeflateFunction(flush); - - if (bstate == BlockState.FinishStarted || bstate == BlockState.FinishDone) - { - status = FINISH_STATE; - } - if (bstate == BlockState.NeedMore || bstate == BlockState.FinishStarted) - { - if (_codec.AvailableBytesOut == 0) - { - last_flush = -1; // avoid BUF_ERROR next call, see above - } - return ZlibConstants.Z_OK; - // If flush != Z_NO_FLUSH && avail_out == 0, the next call - // of deflate should use the same flush parameter to make sure - // that the flush is complete. So we don't have to output an - // empty block here, this will be done at next call. This also - // ensures that for a very small output buffer, we emit at most - // one empty block. - } - - if (bstate == BlockState.BlockDone) - { - if (flush == FlushType.Partial) - { - _tr_align(); - } - else - { - // FlushType.Full or FlushType.Sync - _tr_stored_block(0, 0, false); - // For a full flush, this empty block will be recognized - // as a special marker by inflate_sync(). - if (flush == FlushType.Full) - { - // clear hash (forget the history) - for (int i = 0; i < hash_size; i++) - head[i] = 0; - } - } - _codec.flush_pending(); - if (_codec.AvailableBytesOut == 0) - { - last_flush = -1; // avoid BUF_ERROR at next call, see above - return ZlibConstants.Z_OK; - } - } - } - - if (flush != FlushType.Finish) - return ZlibConstants.Z_OK; - - if (!WantRfc1950HeaderBytes || Rfc1950BytesEmitted) - return ZlibConstants.Z_STREAM_END; - - // Write the zlib trailer (adler32) - pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); - pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); - pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); - pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); - //putShortMSB((int)(SharedUtils.URShift(_codec._Adler32, 16))); - //putShortMSB((int)(_codec._Adler32 & 0xffff)); - - _codec.flush_pending(); - - // If avail_out is zero, the application will call deflate again - // to flush the rest. - - Rfc1950BytesEmitted = true; // write the trailer only once! - - return pendingCount != 0 ? ZlibConstants.Z_OK : ZlibConstants.Z_STREAM_END; - } - - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs.meta deleted file mode 100755 index bbc044a5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Deflate.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 10c85b67d8e083d4bb3ade7def64d383 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs deleted file mode 100755 index 8f09296a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs +++ /dev/null @@ -1,741 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// DeflateStream.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009-2010 Dino Chiesa. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2011-July-31 14:48:11> -// -// ------------------------------------------------------------------ -// -// This module defines the DeflateStream class, which can be used as a replacement for -// the System.IO.Compression.DeflateStream class in the .NET BCL. -// -// ------------------------------------------------------------------ - - -using System; - -namespace Ionic.Zlib -{ - /// - /// A class for compressing and decompressing streams using the Deflate algorithm. - /// - /// - /// - /// - /// - /// The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any - /// stream. - /// - /// - /// - /// Using this stream, applications can compress or decompress data via stream - /// Read and Write operations. Either compresssion or decompression - /// can occur through either reading or writing. The compression format used is - /// DEFLATE, which is documented in IETF RFC 1951, "DEFLATE - /// Compressed Data Format Specification version 1.3.". - /// - /// - /// - /// This class is similar to , except that - /// ZlibStream adds the RFC - /// 1950 - ZLIB framing bytes to a compressed stream when compressing, or - /// expects the RFC1950 framing bytes when decompressing. The DeflateStream - /// does not. - /// - /// - /// - /// - /// - /// - public class DeflateStream : System.IO.Stream - { - internal ZlibBaseStream _baseStream; - internal System.IO.Stream _innerStream; - bool _disposed; - - /// - /// Create a DeflateStream using the specified CompressionMode. - /// - /// - /// - /// When mode is CompressionMode.Compress, the DeflateStream will use - /// the default compression level. The "captive" stream will be closed when - /// the DeflateStream is closed. - /// - /// - /// - /// This example uses a DeflateStream to compress data from a file, and writes - /// the compressed data to another file. - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - /// { - /// using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") - /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// The stream which will be read or written. - /// Indicates whether the DeflateStream will compress or decompress. - public DeflateStream(System.IO.Stream stream, CompressionMode mode) - : this(stream, mode, CompressionLevel.Default, false) - { - } - - /// - /// Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. - /// - /// - /// - /// - /// - /// When mode is CompressionMode.Decompress, the level parameter is - /// ignored. The "captive" stream will be closed when the DeflateStream is - /// closed. - /// - /// - /// - /// - /// - /// - /// This example uses a DeflateStream to compress data from a file, and writes - /// the compressed data to another file. - /// - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - /// { - /// using (Stream compressor = new DeflateStream(raw, - /// CompressionMode.Compress, - /// CompressionLevel.BestCompression)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n= -1; - /// while (n != 0) - /// { - /// if (n > 0) - /// compressor.Write(buffer, 0, n); - /// n= input.Read(buffer, 0, buffer.Length); - /// } - /// } - /// } - /// } - /// - /// - /// - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") - /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// The stream to be read or written while deflating or inflating. - /// Indicates whether the DeflateStream will compress or decompress. - /// A tuning knob to trade speed for effectiveness. - public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level) - : this(stream, mode, level, false) - { - } - - /// - /// Create a DeflateStream using the specified - /// CompressionMode, and explicitly specify whether the - /// stream should be left open after Deflation or Inflation. - /// - /// - /// - /// - /// - /// This constructor allows the application to request that the captive stream - /// remain open after the deflation or inflation occurs. By default, after - /// Close() is called on the stream, the captive stream is also - /// closed. In some cases this is not desired, for example if the stream is a - /// memory stream that will be re-read after compression. Specify true for - /// the parameter to leave the stream open. - /// - /// - /// - /// The DeflateStream will use the default compression level. - /// - /// - /// - /// See the other overloads of this constructor for example code. - /// - /// - /// - /// - /// The stream which will be read or written. This is called the - /// "captive" stream in other places in this documentation. - /// - /// - /// - /// Indicates whether the DeflateStream will compress or decompress. - /// - /// - /// true if the application would like the stream to - /// remain open after inflation/deflation. - public DeflateStream(System.IO.Stream stream, CompressionMode mode, bool leaveOpen) - : this(stream, mode, CompressionLevel.Default, leaveOpen) - { - } - - /// - /// Create a DeflateStream using the specified CompressionMode - /// and the specified CompressionLevel, and explicitly specify whether - /// the stream should be left open after Deflation or Inflation. - /// - /// - /// - /// - /// - /// When mode is CompressionMode.Decompress, the level parameter is ignored. - /// - /// - /// - /// This constructor allows the application to request that the captive stream - /// remain open after the deflation or inflation occurs. By default, after - /// Close() is called on the stream, the captive stream is also - /// closed. In some cases this is not desired, for example if the stream is a - /// that will be re-read after - /// compression. Specify true for the parameter - /// to leave the stream open. - /// - /// - /// - /// - /// - /// - /// This example shows how to use a DeflateStream to compress data from - /// a file, and store the compressed data into another file. - /// - /// - /// using (var output = System.IO.File.Create(fileToCompress + ".deflated")) - /// { - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n= -1; - /// while (n != 0) - /// { - /// if (n > 0) - /// compressor.Write(buffer, 0, n); - /// n= input.Read(buffer, 0, buffer.Length); - /// } - /// } - /// } - /// // can write additional data to the output stream here - /// } - /// - /// - /// - /// Using output As FileStream = File.Create(fileToCompress & ".deflated") - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// ' can write additional data to the output stream here. - /// End Using - /// - /// - /// The stream which will be read or written. - /// Indicates whether the DeflateStream will compress or decompress. - /// true if the application would like the stream to remain open after inflation/deflation. - /// A tuning knob to trade speed for effectiveness. - public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) - { - _innerStream = stream; - _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen); - } - -#region Zlib properties - - /// - /// This property sets the flush behavior on the stream. - /// - /// See the ZLIB documentation for the meaning of the flush behavior. - /// - virtual public FlushType FlushMode - { - get { return (this._baseStream._flushMode); } - set - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - this._baseStream._flushMode = value; - } - } - - /// - /// The size of the working buffer for the compression codec. - /// - /// - /// - /// - /// The working buffer is used for all stream operations. The default size is - /// 1024 bytes. The minimum size is 128 bytes. You may get better performance - /// with a larger buffer. Then again, you might not. You would have to test - /// it. - /// - /// - /// - /// Set this before the first call to Read() or Write() on the - /// stream. If you try to set it afterwards, it will throw. - /// - /// - public int BufferSize - { - get - { - return this._baseStream._bufferSize; - } - set - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - if (this._baseStream._workingBuffer != null) - throw new ZlibException("The working buffer is already set."); - if (value < ZlibConstants.WorkingBufferSizeMin) - throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); - this._baseStream._bufferSize = value; - } - } - - /// - /// The ZLIB strategy to be used during compression. - /// - /// - /// - /// By tweaking this parameter, you may be able to optimize the compression for - /// data with particular characteristics. - /// - public CompressionStrategy Strategy - { - get - { - return this._baseStream.Strategy; - } - set - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - this._baseStream.Strategy = value; - } - } - - /// Returns the total number of bytes input so far. - virtual public long TotalIn - { - get - { - return this._baseStream._z.TotalBytesIn; - } - } - - /// Returns the total number of bytes output so far. - virtual public long TotalOut - { - get - { - return this._baseStream._z.TotalBytesOut; - } - } - -#endregion - -#region System.IO.Stream methods - /// - /// Dispose the stream. - /// - /// - /// - /// This may or may not result in a Close() call on the captive - /// stream. See the constructors that have a leaveOpen parameter - /// for more information. - /// - /// - /// Application code won't call this code directly. This method may be - /// invoked in two distinct scenarios. If disposing == true, the method - /// has been called directly or indirectly by a user's code, for example - /// via the public Dispose() method. In this case, both managed and - /// unmanaged resources can be referenced and disposed. If disposing == - /// false, the method has been called by the runtime from inside the - /// object finalizer and this method should not reference other objects; - /// in that case only unmanaged resources must be referenced or - /// disposed. - /// - /// - /// - /// true if the Dispose method was invoked by user code. - /// - protected override void Dispose(bool disposing) - { - try - { - if (!_disposed) - { - if (disposing && (this._baseStream != null)) - this._baseStream.Close(); - _disposed = true; - } - } - finally - { - base.Dispose(disposing); - } - } - - - - /// - /// Indicates whether the stream can be read. - /// - /// - /// The return value depends on whether the captive stream supports reading. - /// - public override bool CanRead - { - get - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - return _baseStream._stream.CanRead; - } - } - - /// - /// Indicates whether the stream supports Seek operations. - /// - /// - /// Always returns false. - /// - public override bool CanSeek - { - get { return false; } - } - - - /// - /// Indicates whether the stream can be written. - /// - /// - /// The return value depends on whether the captive stream supports writing. - /// - public override bool CanWrite - { - get - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - return _baseStream._stream.CanWrite; - } - } - - /// - /// Flush the stream. - /// - public override void Flush() - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - _baseStream.Flush(); - } - - /// - /// Reading this property always throws a . - /// - public override long Length - { - get { throw new NotImplementedException(); } - } - - /// - /// The position of the stream pointer. - /// - /// - /// - /// Setting this property always throws a . Reading will return the total bytes - /// written out, if used in writing, or the total bytes read in, if used in - /// reading. The count may refer to compressed bytes or uncompressed bytes, - /// depending on how you've used the stream. - /// - public override long Position - { - get - { - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) - return this._baseStream._z.TotalBytesOut; - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) - return this._baseStream._z.TotalBytesIn; - return 0; - } - set { throw new NotImplementedException(); } - } - - /// - /// Read data from the stream. - /// - /// - /// - /// - /// If you wish to use the DeflateStream to compress data while - /// reading, you can create a DeflateStream with - /// CompressionMode.Compress, providing an uncompressed data stream. - /// Then call Read() on that DeflateStream, and the data read will be - /// compressed as you read. If you wish to use the DeflateStream to - /// decompress data while reading, you can create a DeflateStream with - /// CompressionMode.Decompress, providing a readable compressed data - /// stream. Then call Read() on that DeflateStream, and the data read - /// will be decompressed as you read. - /// - /// - /// - /// A DeflateStream can be used for Read() or Write(), but not both. - /// - /// - /// - /// The buffer into which the read data should be placed. - /// the offset within that data array to put the first byte read. - /// the number of bytes to read. - /// the number of bytes actually read - public override int Read(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - return _baseStream.Read(buffer, offset, count); - } - - - /// - /// Calling this method always throws a . - /// - /// this is irrelevant, since it will always throw! - /// this is irrelevant, since it will always throw! - /// irrelevant! - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - throw new NotImplementedException(); - } - - /// - /// Calling this method always throws a . - /// - /// this is irrelevant, since it will always throw! - public override void SetLength(long value) - { - throw new NotImplementedException(); - } - - /// - /// Write data to the stream. - /// - /// - /// - /// - /// If you wish to use the DeflateStream to compress data while - /// writing, you can create a DeflateStream with - /// CompressionMode.Compress, and a writable output stream. Then call - /// Write() on that DeflateStream, providing uncompressed data - /// as input. The data sent to the output stream will be the compressed form - /// of the data written. If you wish to use the DeflateStream to - /// decompress data while writing, you can create a DeflateStream with - /// CompressionMode.Decompress, and a writable output stream. Then - /// call Write() on that stream, providing previously compressed - /// data. The data sent to the output stream will be the decompressed form of - /// the data written. - /// - /// - /// - /// A DeflateStream can be used for Read() or Write(), - /// but not both. - /// - /// - /// - /// - /// The buffer holding data to write to the stream. - /// the offset within that data array to find the first byte to write. - /// the number of bytes to write. - public override void Write(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("DeflateStream"); - _baseStream.Write(buffer, offset, count); - } -#endregion - - - - - /// - /// Compress a string into a byte array using DEFLATE (RFC 1951). - /// - /// - /// - /// Uncompress it with . - /// - /// - /// DeflateStream.UncompressString(byte[]) - /// DeflateStream.CompressBuffer(byte[]) - /// GZipStream.CompressString(string) - /// ZlibStream.CompressString(string) - /// - /// - /// A string to compress. The string will first be encoded - /// using UTF8, then compressed. - /// - /// - /// The string in compressed form - public static byte[] CompressString(String s) - { - using (var ms = new System.IO.MemoryStream()) - { - System.IO.Stream compressor = - new DeflateStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); - ZlibBaseStream.CompressString(s, compressor); - return ms.ToArray(); - } - } - - - /// - /// Compress a byte array into a new byte array using DEFLATE. - /// - /// - /// - /// Uncompress it with . - /// - /// - /// DeflateStream.CompressString(string) - /// DeflateStream.UncompressBuffer(byte[]) - /// GZipStream.CompressBuffer(byte[]) - /// ZlibStream.CompressBuffer(byte[]) - /// - /// - /// A buffer to compress. - /// - /// - /// The data in compressed form - public static byte[] CompressBuffer(byte[] b) - { - using (var ms = new System.IO.MemoryStream()) - { - System.IO.Stream compressor = - new DeflateStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); - - ZlibBaseStream.CompressBuffer(b, compressor); - return ms.ToArray(); - } - } - - - /// - /// Uncompress a DEFLATE'd byte array into a single string. - /// - /// - /// DeflateStream.CompressString(String) - /// DeflateStream.UncompressBuffer(byte[]) - /// GZipStream.UncompressString(byte[]) - /// ZlibStream.UncompressString(byte[]) - /// - /// - /// A buffer containing DEFLATE-compressed data. - /// - /// - /// The uncompressed string - public static String UncompressString(byte[] compressed) - { - using (var input = new System.IO.MemoryStream(compressed)) - { - System.IO.Stream decompressor = - new DeflateStream(input, CompressionMode.Decompress); - - return ZlibBaseStream.UncompressString(compressed, decompressor); - } - } - - - /// - /// Uncompress a DEFLATE'd byte array into a byte array. - /// - /// - /// DeflateStream.CompressBuffer(byte[]) - /// DeflateStream.UncompressString(byte[]) - /// GZipStream.UncompressBuffer(byte[]) - /// ZlibStream.UncompressBuffer(byte[]) - /// - /// - /// A buffer containing data that has been compressed with DEFLATE. - /// - /// - /// The data in uncompressed form - public static byte[] UncompressBuffer(byte[] compressed) - { - using (var input = new System.IO.MemoryStream(compressed)) - { - System.IO.Stream decompressor = - new DeflateStream( input, CompressionMode.Decompress ); - - return ZlibBaseStream.UncompressBuffer(compressed, decompressor); - } - } - - } - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs.meta deleted file mode 100755 index 579f9fd2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/DeflateStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d7cb4e529d8d0374f96b989aaf5e6c77 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs deleted file mode 100755 index 54a844c4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs +++ /dev/null @@ -1,1031 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// GZipStream.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2011-July-11 21:42:34> -// -// ------------------------------------------------------------------ -// -// This module defines the GZipStream class, which can be used as a replacement for -// the System.IO.Compression.GZipStream class in the .NET BCL. NB: The design is not -// completely OO clean: there is some intelligence in the ZlibBaseStream that reads the -// GZip header. -// -// ------------------------------------------------------------------ - - -using System; -using System.IO; - -namespace Ionic.Zlib -{ - /// - /// A class for compressing and decompressing GZIP streams. - /// - /// - /// - /// - /// The GZipStream is a Decorator on a - /// . It adds GZIP compression or decompression to any - /// stream. - /// - /// - /// - /// Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the - /// Ionic.Zlib.GZipStream can compress while writing, or decompress while - /// reading, but not vice versa. The compression method used is GZIP, which is - /// documented in IETF RFC - /// 1952, "GZIP file format specification version 4.3". - /// - /// - /// A GZipStream can be used to decompress data (through Read()) or - /// to compress data (through Write()), but not both. - /// - /// - /// - /// If you wish to use the GZipStream to compress data, you must wrap it - /// around a write-able stream. As you call Write() on the GZipStream, the - /// data will be compressed into the GZIP format. If you want to decompress data, - /// you must wrap the GZipStream around a readable stream that contains an - /// IETF RFC 1952-compliant stream. The data will be decompressed as you call - /// Read() on the GZipStream. - /// - /// - /// - /// Though the GZIP format allows data from multiple files to be concatenated - /// together, this stream handles only a single segment of GZIP format, typically - /// representing a single file. - /// - /// - /// - /// This class is similar to and . - /// ZlibStream handles RFC1950-compliant streams. - /// handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. - /// - /// - /// - /// - /// - /// - public class GZipStream : System.IO.Stream - { - // GZip format - // source: http://tools.ietf.org/html/rfc1952 - // - // header id: 2 bytes 1F 8B - // compress method 1 byte 8= DEFLATE (none other supported) - // flag 1 byte bitfield (See below) - // mtime 4 bytes time_t (seconds since jan 1, 1970 UTC of the file. - // xflg 1 byte 2 = max compress used , 4 = max speed (can be ignored) - // OS 1 byte OS for originating archive. set to 0xFF in compression. - // extra field length 2 bytes optional - only if FEXTRA is set. - // extra field varies - // filename varies optional - if FNAME is set. zero terminated. ISO-8859-1. - // file comment varies optional - if FCOMMENT is set. zero terminated. ISO-8859-1. - // crc16 1 byte optional - present only if FHCRC bit is set - // compressed data varies - // CRC32 4 bytes - // isize 4 bytes data size modulo 2^32 - // - // FLG (FLaGs) - // bit 0 FTEXT - indicates file is ASCII text (can be safely ignored) - // bit 1 FHCRC - there is a CRC16 for the header immediately following the header - // bit 2 FEXTRA - extra fields are present - // bit 3 FNAME - the zero-terminated filename is present. encoding; ISO-8859-1. - // bit 4 FCOMMENT - a zero-terminated file comment is present. encoding: ISO-8859-1 - // bit 5 reserved - // bit 6 reserved - // bit 7 reserved - // - // On consumption: - // Extra field is a bunch of nonsense and can be safely ignored. - // Header CRC and OS, likewise. - // - // on generation: - // all optional fields get 0, except for the OS, which gets 255. - // - - - - /// - /// The comment on the GZIP stream. - /// - /// - /// - /// - /// The GZIP format allows for each file to optionally have an associated - /// comment stored with the file. The comment is encoded with the ISO-8859-1 - /// code page. To include a comment in a GZIP stream you create, set this - /// property before calling Write() for the first time on the - /// GZipStream. - /// - /// - /// - /// When using GZipStream to decompress, you can retrieve this property - /// after the first call to Read(). If no comment has been set in the - /// GZIP bytestream, the Comment property will return null - /// (Nothing in VB). - /// - /// - public String Comment - { - get - { - return _Comment; - } - set - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - _Comment = value; - } - } - - /// - /// The FileName for the GZIP stream. - /// - /// - /// - /// - /// - /// The GZIP format optionally allows each file to have an associated - /// filename. When compressing data (through Write()), set this - /// FileName before calling Write() the first time on the GZipStream. - /// The actual filename is encoded into the GZIP bytestream with the - /// ISO-8859-1 code page, according to RFC 1952. It is the application's - /// responsibility to insure that the FileName can be encoded and decoded - /// correctly with this code page. - /// - /// - /// - /// When decompressing (through Read()), you can retrieve this value - /// any time after the first Read(). In the case where there was no filename - /// encoded into the GZIP bytestream, the property will return null (Nothing - /// in VB). - /// - /// - public String FileName - { - get { return _FileName; } - set - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - _FileName = value; - if (_FileName == null) return; - if (_FileName.IndexOf("/") != -1) - { - _FileName = _FileName.Replace("/", "\\"); - } - if (_FileName.EndsWith("\\")) - throw new Exception("Illegal filename"); - if (_FileName.IndexOf("\\") != -1) - { - // trim any leading path - _FileName = Path.GetFileName(_FileName); - } - } - } - - /// - /// The last modified time for the GZIP stream. - /// - /// - /// - /// GZIP allows the storage of a last modified time with each GZIP entry. - /// When compressing data, you can set this before the first call to - /// Write(). When decompressing, you can retrieve this value any time - /// after the first call to Read(). - /// - public DateTime? LastModified; - - /// - /// The CRC on the GZIP stream. - /// - /// - /// This is used for internal error checking. You probably don't need to look at this property. - /// - public int Crc32 { get { return _Crc32; } } - - private int _headerByteCount; - internal ZlibBaseStream _baseStream; - bool _disposed; - bool _firstReadDone; - string _FileName; - string _Comment; - int _Crc32; - - - /// - /// Create a GZipStream using the specified CompressionMode. - /// - /// - /// - /// - /// When mode is CompressionMode.Compress, the GZipStream will use the - /// default compression level. - /// - /// - /// - /// As noted in the class documentation, the CompressionMode (Compress - /// or Decompress) also establishes the "direction" of the stream. A - /// GZipStream with CompressionMode.Compress works only through - /// Write(). A GZipStream with - /// CompressionMode.Decompress works only through Read(). - /// - /// - /// - /// - /// - /// This example shows how to use a GZipStream to compress data. - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(outputFile)) - /// { - /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// Dim outputFile As String = (fileToCompress & ".compressed") - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(outputFile) - /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// - /// - /// This example shows how to use a GZipStream to uncompress a file. - /// - /// private void GunZipFile(string filename) - /// { - /// if (!filename.EndsWith(".gz)) - /// throw new ArgumentException("filename"); - /// var DecompressedFile = filename.Substring(0,filename.Length-3); - /// byte[] working = new byte[WORKING_BUFFER_SIZE]; - /// int n= 1; - /// using (System.IO.Stream input = System.IO.File.OpenRead(filename)) - /// { - /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - /// { - /// using (var output = System.IO.File.Create(DecompressedFile)) - /// { - /// while (n !=0) - /// { - /// n= decompressor.Read(working, 0, working.Length); - /// if (n > 0) - /// { - /// output.Write(working, 0, n); - /// } - /// } - /// } - /// } - /// } - /// } - /// - /// - /// - /// Private Sub GunZipFile(ByVal filename as String) - /// If Not (filename.EndsWith(".gz)) Then - /// Throw New ArgumentException("filename") - /// End If - /// Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) - /// Dim working(WORKING_BUFFER_SIZE) as Byte - /// Dim n As Integer = 1 - /// Using input As Stream = File.OpenRead(filename) - /// Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) - /// Using output As Stream = File.Create(UncompressedFile) - /// Do - /// n= decompressor.Read(working, 0, working.Length) - /// If n > 0 Then - /// output.Write(working, 0, n) - /// End IF - /// Loop While (n > 0) - /// End Using - /// End Using - /// End Using - /// End Sub - /// - /// - /// - /// The stream which will be read or written. - /// Indicates whether the GZipStream will compress or decompress. - public GZipStream(Stream stream, CompressionMode mode) - : this(stream, mode, CompressionLevel.Default, false) - { - } - - /// - /// Create a GZipStream using the specified CompressionMode and - /// the specified CompressionLevel. - /// - /// - /// - /// - /// The CompressionMode (Compress or Decompress) also establishes the - /// "direction" of the stream. A GZipStream with - /// CompressionMode.Compress works only through Write(). A - /// GZipStream with CompressionMode.Decompress works only - /// through Read(). - /// - /// - /// - /// - /// - /// - /// This example shows how to use a GZipStream to compress a file into a .gz file. - /// - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(fileToCompress + ".gz")) - /// { - /// using (Stream compressor = new GZipStream(raw, - /// CompressionMode.Compress, - /// CompressionLevel.BestCompression)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(fileToCompress & ".gz") - /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// The stream to be read or written while deflating or inflating. - /// Indicates whether the GZipStream will compress or decompress. - /// A tuning knob to trade speed for effectiveness. - public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level) - : this(stream, mode, level, false) - { - } - - /// - /// Create a GZipStream using the specified CompressionMode, and - /// explicitly specify whether the stream should be left open after Deflation - /// or Inflation. - /// - /// - /// - /// - /// This constructor allows the application to request that the captive stream - /// remain open after the deflation or inflation occurs. By default, after - /// Close() is called on the stream, the captive stream is also - /// closed. In some cases this is not desired, for example if the stream is a - /// memory stream that will be re-read after compressed data has been written - /// to it. Specify true for the parameter to leave - /// the stream open. - /// - /// - /// - /// The (Compress or Decompress) also - /// establishes the "direction" of the stream. A GZipStream with - /// CompressionMode.Compress works only through Write(). A GZipStream - /// with CompressionMode.Decompress works only through Read(). - /// - /// - /// - /// The GZipStream will use the default compression level. If you want - /// to specify the compression level, see . - /// - /// - /// - /// See the other overloads of this constructor for example code. - /// - /// - /// - /// - /// - /// The stream which will be read or written. This is called the "captive" - /// stream in other places in this documentation. - /// - /// - /// Indicates whether the GZipStream will compress or decompress. - /// - /// - /// - /// true if the application would like the base stream to remain open after - /// inflation/deflation. - /// - public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen) - : this(stream, mode, CompressionLevel.Default, leaveOpen) - { - } - - /// - /// Create a GZipStream using the specified CompressionMode and the - /// specified CompressionLevel, and explicitly specify whether the - /// stream should be left open after Deflation or Inflation. - /// - /// - /// - /// - /// - /// This constructor allows the application to request that the captive stream - /// remain open after the deflation or inflation occurs. By default, after - /// Close() is called on the stream, the captive stream is also - /// closed. In some cases this is not desired, for example if the stream is a - /// memory stream that will be re-read after compressed data has been written - /// to it. Specify true for the parameter to - /// leave the stream open. - /// - /// - /// - /// As noted in the class documentation, the CompressionMode (Compress - /// or Decompress) also establishes the "direction" of the stream. A - /// GZipStream with CompressionMode.Compress works only through - /// Write(). A GZipStream with CompressionMode.Decompress works only - /// through Read(). - /// - /// - /// - /// - /// - /// This example shows how to use a GZipStream to compress data. - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(outputFile)) - /// { - /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// Dim outputFile As String = (fileToCompress & ".compressed") - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(outputFile) - /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// The stream which will be read or written. - /// Indicates whether the GZipStream will compress or decompress. - /// true if the application would like the stream to remain open after inflation/deflation. - /// A tuning knob to trade speed for effectiveness. - public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) - { - _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.GZIP, leaveOpen); - } - -#region Zlib properties - - /// - /// This property sets the flush behavior on the stream. - /// - virtual public FlushType FlushMode - { - get { return (this._baseStream._flushMode); } - set { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - this._baseStream._flushMode = value; - } - } - - /// - /// The size of the working buffer for the compression codec. - /// - /// - /// - /// - /// The working buffer is used for all stream operations. The default size is - /// 1024 bytes. The minimum size is 128 bytes. You may get better performance - /// with a larger buffer. Then again, you might not. You would have to test - /// it. - /// - /// - /// - /// Set this before the first call to Read() or Write() on the - /// stream. If you try to set it afterwards, it will throw. - /// - /// - public int BufferSize - { - get - { - return this._baseStream._bufferSize; - } - set - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - if (this._baseStream._workingBuffer != null) - throw new ZlibException("The working buffer is already set."); - if (value < ZlibConstants.WorkingBufferSizeMin) - throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); - this._baseStream._bufferSize = value; - } - } - - - /// Returns the total number of bytes input so far. - virtual public long TotalIn - { - get - { - return this._baseStream._z.TotalBytesIn; - } - } - - /// Returns the total number of bytes output so far. - virtual public long TotalOut - { - get - { - return this._baseStream._z.TotalBytesOut; - } - } - -#endregion - -#region Stream methods - - /// - /// Dispose the stream. - /// - /// - /// - /// This may or may not result in a Close() call on the captive - /// stream. See the constructors that have a leaveOpen parameter - /// for more information. - /// - /// - /// This method may be invoked in two distinct scenarios. If disposing - /// == true, the method has been called directly or indirectly by a - /// user's code, for example via the public Dispose() method. In this - /// case, both managed and unmanaged resources can be referenced and - /// disposed. If disposing == false, the method has been called by the - /// runtime from inside the object finalizer and this method should not - /// reference other objects; in that case only unmanaged resources must - /// be referenced or disposed. - /// - /// - /// - /// indicates whether the Dispose method was invoked by user code. - /// - protected override void Dispose(bool disposing) - { - try - { - if (!_disposed) - { - if (disposing && (this._baseStream != null)) - { - this._baseStream.Close(); - this._Crc32 = _baseStream.Crc32; - } - _disposed = true; - } - } - finally - { - base.Dispose(disposing); - } - } - - - /// - /// Indicates whether the stream can be read. - /// - /// - /// The return value depends on whether the captive stream supports reading. - /// - public override bool CanRead - { - get - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - return _baseStream._stream.CanRead; - } - } - - /// - /// Indicates whether the stream supports Seek operations. - /// - /// - /// Always returns false. - /// - public override bool CanSeek - { - get { return false; } - } - - - /// - /// Indicates whether the stream can be written. - /// - /// - /// The return value depends on whether the captive stream supports writing. - /// - public override bool CanWrite - { - get - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - return _baseStream._stream.CanWrite; - } - } - - /// - /// Flush the stream. - /// - public override void Flush() - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - _baseStream.Flush(); - } - - /// - /// Reading this property always throws a . - /// - public override long Length - { - get { throw new NotImplementedException(); } - } - - /// - /// The position of the stream pointer. - /// - /// - /// - /// Setting this property always throws a . Reading will return the total bytes - /// written out, if used in writing, or the total bytes read in, if used in - /// reading. The count may refer to compressed bytes or uncompressed bytes, - /// depending on how you've used the stream. - /// - public override long Position - { - get - { - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) - return this._baseStream._z.TotalBytesOut + _headerByteCount; - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) - return this._baseStream._z.TotalBytesIn + this._baseStream._gzipHeaderByteCount; - return 0; - } - - set { throw new NotImplementedException(); } - } - - /// - /// Read and decompress data from the source stream. - /// - /// - /// - /// With a GZipStream, decompression is done through reading. - /// - /// - /// - /// - /// byte[] working = new byte[WORKING_BUFFER_SIZE]; - /// using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) - /// { - /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - /// { - /// using (var output = System.IO.File.Create(_DecompressedFile)) - /// { - /// int n; - /// while ((n= decompressor.Read(working, 0, working.Length)) !=0) - /// { - /// output.Write(working, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// The buffer into which the decompressed data should be placed. - /// the offset within that data array to put the first byte read. - /// the number of bytes to read. - /// the number of bytes actually read - public override int Read(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - int n = _baseStream.Read(buffer, offset, count); - - // Console.WriteLine("GZipStream::Read(buffer, off({0}), c({1}) = {2}", offset, count, n); - // Console.WriteLine( Util.FormatByteArray(buffer, offset, n) ); - - if (!_firstReadDone) - { - _firstReadDone = true; - FileName = _baseStream._GzipFileName; - Comment = _baseStream._GzipComment; - } - return n; - } - - - - /// - /// Calling this method always throws a . - /// - /// irrelevant; it will always throw! - /// irrelevant; it will always throw! - /// irrelevant! - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotImplementedException(); - } - - /// - /// Calling this method always throws a . - /// - /// irrelevant; this method will always throw! - public override void SetLength(long value) - { - throw new NotImplementedException(); - } - - /// - /// Write data to the stream. - /// - /// - /// - /// - /// If you wish to use the GZipStream to compress data while writing, - /// you can create a GZipStream with CompressionMode.Compress, and a - /// writable output stream. Then call Write() on that GZipStream, - /// providing uncompressed data as input. The data sent to the output stream - /// will be the compressed form of the data written. - /// - /// - /// - /// A GZipStream can be used for Read() or Write(), but not - /// both. Writing implies compression. Reading implies decompression. - /// - /// - /// - /// The buffer holding data to write to the stream. - /// the offset within that data array to find the first byte to write. - /// the number of bytes to write. - public override void Write(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("GZipStream"); - if (_baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Undefined) - { - //Console.WriteLine("GZipStream: First write"); - if (_baseStream._wantCompress) - { - // first write in compression, therefore, emit the GZIP header - _headerByteCount = EmitHeader(); - } - else - { - throw new InvalidOperationException(); - } - } - - _baseStream.Write(buffer, offset, count); - } -#endregion - - - internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding("iso-8859-1"); - - - private int EmitHeader() - { - byte[] commentBytes = (Comment == null) ? null : iso8859dash1.GetBytes(Comment); - byte[] filenameBytes = (FileName == null) ? null : iso8859dash1.GetBytes(FileName); - - int cbLength = (Comment == null) ? 0 : commentBytes.Length + 1; - int fnLength = (FileName == null) ? 0 : filenameBytes.Length + 1; - - int bufferLength = 10 + cbLength + fnLength; - byte[] header = new byte[bufferLength]; - int i = 0; - // ID - header[i++] = 0x1F; - header[i++] = 0x8B; - - // compression method - header[i++] = 8; - byte flag = 0; - if (Comment != null) - flag ^= 0x10; - if (FileName != null) - flag ^= 0x8; - - // flag - header[i++] = flag; - - // mtime - if (!LastModified.HasValue) LastModified = DateTime.Now; - System.TimeSpan delta = LastModified.Value - _unixEpoch; - Int32 timet = (Int32)delta.TotalSeconds; - Array.Copy(BitConverter.GetBytes(timet), 0, header, i, 4); - i += 4; - - // xflg - header[i++] = 0; // this field is totally useless - // OS - header[i++] = 0xFF; // 0xFF == unspecified - - // extra field length - only if FEXTRA is set, which it is not. - //header[i++]= 0; - //header[i++]= 0; - - // filename - if (fnLength != 0) - { - Array.Copy(filenameBytes, 0, header, i, fnLength - 1); - i += fnLength - 1; - header[i++] = 0; // terminate - } - - // comment - if (cbLength != 0) - { - Array.Copy(commentBytes, 0, header, i, cbLength - 1); - i += cbLength - 1; - header[i++] = 0; // terminate - } - - _baseStream._stream.Write(header, 0, header.Length); - - return header.Length; // bytes written - } - - - - /// - /// Compress a string into a byte array using GZip. - /// - /// - /// - /// Uncompress it with . - /// - /// - /// - /// - /// - /// - /// A string to compress. The string will first be encoded - /// using UTF8, then compressed. - /// - /// - /// The string in compressed form - public static byte[] CompressString(String s) - { - using (var ms = new MemoryStream()) - { - System.IO.Stream compressor = - new GZipStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); - ZlibBaseStream.CompressString(s, compressor); - return ms.ToArray(); - } - } - - - /// - /// Compress a byte array into a new byte array using GZip. - /// - /// - /// - /// Uncompress it with . - /// - /// - /// - /// - /// - /// - /// A buffer to compress. - /// - /// - /// The data in compressed form - public static byte[] CompressBuffer(byte[] b) - { - using (var ms = new MemoryStream()) - { - System.IO.Stream compressor = - new GZipStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); - - ZlibBaseStream.CompressBuffer(b, compressor); - return ms.ToArray(); - } - } - - - /// - /// Uncompress a GZip'ed byte array into a single string. - /// - /// - /// - /// - /// - /// - /// A buffer containing GZIP-compressed data. - /// - /// - /// The uncompressed string - public static String UncompressString(byte[] compressed) - { - using (var input = new MemoryStream(compressed)) - { - Stream decompressor = new GZipStream(input, CompressionMode.Decompress); - return ZlibBaseStream.UncompressString(compressed, decompressor); - } - } - - - /// - /// Uncompress a GZip'ed byte array into a byte array. - /// - /// - /// - /// - /// - /// - /// A buffer containing data that has been compressed with GZip. - /// - /// - /// The data in uncompressed form - public static byte[] UncompressBuffer(byte[] compressed) - { - using (var input = new System.IO.MemoryStream(compressed)) - { - System.IO.Stream decompressor = - new GZipStream( input, CompressionMode.Decompress ); - - return ZlibBaseStream.UncompressBuffer(compressed, decompressor); - } - } - - - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs.meta deleted file mode 100755 index 4e4c0633..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1d218a1ed7f6a614cb68a4a0c093dfbe -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/InfTree.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/InfTree.cs deleted file mode 100755 index 310db7b9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/InfTree.cs +++ /dev/null @@ -1,438 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// Inftree.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2009-October-28 12:43:54> -// -// ------------------------------------------------------------------ -// -// This module defines classes used in decompression. This code is derived -// from the jzlib implementation of zlib. In keeping with the license for jzlib, -// the copyright to that code is below. -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - - -using System; -namespace Ionic.Zlib -{ - - sealed class InfTree - { - - private const int MANY = 1440; - - private const int Z_OK = 0; - private const int Z_STREAM_END = 1; - private const int Z_NEED_DICT = 2; - private const int Z_ERRNO = - 1; - private const int Z_STREAM_ERROR = - 2; - private const int Z_DATA_ERROR = - 3; - private const int Z_MEM_ERROR = - 4; - private const int Z_BUF_ERROR = - 5; - private const int Z_VERSION_ERROR = - 6; - - internal const int fixed_bl = 9; - internal const int fixed_bd = 5; - - //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_tl'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] fixed_tl = new int[]{96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, - 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, - 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255}; - //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_td'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] fixed_td = new int[]{80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577}; - - // Tables for deflate from PKZIP's appnote.txt. - //UPGRADE_NOTE: Final was removed from the declaration of 'cplens'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] cplens = new int[]{3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - - // see note #13 above about 258 - //UPGRADE_NOTE: Final was removed from the declaration of 'cplext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] cplext = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; - - //UPGRADE_NOTE: Final was removed from the declaration of 'cpdist'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] cpdist = new int[]{1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; - - //UPGRADE_NOTE: Final was removed from the declaration of 'cpdext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" - internal static readonly int[] cpdext = new int[]{0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; - - // If BMAX needs to be larger than 16, then h and x[] should be uLong. - internal const int BMAX = 15; // maximum bit length of any code - - internal int[] hn = null; // hufts used in space - internal int[] v = null; // work area for huft_build - internal int[] c = null; // bit length count table - internal int[] r = null; // table entry for structure assignment - internal int[] u = null; // table stack - internal int[] x = null; // bit offsets, then code stack - - private int huft_build(int[] b, int bindex, int n, int s, int[] d, int[] e, int[] t, int[] m, int[] hp, int[] hn, int[] v) - { - // Given a list of code lengths and a maximum table size, make a set of - // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR - // if the given code set is incomplete (the tables are still built in this - // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of - // lengths), or Z_MEM_ERROR if not enough memory. - - int a; // counter for codes of length k - int f; // i repeats in table every f entries - int g; // maximum code length - int h; // table level - int i; // counter, current code - int j; // counter - int k; // number of bits in current code - int l; // bits per table (returned in m) - int mask; // (1 << w) - 1, to avoid cc -O bug on HP - int p; // pointer into c[], b[], or v[] - int q; // points to current table - int w; // bits before this table == (l * h) - int xp; // pointer into x - int y; // number of dummy codes added - int z; // number of entries in current table - - // Generate counts for each bit length - - p = 0; i = n; - do - { - c[b[bindex + p]]++; p++; i--; // assume all entries <= BMAX - } - while (i != 0); - - if (c[0] == n) - { - // null input--all zero length codes - t[0] = - 1; - m[0] = 0; - return Z_OK; - } - - // Find minimum and maximum length, bound *m by those - l = m[0]; - for (j = 1; j <= BMAX; j++) - if (c[j] != 0) - break; - k = j; // minimum code length - if (l < j) - { - l = j; - } - for (i = BMAX; i != 0; i--) - { - if (c[i] != 0) - break; - } - g = i; // maximum code length - if (l > i) - { - l = i; - } - m[0] = l; - - // Adjust last length count to fill out codes, if needed - for (y = 1 << j; j < i; j++, y <<= 1) - { - if ((y -= c[j]) < 0) - { - return Z_DATA_ERROR; - } - } - if ((y -= c[i]) < 0) - { - return Z_DATA_ERROR; - } - c[i] += y; - - // Generate starting offsets into the value table for each length - x[1] = j = 0; - p = 1; xp = 2; - while (--i != 0) - { - // note that i == g from above - x[xp] = (j += c[p]); - xp++; - p++; - } - - // Make a table of values in order of bit lengths - i = 0; p = 0; - do - { - if ((j = b[bindex + p]) != 0) - { - v[x[j]++] = i; - } - p++; - } - while (++i < n); - n = x[g]; // set n to length of v - - // Generate the Huffman codes and for each, make the table entries - x[0] = i = 0; // first Huffman code is zero - p = 0; // grab values in bit order - h = - 1; // no tables yet--level -1 - w = - l; // bits decoded == (l * h) - u[0] = 0; // just to keep compilers happy - q = 0; // ditto - z = 0; // ditto - - // go through the bit lengths (k already is bits in shortest code) - for (; k <= g; k++) - { - a = c[k]; - while (a-- != 0) - { - // here i is the Huffman code of length k bits for value *p - // make tables up to required level - while (k > w + l) - { - h++; - w += l; // previous table always l bits - // compute minimum size table less than or equal to l bits - z = g - w; - z = (z > l)?l:z; // table size upper limit - if ((f = 1 << (j = k - w)) > a + 1) - { - // try a k-w bit table - // too few codes for k-w bit table - f -= (a + 1); // deduct codes from patterns left - xp = k; - if (j < z) - { - while (++j < z) - { - // try smaller tables up to z bits - if ((f <<= 1) <= c[++xp]) - break; // enough codes to use up j bits - f -= c[xp]; // else deduct codes from patterns - } - } - } - z = 1 << j; // table entries for j-bit table - - // allocate new table - if (hn[0] + z > MANY) - { - // (note: doesn't matter for fixed) - return Z_DATA_ERROR; // overflow of MANY - } - u[h] = q = hn[0]; // DEBUG - hn[0] += z; - - // connect to last table, if there is one - if (h != 0) - { - x[h] = i; // save pattern for backing up - r[0] = (sbyte) j; // bits in this table - r[1] = (sbyte) l; // bits to dump before this table - j = SharedUtils.URShift(i, (w - l)); - r[2] = (int) (q - u[h - 1] - j); // offset to this table - Array.Copy(r, 0, hp, (u[h - 1] + j) * 3, 3); // connect to last table - } - else - { - t[0] = q; // first table is returned result - } - } - - // set up table entry in r - r[1] = (sbyte) (k - w); - if (p >= n) - { - r[0] = 128 + 64; // out of values--invalid code - } - else if (v[p] < s) - { - r[0] = (sbyte) (v[p] < 256?0:32 + 64); // 256 is end-of-block - r[2] = v[p++]; // simple code is just the value - } - else - { - r[0] = (sbyte) (e[v[p] - s] + 16 + 64); // non-simple--look up in lists - r[2] = d[v[p++] - s]; - } - - // fill code-like entries with r - f = 1 << (k - w); - for (j = SharedUtils.URShift(i, w); j < z; j += f) - { - Array.Copy(r, 0, hp, (q + j) * 3, 3); - } - - // backwards increment the k-bit code i - for (j = 1 << (k - 1); (i & j) != 0; j = SharedUtils.URShift(j, 1)) - { - i ^= j; - } - i ^= j; - - // backup over finished tables - mask = (1 << w) - 1; // needed on HP, cc -O bug - while ((i & mask) != x[h]) - { - h--; // don't need to update q - w -= l; - mask = (1 << w) - 1; - } - } - } - // Return Z_BUF_ERROR if we were given an incomplete table - return y != 0 && g != 1?Z_BUF_ERROR:Z_OK; - } - - internal int inflate_trees_bits(int[] c, int[] bb, int[] tb, int[] hp, ZlibCodec z) - { - int result; - initWorkArea(19); - hn[0] = 0; - result = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v); - - if (result == Z_DATA_ERROR) - { - z.Message = "oversubscribed dynamic bit lengths tree"; - } - else if (result == Z_BUF_ERROR || bb[0] == 0) - { - z.Message = "incomplete dynamic bit lengths tree"; - result = Z_DATA_ERROR; - } - return result; - } - - internal int inflate_trees_dynamic(int nl, int nd, int[] c, int[] bl, int[] bd, int[] tl, int[] td, int[] hp, ZlibCodec z) - { - int result; - - // build literal/length tree - initWorkArea(288); - hn[0] = 0; - result = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v); - if (result != Z_OK || bl[0] == 0) - { - if (result == Z_DATA_ERROR) - { - z.Message = "oversubscribed literal/length tree"; - } - else if (result != Z_MEM_ERROR) - { - z.Message = "incomplete literal/length tree"; - result = Z_DATA_ERROR; - } - return result; - } - - // build distance tree - initWorkArea(288); - result = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v); - - if (result != Z_OK || (bd[0] == 0 && nl > 257)) - { - if (result == Z_DATA_ERROR) - { - z.Message = "oversubscribed distance tree"; - } - else if (result == Z_BUF_ERROR) - { - z.Message = "incomplete distance tree"; - result = Z_DATA_ERROR; - } - else if (result != Z_MEM_ERROR) - { - z.Message = "empty distance tree with lengths"; - result = Z_DATA_ERROR; - } - return result; - } - - return Z_OK; - } - - internal static int inflate_trees_fixed(int[] bl, int[] bd, int[][] tl, int[][] td, ZlibCodec z) - { - bl[0] = fixed_bl; - bd[0] = fixed_bd; - tl[0] = fixed_tl; - td[0] = fixed_td; - return Z_OK; - } - - private void initWorkArea(int vsize) - { - if (hn == null) - { - hn = new int[1]; - v = new int[vsize]; - c = new int[BMAX + 1]; - r = new int[3]; - u = new int[BMAX]; - x = new int[BMAX + 1]; - } - else - { - if (v.Length < vsize) - { - v = new int[vsize]; - } - Array.Clear(v,0,vsize); - Array.Clear(c,0,BMAX+1); - r[0]=0; r[1]=0; r[2]=0; - // for(int i=0; i -// -// ------------------------------------------------------------------ -// -// This module defines classes for decompression. This code is derived -// from the jzlib implementation of zlib, but significantly modified. -// The object model is not the same, and many of the behaviors are -// different. Nonetheless, in keeping with the license for jzlib, I am -// reproducing the copyright to that code here. -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - -using System; -namespace Ionic.Zlib -{ - sealed class InflateBlocks - { - private const int MANY = 1440; - - // Table for deflate from PKZIP's appnote.txt. - internal static readonly int[] border = new int[] - { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - - private enum InflateBlockMode - { - TYPE = 0, // get type bits (3, including end bit) - LENS = 1, // get lengths for stored - STORED = 2, // processing stored block - TABLE = 3, // get table lengths - BTREE = 4, // get bit lengths tree for a dynamic block - DTREE = 5, // get length, distance trees for a dynamic block - CODES = 6, // processing fixed or dynamic block - DRY = 7, // output remaining window bytes - DONE = 8, // finished last block, done - BAD = 9, // ot a data error--stuck here - } - - private InflateBlockMode mode; // current inflate_block mode - - internal int left; // if STORED, bytes left to copy - - internal int table; // table lengths (14 bits) - internal int index; // index into blens (or border) - internal int[] blens; // bit lengths of codes - internal int[] bb = new int[1]; // bit length tree depth - internal int[] tb = new int[1]; // bit length decoding tree - - internal InflateCodes codes = new InflateCodes(); // if CODES, current state - - internal int last; // true if this block is the last block - - internal ZlibCodec _codec; // pointer back to this zlib stream - - // mode independent information - internal int bitk; // bits in bit buffer - internal int bitb; // bit buffer - internal int[] hufts; // single malloc for tree space - internal byte[] window; // sliding window - internal int end; // one byte after sliding window - internal int readAt; // window read pointer - internal int writeAt; // window write pointer - internal System.Object checkfn; // check function - internal uint check; // check on output - - internal InfTree inftree = new InfTree(); - - internal InflateBlocks(ZlibCodec codec, System.Object checkfn, int w) - { - _codec = codec; - hufts = new int[MANY * 3]; - window = new byte[w]; - end = w; - this.checkfn = checkfn; - mode = InflateBlockMode.TYPE; - Reset(); - } - - internal uint Reset() - { - uint oldCheck = check; - mode = InflateBlockMode.TYPE; - bitk = 0; - bitb = 0; - readAt = writeAt = 0; - - if (checkfn != null) - _codec._Adler32 = check = Adler.Adler32(0, null, 0, 0); - return oldCheck; - } - - - internal int Process(int r) - { - int t; // temporary storage - int b; // bit buffer - int k; // bits in bit buffer - int p; // input data pointer - int n; // bytes available there - int q; // output window write pointer - int m; // bytes to end of window or read pointer - - // copy input/output information to locals (UPDATE macro restores) - - p = _codec.NextIn; - n = _codec.AvailableBytesIn; - b = bitb; - k = bitk; - - q = writeAt; - m = (int)(q < readAt ? readAt - q - 1 : end - q); - - - // process input based on current state - while (true) - { - switch (mode) - { - case InflateBlockMode.TYPE: - - while (k < (3)) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - t = (int)(b & 7); - last = t & 1; - - switch ((uint)t >> 1) - { - case 0: // stored - b >>= 3; k -= (3); - t = k & 7; // go to byte boundary - b >>= t; k -= t; - mode = InflateBlockMode.LENS; // get length of stored block - break; - - case 1: // fixed - int[] bl = new int[1]; - int[] bd = new int[1]; - int[][] tl = new int[1][]; - int[][] td = new int[1][]; - InfTree.inflate_trees_fixed(bl, bd, tl, td, _codec); - codes.Init(bl[0], bd[0], tl[0], 0, td[0], 0); - b >>= 3; k -= 3; - mode = InflateBlockMode.CODES; - break; - - case 2: // dynamic - b >>= 3; k -= 3; - mode = InflateBlockMode.TABLE; - break; - - case 3: // illegal - b >>= 3; k -= 3; - mode = InflateBlockMode.BAD; - _codec.Message = "invalid block type"; - r = ZlibConstants.Z_DATA_ERROR; - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - break; - - case InflateBlockMode.LENS: - - while (k < (32)) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - ; - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - if ( ( ((~b)>>16) & 0xffff) != (b & 0xffff)) - { - mode = InflateBlockMode.BAD; - _codec.Message = "invalid stored block lengths"; - r = ZlibConstants.Z_DATA_ERROR; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - left = (b & 0xffff); - b = k = 0; // dump bits - mode = left != 0 ? InflateBlockMode.STORED : (last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE); - break; - - case InflateBlockMode.STORED: - if (n == 0) - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - if (m == 0) - { - if (q == end && readAt != 0) - { - q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); - } - if (m == 0) - { - writeAt = q; - r = Flush(r); - q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); - if (q == end && readAt != 0) - { - q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); - } - if (m == 0) - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - } - } - r = ZlibConstants.Z_OK; - - t = left; - if (t > n) - t = n; - if (t > m) - t = m; - Array.Copy(_codec.InputBuffer, p, window, q, t); - p += t; n -= t; - q += t; m -= t; - if ((left -= t) != 0) - break; - mode = last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE; - break; - - case InflateBlockMode.TABLE: - - while (k < (14)) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - table = t = (b & 0x3fff); - if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) - { - mode = InflateBlockMode.BAD; - _codec.Message = "too many length or distance symbols"; - r = ZlibConstants.Z_DATA_ERROR; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); - if (blens == null || blens.Length < t) - { - blens = new int[t]; - } - else - { - Array.Clear(blens, 0, t); - // for (int i = 0; i < t; i++) - // { - // blens[i] = 0; - // } - } - - b >>= 14; - k -= 14; - - - index = 0; - mode = InflateBlockMode.BTREE; - goto case InflateBlockMode.BTREE; - - case InflateBlockMode.BTREE: - while (index < 4 + (table >> 10)) - { - while (k < (3)) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - blens[border[index++]] = b & 7; - - b >>= 3; k -= 3; - } - - while (index < 19) - { - blens[border[index++]] = 0; - } - - bb[0] = 7; - t = inftree.inflate_trees_bits(blens, bb, tb, hufts, _codec); - if (t != ZlibConstants.Z_OK) - { - r = t; - if (r == ZlibConstants.Z_DATA_ERROR) - { - blens = null; - mode = InflateBlockMode.BAD; - } - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - index = 0; - mode = InflateBlockMode.DTREE; - goto case InflateBlockMode.DTREE; - - case InflateBlockMode.DTREE: - while (true) - { - t = table; - if (!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) - { - break; - } - - int i, j, c; - - t = bb[0]; - - while (k < t) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - t = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 1]; - c = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 2]; - - if (c < 16) - { - b >>= t; k -= t; - blens[index++] = c; - } - else - { - // c == 16..18 - i = c == 18 ? 7 : c - 14; - j = c == 18 ? 11 : 3; - - while (k < (t + i)) - { - if (n != 0) - { - r = ZlibConstants.Z_OK; - } - else - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - n--; - b |= (_codec.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - b >>= t; k -= t; - - j += (b & InternalInflateConstants.InflateMask[i]); - - b >>= i; k -= i; - - i = index; - t = table; - if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) - { - blens = null; - mode = InflateBlockMode.BAD; - _codec.Message = "invalid bit length repeat"; - r = ZlibConstants.Z_DATA_ERROR; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - - c = (c == 16) ? blens[i-1] : 0; - do - { - blens[i++] = c; - } - while (--j != 0); - index = i; - } - } - - tb[0] = -1; - { - int[] bl = new int[] { 9 }; // must be <= 9 for lookahead assumptions - int[] bd = new int[] { 6 }; // must be <= 9 for lookahead assumptions - int[] tl = new int[1]; - int[] td = new int[1]; - - t = table; - t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl, bd, tl, td, hufts, _codec); - - if (t != ZlibConstants.Z_OK) - { - if (t == ZlibConstants.Z_DATA_ERROR) - { - blens = null; - mode = InflateBlockMode.BAD; - } - r = t; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - codes.Init(bl[0], bd[0], hufts, tl[0], hufts, td[0]); - } - mode = InflateBlockMode.CODES; - goto case InflateBlockMode.CODES; - - case InflateBlockMode.CODES: - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - - r = codes.Process(this, r); - if (r != ZlibConstants.Z_STREAM_END) - { - return Flush(r); - } - - r = ZlibConstants.Z_OK; - p = _codec.NextIn; - n = _codec.AvailableBytesIn; - b = bitb; - k = bitk; - q = writeAt; - m = (int)(q < readAt ? readAt - q - 1 : end - q); - - if (last == 0) - { - mode = InflateBlockMode.TYPE; - break; - } - mode = InflateBlockMode.DRY; - goto case InflateBlockMode.DRY; - - case InflateBlockMode.DRY: - writeAt = q; - r = Flush(r); - q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); - if (readAt != writeAt) - { - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - mode = InflateBlockMode.DONE; - goto case InflateBlockMode.DONE; - - case InflateBlockMode.DONE: - r = ZlibConstants.Z_STREAM_END; - bitb = b; - bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - - case InflateBlockMode.BAD: - r = ZlibConstants.Z_DATA_ERROR; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - - - default: - r = ZlibConstants.Z_STREAM_ERROR; - - bitb = b; bitk = k; - _codec.AvailableBytesIn = n; - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - writeAt = q; - return Flush(r); - } - } - } - - - internal void Free() - { - Reset(); - window = null; - hufts = null; - } - - internal void SetDictionary(byte[] d, int start, int n) - { - Array.Copy(d, start, window, 0, n); - readAt = writeAt = n; - } - - // Returns true if inflate is currently at the end of a block generated - // by Z_SYNC_FLUSH or Z_FULL_FLUSH. - internal int SyncPoint() - { - return mode == InflateBlockMode.LENS ? 1 : 0; - } - - // copy as much as possible from the sliding window to the output area - internal int Flush(int r) - { - int nBytes; - - for (int pass=0; pass < 2; pass++) - { - if (pass==0) - { - // compute number of bytes to copy as far as end of window - nBytes = (int)((readAt <= writeAt ? writeAt : end) - readAt); - } - else - { - // compute bytes to copy - nBytes = writeAt - readAt; - } - - // workitem 8870 - if (nBytes == 0) - { - if (r == ZlibConstants.Z_BUF_ERROR) - r = ZlibConstants.Z_OK; - return r; - } - - if (nBytes > _codec.AvailableBytesOut) - nBytes = _codec.AvailableBytesOut; - - if (nBytes != 0 && r == ZlibConstants.Z_BUF_ERROR) - r = ZlibConstants.Z_OK; - - // update counters - _codec.AvailableBytesOut -= nBytes; - _codec.TotalBytesOut += nBytes; - - // update check information - if (checkfn != null) - _codec._Adler32 = check = Adler.Adler32(check, window, readAt, nBytes); - - // copy as far as end of window - Array.Copy(window, readAt, _codec.OutputBuffer, _codec.NextOut, nBytes); - _codec.NextOut += nBytes; - readAt += nBytes; - - // see if more to copy at beginning of window - if (readAt == end && pass == 0) - { - // wrap pointers - readAt = 0; - if (writeAt == end) - writeAt = 0; - } - else pass++; - } - - // done - return r; - } - } - - - internal static class InternalInflateConstants - { - // And'ing with mask[n] masks the lower n bits - internal static readonly int[] InflateMask = new int[] { - 0x00000000, 0x00000001, 0x00000003, 0x00000007, - 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, - 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, - 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff }; - } - - - sealed class InflateCodes - { - // waiting for "i:"=input, - // "o:"=output, - // "x:"=nothing - private const int START = 0; // x: set up for LEN - private const int LEN = 1; // i: get length/literal/eob next - private const int LENEXT = 2; // i: getting length extra (have base) - private const int DIST = 3; // i: get distance next - private const int DISTEXT = 4; // i: getting distance extra - private const int COPY = 5; // o: copying bytes in window, waiting for space - private const int LIT = 6; // o: got literal, waiting for output space - private const int WASH = 7; // o: got eob, possibly still output waiting - private const int END = 8; // x: got eob and all data flushed - private const int BADCODE = 9; // x: got error - - internal int mode; // current inflate_codes mode - - // mode dependent information - internal int len; - - internal int[] tree; // pointer into tree - internal int tree_index = 0; - internal int need; // bits needed - - internal int lit; - - // if EXT or COPY, where and how much - internal int bitsToGet; // bits to get for extra - internal int dist; // distance back to copy from - - internal byte lbits; // ltree bits decoded per branch - internal byte dbits; // dtree bits decoder per branch - internal int[] ltree; // literal/length/eob tree - internal int ltree_index; // literal/length/eob tree - internal int[] dtree; // distance tree - internal int dtree_index; // distance tree - - internal InflateCodes() - { - } - - internal void Init(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index) - { - mode = START; - lbits = (byte)bl; - dbits = (byte)bd; - ltree = tl; - ltree_index = tl_index; - dtree = td; - dtree_index = td_index; - tree = null; - } - - internal int Process(InflateBlocks blocks, int r) - { - int j; // temporary storage - int tindex; // temporary pointer - int e; // extra bits or operation - int b = 0; // bit buffer - int k = 0; // bits in bit buffer - int p = 0; // input data pointer - int n; // bytes available there - int q; // output window write pointer - int m; // bytes to end of window or read pointer - int f; // pointer to copy strings from - - ZlibCodec z = blocks._codec; - - // copy input/output information to locals (UPDATE macro restores) - p = z.NextIn; - n = z.AvailableBytesIn; - b = blocks.bitb; - k = blocks.bitk; - q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - - // process input and output based on current state - while (true) - { - switch (mode) - { - // waiting for "i:"=input, "o:"=output, "x:"=nothing - case START: // x: set up for LEN - if (m >= 258 && n >= 10) - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; - z.TotalBytesIn += p - z.NextIn; - z.NextIn = p; - blocks.writeAt = q; - r = InflateFast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, blocks, z); - - p = z.NextIn; - n = z.AvailableBytesIn; - b = blocks.bitb; - k = blocks.bitk; - q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - - if (r != ZlibConstants.Z_OK) - { - mode = (r == ZlibConstants.Z_STREAM_END) ? WASH : BADCODE; - break; - } - } - need = lbits; - tree = ltree; - tree_index = ltree_index; - - mode = LEN; - goto case LEN; - - case LEN: // i: get length/literal/eob next - j = need; - - while (k < j) - { - if (n != 0) - r = ZlibConstants.Z_OK; - else - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; - z.TotalBytesIn += p - z.NextIn; - z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - n--; - b |= (z.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; - - b >>= (tree[tindex + 1]); - k -= (tree[tindex + 1]); - - e = tree[tindex]; - - if (e == 0) - { - // literal - lit = tree[tindex + 2]; - mode = LIT; - break; - } - if ((e & 16) != 0) - { - // length - bitsToGet = e & 15; - len = tree[tindex + 2]; - mode = LENEXT; - break; - } - if ((e & 64) == 0) - { - // next table - need = e; - tree_index = tindex / 3 + tree[tindex + 2]; - break; - } - if ((e & 32) != 0) - { - // end of block - mode = WASH; - break; - } - mode = BADCODE; // invalid code - z.Message = "invalid literal/length code"; - r = ZlibConstants.Z_DATA_ERROR; - - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; - z.TotalBytesIn += p - z.NextIn; - z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - - - case LENEXT: // i: getting length extra (have base) - j = bitsToGet; - - while (k < j) - { - if (n != 0) - r = ZlibConstants.Z_OK; - else - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - n--; b |= (z.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - len += (b & InternalInflateConstants.InflateMask[j]); - - b >>= j; - k -= j; - - need = dbits; - tree = dtree; - tree_index = dtree_index; - mode = DIST; - goto case DIST; - - case DIST: // i: get distance next - j = need; - - while (k < j) - { - if (n != 0) - r = ZlibConstants.Z_OK; - else - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - n--; b |= (z.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; - - b >>= tree[tindex + 1]; - k -= tree[tindex + 1]; - - e = (tree[tindex]); - if ((e & 0x10) != 0) - { - // distance - bitsToGet = e & 15; - dist = tree[tindex + 2]; - mode = DISTEXT; - break; - } - if ((e & 64) == 0) - { - // next table - need = e; - tree_index = tindex / 3 + tree[tindex + 2]; - break; - } - mode = BADCODE; // invalid code - z.Message = "invalid distance code"; - r = ZlibConstants.Z_DATA_ERROR; - - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - - - case DISTEXT: // i: getting distance extra - j = bitsToGet; - - while (k < j) - { - if (n != 0) - r = ZlibConstants.Z_OK; - else - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - n--; b |= (z.InputBuffer[p++] & 0xff) << k; - k += 8; - } - - dist += (b & InternalInflateConstants.InflateMask[j]); - - b >>= j; - k -= j; - - mode = COPY; - goto case COPY; - - case COPY: // o: copying bytes in window, waiting for space - f = q - dist; - while (f < 0) - { - // modulo window size-"while" instead - f += blocks.end; // of "if" handles invalid distances - } - while (len != 0) - { - if (m == 0) - { - if (q == blocks.end && blocks.readAt != 0) - { - q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - } - if (m == 0) - { - blocks.writeAt = q; r = blocks.Flush(r); - q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - - if (q == blocks.end && blocks.readAt != 0) - { - q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - } - - if (m == 0) - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; - z.TotalBytesIn += p - z.NextIn; - z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - } - } - - blocks.window[q++] = blocks.window[f++]; m--; - - if (f == blocks.end) - f = 0; - len--; - } - mode = START; - break; - - case LIT: // o: got literal, waiting for output space - if (m == 0) - { - if (q == blocks.end && blocks.readAt != 0) - { - q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - } - if (m == 0) - { - blocks.writeAt = q; r = blocks.Flush(r); - q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - - if (q == blocks.end && blocks.readAt != 0) - { - q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - } - if (m == 0) - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - } - } - r = ZlibConstants.Z_OK; - - blocks.window[q++] = (byte)lit; m--; - - mode = START; - break; - - case WASH: // o: got eob, possibly more output - if (k > 7) - { - // return unused byte, if any - k -= 8; - n++; - p--; // can always return one - } - - blocks.writeAt = q; r = blocks.Flush(r); - q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; - - if (blocks.readAt != blocks.writeAt) - { - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - mode = END; - goto case END; - - case END: - r = ZlibConstants.Z_STREAM_END; - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - - case BADCODE: // x: got error - - r = ZlibConstants.Z_DATA_ERROR; - - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - - default: - r = ZlibConstants.Z_STREAM_ERROR; - - blocks.bitb = b; blocks.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - blocks.writeAt = q; - return blocks.Flush(r); - } - } - } - - - // Called with number of bytes left to write in window at least 258 - // (the maximum string length) and number of input bytes available - // at least ten. The ten bytes are six bytes for the longest length/ - // distance pair plus four bytes for overloading the bit buffer. - - internal int InflateFast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InflateBlocks s, ZlibCodec z) - { - int t; // temporary pointer - int[] tp; // temporary pointer - int tp_index; // temporary pointer - int e; // extra bits or operation - int b; // bit buffer - int k; // bits in bit buffer - int p; // input data pointer - int n; // bytes available there - int q; // output window write pointer - int m; // bytes to end of window or read pointer - int ml; // mask for literal/length tree - int md; // mask for distance tree - int c; // bytes to copy - int d; // distance back to copy from - int r; // copy source pointer - - int tp_index_t_3; // (tp_index+t)*3 - - // load input, output, bit values - p = z.NextIn; n = z.AvailableBytesIn; b = s.bitb; k = s.bitk; - q = s.writeAt; m = q < s.readAt ? s.readAt - q - 1 : s.end - q; - - // initialize masks - ml = InternalInflateConstants.InflateMask[bl]; - md = InternalInflateConstants.InflateMask[bd]; - - // do until not enough input or output space for fast loop - do - { - // assume called with m >= 258 && n >= 10 - // get literal/length code - while (k < (20)) - { - // max bits for literal/length code - n--; - b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; - } - - t = b & ml; - tp = tl; - tp_index = tl_index; - tp_index_t_3 = (tp_index + t) * 3; - if ((e = tp[tp_index_t_3]) == 0) - { - b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); - - s.window[q++] = (byte)tp[tp_index_t_3 + 2]; - m--; - continue; - } - do - { - - b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); - - if ((e & 16) != 0) - { - e &= 15; - c = tp[tp_index_t_3 + 2] + ((int)b & InternalInflateConstants.InflateMask[e]); - - b >>= e; k -= e; - - // decode distance base of block to copy - while (k < 15) - { - // max bits for distance code - n--; - b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; - } - - t = b & md; - tp = td; - tp_index = td_index; - tp_index_t_3 = (tp_index + t) * 3; - e = tp[tp_index_t_3]; - - do - { - - b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); - - if ((e & 16) != 0) - { - // get extra bits to add to distance base - e &= 15; - while (k < e) - { - // get extra bits (up to 13) - n--; - b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; - } - - d = tp[tp_index_t_3 + 2] + (b & InternalInflateConstants.InflateMask[e]); - - b >>= e; k -= e; - - // do the copy - m -= c; - if (q >= d) - { - // offset before dest - // just copy - r = q - d; - if (q - r > 0 && 2 > (q - r)) - { - s.window[q++] = s.window[r++]; // minimum count is three, - s.window[q++] = s.window[r++]; // so unroll loop a little - c -= 2; - } - else - { - Array.Copy(s.window, r, s.window, q, 2); - q += 2; r += 2; c -= 2; - } - } - else - { - // else offset after destination - r = q - d; - do - { - r += s.end; // force pointer in window - } - while (r < 0); // covers invalid distances - e = s.end - r; - if (c > e) - { - // if source crosses, - c -= e; // wrapped copy - if (q - r > 0 && e > (q - r)) - { - do - { - s.window[q++] = s.window[r++]; - } - while (--e != 0); - } - else - { - Array.Copy(s.window, r, s.window, q, e); - q += e; r += e; e = 0; - } - r = 0; // copy rest from start of window - } - } - - // copy all or what's left - if (q - r > 0 && c > (q - r)) - { - do - { - s.window[q++] = s.window[r++]; - } - while (--c != 0); - } - else - { - Array.Copy(s.window, r, s.window, q, c); - q += c; r += c; c = 0; - } - break; - } - else if ((e & 64) == 0) - { - t += tp[tp_index_t_3 + 2]; - t += (b & InternalInflateConstants.InflateMask[e]); - tp_index_t_3 = (tp_index + t) * 3; - e = tp[tp_index_t_3]; - } - else - { - z.Message = "invalid distance code"; - - c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); - - s.bitb = b; s.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - s.writeAt = q; - - return ZlibConstants.Z_DATA_ERROR; - } - } - while (true); - break; - } - - if ((e & 64) == 0) - { - t += tp[tp_index_t_3 + 2]; - t += (b & InternalInflateConstants.InflateMask[e]); - tp_index_t_3 = (tp_index + t) * 3; - if ((e = tp[tp_index_t_3]) == 0) - { - b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); - s.window[q++] = (byte)tp[tp_index_t_3 + 2]; - m--; - break; - } - } - else if ((e & 32) != 0) - { - c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); - - s.bitb = b; s.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - s.writeAt = q; - - return ZlibConstants.Z_STREAM_END; - } - else - { - z.Message = "invalid literal/length code"; - - c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); - - s.bitb = b; s.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - s.writeAt = q; - - return ZlibConstants.Z_DATA_ERROR; - } - } - while (true); - } - while (m >= 258 && n >= 10); - - // not enough input or output--restore pointers and return - c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); - - s.bitb = b; s.bitk = k; - z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; - s.writeAt = q; - - return ZlibConstants.Z_OK; - } - } - - - internal sealed class InflateManager - { - // preset dictionary flag in zlib header - private const int PRESET_DICT = 0x20; - - private const int Z_DEFLATED = 8; - - private enum InflateManagerMode - { - METHOD = 0, // waiting for method byte - FLAG = 1, // waiting for flag byte - DICT4 = 2, // four dictionary check bytes to go - DICT3 = 3, // three dictionary check bytes to go - DICT2 = 4, // two dictionary check bytes to go - DICT1 = 5, // one dictionary check byte to go - DICT0 = 6, // waiting for inflateSetDictionary - BLOCKS = 7, // decompressing blocks - CHECK4 = 8, // four check bytes to go - CHECK3 = 9, // three check bytes to go - CHECK2 = 10, // two check bytes to go - CHECK1 = 11, // one check byte to go - DONE = 12, // finished check, done - BAD = 13, // got an error--stay here - } - - private InflateManagerMode mode; // current inflate mode - internal ZlibCodec _codec; // pointer back to this zlib stream - - // mode dependent information - internal int method; // if FLAGS, method byte - - // if CHECK, check values to compare - internal uint computedCheck; // computed check value - internal uint expectedCheck; // stream check value - - // if BAD, inflateSync's marker bytes count - internal int marker; - - // mode independent information - //internal int nowrap; // flag for no wrapper - private bool _handleRfc1950HeaderBytes = true; - internal bool HandleRfc1950HeaderBytes - { - get { return _handleRfc1950HeaderBytes; } - set { _handleRfc1950HeaderBytes = value; } - } - internal int wbits; // log2(window size) (8..15, defaults to 15) - - internal InflateBlocks blocks; // current inflate_blocks state - - public InflateManager() { } - - public InflateManager(bool expectRfc1950HeaderBytes) - { - _handleRfc1950HeaderBytes = expectRfc1950HeaderBytes; - } - - internal int Reset() - { - _codec.TotalBytesIn = _codec.TotalBytesOut = 0; - _codec.Message = null; - mode = HandleRfc1950HeaderBytes ? InflateManagerMode.METHOD : InflateManagerMode.BLOCKS; - blocks.Reset(); - return ZlibConstants.Z_OK; - } - - internal int End() - { - if (blocks != null) - blocks.Free(); - blocks = null; - return ZlibConstants.Z_OK; - } - - internal int Initialize(ZlibCodec codec, int w) - { - _codec = codec; - _codec.Message = null; - blocks = null; - - // handle undocumented nowrap option (no zlib header or check) - //nowrap = 0; - //if (w < 0) - //{ - // w = - w; - // nowrap = 1; - //} - - // set window size - if (w < 8 || w > 15) - { - End(); - throw new ZlibException("Bad window size."); - - //return ZlibConstants.Z_STREAM_ERROR; - } - wbits = w; - - blocks = new InflateBlocks(codec, - HandleRfc1950HeaderBytes ? this : null, - 1 << w); - - // reset state - Reset(); - return ZlibConstants.Z_OK; - } - - - internal int Inflate(FlushType flush) - { - int b; - - if (_codec.InputBuffer == null) - throw new ZlibException("InputBuffer is null. "); - -// int f = (flush == FlushType.Finish) -// ? ZlibConstants.Z_BUF_ERROR -// : ZlibConstants.Z_OK; - - // workitem 8870 - int f = ZlibConstants.Z_OK; - int r = ZlibConstants.Z_BUF_ERROR; - - while (true) - { - switch (mode) - { - case InflateManagerMode.METHOD: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - if (((method = _codec.InputBuffer[_codec.NextIn++]) & 0xf) != Z_DEFLATED) - { - mode = InflateManagerMode.BAD; - _codec.Message = String.Format("unknown compression method (0x{0:X2})", method); - marker = 5; // can't try inflateSync - break; - } - if ((method >> 4) + 8 > wbits) - { - mode = InflateManagerMode.BAD; - _codec.Message = String.Format("invalid window size ({0})", (method >> 4) + 8); - marker = 5; // can't try inflateSync - break; - } - mode = InflateManagerMode.FLAG; - break; - - - case InflateManagerMode.FLAG: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - b = (_codec.InputBuffer[_codec.NextIn++]) & 0xff; - - if ((((method << 8) + b) % 31) != 0) - { - mode = InflateManagerMode.BAD; - _codec.Message = "incorrect header check"; - marker = 5; // can't try inflateSync - break; - } - - mode = ((b & PRESET_DICT) == 0) - ? InflateManagerMode.BLOCKS - : InflateManagerMode.DICT4; - break; - - case InflateManagerMode.DICT4: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); - mode = InflateManagerMode.DICT3; - break; - - case InflateManagerMode.DICT3: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); - mode = InflateManagerMode.DICT2; - break; - - case InflateManagerMode.DICT2: - - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); - mode = InflateManagerMode.DICT1; - break; - - - case InflateManagerMode.DICT1: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; _codec.TotalBytesIn++; - expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); - _codec._Adler32 = expectedCheck; - mode = InflateManagerMode.DICT0; - return ZlibConstants.Z_NEED_DICT; - - - case InflateManagerMode.DICT0: - mode = InflateManagerMode.BAD; - _codec.Message = "need dictionary"; - marker = 0; // can try inflateSync - return ZlibConstants.Z_STREAM_ERROR; - - - case InflateManagerMode.BLOCKS: - r = blocks.Process(r); - if (r == ZlibConstants.Z_DATA_ERROR) - { - mode = InflateManagerMode.BAD; - marker = 0; // can try inflateSync - break; - } - - if (r == ZlibConstants.Z_OK) r = f; - - if (r != ZlibConstants.Z_STREAM_END) - return r; - - r = f; - computedCheck = blocks.Reset(); - if (!HandleRfc1950HeaderBytes) - { - mode = InflateManagerMode.DONE; - return ZlibConstants.Z_STREAM_END; - } - mode = InflateManagerMode.CHECK4; - break; - - case InflateManagerMode.CHECK4: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); - mode = InflateManagerMode.CHECK3; - break; - - case InflateManagerMode.CHECK3: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; _codec.TotalBytesIn++; - expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); - mode = InflateManagerMode.CHECK2; - break; - - case InflateManagerMode.CHECK2: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; - _codec.TotalBytesIn++; - expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); - mode = InflateManagerMode.CHECK1; - break; - - case InflateManagerMode.CHECK1: - if (_codec.AvailableBytesIn == 0) return r; - r = f; - _codec.AvailableBytesIn--; _codec.TotalBytesIn++; - expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); - if (computedCheck != expectedCheck) - { - mode = InflateManagerMode.BAD; - _codec.Message = "incorrect data check"; - marker = 5; // can't try inflateSync - break; - } - mode = InflateManagerMode.DONE; - return ZlibConstants.Z_STREAM_END; - - case InflateManagerMode.DONE: - return ZlibConstants.Z_STREAM_END; - - case InflateManagerMode.BAD: - throw new ZlibException(String.Format("Bad state ({0})", _codec.Message)); - - default: - throw new ZlibException("Stream error."); - - } - } - } - - - - internal int SetDictionary(byte[] dictionary) - { - int index = 0; - int length = dictionary.Length; - if (mode != InflateManagerMode.DICT0) - throw new ZlibException("Stream error."); - - if (Adler.Adler32(1, dictionary, 0, dictionary.Length) != _codec._Adler32) - { - return ZlibConstants.Z_DATA_ERROR; - } - - _codec._Adler32 = Adler.Adler32(0, null, 0, 0); - - if (length >= (1 << wbits)) - { - length = (1 << wbits) - 1; - index = dictionary.Length - length; - } - blocks.SetDictionary(dictionary, index, length); - mode = InflateManagerMode.BLOCKS; - return ZlibConstants.Z_OK; - } - - - private static readonly byte[] mark = new byte[] { 0, 0, 0xff, 0xff }; - - internal int Sync() - { - int n; // number of bytes to look at - int p; // pointer to bytes - int m; // number of marker bytes found in a row - long r, w; // temporaries to save total_in and total_out - - // set up - if (mode != InflateManagerMode.BAD) - { - mode = InflateManagerMode.BAD; - marker = 0; - } - if ((n = _codec.AvailableBytesIn) == 0) - return ZlibConstants.Z_BUF_ERROR; - p = _codec.NextIn; - m = marker; - - // search - while (n != 0 && m < 4) - { - if (_codec.InputBuffer[p] == mark[m]) - { - m++; - } - else if (_codec.InputBuffer[p] != 0) - { - m = 0; - } - else - { - m = 4 - m; - } - p++; n--; - } - - // restore - _codec.TotalBytesIn += p - _codec.NextIn; - _codec.NextIn = p; - _codec.AvailableBytesIn = n; - marker = m; - - // return no joy or set up to restart on a new block - if (m != 4) - { - return ZlibConstants.Z_DATA_ERROR; - } - r = _codec.TotalBytesIn; - w = _codec.TotalBytesOut; - Reset(); - _codec.TotalBytesIn = r; - _codec.TotalBytesOut = w; - mode = InflateManagerMode.BLOCKS; - return ZlibConstants.Z_OK; - } - - - // Returns true if inflate is currently at the end of a block generated - // by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - // implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH - // but removes the length bytes of the resulting empty stored block. When - // decompressing, PPP checks that at the end of input packet, inflate is - // waiting for these length bytes. - internal int SyncPoint(ZlibCodec z) - { - return blocks.SyncPoint(); - } - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Inflate.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Inflate.cs.meta deleted file mode 100755 index 7780efa6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Inflate.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: dbc8cf5f446a5304d9816ca7c6842d08 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs deleted file mode 100755 index 42e280f7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs +++ /dev/null @@ -1,1385 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -//#define Trace - -// ParallelDeflateOutputStream.cs -// ------------------------------------------------------------------ -// -// A DeflateStream that does compression only, it uses a -// divide-and-conquer approach with multiple threads to exploit multiple -// CPUs for the DEFLATE computation. -// -// last saved: <2011-July-31 14:49:40> -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2009-2011 by Dino Chiesa -// All rights reserved! -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Threading; -using Ionic.Zlib; -using System.IO; - - -namespace Ionic.Zlib -{ - internal class WorkItem - { - public byte[] buffer; - public byte[] compressed; - public int crc; - public int index; - public int ordinal; - public int inputBytesAvailable; - public int compressedBytesAvailable; - public ZlibCodec compressor; - - public WorkItem(int size, - Ionic.Zlib.CompressionLevel compressLevel, - CompressionStrategy strategy, - int ix) - { - this.buffer= new byte[size]; - // alloc 5 bytes overhead for every block (margin of safety= 2) - int n = size + ((size / 32768)+1) * 5 * 2; - this.compressed = new byte[n]; - this.compressor = new ZlibCodec(); - this.compressor.InitializeDeflate(compressLevel, false); - this.compressor.OutputBuffer = this.compressed; - this.compressor.InputBuffer = this.buffer; - this.index = ix; - } - } - - /// - /// A class for compressing streams using the - /// Deflate algorithm with multiple threads. - /// - /// - /// - /// - /// This class performs DEFLATE compression through writing. For - /// more information on the Deflate algorithm, see IETF RFC 1951, - /// "DEFLATE Compressed Data Format Specification version 1.3." - /// - /// - /// - /// This class is similar to , except - /// that this class is for compression only, and this implementation uses an - /// approach that employs multiple worker threads to perform the DEFLATE. On - /// a multi-cpu or multi-core computer, the performance of this class can be - /// significantly higher than the single-threaded DeflateStream, particularly - /// for larger streams. How large? Anything over 10mb is a good candidate - /// for parallel compression. - /// - /// - /// - /// The tradeoff is that this class uses more memory and more CPU than the - /// vanilla DeflateStream, and also is less efficient as a compressor. For - /// large files the size of the compressed data stream can be less than 1% - /// larger than the size of a compressed data stream from the vanialla - /// DeflateStream. For smaller files the difference can be larger. The - /// difference will also be larger if you set the BufferSize to be lower than - /// the default value. Your mileage may vary. Finally, for small files, the - /// ParallelDeflateOutputStream can be much slower than the vanilla - /// DeflateStream, because of the overhead associated to using the thread - /// pool. - /// - /// - /// - /// - public class ParallelDeflateOutputStream : System.IO.Stream - { - - private static readonly int IO_BUFFER_SIZE_DEFAULT = 64 * 1024; // 128k - private static readonly int BufferPairsPerCore = 4; - - private System.Collections.Generic.List _pool; - private bool _leaveOpen; - private bool emitting; - private System.IO.Stream _outStream; - private int _maxBufferPairs; - private int _bufferSize = IO_BUFFER_SIZE_DEFAULT; - private AutoResetEvent _newlyCompressedBlob; - //private ManualResetEvent _writingDone; - //private ManualResetEvent _sessionReset; - private object _outputLock = new object(); - private bool _isClosed; - private bool _firstWriteDone; - private int _currentlyFilling; - private int _lastFilled; - private int _lastWritten; - private int _latestCompressed; - private int _Crc32; - private Ionic.Crc.CRC32 _runningCrc; - private object _latestLock = new object(); - private System.Collections.Generic.Queue _toWrite; - private System.Collections.Generic.Queue _toFill; - private Int64 _totalBytesProcessed; - private Ionic.Zlib.CompressionLevel _compressLevel; - private volatile Exception _pendingException; - private bool _handlingException; - private object _eLock = new Object(); // protects _pendingException - - // This bitfield is used only when Trace is defined. - //private TraceBits _DesiredTrace = TraceBits.Write | TraceBits.WriteBegin | - //TraceBits.WriteDone | TraceBits.Lifecycle | TraceBits.Fill | TraceBits.Flush | - //TraceBits.Session; - - //private TraceBits _DesiredTrace = TraceBits.WriteBegin | TraceBits.WriteDone | TraceBits.Synch | TraceBits.Lifecycle | TraceBits.Session ; - - private TraceBits _DesiredTrace = - TraceBits.Session | - TraceBits.Compress | - TraceBits.WriteTake | - TraceBits.WriteEnter | - TraceBits.EmitEnter | - TraceBits.EmitDone | - TraceBits.EmitLock | - TraceBits.EmitSkip | - TraceBits.EmitBegin; - - /// - /// Create a ParallelDeflateOutputStream. - /// - /// - /// - /// - /// This stream compresses data written into it via the DEFLATE - /// algorithm (see RFC 1951), and writes out the compressed byte stream. - /// - /// - /// - /// The instance will use the default compression level, the default - /// buffer sizes and the default number of threads and buffers per - /// thread. - /// - /// - /// - /// This class is similar to , - /// except that this implementation uses an approach that employs - /// multiple worker threads to perform the DEFLATE. On a multi-cpu or - /// multi-core computer, the performance of this class can be - /// significantly higher than the single-threaded DeflateStream, - /// particularly for larger streams. How large? Anything over 10mb is - /// a good candidate for parallel compression. - /// - /// - /// - /// - /// - /// - /// This example shows how to use a ParallelDeflateOutputStream to compress - /// data. It reads a file, compresses it, and writes the compressed data to - /// a second, output file. - /// - /// - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n= -1; - /// String outputFile = fileToCompress + ".compressed"; - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(outputFile)) - /// { - /// using (Stream compressor = new ParallelDeflateOutputStream(raw)) - /// { - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Dim outputFile As String = (fileToCompress & ".compressed") - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(outputFile) - /// Using compressor As Stream = New ParallelDeflateOutputStream(raw) - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// The stream to which compressed data will be written. - public ParallelDeflateOutputStream(System.IO.Stream stream) - : this(stream, CompressionLevel.Default, CompressionStrategy.Default, false) - { - } - - /// - /// Create a ParallelDeflateOutputStream using the specified CompressionLevel. - /// - /// - /// See the - /// constructor for example code. - /// - /// The stream to which compressed data will be written. - /// A tuning knob to trade speed for effectiveness. - public ParallelDeflateOutputStream(System.IO.Stream stream, CompressionLevel level) - : this(stream, level, CompressionStrategy.Default, false) - { - } - - /// - /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - /// when the ParallelDeflateOutputStream is closed. - /// - /// - /// See the - /// constructor for example code. - /// - /// The stream to which compressed data will be written. - /// - /// true if the application would like the stream to remain open after inflation/deflation. - /// - public ParallelDeflateOutputStream(System.IO.Stream stream, bool leaveOpen) - : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) - { - } - - /// - /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - /// when the ParallelDeflateOutputStream is closed. - /// - /// - /// See the - /// constructor for example code. - /// - /// The stream to which compressed data will be written. - /// A tuning knob to trade speed for effectiveness. - /// - /// true if the application would like the stream to remain open after inflation/deflation. - /// - public ParallelDeflateOutputStream(System.IO.Stream stream, CompressionLevel level, bool leaveOpen) - : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) - { - } - - /// - /// Create a ParallelDeflateOutputStream using the specified - /// CompressionLevel and CompressionStrategy, and specifying whether to - /// leave the captive stream open when the ParallelDeflateOutputStream is - /// closed. - /// - /// - /// See the - /// constructor for example code. - /// - /// The stream to which compressed data will be written. - /// A tuning knob to trade speed for effectiveness. - /// - /// By tweaking this parameter, you may be able to optimize the compression for - /// data with particular characteristics. - /// - /// - /// true if the application would like the stream to remain open after inflation/deflation. - /// - public ParallelDeflateOutputStream(System.IO.Stream stream, - CompressionLevel level, - CompressionStrategy strategy, - bool leaveOpen) - { - TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "-------------------------------------------------------"); - TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "Create {0:X8}", this.GetHashCode()); - _outStream = stream; - _compressLevel= level; - Strategy = strategy; - _leaveOpen = leaveOpen; - this.MaxBufferPairs = 16; // default - } - - - /// - /// The ZLIB strategy to be used during compression. - /// - /// - public CompressionStrategy Strategy - { - get; - private set; - } - - /// - /// The maximum number of buffer pairs to use. - /// - /// - /// - /// - /// This property sets an upper limit on the number of memory buffer - /// pairs to create. The implementation of this stream allocates - /// multiple buffers to facilitate parallel compression. As each buffer - /// fills up, this stream uses - /// ThreadPool.QueueUserWorkItem() - /// to compress those buffers in a background threadpool thread. After a - /// buffer is compressed, it is re-ordered and written to the output - /// stream. - /// - /// - /// - /// A higher number of buffer pairs enables a higher degree of - /// parallelism, which tends to increase the speed of compression on - /// multi-cpu computers. On the other hand, a higher number of buffer - /// pairs also implies a larger memory consumption, more active worker - /// threads, and a higher cpu utilization for any compression. This - /// property enables the application to limit its memory consumption and - /// CPU utilization behavior depending on requirements. - /// - /// - /// - /// For each compression "task" that occurs in parallel, there are 2 - /// buffers allocated: one for input and one for output. This property - /// sets a limit for the number of pairs. The total amount of storage - /// space allocated for buffering will then be (N*S*2), where N is the - /// number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer - /// pairs per CPU core, so if your machine has 4 cores, and you retain - /// the default buffer size of 128k, then the - /// ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer - /// memory in total, or 4mb, in blocks of 128kb. If you then set this - /// property to 8, then the number will be 8 * 2 * 128kb of buffer - /// memory, or 2mb. - /// - /// - /// - /// CPU utilization will also go up with additional buffers, because a - /// larger number of buffer pairs allows a larger number of background - /// threads to compress in parallel. If you find that parallel - /// compression is consuming too much memory or CPU, you can adjust this - /// value downward. - /// - /// - /// - /// The default value is 16. Different values may deliver better or - /// worse results, depending on your priorities and the dynamic - /// performance characteristics of your storage and compute resources. - /// - /// - /// - /// This property is not the number of buffer pairs to use; it is an - /// upper limit. An illustration: Suppose you have an application that - /// uses the default value of this property (which is 16), and it runs - /// on a machine with 2 CPU cores. In that case, DotNetZip will allocate - /// 4 buffer pairs per CPU core, for a total of 8 pairs. The upper - /// limit specified by this property has no effect. - /// - /// - /// - /// The application can set this value at any time, but it is effective - /// only before the first call to Write(), which is when the buffers are - /// allocated. - /// - /// - public int MaxBufferPairs - { - get - { - return _maxBufferPairs; - } - set - { - if (value < 4) - throw new ArgumentException("MaxBufferPairs", - "Value must be 4 or greater."); - _maxBufferPairs = value; - } - } - - /// - /// The size of the buffers used by the compressor threads. - /// - /// - /// - /// - /// The default buffer size is 128k. The application can set this value - /// at any time, but it is effective only before the first Write(). - /// - /// - /// - /// Larger buffer sizes implies larger memory consumption but allows - /// more efficient compression. Using smaller buffer sizes consumes less - /// memory but may result in less effective compression. For example, - /// using the default buffer size of 128k, the compression delivered is - /// within 1% of the compression delivered by the single-threaded . On the other hand, using a - /// BufferSize of 8k can result in a compressed data stream that is 5% - /// larger than that delivered by the single-threaded - /// DeflateStream. Excessively small buffer sizes can also cause - /// the speed of the ParallelDeflateOutputStream to drop, because of - /// larger thread scheduling overhead dealing with many many small - /// buffers. - /// - /// - /// - /// The total amount of storage space allocated for buffering will be - /// (N*S*2), where N is the number of buffer pairs, and S is the size of - /// each buffer (this property). There are 2 buffers used by the - /// compressor, one for input and one for output. By default, DotNetZip - /// allocates 4 buffer pairs per CPU core, so if your machine has 4 - /// cores, then the number of buffer pairs used will be 16. If you - /// accept the default value of this property, 128k, then the - /// ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory - /// in total, or 4mb, in blocks of 128kb. If you set this property to - /// 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or - /// 2mb. - /// - /// - /// - public int BufferSize - { - get { return _bufferSize;} - set - { - if (value < 1024) - throw new ArgumentOutOfRangeException("BufferSize", - "BufferSize must be greater than 1024 bytes"); - _bufferSize = value; - } - } - - /// - /// The CRC32 for the data that was written out, prior to compression. - /// - /// - /// This value is meaningful only after a call to Close(). - /// - public int Crc32 { get { return _Crc32; } } - - - /// - /// The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. - /// - /// - /// This value is meaningful only after a call to Close(). - /// - public Int64 BytesProcessed { get { return _totalBytesProcessed; } } - - - private void _InitializePoolOfWorkItems() - { - _toWrite = new Queue(); - _toFill = new Queue(); - _pool = new System.Collections.Generic.List(); - int nTasks = BufferPairsPerCore * Environment.ProcessorCount; - nTasks = Math.Min(nTasks, _maxBufferPairs); - for(int i=0; i < nTasks; i++) - { - _pool.Add(new WorkItem(_bufferSize, _compressLevel, Strategy, i)); - _toFill.Enqueue(i); - } - - _newlyCompressedBlob = new AutoResetEvent(false); - _runningCrc = new Ionic.Crc.CRC32(); - _currentlyFilling = -1; - _lastFilled = -1; - _lastWritten = -1; - _latestCompressed = -1; - } - - - - - /// - /// Write data to the stream. - /// - /// - /// - /// - /// - /// To use the ParallelDeflateOutputStream to compress data, create a - /// ParallelDeflateOutputStream with CompressionMode.Compress, passing a - /// writable output stream. Then call Write() on that - /// ParallelDeflateOutputStream, providing uncompressed data as input. The - /// data sent to the output stream will be the compressed form of the data - /// written. - /// - /// - /// - /// To decompress data, use the class. - /// - /// - /// - /// The buffer holding data to write to the stream. - /// the offset within that data array to find the first byte to write. - /// the number of bytes to write. - public override void Write(byte[] buffer, int offset, int count) - { - bool mustWait = false; - - // This method does this: - // 0. handles any pending exceptions - // 1. write any buffers that are ready to be written, - // 2. fills a work buffer; when full, flip state to 'Filled', - // 3. if more data to be written, goto step 1 - - if (_isClosed) - throw new InvalidOperationException(); - - // dispense any exceptions that occurred on the BG threads - if (_pendingException != null) - { - _handlingException = true; - var pe = _pendingException; - _pendingException = null; - throw pe; - } - - if (count == 0) return; - - if (!_firstWriteDone) - { - // Want to do this on first Write, first session, and not in the - // constructor. We want to allow MaxBufferPairs to - // change after construction, but before first Write. - _InitializePoolOfWorkItems(); - _firstWriteDone = true; - } - - - do - { - // may need to make buffers available - EmitPendingBuffers(false, mustWait); - - mustWait = false; - // use current buffer, or get a new buffer to fill - int ix = -1; - if (_currentlyFilling >= 0) - { - ix = _currentlyFilling; - TraceOutput(TraceBits.WriteTake, - "Write notake wi({0}) lf({1})", - ix, - _lastFilled); - } - else - { - TraceOutput(TraceBits.WriteTake, "Write take?"); - if (_toFill.Count == 0) - { - // no available buffers, so... need to emit - // compressed buffers. - mustWait = true; - continue; - } - - ix = _toFill.Dequeue(); - TraceOutput(TraceBits.WriteTake, - "Write take wi({0}) lf({1})", - ix, - _lastFilled); - ++_lastFilled; // TODO: consider rollover? - } - - WorkItem workitem = _pool[ix]; - - int limit = ((workitem.buffer.Length - workitem.inputBytesAvailable) > count) - ? count - : (workitem.buffer.Length - workitem.inputBytesAvailable); - - workitem.ordinal = _lastFilled; - - TraceOutput(TraceBits.Write, - "Write lock wi({0}) ord({1}) iba({2})", - workitem.index, - workitem.ordinal, - workitem.inputBytesAvailable - ); - - // copy from the provided buffer to our workitem, starting at - // the tail end of whatever data we might have in there currently. - Buffer.BlockCopy(buffer, - offset, - workitem.buffer, - workitem.inputBytesAvailable, - limit); - - count -= limit; - offset += limit; - workitem.inputBytesAvailable += limit; - if (workitem.inputBytesAvailable == workitem.buffer.Length) - { - // No need for interlocked.increment: the Write() - // method is documented as not multi-thread safe, so - // we can assume Write() calls come in from only one - // thread. - TraceOutput(TraceBits.Write, - "Write QUWI wi({0}) ord({1}) iba({2}) nf({3})", - workitem.index, - workitem.ordinal, - workitem.inputBytesAvailable ); - - if (!ThreadPool.QueueUserWorkItem( _DeflateOne, workitem )) - throw new Exception("Cannot enqueue workitem"); - - _currentlyFilling = -1; // will get a new buffer next time - } - else - _currentlyFilling = ix; - - if (count > 0) - TraceOutput(TraceBits.WriteEnter, "Write more"); - } - while (count > 0); // until no more to write - - TraceOutput(TraceBits.WriteEnter, "Write exit"); - return; - } - - - - private void _FlushFinish() - { - // After writing a series of compressed buffers, each one closed - // with Flush.Sync, we now write the final one as Flush.Finish, - // and then stop. - byte[] buffer = new byte[128]; - var compressor = new ZlibCodec(); - int rc = compressor.InitializeDeflate(_compressLevel, false); - compressor.InputBuffer = null; - compressor.NextIn = 0; - compressor.AvailableBytesIn = 0; - compressor.OutputBuffer = buffer; - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("deflating: " + compressor.Message); - - if (buffer.Length - compressor.AvailableBytesOut > 0) - { - TraceOutput(TraceBits.EmitBegin, - "Emit begin flush bytes({0})", - buffer.Length - compressor.AvailableBytesOut); - - _outStream.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); - - TraceOutput(TraceBits.EmitDone, - "Emit done flush"); - } - - compressor.EndDeflate(); - - _Crc32 = _runningCrc.Crc32Result; - } - - - private void _Flush(bool lastInput) - { - if (_isClosed) - throw new InvalidOperationException(); - - if (emitting) return; - - // compress any partial buffer - if (_currentlyFilling >= 0) - { - WorkItem workitem = _pool[_currentlyFilling]; - _DeflateOne(workitem); - _currentlyFilling = -1; // get a new buffer next Write() - } - - if (lastInput) - { - EmitPendingBuffers(true, false); - _FlushFinish(); - } - else - { - EmitPendingBuffers(false, false); - } - } - - - - /// - /// Flush the stream. - /// - public override void Flush() - { - if (_pendingException != null) - { - _handlingException = true; - var pe = _pendingException; - _pendingException = null; - throw pe; - } - if (_handlingException) - return; - - _Flush(false); - } - - - /// - /// Close the stream. - /// - /// - /// You must call Close on the stream to guarantee that all of the data written in has - /// been compressed, and the compressed data has been written out. - /// - public override void Close() - { - TraceOutput(TraceBits.Session, "Close {0:X8}", this.GetHashCode()); - - if (_pendingException != null) - { - _handlingException = true; - var pe = _pendingException; - _pendingException = null; - throw pe; - } - - if (_handlingException) - return; - - if (_isClosed) return; - - _Flush(true); - - if (!_leaveOpen) - _outStream.Close(); - - _isClosed= true; - } - - - - // workitem 10030 - implement a new Dispose method - - /// Dispose the object - /// - /// - /// Because ParallelDeflateOutputStream is IDisposable, the - /// application must call this method when finished using the instance. - /// - /// - /// This method is generally called implicitly upon exit from - /// a using scope in C# (Using in VB). - /// - /// - new public void Dispose() - { - TraceOutput(TraceBits.Lifecycle, "Dispose {0:X8}", this.GetHashCode()); - Close(); - _pool = null; - Dispose(true); - } - - - - /// The Dispose method - /// - /// indicates whether the Dispose method was invoked by user code. - /// - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - } - - - /// - /// Resets the stream for use with another stream. - /// - /// - /// Because the ParallelDeflateOutputStream is expensive to create, it - /// has been designed so that it can be recycled and re-used. You have - /// to call Close() on the stream first, then you can call Reset() on - /// it, to use it again on another stream. - /// - /// - /// - /// The new output stream for this era. - /// - /// - /// - /// - /// ParallelDeflateOutputStream deflater = null; - /// foreach (var inputFile in listOfFiles) - /// { - /// string outputFile = inputFile + ".compressed"; - /// using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) - /// { - /// using (var outStream = System.IO.File.Create(outputFile)) - /// { - /// if (deflater == null) - /// deflater = new ParallelDeflateOutputStream(outStream, - /// CompressionLevel.Best, - /// CompressionStrategy.Default, - /// true); - /// deflater.Reset(outStream); - /// - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// deflater.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - public void Reset(Stream stream) - { - TraceOutput(TraceBits.Session, "-------------------------------------------------------"); - TraceOutput(TraceBits.Session, "Reset {0:X8} firstDone({1})", this.GetHashCode(), _firstWriteDone); - - if (!_firstWriteDone) return; - - // reset all status - _toWrite.Clear(); - _toFill.Clear(); - foreach (var workitem in _pool) - { - _toFill.Enqueue(workitem.index); - workitem.ordinal = -1; - } - - _firstWriteDone = false; - _totalBytesProcessed = 0L; - _runningCrc = new Ionic.Crc.CRC32(); - _isClosed= false; - _currentlyFilling = -1; - _lastFilled = -1; - _lastWritten = -1; - _latestCompressed = -1; - _outStream = stream; - } - - - - - private void EmitPendingBuffers(bool doAll, bool mustWait) - { - // When combining parallel deflation with a ZipSegmentedStream, it's - // possible for the ZSS to throw from within this method. In that - // case, Close/Dispose will be called on this stream, if this stream - // is employed within a using or try/finally pair as required. But - // this stream is unaware of the pending exception, so the Close() - // method invokes this method AGAIN. This can lead to a deadlock. - // Therefore, failfast if re-entering. - - if (emitting) return; - emitting = true; - if (doAll || mustWait) - _newlyCompressedBlob.WaitOne(); - - do - { - int firstSkip = -1; - int millisecondsToWait = doAll ? 200 : (mustWait ? -1 : 0); - int nextToWrite = -1; - - do - { - if (Monitor.TryEnter(_toWrite, millisecondsToWait)) - { - nextToWrite = -1; - try - { - if (_toWrite.Count > 0) - nextToWrite = _toWrite.Dequeue(); - } - finally - { - Monitor.Exit(_toWrite); - } - - if (nextToWrite >= 0) - { - WorkItem workitem = _pool[nextToWrite]; - if (workitem.ordinal != _lastWritten + 1) - { - // out of order. requeue and try again. - TraceOutput(TraceBits.EmitSkip, - "Emit skip wi({0}) ord({1}) lw({2}) fs({3})", - workitem.index, - workitem.ordinal, - _lastWritten, - firstSkip); - - lock(_toWrite) - { - _toWrite.Enqueue(nextToWrite); - } - - if (firstSkip == nextToWrite) - { - // We went around the list once. - // None of the items in the list is the one we want. - // Now wait for a compressor to signal again. - _newlyCompressedBlob.WaitOne(); - firstSkip = -1; - } - else if (firstSkip == -1) - firstSkip = nextToWrite; - - continue; - } - - firstSkip = -1; - - TraceOutput(TraceBits.EmitBegin, - "Emit begin wi({0}) ord({1}) cba({2})", - workitem.index, - workitem.ordinal, - workitem.compressedBytesAvailable); - - _outStream.Write(workitem.compressed, 0, workitem.compressedBytesAvailable); - _runningCrc.Combine(workitem.crc, workitem.inputBytesAvailable); - _totalBytesProcessed += workitem.inputBytesAvailable; - workitem.inputBytesAvailable = 0; - - TraceOutput(TraceBits.EmitDone, - "Emit done wi({0}) ord({1}) cba({2}) mtw({3})", - workitem.index, - workitem.ordinal, - workitem.compressedBytesAvailable, - millisecondsToWait); - - _lastWritten = workitem.ordinal; - _toFill.Enqueue(workitem.index); - - // don't wait next time through - if (millisecondsToWait == -1) millisecondsToWait = 0; - } - } - else - nextToWrite = -1; - - } while (nextToWrite >= 0); - - } while (doAll && (_lastWritten != _latestCompressed)); - - emitting = false; - } - - - -#if OLD - private void _PerpetualWriterMethod(object state) - { - TraceOutput(TraceBits.WriterThread, "_PerpetualWriterMethod START"); - - try - { - do - { - // wait for the next session - TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.WaitOne(begin) PWM"); - _sessionReset.WaitOne(); - TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.WaitOne(done) PWM"); - - if (_isDisposed) break; - - TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.Reset() PWM"); - _sessionReset.Reset(); - - // repeatedly write buffers as they become ready - WorkItem workitem = null; - Ionic.Zlib.CRC32 c= new Ionic.Zlib.CRC32(); - do - { - workitem = _pool[_nextToWrite % _pc]; - lock(workitem) - { - if (_noMoreInputForThisSegment) - TraceOutput(TraceBits.Write, - "Write drain wi({0}) stat({1}) canuse({2}) cba({3})", - workitem.index, - workitem.status, - (workitem.status == (int)WorkItem.Status.Compressed), - workitem.compressedBytesAvailable); - - do - { - if (workitem.status == (int)WorkItem.Status.Compressed) - { - TraceOutput(TraceBits.WriteBegin, - "Write begin wi({0}) stat({1}) cba({2})", - workitem.index, - workitem.status, - workitem.compressedBytesAvailable); - - workitem.status = (int)WorkItem.Status.Writing; - _outStream.Write(workitem.compressed, 0, workitem.compressedBytesAvailable); - c.Combine(workitem.crc, workitem.inputBytesAvailable); - _totalBytesProcessed += workitem.inputBytesAvailable; - _nextToWrite++; - workitem.inputBytesAvailable= 0; - workitem.status = (int)WorkItem.Status.Done; - - TraceOutput(TraceBits.WriteDone, - "Write done wi({0}) stat({1}) cba({2})", - workitem.index, - workitem.status, - workitem.compressedBytesAvailable); - - - Monitor.Pulse(workitem); - break; - } - else - { - int wcycles = 0; - // I've locked a workitem I cannot use. - // Therefore, wake someone else up, and then release the lock. - while (workitem.status != (int)WorkItem.Status.Compressed) - { - TraceOutput(TraceBits.WriteWait, - "Write waiting wi({0}) stat({1}) nw({2}) nf({3}) nomore({4})", - workitem.index, - workitem.status, - _nextToWrite, _nextToFill, - _noMoreInputForThisSegment ); - - if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) - break; - - wcycles++; - - // wake up someone else - Monitor.Pulse(workitem); - // release and wait - Monitor.Wait(workitem); - - if (workitem.status == (int)WorkItem.Status.Compressed) - TraceOutput(TraceBits.WriteWait, - "Write A-OK wi({0}) stat({1}) iba({2}) cba({3}) cyc({4})", - workitem.index, - workitem.status, - workitem.inputBytesAvailable, - workitem.compressedBytesAvailable, - wcycles); - } - - if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) - break; - - } - } - while (true); - } - - if (_noMoreInputForThisSegment) - TraceOutput(TraceBits.Write, - "Write nomore nw({0}) nf({1}) break({2})", - _nextToWrite, _nextToFill, (_nextToWrite == _nextToFill)); - - if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) - break; - - } while (true); - - - // Finish: - // After writing a series of buffers, closing each one with - // Flush.Sync, we now write the final one as Flush.Finish, and - // then stop. - byte[] buffer = new byte[128]; - ZlibCodec compressor = new ZlibCodec(); - int rc = compressor.InitializeDeflate(_compressLevel, false); - compressor.InputBuffer = null; - compressor.NextIn = 0; - compressor.AvailableBytesIn = 0; - compressor.OutputBuffer = buffer; - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("deflating: " + compressor.Message); - - if (buffer.Length - compressor.AvailableBytesOut > 0) - { - TraceOutput(TraceBits.WriteBegin, - "Write begin flush bytes({0})", - buffer.Length - compressor.AvailableBytesOut); - - _outStream.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); - - TraceOutput(TraceBits.WriteBegin, - "Write done flush"); - } - - compressor.EndDeflate(); - - _Crc32 = c.Crc32Result; - - // signal that writing is complete: - TraceOutput(TraceBits.Synch, "Synch _writingDone.Set() PWM"); - _writingDone.Set(); - } - while (true); - } - catch (System.Exception exc1) - { - lock(_eLock) - { - // expose the exception to the main thread - if (_pendingException!=null) - _pendingException = exc1; - } - } - - TraceOutput(TraceBits.WriterThread, "_PerpetualWriterMethod FINIS"); - } -#endif - - - - - private void _DeflateOne(Object wi) - { - // compress one buffer - WorkItem workitem = (WorkItem) wi; - try - { - Ionic.Crc.CRC32 crc = new Ionic.Crc.CRC32(); - - // calc CRC on the buffer - crc.SlurpBlock(workitem.buffer, 0, workitem.inputBytesAvailable); - - // deflate it - DeflateOneSegment(workitem); - - // update status - workitem.crc = crc.Crc32Result; - TraceOutput(TraceBits.Compress, - "Compress wi({0}) ord({1}) len({2})", - workitem.index, - workitem.ordinal, - workitem.compressedBytesAvailable - ); - - lock(_latestLock) - { - if (workitem.ordinal > _latestCompressed) - _latestCompressed = workitem.ordinal; - } - lock (_toWrite) - { - _toWrite.Enqueue(workitem.index); - } - _newlyCompressedBlob.Set(); - } - catch (System.Exception exc1) - { - lock(_eLock) - { - // expose the exception to the main thread - if (_pendingException!=null) - _pendingException = exc1; - } - } - } - - - -#pragma warning disable 219 - private bool DeflateOneSegment(WorkItem workitem) - { - ZlibCodec compressor = workitem.compressor; - int rc= 0; - compressor.ResetDeflate(); - compressor.NextIn = 0; - - compressor.AvailableBytesIn = workitem.inputBytesAvailable; - - // step 1: deflate the buffer - compressor.NextOut = 0; - compressor.AvailableBytesOut = workitem.compressed.Length; - do - { - compressor.Deflate(FlushType.None); - } - while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - - // step 2: flush (sync) - rc = compressor.Deflate(FlushType.Sync); - - workitem.compressedBytesAvailable= (int) compressor.TotalBytesOut; - return true; - } - - - [System.Diagnostics.ConditionalAttribute("Trace")] - private void TraceOutput(TraceBits bits, string format, params object[] varParams) - { - if ((bits & _DesiredTrace) != 0) - { - lock(_outputLock) - { - int tid = Thread.CurrentThread.GetHashCode(); -#if !SILVERLIGHT - // Console.ForegroundColor = (ConsoleColor) (tid % 8 + 8); -#endif - Console.Write("{0:000} PDOS ", tid); - Console.WriteLine(format, varParams); -#if !SILVERLIGHT - // Console.ResetColor(); -#endif - } - } - } - - - // used only when Trace is defined - [Flags] - enum TraceBits : uint - { - None = 0, - NotUsed1 = 1, - EmitLock = 2, - EmitEnter = 4, // enter _EmitPending - EmitBegin = 8, // begin to write out - EmitDone = 16, // done writing out - EmitSkip = 32, // writer skipping a workitem - EmitAll = 58, // All Emit flags - Flush = 64, - Lifecycle = 128, // constructor/disposer - Session = 256, // Close/Reset - Synch = 512, // thread synchronization - Instance = 1024, // instance settings - Compress = 2048, // compress task - Write = 4096, // filling buffers, when caller invokes Write() - WriteEnter = 8192, // upon entry to Write() - WriteTake = 16384, // on _toFill.Take() - All = 0xffffffff, - } - - - - /// - /// Indicates whether the stream supports Seek operations. - /// - /// - /// Always returns false. - /// - public override bool CanSeek - { - get { return false; } - } - - - /// - /// Indicates whether the stream supports Read operations. - /// - /// - /// Always returns false. - /// - public override bool CanRead - { - get {return false;} - } - - /// - /// Indicates whether the stream supports Write operations. - /// - /// - /// Returns true if the provided stream is writable. - /// - public override bool CanWrite - { - get { return _outStream.CanWrite; } - } - - /// - /// Reading this property always throws a NotSupportedException. - /// - public override long Length - { - get { throw new NotSupportedException(); } - } - - /// - /// Returns the current position of the output stream. - /// - /// - /// - /// Because the output gets written by a background thread, - /// the value may change asynchronously. Setting this - /// property always throws a NotSupportedException. - /// - /// - public override long Position - { - get { return _outStream.Position; } - set { throw new NotSupportedException(); } - } - - /// - /// This method always throws a NotSupportedException. - /// - /// - /// The buffer into which data would be read, IF THIS METHOD - /// ACTUALLY DID ANYTHING. - /// - /// - /// The offset within that data array at which to insert the - /// data that is read, IF THIS METHOD ACTUALLY DID - /// ANYTHING. - /// - /// - /// The number of bytes to write, IF THIS METHOD ACTUALLY DID - /// ANYTHING. - /// - /// nothing. - public override int Read(byte[] buffer, int offset, int count) - { - throw new NotSupportedException(); - } - - /// - /// This method always throws a NotSupportedException. - /// - /// - /// The offset to seek to.... - /// IF THIS METHOD ACTUALLY DID ANYTHING. - /// - /// - /// The reference specifying how to apply the offset.... IF - /// THIS METHOD ACTUALLY DID ANYTHING. - /// - /// nothing. It always throws. - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - throw new NotSupportedException(); - } - - /// - /// This method always throws a NotSupportedException. - /// - /// - /// The new value for the stream length.... IF - /// THIS METHOD ACTUALLY DID ANYTHING. - /// - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - } - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs.meta deleted file mode 100755 index 036438b7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ParallelDeflateOutputStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8c72138acdb9b6541b0e8695a08c4b5b -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs deleted file mode 100755 index ed480ed8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs +++ /dev/null @@ -1,425 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// Tree.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2009-October-28 13:29:50> -// -// ------------------------------------------------------------------ -// -// This module defines classes for zlib compression and -// decompression. This code is derived from the jzlib implementation of -// zlib. In keeping with the license for jzlib, the copyright to that -// code is below. -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - -using System; - -namespace Ionic.Zlib -{ - sealed class ZTree - { - private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); - - // extra bits for each length code - internal static readonly int[] ExtraLengthBits = new int[] - { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 - }; - - // extra bits for each distance code - internal static readonly int[] ExtraDistanceBits = new int[] - { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 - }; - - // extra bits for each bit length code - internal static readonly int[] extra_blbits = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7}; - - internal static readonly sbyte[] bl_order = new sbyte[]{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - - // The lengths of the bit length codes are sent in order of decreasing - // probability, to avoid transmitting the lengths for unused bit - // length codes. - - internal const int Buf_size = 8 * 2; - - // see definition of array dist_code below - //internal const int DIST_CODE_LEN = 512; - - private static readonly sbyte[] _dist_code = new sbyte[] - { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, - 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 - }; - - internal static readonly sbyte[] LengthCode = new sbyte[] - { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 - }; - - - internal static readonly int[] LengthBase = new int[] - { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, - 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0 - }; - - - internal static readonly int[] DistanceBase = new int[] - { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, - 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 - }; - - - /// - /// Map from a distance to a distance code. - /// - /// - /// No side effects. _dist_code[256] and _dist_code[257] are never used. - /// - internal static int DistanceCode(int dist) - { - return (dist < 256) - ? _dist_code[dist] - : _dist_code[256 + SharedUtils.URShift(dist, 7)]; - } - - internal short[] dyn_tree; // the dynamic tree - internal int max_code; // largest code with non zero frequency - internal StaticTree staticTree; // the corresponding static tree - - // Compute the optimal bit lengths for a tree and update the total bit length - // for the current block. - // IN assertion: the fields freq and dad are set, heap[heap_max] and - // above are the tree nodes sorted by increasing frequency. - // OUT assertions: the field len is set to the optimal bit length, the - // array bl_count contains the frequencies for each bit length. - // The length opt_len is updated; static_len is also updated if stree is - // not null. - internal void gen_bitlen(DeflateManager s) - { - short[] tree = dyn_tree; - short[] stree = staticTree.treeCodes; - int[] extra = staticTree.extraBits; - int base_Renamed = staticTree.extraBase; - int max_length = staticTree.maxLength; - int h; // heap index - int n, m; // iterate over the tree elements - int bits; // bit length - int xbits; // extra bits - short f; // frequency - int overflow = 0; // number of elements with bit length too large - - for (bits = 0; bits <= InternalConstants.MAX_BITS; bits++) - s.bl_count[bits] = 0; - - // In a first pass, compute the optimal bit lengths (which may - // overflow in the case of the bit length tree). - tree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap - - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) - { - n = s.heap[h]; - bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; - if (bits > max_length) - { - bits = max_length; overflow++; - } - tree[n * 2 + 1] = (short) bits; - // We overwrite tree[n*2+1] which is no longer needed - - if (n > max_code) - continue; // not a leaf node - - s.bl_count[bits]++; - xbits = 0; - if (n >= base_Renamed) - xbits = extra[n - base_Renamed]; - f = tree[n * 2]; - s.opt_len += f * (bits + xbits); - if (stree != null) - s.static_len += f * (stree[n * 2 + 1] + xbits); - } - if (overflow == 0) - return ; - - // This happens for example on obj2 and pic of the Calgary corpus - // Find the first bit length which could increase: - do - { - bits = max_length - 1; - while (s.bl_count[bits] == 0) - bits--; - s.bl_count[bits]--; // move one leaf down the tree - s.bl_count[bits + 1] = (short) (s.bl_count[bits + 1] + 2); // move one overflow item as its brother - s.bl_count[max_length]--; - // The brother of the overflow item also moves one step up, - // but this does not affect bl_count[max_length] - overflow -= 2; - } - while (overflow > 0); - - for (bits = max_length; bits != 0; bits--) - { - n = s.bl_count[bits]; - while (n != 0) - { - m = s.heap[--h]; - if (m > max_code) - continue; - if (tree[m * 2 + 1] != bits) - { - s.opt_len = (int) (s.opt_len + ((long) bits - (long) tree[m * 2 + 1]) * (long) tree[m * 2]); - tree[m * 2 + 1] = (short) bits; - } - n--; - } - } - } - - // Construct one Huffman tree and assigns the code bit strings and lengths. - // Update the total bit length for the current block. - // IN assertion: the field freq is set for all tree elements. - // OUT assertions: the fields len and code are set to the optimal bit length - // and corresponding code. The length opt_len is updated; static_len is - // also updated if stree is not null. The field max_code is set. - internal void build_tree(DeflateManager s) - { - short[] tree = dyn_tree; - short[] stree = staticTree.treeCodes; - int elems = staticTree.elems; - int n, m; // iterate over heap elements - int max_code = -1; // largest code with non zero frequency - int node; // new node being created - - // Construct the initial heap, with least frequent element in - // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - // heap[0] is not used. - s.heap_len = 0; - s.heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) - { - if (tree[n * 2] != 0) - { - s.heap[++s.heap_len] = max_code = n; - s.depth[n] = 0; - } - else - { - tree[n * 2 + 1] = 0; - } - } - - // The pkzip format requires that at least one distance code exists, - // and that at least one bit should be sent even if there is only one - // possible code. So to avoid special checks later on we force at least - // two codes of non zero frequency. - while (s.heap_len < 2) - { - node = s.heap[++s.heap_len] = (max_code < 2?++max_code:0); - tree[node * 2] = 1; - s.depth[node] = 0; - s.opt_len--; - if (stree != null) - s.static_len -= stree[node * 2 + 1]; - // node is 0 or 1 so it does not have extra bits - } - this.max_code = max_code; - - // The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - // establish sub-heaps of increasing lengths: - - for (n = s.heap_len / 2; n >= 1; n--) - s.pqdownheap(tree, n); - - // Construct the Huffman tree by repeatedly combining the least two - // frequent nodes. - - node = elems; // next internal node of the tree - do - { - // n = node of least frequency - n = s.heap[1]; - s.heap[1] = s.heap[s.heap_len--]; - s.pqdownheap(tree, 1); - m = s.heap[1]; // m = node of next least frequency - - s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency - s.heap[--s.heap_max] = m; - - // Create a new node father of n and m - tree[node * 2] = unchecked((short) (tree[n * 2] + tree[m * 2])); - s.depth[node] = (sbyte) (System.Math.Max((byte) s.depth[n], (byte) s.depth[m]) + 1); - tree[n * 2 + 1] = tree[m * 2 + 1] = (short) node; - - // and insert the new node in the heap - s.heap[1] = node++; - s.pqdownheap(tree, 1); - } - while (s.heap_len >= 2); - - s.heap[--s.heap_max] = s.heap[1]; - - // At this point, the fields freq and dad are set. We can now - // generate the bit lengths. - - gen_bitlen(s); - - // The field len is now set, we can generate the bit codes - gen_codes(tree, max_code, s.bl_count); - } - - // Generate the codes for a given tree and bit counts (which need not be - // optimal). - // IN assertion: the array bl_count contains the bit length statistics for - // the given tree and the field len is set for all tree elements. - // OUT assertion: the field code is set for all tree elements of non - // zero code length. - internal static void gen_codes(short[] tree, int max_code, short[] bl_count) - { - short[] next_code = new short[InternalConstants.MAX_BITS + 1]; // next code value for each bit length - short code = 0; // running code value - int bits; // bit index - int n; // code index - - // The distribution counts are first used to generate the code values - // without bit reversal. - for (bits = 1; bits <= InternalConstants.MAX_BITS; bits++) - unchecked { - next_code[bits] = code = (short) ((code + bl_count[bits - 1]) << 1); - } - - // Check that the bit counts in bl_count are consistent. The last code - // must be all ones. - //Assert (code + bl_count[MAX_BITS]-1 == (1<>= 1; //SharedUtils.URShift(code, 1); - res <<= 1; - } - while (--len > 0); - return res >> 1; - } - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs.meta deleted file mode 100755 index 29756d23..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZTree.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e87ed58b28c1f8444aac50a060bd86a9 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs deleted file mode 100755 index 98d24c52..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs +++ /dev/null @@ -1,548 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// Zlib.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009-2011 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// Last Saved: <2011-August-03 19:52:28> -// -// ------------------------------------------------------------------ -// -// This module defines classes for ZLIB compression and -// decompression. This code is derived from the jzlib implementation of -// zlib, but significantly modified. The object model is not the same, -// and many of the behaviors are new or different. Nonetheless, in -// keeping with the license for jzlib, the copyright to that code is -// included below. -// -// ------------------------------------------------------------------ -// -// The following notice applies to jzlib: -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// jzlib is based on zlib-1.1.3. -// -// The following notice applies to zlib: -// -// ----------------------------------------------------------------------- -// -// Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler -// -// The ZLIB software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// -// Jean-loup Gailly jloup@gzip.org -// Mark Adler madler@alumni.caltech.edu -// -// ----------------------------------------------------------------------- - - - -using System; -using Interop=System.Runtime.InteropServices; - -namespace Ionic.Zlib -{ - - /// - /// Describes how to flush the current deflate operation. - /// - /// - /// The different FlushType values are useful when using a Deflate in a streaming application. - /// - public enum FlushType - { - /// No flush at all. - None = 0, - - /// Closes the current block, but doesn't flush it to - /// the output. Used internally only in hypothetical - /// scenarios. This was supposed to be removed by Zlib, but it is - /// still in use in some edge cases. - /// - Partial, - - /// - /// Use this during compression to specify that all pending output should be - /// flushed to the output buffer and the output should be aligned on a byte - /// boundary. You might use this in a streaming communication scenario, so that - /// the decompressor can get all input data available so far. When using this - /// with a ZlibCodec, AvailableBytesIn will be zero after the call if - /// enough output space has been provided before the call. Flushing will - /// degrade compression and so it should be used only when necessary. - /// - Sync, - - /// - /// Use this during compression to specify that all output should be flushed, as - /// with FlushType.Sync, but also, the compression state should be reset - /// so that decompression can restart from this point if previous compressed - /// data has been damaged or if random access is desired. Using - /// FlushType.Full too often can significantly degrade the compression. - /// - Full, - - /// Signals the end of the compression/decompression stream. - Finish, - } - - - /// - /// The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. - /// - public enum CompressionLevel - { - /// - /// None means that the data will be simply stored, with no change at all. - /// If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None - /// cannot be opened with the default zip reader. Use a different CompressionLevel. - /// - None= 0, - /// - /// Same as None. - /// - Level0 = 0, - - /// - /// The fastest but least effective compression. - /// - BestSpeed = 1, - - /// - /// A synonym for BestSpeed. - /// - Level1 = 1, - - /// - /// A little slower, but better, than level 1. - /// - Level2 = 2, - - /// - /// A little slower, but better, than level 2. - /// - Level3 = 3, - - /// - /// A little slower, but better, than level 3. - /// - Level4 = 4, - - /// - /// A little slower than level 4, but with better compression. - /// - Level5 = 5, - - /// - /// The default compression level, with a good balance of speed and compression efficiency. - /// - Default = 6, - /// - /// A synonym for Default. - /// - Level6 = 6, - - /// - /// Pretty good compression! - /// - Level7 = 7, - - /// - /// Better compression than Level7! - /// - Level8 = 8, - - /// - /// The "best" compression, where best means greatest reduction in size of the input data stream. - /// This is also the slowest compression. - /// - BestCompression = 9, - - /// - /// A synonym for BestCompression. - /// - Level9 = 9, - } - - /// - /// Describes options for how the compression algorithm is executed. Different strategies - /// work better on different sorts of data. The strategy parameter can affect the compression - /// ratio and the speed of compression but not the correctness of the compresssion. - /// - public enum CompressionStrategy - { - /// - /// The default strategy is probably the best for normal data. - /// - Default = 0, - - /// - /// The Filtered strategy is intended to be used most effectively with data produced by a - /// filter or predictor. By this definition, filtered data consists mostly of small - /// values with a somewhat random distribution. In this case, the compression algorithm - /// is tuned to compress them better. The effect of Filtered is to force more Huffman - /// coding and less string matching; it is a half-step between Default and HuffmanOnly. - /// - Filtered = 1, - - /// - /// Using HuffmanOnly will force the compressor to do Huffman encoding only, with no - /// string matching. - /// - HuffmanOnly = 2, - } - - - /// - /// An enum to specify the direction of transcoding - whether to compress or decompress. - /// - public enum CompressionMode - { - /// - /// Used to specify that the stream should compress the data. - /// - Compress= 0, - /// - /// Used to specify that the stream should decompress the data. - /// - Decompress = 1, - } - - - /// - /// A general purpose exception class for exceptions in the Zlib library. - /// - [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000E")] - public class ZlibException : System.Exception - { - /// - /// The ZlibException class captures exception information generated - /// by the Zlib library. - /// - public ZlibException() - : base() - { - } - - /// - /// This ctor collects a message attached to the exception. - /// - /// the message for the exception. - public ZlibException(System.String s) - : base(s) - { - } - } - - - internal class SharedUtils - { - /// - /// Performs an unsigned bitwise right shift with the specified number - /// - /// Number to operate on - /// Ammount of bits to shift - /// The resulting number from the shift operation - public static int URShift(int number, int bits) - { - return (int)((uint)number >> bits); - } - -#if NOT - /// - /// Performs an unsigned bitwise right shift with the specified number - /// - /// Number to operate on - /// Ammount of bits to shift - /// The resulting number from the shift operation - public static long URShift(long number, int bits) - { - return (long) ((UInt64)number >> bits); - } -#endif - - /// - /// Reads a number of characters from the current source TextReader and writes - /// the data to the target array at the specified index. - /// - /// - /// The source TextReader to read from - /// Contains the array of characteres read from the source TextReader. - /// The starting index of the target array. - /// The maximum number of characters to read from the source TextReader. - /// - /// - /// The number of characters read. The number will be less than or equal to - /// count depending on the data available in the source TextReader. Returns -1 - /// if the end of the stream is reached. - /// - public static System.Int32 ReadInput(System.IO.TextReader sourceTextReader, byte[] target, int start, int count) - { - // Returns 0 bytes if not enough space in target - if (target.Length == 0) return 0; - - char[] charArray = new char[target.Length]; - int bytesRead = sourceTextReader.Read(charArray, start, count); - - // Returns -1 if EOF - if (bytesRead == 0) return -1; - - for (int index = start; index < start + bytesRead; index++) - target[index] = (byte)charArray[index]; - - return bytesRead; - } - - - internal static byte[] ToByteArray(System.String sourceString) - { - return System.Text.UTF8Encoding.UTF8.GetBytes(sourceString); - } - - - internal static char[] ToCharArray(byte[] byteArray) - { - return System.Text.UTF8Encoding.UTF8.GetChars(byteArray); - } - } - - internal static class InternalConstants - { - internal static readonly int MAX_BITS = 15; - internal static readonly int BL_CODES = 19; - internal static readonly int D_CODES = 30; - internal static readonly int LITERALS = 256; - internal static readonly int LENGTH_CODES = 29; - internal static readonly int L_CODES = (LITERALS + 1 + LENGTH_CODES); - - // Bit length codes must not exceed MAX_BL_BITS bits - internal static readonly int MAX_BL_BITS = 7; - - // repeat previous bit length 3-6 times (2 bits of repeat count) - internal static readonly int REP_3_6 = 16; - - // repeat a zero length 3-10 times (3 bits of repeat count) - internal static readonly int REPZ_3_10 = 17; - - // repeat a zero length 11-138 times (7 bits of repeat count) - internal static readonly int REPZ_11_138 = 18; - - } - - internal sealed class StaticTree - { - internal static readonly short[] lengthAndLiteralsTreeCodes = new short[] { - 12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, - 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, - 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, - 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, - 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, - 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, - 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, - 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, - 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, - 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, - 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, - 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, - 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, - 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, - 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, - 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, - 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, - 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, - 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, - 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, - 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, - 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, - 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, - 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, - 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, - 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, - 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, - 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, - 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, - 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, - 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, - 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, - 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, - 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, - 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, - 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8 - }; - - internal static readonly short[] distTreeCodes = new short[] { - 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, - 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, - 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, - 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 }; - - internal static readonly StaticTree Literals; - internal static readonly StaticTree Distances; - internal static readonly StaticTree BitLengths; - - internal short[] treeCodes; // static tree or null - internal int[] extraBits; // extra bits for each code or null - internal int extraBase; // base index for extra_bits - internal int elems; // max number of elements in the tree - internal int maxLength; // max bit length for the codes - - private StaticTree(short[] treeCodes, int[] extraBits, int extraBase, int elems, int maxLength) - { - this.treeCodes = treeCodes; - this.extraBits = extraBits; - this.extraBase = extraBase; - this.elems = elems; - this.maxLength = maxLength; - } - static StaticTree() - { - Literals = new StaticTree(lengthAndLiteralsTreeCodes, ZTree.ExtraLengthBits, InternalConstants.LITERALS + 1, InternalConstants.L_CODES, InternalConstants.MAX_BITS); - Distances = new StaticTree(distTreeCodes, ZTree.ExtraDistanceBits, 0, InternalConstants.D_CODES, InternalConstants.MAX_BITS); - BitLengths = new StaticTree(null, ZTree.extra_blbits, 0, InternalConstants.BL_CODES, InternalConstants.MAX_BL_BITS); - } - } - - - - /// - /// Computes an Adler-32 checksum. - /// - /// - /// The Adler checksum is similar to a CRC checksum, but faster to compute, though less - /// reliable. It is used in producing RFC1950 compressed streams. The Adler checksum - /// is a required part of the "ZLIB" standard. Applications will almost never need to - /// use this class directly. - /// - /// - /// - public sealed class Adler - { - // largest prime smaller than 65536 - private static readonly uint BASE = 65521; - // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 - private static readonly int NMAX = 5552; - - -#pragma warning disable 3001 -#pragma warning disable 3002 - - /// - /// Calculates the Adler32 checksum. - /// - /// - /// - /// This is used within ZLIB. You probably don't need to use this directly. - /// - /// - /// - /// To compute an Adler32 checksum on a byte array: - /// - /// var adler = Adler.Adler32(0, null, 0, 0); - /// adler = Adler.Adler32(adler, buffer, index, length); - /// - /// - public static uint Adler32(uint adler, byte[] buf, int index, int len) - { - if (buf == null) - return 1; - - uint s1 = (uint) (adler & 0xffff); - uint s2 = (uint) ((adler >> 16) & 0xffff); - - while (len > 0) - { - int k = len < NMAX ? len : NMAX; - len -= k; - while (k >= 16) - { - //s1 += (buf[index++] & 0xff); s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - s1 += buf[index++]; s2 += s1; - k -= 16; - } - if (k != 0) - { - do - { - s1 += buf[index++]; - s2 += s1; - } - while (--k != 0); - } - s1 %= BASE; - s2 %= BASE; - } - return (uint)((s2 << 16) | s1); - } -#pragma warning restore 3001 -#pragma warning restore 3002 - - } - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs.meta deleted file mode 100755 index c3a5e071..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/Zlib.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 60b0fc53c1c7d6d41bab583eda94aea8 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs deleted file mode 100755 index 38480c04..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs +++ /dev/null @@ -1,629 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// ZlibBaseStream.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2011-August-06 21:22:38> -// -// ------------------------------------------------------------------ -// -// This module defines the ZlibBaseStream class, which is an intnernal -// base class for DeflateStream, ZlibStream and GZipStream. -// -// ------------------------------------------------------------------ - -using System; -using System.IO; - -namespace Ionic.Zlib -{ - - internal enum ZlibStreamFlavor { ZLIB = 1950, DEFLATE = 1951, GZIP = 1952 } - - internal class ZlibBaseStream : System.IO.Stream - { - protected internal ZlibCodec _z = null; // deferred init... new ZlibCodec(); - - protected internal StreamMode _streamMode = StreamMode.Undefined; - protected internal FlushType _flushMode; - protected internal ZlibStreamFlavor _flavor; - protected internal CompressionMode _compressionMode; - protected internal CompressionLevel _level; - protected internal bool _leaveOpen; - protected internal byte[] _workingBuffer; - protected internal int _bufferSize = ZlibConstants.WorkingBufferSizeDefault; - protected internal byte[] _buf1 = new byte[1]; - - protected internal System.IO.Stream _stream; - protected internal CompressionStrategy Strategy = CompressionStrategy.Default; - - // workitem 7159 - Ionic.Crc.CRC32 crc; - protected internal string _GzipFileName; - protected internal string _GzipComment; - protected internal DateTime _GzipMtime; - protected internal int _gzipHeaderByteCount; - - internal int Crc32 { get { if (crc == null) return 0; return crc.Crc32Result; } } - - public ZlibBaseStream(System.IO.Stream stream, - CompressionMode compressionMode, - CompressionLevel level, - ZlibStreamFlavor flavor, - bool leaveOpen) - : base() - { - this._flushMode = FlushType.None; - //this._workingBuffer = new byte[WORKING_BUFFER_SIZE_DEFAULT]; - this._stream = stream; - this._leaveOpen = leaveOpen; - this._compressionMode = compressionMode; - this._flavor = flavor; - this._level = level; - // workitem 7159 - if (flavor == ZlibStreamFlavor.GZIP) - { - this.crc = new Ionic.Crc.CRC32(); - } - } - - - protected internal bool _wantCompress - { - get - { - return (this._compressionMode == CompressionMode.Compress); - } - } - - private ZlibCodec z - { - get - { - if (_z == null) - { - bool wantRfc1950Header = (this._flavor == ZlibStreamFlavor.ZLIB); - _z = new ZlibCodec(); - if (this._compressionMode == CompressionMode.Decompress) - { - _z.InitializeInflate(wantRfc1950Header); - } - else - { - _z.Strategy = Strategy; - _z.InitializeDeflate(this._level, wantRfc1950Header); - } - } - return _z; - } - } - - - - private byte[] workingBuffer - { - get - { - if (_workingBuffer == null) - _workingBuffer = new byte[_bufferSize]; - return _workingBuffer; - } - } - - - - public override void Write(System.Byte[] buffer, int offset, int count) - { - // workitem 7159 - // calculate the CRC on the unccompressed data (before writing) - if (crc != null) - crc.SlurpBlock(buffer, offset, count); - - if (_streamMode == StreamMode.Undefined) - _streamMode = StreamMode.Writer; - else if (_streamMode != StreamMode.Writer) - throw new ZlibException("Cannot Write after Reading."); - - if (count == 0) - return; - - // first reference of z property will initialize the private var _z - z.InputBuffer = buffer; - _z.NextIn = offset; - _z.AvailableBytesIn = count; - bool done = false; - do - { - _z.OutputBuffer = workingBuffer; - _z.NextOut = 0; - _z.AvailableBytesOut = _workingBuffer.Length; - int rc = (_wantCompress) - ? _z.Deflate(_flushMode) - : _z.Inflate(_flushMode); - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new ZlibException((_wantCompress ? "de" : "in") + "flating: " + _z.Message); - - //if (_workingBuffer.Length - _z.AvailableBytesOut > 0) - _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); - - done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; - - // If GZIP and de-compress, we're done when 8 bytes remain. - if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) - done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); - - } - while (!done); - } - - - - private void finish() - { - if (_z == null) return; - - if (_streamMode == StreamMode.Writer) - { - bool done = false; - do - { - _z.OutputBuffer = workingBuffer; - _z.NextOut = 0; - _z.AvailableBytesOut = _workingBuffer.Length; - int rc = (_wantCompress) - ? _z.Deflate(FlushType.Finish) - : _z.Inflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - { - string verb = (_wantCompress ? "de" : "in") + "flating"; - if (_z.Message == null) - throw new ZlibException(String.Format("{0}: (rc = {1})", verb, rc)); - else - throw new ZlibException(verb + ": " + _z.Message); - } - - if (_workingBuffer.Length - _z.AvailableBytesOut > 0) - { - _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); - } - - done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; - // If GZIP and de-compress, we're done when 8 bytes remain. - if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) - done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); - - } - while (!done); - - Flush(); - - // workitem 7159 - if (_flavor == ZlibStreamFlavor.GZIP) - { - if (_wantCompress) - { - // Emit the GZIP trailer: CRC32 and size mod 2^32 - int c1 = crc.Crc32Result; - _stream.Write(BitConverter.GetBytes(c1), 0, 4); - int c2 = (Int32)(crc.TotalBytesRead & 0x00000000FFFFFFFF); - _stream.Write(BitConverter.GetBytes(c2), 0, 4); - } - else - { - throw new ZlibException("Writing with decompression is not supported."); - } - } - } - // workitem 7159 - else if (_streamMode == StreamMode.Reader) - { - if (_flavor == ZlibStreamFlavor.GZIP) - { - if (!_wantCompress) - { - // workitem 8501: handle edge case (decompress empty stream) - if (_z.TotalBytesOut == 0L) - return; - - // Read and potentially verify the GZIP trailer: - // CRC32 and size mod 2^32 - byte[] trailer = new byte[8]; - - // workitems 8679 & 12554 - if (_z.AvailableBytesIn < 8) - { - // Make sure we have read to the end of the stream - Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, _z.AvailableBytesIn); - int bytesNeeded = 8 - _z.AvailableBytesIn; - int bytesRead = _stream.Read(trailer, - _z.AvailableBytesIn, - bytesNeeded); - if (bytesNeeded != bytesRead) - { - throw new ZlibException(String.Format("Missing or incomplete GZIP trailer. Expected 8 bytes, got {0}.", - _z.AvailableBytesIn + bytesRead)); - } - } - else - { - Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, trailer.Length); - } - - Int32 crc32_expected = BitConverter.ToInt32(trailer, 0); - Int32 crc32_actual = crc.Crc32Result; - Int32 isize_expected = BitConverter.ToInt32(trailer, 4); - Int32 isize_actual = (Int32)(_z.TotalBytesOut & 0x00000000FFFFFFFF); - - if (crc32_actual != crc32_expected) - throw new ZlibException(String.Format("Bad CRC32 in GZIP trailer. (actual({0:X8})!=expected({1:X8}))", crc32_actual, crc32_expected)); - - if (isize_actual != isize_expected) - throw new ZlibException(String.Format("Bad size in GZIP trailer. (actual({0})!=expected({1}))", isize_actual, isize_expected)); - - } - else - { - throw new ZlibException("Reading with compression is not supported."); - } - } - } - } - - - private void end() - { - if (z == null) - return; - if (_wantCompress) - { - _z.EndDeflate(); - } - else - { - _z.EndInflate(); - } - _z = null; - } - - - public override void Close() - { - if (_stream == null) return; - try - { - finish(); - } - finally - { - end(); - if (!_leaveOpen) _stream.Close(); - _stream = null; - } - } - - public override void Flush() - { - _stream.Flush(); - } - - public override System.Int64 Seek(System.Int64 offset, System.IO.SeekOrigin origin) - { - throw new NotImplementedException(); - //_outStream.Seek(offset, origin); - } - public override void SetLength(System.Int64 value) - { - _stream.SetLength(value); - } - - -#if NOT - public int Read() - { - if (Read(_buf1, 0, 1) == 0) - return 0; - // calculate CRC after reading - if (crc!=null) - crc.SlurpBlock(_buf1,0,1); - return (_buf1[0] & 0xFF); - } -#endif - - private bool nomoreinput = false; - - - - private string ReadZeroTerminatedString() - { - var list = new System.Collections.Generic.List(); - bool done = false; - do - { - // workitem 7740 - int n = _stream.Read(_buf1, 0, 1); - if (n != 1) - throw new ZlibException("Unexpected EOF reading GZIP header."); - else - { - if (_buf1[0] == 0) - done = true; - else - list.Add(_buf1[0]); - } - } while (!done); - byte[] a = list.ToArray(); - return GZipStream.iso8859dash1.GetString(a, 0, a.Length); - } - - - private int _ReadAndValidateGzipHeader() - { - int totalBytesRead = 0; - // read the header on the first read - byte[] header = new byte[10]; - int n = _stream.Read(header, 0, header.Length); - - // workitem 8501: handle edge case (decompress empty stream) - if (n == 0) - return 0; - - if (n != 10) - throw new ZlibException("Not a valid GZIP stream."); - - if (header[0] != 0x1F || header[1] != 0x8B || header[2] != 8) - throw new ZlibException("Bad GZIP header."); - - Int32 timet = BitConverter.ToInt32(header, 4); - _GzipMtime = GZipStream._unixEpoch.AddSeconds(timet); - totalBytesRead += n; - if ((header[3] & 0x04) == 0x04) - { - // read and discard extra field - n = _stream.Read(header, 0, 2); // 2-byte length field - totalBytesRead += n; - - Int16 extraLength = (Int16)(header[0] + header[1] * 256); - byte[] extra = new byte[extraLength]; - n = _stream.Read(extra, 0, extra.Length); - if (n != extraLength) - throw new ZlibException("Unexpected end-of-file reading GZIP header."); - totalBytesRead += n; - } - if ((header[3] & 0x08) == 0x08) - _GzipFileName = ReadZeroTerminatedString(); - if ((header[3] & 0x10) == 0x010) - _GzipComment = ReadZeroTerminatedString(); - if ((header[3] & 0x02) == 0x02) - Read(_buf1, 0, 1); // CRC16, ignore - - return totalBytesRead; - } - - - - public override System.Int32 Read(System.Byte[] buffer, System.Int32 offset, System.Int32 count) - { - // According to MS documentation, any implementation of the IO.Stream.Read function must: - // (a) throw an exception if offset & count reference an invalid part of the buffer, - // or if count < 0, or if buffer is null - // (b) return 0 only upon EOF, or if count = 0 - // (c) if not EOF, then return at least 1 byte, up to bytes - - if (_streamMode == StreamMode.Undefined) - { - if (!this._stream.CanRead) throw new ZlibException("The stream is not readable."); - // for the first read, set up some controls. - _streamMode = StreamMode.Reader; - // (The first reference to _z goes through the private accessor which - // may initialize it.) - z.AvailableBytesIn = 0; - if (_flavor == ZlibStreamFlavor.GZIP) - { - _gzipHeaderByteCount = _ReadAndValidateGzipHeader(); - // workitem 8501: handle edge case (decompress empty stream) - if (_gzipHeaderByteCount == 0) - return 0; - } - } - - if (_streamMode != StreamMode.Reader) - throw new ZlibException("Cannot Read after Writing."); - - if (count == 0) return 0; - if (nomoreinput && _wantCompress) return 0; // workitem 8557 - if (buffer == null) throw new ArgumentNullException("buffer"); - if (count < 0) throw new ArgumentOutOfRangeException("count"); - if (offset < buffer.GetLowerBound(0)) throw new ArgumentOutOfRangeException("offset"); - if ((offset + count) > buffer.GetLength(0)) throw new ArgumentOutOfRangeException("count"); - - int rc = 0; - - // set up the output of the deflate/inflate codec: - _z.OutputBuffer = buffer; - _z.NextOut = offset; - _z.AvailableBytesOut = count; - - // This is necessary in case _workingBuffer has been resized. (new byte[]) - // (The first reference to _workingBuffer goes through the private accessor which - // may initialize it.) - _z.InputBuffer = workingBuffer; - - do - { - // need data in _workingBuffer in order to deflate/inflate. Here, we check if we have any. - if ((_z.AvailableBytesIn == 0) && (!nomoreinput)) - { - // No data available, so try to Read data from the captive stream. - _z.NextIn = 0; - _z.AvailableBytesIn = _stream.Read(_workingBuffer, 0, _workingBuffer.Length); - if (_z.AvailableBytesIn == 0) - nomoreinput = true; - - } - // we have data in InputBuffer; now compress or decompress as appropriate - rc = (_wantCompress) - ? _z.Deflate(_flushMode) - : _z.Inflate(_flushMode); - - if (nomoreinput && (rc == ZlibConstants.Z_BUF_ERROR)) - return 0; - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new ZlibException(String.Format("{0}flating: rc={1} msg={2}", (_wantCompress ? "de" : "in"), rc, _z.Message)); - - if ((nomoreinput || rc == ZlibConstants.Z_STREAM_END) && (_z.AvailableBytesOut == count)) - break; // nothing more to read - } - //while (_z.AvailableBytesOut == count && rc == ZlibConstants.Z_OK); - while (_z.AvailableBytesOut > 0 && !nomoreinput && rc == ZlibConstants.Z_OK); - - - // workitem 8557 - // is there more room in output? - if (_z.AvailableBytesOut > 0) - { - if (rc == ZlibConstants.Z_OK && _z.AvailableBytesIn == 0) - { - // deferred - } - - // are we completely done reading? - if (nomoreinput) - { - // and in compression? - if (_wantCompress) - { - // no more input data available; therefore we flush to - // try to complete the read - rc = _z.Deflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new ZlibException(String.Format("Deflating: rc={0} msg={1}", rc, _z.Message)); - } - } - } - - - rc = (count - _z.AvailableBytesOut); - - // calculate CRC after reading - if (crc != null) - crc.SlurpBlock(buffer, offset, rc); - - return rc; - } - - - - public override System.Boolean CanRead - { - get { return this._stream.CanRead; } - } - - public override System.Boolean CanSeek - { - get { return this._stream.CanSeek; } - } - - public override System.Boolean CanWrite - { - get { return this._stream.CanWrite; } - } - - public override System.Int64 Length - { - get { return _stream.Length; } - } - - public override long Position - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - internal enum StreamMode - { - Writer, - Reader, - Undefined, - } - - - public static void CompressString(String s, Stream compressor) - { - byte[] uncompressed = System.Text.Encoding.UTF8.GetBytes(s); - using (compressor) - { - compressor.Write(uncompressed, 0, uncompressed.Length); - } - } - - public static void CompressBuffer(byte[] b, Stream compressor) - { - // workitem 8460 - using (compressor) - { - compressor.Write(b, 0, b.Length); - } - } - - public static String UncompressString(byte[] compressed, Stream decompressor) - { - // workitem 8460 - byte[] working = new byte[1024]; - var encoding = System.Text.Encoding.UTF8; - using (var output = new MemoryStream()) - { - using (decompressor) - { - int n; - while ((n = decompressor.Read(working, 0, working.Length)) != 0) - { - output.Write(working, 0, n); - } - } - - // reset to allow read from start - output.Seek(0, SeekOrigin.Begin); - var sr = new StreamReader(output, encoding); - return sr.ReadToEnd(); - } - } - - public static byte[] UncompressBuffer(byte[] compressed, Stream decompressor) - { - // workitem 8460 - byte[] working = new byte[1024]; - using (var output = new MemoryStream()) - { - using (decompressor) - { - int n; - while ((n = decompressor.Read(working, 0, working.Length)) != 0) - { - output.Write(working, 0, n); - } - } - return output.ToArray(); - } - } - - } - - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs.meta deleted file mode 100755 index 46b218da..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1d7f7413bfac9414f9af6ed50db74ef0 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs deleted file mode 100755 index 7fe6e666..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs +++ /dev/null @@ -1,719 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// ZlibCodec.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2009-November-03 15:40:51> -// -// ------------------------------------------------------------------ -// -// This module defines a Codec for ZLIB compression and -// decompression. This code extends code that was based the jzlib -// implementation of zlib, but this code is completely novel. The codec -// class is new, and encapsulates some behaviors that are new, and some -// that were present in other classes in the jzlib code base. In -// keeping with the license for jzlib, the copyright to the jzlib code -// is included below. -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - -using System; -using Interop=System.Runtime.InteropServices; - -namespace Ionic.Zlib -{ - /// - /// Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). - /// - /// - /// - /// This class compresses and decompresses data according to the Deflate algorithm - /// and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. - /// - [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000D")] - [Interop.ComVisible(true)] -#if !NETCF - [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] -#endif - sealed public class ZlibCodec - { - /// - /// The buffer from which data is taken. - /// - public byte[] InputBuffer; - - /// - /// An index into the InputBuffer array, indicating where to start reading. - /// - public int NextIn; - - /// - /// The number of bytes available in the InputBuffer, starting at NextIn. - /// - /// - /// Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. - /// The class will update this number as calls to Inflate/Deflate are made. - /// - public int AvailableBytesIn; - - /// - /// Total number of bytes read so far, through all calls to Inflate()/Deflate(). - /// - public long TotalBytesIn; - - /// - /// Buffer to store output data. - /// - public byte[] OutputBuffer; - - /// - /// An index into the OutputBuffer array, indicating where to start writing. - /// - public int NextOut; - - /// - /// The number of bytes available in the OutputBuffer, starting at NextOut. - /// - /// - /// Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. - /// The class will update this number as calls to Inflate/Deflate are made. - /// - public int AvailableBytesOut; - - /// - /// Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). - /// - public long TotalBytesOut; - - /// - /// used for diagnostics, when something goes wrong! - /// - public System.String Message; - - internal DeflateManager dstate; - internal InflateManager istate; - - internal uint _Adler32; - - /// - /// The compression level to use in this codec. Useful only in compression mode. - /// - public CompressionLevel CompressLevel = CompressionLevel.Default; - - /// - /// The number of Window Bits to use. - /// - /// - /// This gauges the size of the sliding window, and hence the - /// compression effectiveness as well as memory consumption. It's best to just leave this - /// setting alone if you don't know what it is. The maximum value is 15 bits, which implies - /// a 32k window. - /// - public int WindowBits = ZlibConstants.WindowBitsDefault; - - /// - /// The compression strategy to use. - /// - /// - /// This is only effective in compression. The theory offered by ZLIB is that different - /// strategies could potentially produce significant differences in compression behavior - /// for different data sets. Unfortunately I don't have any good recommendations for how - /// to set it differently. When I tested changing the strategy I got minimally different - /// compression performance. It's best to leave this property alone if you don't have a - /// good feel for it. Or, you may want to produce a test harness that runs through the - /// different strategy options and evaluates them on different file types. If you do that, - /// let me know your results. - /// - public CompressionStrategy Strategy = CompressionStrategy.Default; - - - /// - /// The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. - /// - public int Adler32 { get { return (int)_Adler32; } } - - - /// - /// Create a ZlibCodec. - /// - /// - /// If you use this default constructor, you will later have to explicitly call - /// InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress - /// or decompress. - /// - public ZlibCodec() { } - - /// - /// Create a ZlibCodec that either compresses or decompresses. - /// - /// - /// Indicates whether the codec should compress (deflate) or decompress (inflate). - /// - public ZlibCodec(CompressionMode mode) - { - if (mode == CompressionMode.Compress) - { - int rc = InitializeDeflate(); - if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for deflate."); - } - else if (mode == CompressionMode.Decompress) - { - int rc = InitializeInflate(); - if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for inflate."); - } - else throw new ZlibException("Invalid ZlibStreamFlavor."); - } - - /// - /// Initialize the inflation state. - /// - /// - /// It is not necessary to call this before using the ZlibCodec to inflate data; - /// It is implicitly called when you call the constructor. - /// - /// Z_OK if everything goes well. - public int InitializeInflate() - { - return InitializeInflate(this.WindowBits); - } - - /// - /// Initialize the inflation state with an explicit flag to - /// govern the handling of RFC1950 header bytes. - /// - /// - /// - /// By default, the ZLIB header defined in RFC 1950 is expected. If - /// you want to read a zlib stream you should specify true for - /// expectRfc1950Header. If you have a deflate stream, you will want to specify - /// false. It is only necessary to invoke this initializer explicitly if you - /// want to specify false. - /// - /// - /// whether to expect an RFC1950 header byte - /// pair when reading the stream of data to be inflated. - /// - /// Z_OK if everything goes well. - public int InitializeInflate(bool expectRfc1950Header) - { - return InitializeInflate(this.WindowBits, expectRfc1950Header); - } - - /// - /// Initialize the ZlibCodec for inflation, with the specified number of window bits. - /// - /// The number of window bits to use. If you need to ask what that is, - /// then you shouldn't be calling this initializer. - /// Z_OK if all goes well. - public int InitializeInflate(int windowBits) - { - this.WindowBits = windowBits; - return InitializeInflate(windowBits, true); - } - - /// - /// Initialize the inflation state with an explicit flag to govern the handling of - /// RFC1950 header bytes. - /// - /// - /// - /// If you want to read a zlib stream you should specify true for - /// expectRfc1950Header. In this case, the library will expect to find a ZLIB - /// header, as defined in RFC - /// 1950, in the compressed stream. If you will be reading a DEFLATE or - /// GZIP stream, which does not have such a header, you will want to specify - /// false. - /// - /// - /// whether to expect an RFC1950 header byte pair when reading - /// the stream of data to be inflated. - /// The number of window bits to use. If you need to ask what that is, - /// then you shouldn't be calling this initializer. - /// Z_OK if everything goes well. - public int InitializeInflate(int windowBits, bool expectRfc1950Header) - { - this.WindowBits = windowBits; - if (dstate != null) throw new ZlibException("You may not call InitializeInflate() after calling InitializeDeflate()."); - istate = new InflateManager(expectRfc1950Header); - return istate.Initialize(this, windowBits); - } - - /// - /// Inflate the data in the InputBuffer, placing the result in the OutputBuffer. - /// - /// - /// You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and - /// AvailableBytesOut before calling this method. - /// - /// - /// - /// private void InflateBuffer() - /// { - /// int bufferSize = 1024; - /// byte[] buffer = new byte[bufferSize]; - /// ZlibCodec decompressor = new ZlibCodec(); - /// - /// Console.WriteLine("\n============================================"); - /// Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); - /// MemoryStream ms = new MemoryStream(DecompressedBytes); - /// - /// int rc = decompressor.InitializeInflate(); - /// - /// decompressor.InputBuffer = CompressedBytes; - /// decompressor.NextIn = 0; - /// decompressor.AvailableBytesIn = CompressedBytes.Length; - /// - /// decompressor.OutputBuffer = buffer; - /// - /// // pass 1: inflate - /// do - /// { - /// decompressor.NextOut = 0; - /// decompressor.AvailableBytesOut = buffer.Length; - /// rc = decompressor.Inflate(FlushType.None); - /// - /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - /// throw new Exception("inflating: " + decompressor.Message); - /// - /// ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); - /// } - /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - /// - /// // pass 2: finish and flush - /// do - /// { - /// decompressor.NextOut = 0; - /// decompressor.AvailableBytesOut = buffer.Length; - /// rc = decompressor.Inflate(FlushType.Finish); - /// - /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - /// throw new Exception("inflating: " + decompressor.Message); - /// - /// if (buffer.Length - decompressor.AvailableBytesOut > 0) - /// ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); - /// } - /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - /// - /// decompressor.EndInflate(); - /// } - /// - /// - /// - /// The flush to use when inflating. - /// Z_OK if everything goes well. - public int Inflate(FlushType flush) - { - if (istate == null) - throw new ZlibException("No Inflate State!"); - return istate.Inflate(flush); - } - - - /// - /// Ends an inflation session. - /// - /// - /// Call this after successively calling Inflate(). This will cause all buffers to be flushed. - /// After calling this you cannot call Inflate() without a intervening call to one of the - /// InitializeInflate() overloads. - /// - /// Z_OK if everything goes well. - public int EndInflate() - { - if (istate == null) - throw new ZlibException("No Inflate State!"); - int ret = istate.End(); - istate = null; - return ret; - } - - /// - /// I don't know what this does! - /// - /// Z_OK if everything goes well. - public int SyncInflate() - { - if (istate == null) - throw new ZlibException("No Inflate State!"); - return istate.Sync(); - } - - /// - /// Initialize the ZlibCodec for deflation operation. - /// - /// - /// The codec will use the MAX window bits and the default level of compression. - /// - /// - /// - /// int bufferSize = 40000; - /// byte[] CompressedBytes = new byte[bufferSize]; - /// byte[] DecompressedBytes = new byte[bufferSize]; - /// - /// ZlibCodec compressor = new ZlibCodec(); - /// - /// compressor.InitializeDeflate(CompressionLevel.Default); - /// - /// compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); - /// compressor.NextIn = 0; - /// compressor.AvailableBytesIn = compressor.InputBuffer.Length; - /// - /// compressor.OutputBuffer = CompressedBytes; - /// compressor.NextOut = 0; - /// compressor.AvailableBytesOut = CompressedBytes.Length; - /// - /// while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) - /// { - /// compressor.Deflate(FlushType.None); - /// } - /// - /// while (true) - /// { - /// int rc= compressor.Deflate(FlushType.Finish); - /// if (rc == ZlibConstants.Z_STREAM_END) break; - /// } - /// - /// compressor.EndDeflate(); - /// - /// - /// - /// Z_OK if all goes well. You generally don't need to check the return code. - public int InitializeDeflate() - { - return _InternalInitializeDeflate(true); - } - - /// - /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. - /// - /// - /// The codec will use the maximum window bits (15) and the specified - /// CompressionLevel. It will emit a ZLIB stream as it compresses. - /// - /// The compression level for the codec. - /// Z_OK if all goes well. - public int InitializeDeflate(CompressionLevel level) - { - this.CompressLevel = level; - return _InternalInitializeDeflate(true); - } - - - /// - /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - /// and the explicit flag governing whether to emit an RFC1950 header byte pair. - /// - /// - /// The codec will use the maximum window bits (15) and the specified CompressionLevel. - /// If you want to generate a zlib stream, you should specify true for - /// wantRfc1950Header. In this case, the library will emit a ZLIB - /// header, as defined in RFC - /// 1950, in the compressed stream. - /// - /// The compression level for the codec. - /// whether to emit an initial RFC1950 byte pair in the compressed stream. - /// Z_OK if all goes well. - public int InitializeDeflate(CompressionLevel level, bool wantRfc1950Header) - { - this.CompressLevel = level; - return _InternalInitializeDeflate(wantRfc1950Header); - } - - - /// - /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - /// and the specified number of window bits. - /// - /// - /// The codec will use the specified number of window bits and the specified CompressionLevel. - /// - /// The compression level for the codec. - /// the number of window bits to use. If you don't know what this means, don't use this method. - /// Z_OK if all goes well. - public int InitializeDeflate(CompressionLevel level, int bits) - { - this.CompressLevel = level; - this.WindowBits = bits; - return _InternalInitializeDeflate(true); - } - - /// - /// Initialize the ZlibCodec for deflation operation, using the specified - /// CompressionLevel, the specified number of window bits, and the explicit flag - /// governing whether to emit an RFC1950 header byte pair. - /// - /// - /// The compression level for the codec. - /// whether to emit an initial RFC1950 byte pair in the compressed stream. - /// the number of window bits to use. If you don't know what this means, don't use this method. - /// Z_OK if all goes well. - public int InitializeDeflate(CompressionLevel level, int bits, bool wantRfc1950Header) - { - this.CompressLevel = level; - this.WindowBits = bits; - return _InternalInitializeDeflate(wantRfc1950Header); - } - - private int _InternalInitializeDeflate(bool wantRfc1950Header) - { - if (istate != null) throw new ZlibException("You may not call InitializeDeflate() after calling InitializeInflate()."); - dstate = new DeflateManager(); - dstate.WantRfc1950HeaderBytes = wantRfc1950Header; - - return dstate.Initialize(this, this.CompressLevel, this.WindowBits, this.Strategy); - } - - /// - /// Deflate one batch of data. - /// - /// - /// You must have set InputBuffer and OutputBuffer before calling this method. - /// - /// - /// - /// private void DeflateBuffer(CompressionLevel level) - /// { - /// int bufferSize = 1024; - /// byte[] buffer = new byte[bufferSize]; - /// ZlibCodec compressor = new ZlibCodec(); - /// - /// Console.WriteLine("\n============================================"); - /// Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); - /// MemoryStream ms = new MemoryStream(); - /// - /// int rc = compressor.InitializeDeflate(level); - /// - /// compressor.InputBuffer = UncompressedBytes; - /// compressor.NextIn = 0; - /// compressor.AvailableBytesIn = UncompressedBytes.Length; - /// - /// compressor.OutputBuffer = buffer; - /// - /// // pass 1: deflate - /// do - /// { - /// compressor.NextOut = 0; - /// compressor.AvailableBytesOut = buffer.Length; - /// rc = compressor.Deflate(FlushType.None); - /// - /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - /// throw new Exception("deflating: " + compressor.Message); - /// - /// ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); - /// } - /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - /// - /// // pass 2: finish and flush - /// do - /// { - /// compressor.NextOut = 0; - /// compressor.AvailableBytesOut = buffer.Length; - /// rc = compressor.Deflate(FlushType.Finish); - /// - /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - /// throw new Exception("deflating: " + compressor.Message); - /// - /// if (buffer.Length - compressor.AvailableBytesOut > 0) - /// ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); - /// } - /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - /// - /// compressor.EndDeflate(); - /// - /// ms.Seek(0, SeekOrigin.Begin); - /// CompressedBytes = new byte[compressor.TotalBytesOut]; - /// ms.Read(CompressedBytes, 0, CompressedBytes.Length); - /// } - /// - /// - /// whether to flush all data as you deflate. Generally you will want to - /// use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to - /// flush everything. - /// - /// Z_OK if all goes well. - public int Deflate(FlushType flush) - { - if (dstate == null) - throw new ZlibException("No Deflate State!"); - return dstate.Deflate(flush); - } - - /// - /// End a deflation session. - /// - /// - /// Call this after making a series of one or more calls to Deflate(). All buffers are flushed. - /// - /// Z_OK if all goes well. - public int EndDeflate() - { - if (dstate == null) - throw new ZlibException("No Deflate State!"); - // TODO: dinoch Tue, 03 Nov 2009 15:39 (test this) - //int ret = dstate.End(); - dstate = null; - return ZlibConstants.Z_OK; //ret; - } - - /// - /// Reset a codec for another deflation session. - /// - /// - /// Call this to reset the deflation state. For example if a thread is deflating - /// non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first - /// block and before the next Deflate(None) of the second block. - /// - /// Z_OK if all goes well. - public void ResetDeflate() - { - if (dstate == null) - throw new ZlibException("No Deflate State!"); - dstate.Reset(); - } - - - /// - /// Set the CompressionStrategy and CompressionLevel for a deflation session. - /// - /// the level of compression to use. - /// the strategy to use for compression. - /// Z_OK if all goes well. - public int SetDeflateParams(CompressionLevel level, CompressionStrategy strategy) - { - if (dstate == null) - throw new ZlibException("No Deflate State!"); - return dstate.SetParams(level, strategy); - } - - - /// - /// Set the dictionary to be used for either Inflation or Deflation. - /// - /// The dictionary bytes to use. - /// Z_OK if all goes well. - public int SetDictionary(byte[] dictionary) - { - if (istate != null) - return istate.SetDictionary(dictionary); - - if (dstate != null) - return dstate.SetDictionary(dictionary); - - throw new ZlibException("No Inflate or Deflate state!"); - } - - // Flush as much pending output as possible. All deflate() output goes - // through this function so some applications may wish to modify it - // to avoid allocating a large strm->next_out buffer and copying into it. - // (See also read_buf()). - internal void flush_pending() - { - int len = dstate.pendingCount; - - if (len > AvailableBytesOut) - len = AvailableBytesOut; - if (len == 0) - return; - - if (dstate.pending.Length <= dstate.nextPending || - OutputBuffer.Length <= NextOut || - dstate.pending.Length < (dstate.nextPending + len) || - OutputBuffer.Length < (NextOut + len)) - { - throw new ZlibException(String.Format("Invalid State. (pending.Length={0}, pendingCount={1})", - dstate.pending.Length, dstate.pendingCount)); - } - - Array.Copy(dstate.pending, dstate.nextPending, OutputBuffer, NextOut, len); - - NextOut += len; - dstate.nextPending += len; - TotalBytesOut += len; - AvailableBytesOut -= len; - dstate.pendingCount -= len; - if (dstate.pendingCount == 0) - { - dstate.nextPending = 0; - } - } - - // Read a new buffer from the current input stream, update the adler32 - // and total number of bytes read. All deflate() input goes through - // this function so some applications may wish to modify it to avoid - // allocating a large strm->next_in buffer and copying from it. - // (See also flush_pending()). - internal int read_buf(byte[] buf, int start, int size) - { - int len = AvailableBytesIn; - - if (len > size) - len = size; - if (len == 0) - return 0; - - AvailableBytesIn -= len; - - if (dstate.WantRfc1950HeaderBytes) - { - _Adler32 = Adler.Adler32(_Adler32, InputBuffer, NextIn, len); - } - Array.Copy(InputBuffer, NextIn, buf, start, len); - NextIn += len; - TotalBytesIn += len; - return len; - } - - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs.meta deleted file mode 100755 index 90692d21..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibCodec.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 91aee734bfb149145aedc35cebc213c0 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs deleted file mode 100755 index 62c63df2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs +++ /dev/null @@ -1,129 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// ZlibConstants.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2009-November-03 18:50:19> -// -// ------------------------------------------------------------------ -// -// This module defines constants used by the zlib class library. This -// code is derived from the jzlib implementation of zlib, but -// significantly modified. In keeping with the license for jzlib, the -// copyright to that code is included here. -// -// ------------------------------------------------------------------ -// -// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the distribution. -// -// 3. The names of the authors may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ----------------------------------------------------------------------- -// -// This program is based on zlib-1.1.3; credit to authors -// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) -// and contributors of zlib. -// -// ----------------------------------------------------------------------- - - -using System; - -namespace Ionic.Zlib -{ - /// - /// A bunch of constants used in the Zlib interface. - /// - public static class ZlibConstants - { - /// - /// The maximum number of window bits for the Deflate algorithm. - /// - public const int WindowBitsMax = 15; // 32K LZ77 window - - /// - /// The default number of window bits for the Deflate algorithm. - /// - public const int WindowBitsDefault = WindowBitsMax; - - /// - /// indicates everything is A-OK - /// - public const int Z_OK = 0; - - /// - /// Indicates that the last operation reached the end of the stream. - /// - public const int Z_STREAM_END = 1; - - /// - /// The operation ended in need of a dictionary. - /// - public const int Z_NEED_DICT = 2; - - /// - /// There was an error with the stream - not enough data, not open and readable, etc. - /// - public const int Z_STREAM_ERROR = -2; - - /// - /// There was an error with the data - not enough data, bad data, etc. - /// - public const int Z_DATA_ERROR = -3; - - /// - /// There was an error with the working buffer. - /// - public const int Z_BUF_ERROR = -5; - - /// - /// The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. - /// -#if NETCF - public const int WorkingBufferSizeDefault = 8192; -#else - public const int WorkingBufferSizeDefault = 16384; -#endif - /// - /// The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. - /// - public const int WorkingBufferSizeMin = 1024; - } - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs.meta deleted file mode 100755 index 2a5d46a8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibConstants.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8361ff3584a8a2e488ae21b3c835ce43 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs deleted file mode 100755 index e5fdf701..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs +++ /dev/null @@ -1,727 +0,0 @@ -#if !UNITY_WSA && !UNITY_WP8 -// ZlibStream.cs -// ------------------------------------------------------------------ -// -// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. -// All rights reserved. -// -// This code module is part of DotNetZip, a zipfile class library. -// -// ------------------------------------------------------------------ -// -// This code is licensed under the Microsoft Public License. -// See the file License.txt for the license details. -// More info on: http://dotnetzip.codeplex.com -// -// ------------------------------------------------------------------ -// -// last saved (in emacs): -// Time-stamp: <2011-July-31 14:53:33> -// -// ------------------------------------------------------------------ -// -// This module defines the ZlibStream class, which is similar in idea to -// the System.IO.Compression.DeflateStream and -// System.IO.Compression.GZipStream classes in the .NET BCL. -// -// ------------------------------------------------------------------ - -using System; -using System.IO; - -namespace Ionic.Zlib -{ - - /// - /// Represents a Zlib stream for compression or decompression. - /// - /// - /// - /// - /// The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any - /// stream. - /// - /// - /// Using this stream, applications can compress or decompress data via - /// stream Read() and Write() operations. Either compresssion or - /// decompression can occur through either reading or writing. The compression - /// format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed - /// Data Format Specification version 3.3". This implementation of ZLIB always uses - /// DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE - /// Compressed Data Format Specification version 1.3.") - /// - /// - /// The ZLIB format allows for varying compression methods, window sizes, and dictionaries. - /// This implementation always uses the DEFLATE compression method, a preset dictionary, - /// and 15 window bits by default. - /// - /// - /// - /// This class is similar to , except that it adds the - /// RFC1950 header and trailer bytes to a compressed stream when compressing, or expects - /// the RFC1950 header and trailer bytes when decompressing. It is also similar to the - /// . - /// - /// - /// - /// - public class ZlibStream : System.IO.Stream - { - internal ZlibBaseStream _baseStream; - bool _disposed; - - /// - /// Create a ZlibStream using the specified CompressionMode. - /// - /// - /// - /// - /// When mode is CompressionMode.Compress, the ZlibStream - /// will use the default compression level. The "captive" stream will be - /// closed when the ZlibStream is closed. - /// - /// - /// - /// - /// - /// This example uses a ZlibStream to compress a file, and writes the - /// compressed data to another file. - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - /// { - /// using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(fileToCompress & ".zlib") - /// Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// - /// The stream which will be read or written. - /// Indicates whether the ZlibStream will compress or decompress. - public ZlibStream(System.IO.Stream stream, CompressionMode mode) - : this(stream, mode, CompressionLevel.Default, false) - { - } - - /// - /// Create a ZlibStream using the specified CompressionMode and - /// the specified CompressionLevel. - /// - /// - /// - /// - /// - /// When mode is CompressionMode.Decompress, the level parameter is ignored. - /// The "captive" stream will be closed when the ZlibStream is closed. - /// - /// - /// - /// - /// - /// This example uses a ZlibStream to compress data from a file, and writes the - /// compressed data to another file. - /// - /// - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - /// { - /// using (Stream compressor = new ZlibStream(raw, - /// CompressionMode.Compress, - /// CompressionLevel.BestCompression)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// } - /// - /// - /// - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using raw As FileStream = File.Create(fileToCompress & ".zlib") - /// Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// End Using - /// - /// - /// - /// The stream to be read or written while deflating or inflating. - /// Indicates whether the ZlibStream will compress or decompress. - /// A tuning knob to trade speed for effectiveness. - public ZlibStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level) - : this(stream, mode, level, false) - { - } - - /// - /// Create a ZlibStream using the specified CompressionMode, and - /// explicitly specify whether the captive stream should be left open after - /// Deflation or Inflation. - /// - /// - /// - /// - /// - /// When mode is CompressionMode.Compress, the ZlibStream will use - /// the default compression level. - /// - /// - /// - /// This constructor allows the application to request that the captive stream - /// remain open after the deflation or inflation occurs. By default, after - /// Close() is called on the stream, the captive stream is also - /// closed. In some cases this is not desired, for example if the stream is a - /// that will be re-read after - /// compression. Specify true for the parameter to leave the stream - /// open. - /// - /// - /// - /// See the other overloads of this constructor for example code. - /// - /// - /// - /// - /// The stream which will be read or written. This is called the - /// "captive" stream in other places in this documentation. - /// Indicates whether the ZlibStream will compress or decompress. - /// true if the application would like the stream to remain - /// open after inflation/deflation. - public ZlibStream(System.IO.Stream stream, CompressionMode mode, bool leaveOpen) - : this(stream, mode, CompressionLevel.Default, leaveOpen) - { - } - - /// - /// Create a ZlibStream using the specified CompressionMode - /// and the specified CompressionLevel, and explicitly specify - /// whether the stream should be left open after Deflation or Inflation. - /// - /// - /// - /// - /// - /// This constructor allows the application to request that the captive - /// stream remain open after the deflation or inflation occurs. By - /// default, after Close() is called on the stream, the captive - /// stream is also closed. In some cases this is not desired, for example - /// if the stream is a that will be - /// re-read after compression. Specify true for the parameter to leave the stream open. - /// - /// - /// - /// When mode is CompressionMode.Decompress, the level parameter is - /// ignored. - /// - /// - /// - /// - /// - /// - /// This example shows how to use a ZlibStream to compress the data from a file, - /// and store the result into another file. The filestream remains open to allow - /// additional data to be written to it. - /// - /// - /// using (var output = System.IO.File.Create(fileToCompress + ".zlib")) - /// { - /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - /// { - /// using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - /// { - /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - /// int n; - /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - /// { - /// compressor.Write(buffer, 0, n); - /// } - /// } - /// } - /// // can write additional data to the output stream here - /// } - /// - /// - /// Using output As FileStream = File.Create(fileToCompress & ".zlib") - /// Using input As Stream = File.OpenRead(fileToCompress) - /// Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - /// Dim buffer As Byte() = New Byte(4096) {} - /// Dim n As Integer = -1 - /// Do While (n <> 0) - /// If (n > 0) Then - /// compressor.Write(buffer, 0, n) - /// End If - /// n = input.Read(buffer, 0, buffer.Length) - /// Loop - /// End Using - /// End Using - /// ' can write additional data to the output stream here. - /// End Using - /// - /// - /// - /// The stream which will be read or written. - /// - /// Indicates whether the ZlibStream will compress or decompress. - /// - /// - /// true if the application would like the stream to remain open after - /// inflation/deflation. - /// - /// - /// - /// A tuning knob to trade speed for effectiveness. This parameter is - /// effective only when mode is CompressionMode.Compress. - /// - public ZlibStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) - { - _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.ZLIB, leaveOpen); - } - -#region Zlib properties - - /// - /// This property sets the flush behavior on the stream. - /// Sorry, though, not sure exactly how to describe all the various settings. - /// - virtual public FlushType FlushMode - { - get { return (this._baseStream._flushMode); } - set - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - this._baseStream._flushMode = value; - } - } - - /// - /// The size of the working buffer for the compression codec. - /// - /// - /// - /// - /// The working buffer is used for all stream operations. The default size is - /// 1024 bytes. The minimum size is 128 bytes. You may get better performance - /// with a larger buffer. Then again, you might not. You would have to test - /// it. - /// - /// - /// - /// Set this before the first call to Read() or Write() on the - /// stream. If you try to set it afterwards, it will throw. - /// - /// - public int BufferSize - { - get - { - return this._baseStream._bufferSize; - } - set - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - if (this._baseStream._workingBuffer != null) - throw new ZlibException("The working buffer is already set."); - if (value < ZlibConstants.WorkingBufferSizeMin) - throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); - this._baseStream._bufferSize = value; - } - } - - /// Returns the total number of bytes input so far. - virtual public long TotalIn - { - get { return this._baseStream._z.TotalBytesIn; } - } - - /// Returns the total number of bytes output so far. - virtual public long TotalOut - { - get { return this._baseStream._z.TotalBytesOut; } - } - -#endregion - -#region System.IO.Stream methods - - /// - /// Dispose the stream. - /// - /// - /// - /// This may or may not result in a Close() call on the captive - /// stream. See the constructors that have a leaveOpen parameter - /// for more information. - /// - /// - /// This method may be invoked in two distinct scenarios. If disposing - /// == true, the method has been called directly or indirectly by a - /// user's code, for example via the public Dispose() method. In this - /// case, both managed and unmanaged resources can be referenced and - /// disposed. If disposing == false, the method has been called by the - /// runtime from inside the object finalizer and this method should not - /// reference other objects; in that case only unmanaged resources must - /// be referenced or disposed. - /// - /// - /// - /// indicates whether the Dispose method was invoked by user code. - /// - protected override void Dispose(bool disposing) - { - try - { - if (!_disposed) - { - if (disposing && (this._baseStream != null)) - this._baseStream.Close(); - _disposed = true; - } - } - finally - { - base.Dispose(disposing); - } - } - - - /// - /// Indicates whether the stream can be read. - /// - /// - /// The return value depends on whether the captive stream supports reading. - /// - public override bool CanRead - { - get - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - return _baseStream._stream.CanRead; - } - } - - /// - /// Indicates whether the stream supports Seek operations. - /// - /// - /// Always returns false. - /// - public override bool CanSeek - { - get { return false; } - } - - /// - /// Indicates whether the stream can be written. - /// - /// - /// The return value depends on whether the captive stream supports writing. - /// - public override bool CanWrite - { - get - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - return _baseStream._stream.CanWrite; - } - } - - /// - /// Flush the stream. - /// - public override void Flush() - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - _baseStream.Flush(); - } - - /// - /// Reading this property always throws a . - /// - public override long Length - { - get { throw new NotSupportedException(); } - } - - /// - /// The position of the stream pointer. - /// - /// - /// - /// Setting this property always throws a . Reading will return the total bytes - /// written out, if used in writing, or the total bytes read in, if used in - /// reading. The count may refer to compressed bytes or uncompressed bytes, - /// depending on how you've used the stream. - /// - public override long Position - { - get - { - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) - return this._baseStream._z.TotalBytesOut; - if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) - return this._baseStream._z.TotalBytesIn; - return 0; - } - - set { throw new NotSupportedException(); } - } - - /// - /// Read data from the stream. - /// - /// - /// - /// - /// - /// If you wish to use the ZlibStream to compress data while reading, - /// you can create a ZlibStream with CompressionMode.Compress, - /// providing an uncompressed data stream. Then call Read() on that - /// ZlibStream, and the data read will be compressed. If you wish to - /// use the ZlibStream to decompress data while reading, you can create - /// a ZlibStream with CompressionMode.Decompress, providing a - /// readable compressed data stream. Then call Read() on that - /// ZlibStream, and the data will be decompressed as it is read. - /// - /// - /// - /// A ZlibStream can be used for Read() or Write(), but - /// not both. - /// - /// - /// - /// - /// - /// The buffer into which the read data should be placed. - /// - /// - /// the offset within that data array to put the first byte read. - /// - /// the number of bytes to read. - /// - /// the number of bytes read - public override int Read(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - return _baseStream.Read(buffer, offset, count); - } - - /// - /// Calling this method always throws a . - /// - /// - /// The offset to seek to.... - /// IF THIS METHOD ACTUALLY DID ANYTHING. - /// - /// - /// The reference specifying how to apply the offset.... IF - /// THIS METHOD ACTUALLY DID ANYTHING. - /// - /// - /// nothing. This method always throws. - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - throw new NotSupportedException(); - } - - /// - /// Calling this method always throws a . - /// - /// - /// The new value for the stream length.... IF - /// THIS METHOD ACTUALLY DID ANYTHING. - /// - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - /// - /// Write data to the stream. - /// - /// - /// - /// - /// - /// If you wish to use the ZlibStream to compress data while writing, - /// you can create a ZlibStream with CompressionMode.Compress, - /// and a writable output stream. Then call Write() on that - /// ZlibStream, providing uncompressed data as input. The data sent to - /// the output stream will be the compressed form of the data written. If you - /// wish to use the ZlibStream to decompress data while writing, you - /// can create a ZlibStream with CompressionMode.Decompress, and a - /// writable output stream. Then call Write() on that stream, - /// providing previously compressed data. The data sent to the output stream - /// will be the decompressed form of the data written. - /// - /// - /// - /// A ZlibStream can be used for Read() or Write(), but not both. - /// - /// - /// The buffer holding data to write to the stream. - /// the offset within that data array to find the first byte to write. - /// the number of bytes to write. - public override void Write(byte[] buffer, int offset, int count) - { - if (_disposed) throw new ObjectDisposedException("ZlibStream"); - _baseStream.Write(buffer, offset, count); - } -#endregion - - - /// - /// Compress a string into a byte array using ZLIB. - /// - /// - /// - /// Uncompress it with . - /// - /// - /// - /// - /// - /// - /// - /// A string to compress. The string will first be encoded - /// using UTF8, then compressed. - /// - /// - /// The string in compressed form - public static byte[] CompressString(String s) - { - using (var ms = new MemoryStream()) - { - Stream compressor = - new ZlibStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); - ZlibBaseStream.CompressString(s, compressor); - return ms.ToArray(); - } - } - - - /// - /// Compress a byte array into a new byte array using ZLIB. - /// - /// - /// - /// Uncompress it with . - /// - /// - /// - /// - /// - /// - /// A buffer to compress. - /// - /// - /// The data in compressed form - public static byte[] CompressBuffer(byte[] b) - { - using (var ms = new MemoryStream()) - { - Stream compressor = - new ZlibStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); - - ZlibBaseStream.CompressBuffer(b, compressor); - return ms.ToArray(); - } - } - - - /// - /// Uncompress a ZLIB-compressed byte array into a single string. - /// - /// - /// - /// - /// - /// - /// A buffer containing ZLIB-compressed data. - /// - /// - /// The uncompressed string - public static String UncompressString(byte[] compressed) - { - using (var input = new MemoryStream(compressed)) - { - Stream decompressor = - new ZlibStream(input, CompressionMode.Decompress); - - return ZlibBaseStream.UncompressString(compressed, decompressor); - } - } - - - /// - /// Uncompress a ZLIB-compressed byte array into a byte array. - /// - /// - /// - /// - /// - /// - /// A buffer containing ZLIB-compressed data. - /// - /// - /// The data in uncompressed form - public static byte[] UncompressBuffer(byte[] compressed) - { - using (var input = new MemoryStream(compressed)) - { - Stream decompressor = - new ZlibStream( input, CompressionMode.Decompress ); - - return ZlibBaseStream.UncompressBuffer(compressed, decompressor); - } - } - - } - - -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs.meta deleted file mode 100755 index 1a86c1e5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 50243a2c2dd97ca4eb70551e2b9da7b2 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models.meta deleted file mode 100755 index ab8f60da..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 34c5d2725a89d1c40af9b10a9b9dcbc5 -folderAsset: yes -timeCreated: 1467491757 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor.meta deleted file mode 100755 index 0f43f1af..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e2363a46f0cf15a4d9a69857885e0d4f -folderAsset: yes -DefaultImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs deleted file mode 100755 index 8d0bb854..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs +++ /dev/null @@ -1,21 +0,0 @@ -#if !UNITY_5 -using UnityEngine; -using System.Collections; -using UnityEditor; - -public class MakeScriptableObject -{ - [MenuItem("PlayFab/MakePlayFabSharedSettings")] - public static void MakePlayFabSharedSettings() - { - PlayFabSharedSettings asset = ScriptableObject.CreateInstance(); - - AssetDatabase.CreateAsset(asset, "Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset"); - AssetDatabase.SaveAssets(); - - EditorUtility.FocusProjectWindow(); - - Selection.activeObject = asset; - } -} -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs.meta deleted file mode 100755 index dcf9e34f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/Editor/MakeSharedSettingsObj.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 46c39e1010e247d4bb53f57288dfecc8 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs deleted file mode 100755 index 2941c70f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs +++ /dev/null @@ -1,27 +0,0 @@ -using UnityEngine; -using PlayFab; - -#if UNITY_5 && !UNITY_5_0 -[CreateAssetMenu(fileName = "PlayFabSharedSettings", menuName = "PlayFab/CreateSharedSettings", order = 1)] -#endif -public class PlayFabSharedSettings : ScriptableObject -{ - public string TitleId; -#if ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFABSERVER_API - public string DeveloperSecretKey; -#endif -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - public string ProductionEnvironmentPlayStreamUrl = ""; -#endif - public string ProductionEnvironmentUrl = ""; - public WebRequestType RequestType = WebRequestType.UnityWww; - public int RequestTimeout = 2000; - public bool RequestKeepAlive = true; - public bool CompressApiData = true; - - public PlayFabLogLevel LogLevel = PlayFabLogLevel.Warning | PlayFabLogLevel.Error; - public string LoggerHost = ""; - public int LoggerPort = 0; - public bool EnableRealTimeLogging = false; - public int LogCapLimit = 30; -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs.meta deleted file mode 100755 index 5612c93a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/PlayFabSharedSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 093286084a3d1994a9c28281a1c38b1d -timeCreated: 1467748518 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs deleted file mode 100755 index 6a8346dd..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace PlayFab.SharedModels -{ - public class HttpResponseObject - { - public int code; - public string status; - public object data; - } - - public class PlayFabRequestCommon - { - } - - public class PlayFabResultCommon - { - public PlayFabRequestCommon Request; - public object CustomData; - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs.meta deleted file mode 100755 index ba966239..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Models/SharedModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8e2ad5324972b434883785ddddf9c851 -timeCreated: 1467491766 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public.meta deleted file mode 100755 index 340516d7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 85636a5aec9f04e91a75e422c19ff5da -folderAsset: yes -timeCreated: 1462682372 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs deleted file mode 100755 index 9195cf3b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs +++ /dev/null @@ -1,131 +0,0 @@ -using UnityEngine; -using System.Collections.Generic; -using System.Text; -using UnityEngine.Rendering; -#if NETFX_CORE -using System.Reflection; -#endif - -namespace PlayFab -{ - public class PlayFabDataGatherer - { -#if !UNITY_5 - public enum GraphicsDeviceType - { - OpenGL2 = 0, Direct3D9 = 1, Direct3D11 = 2, PlayStation3 = 3, Null = 4, Xbox360 = 6, OpenGLES2 = 8, OpenGLES3 = 11, PlayStationVita = 12, - PlayStation4 = 13, XboxOne = 14, PlayStationMobile = 15, Metal = 16, OpenGLCore = 17, Direct3D12 = 18, Nintendo3DS = 19 - } - - // RuntimePlatform Enum info: - // OSXEditor = 0, OSXPlayer = 1, WindowsPlayer = 2, OSXWebPlayer = 3, OSXDashboardPlayer = 4, WindowsWebPlayer = 5, WindowsEditor = 7, - // IPhonePlayer = 8, PS3 = 9, XBOX360 = 10, Android = 11, LinuxPlayer = 13, FlashPlayer = 15, WebGLPlayer = 17, MetroPlayerX86 = 18, - // WSAPlayerX86 = 18, MetroPlayerX64 = 19,WSAPlayerX64 = 19, MetroPlayerARM = 20, WSAPlayerARM = 20, WP8Player = 21, - // EditorBrowsable(EditorBrowsableState.Never)] BB10Player = 22, BlackBerryPlayer = 22, TizenPlayer = 23, PSP2 = 24, PS4 = 25, - // PSM = 26, XboxOne = 27, SamsungTVPlayer = 28, WiiU = 30, tvOS = 31 -#elif UNITY_5 - // UNITY_5 Application info - public string ProductName; - public string ProductBundle; - public string Version; - public string Company; - public RuntimePlatform Platform; - // UNITY_5 Graphics Abilities - public bool GraphicsMultiThreaded; -#endif -#if UNITY_5 && !UNITY_5_0 - public GraphicsDeviceType GraphicsType; -#endif - - // Application info - public string DataPath; - public string PersistentDataPath; - public string StreamingAssetsPath; - public int TargetFrameRate; - public string UnityVersion; - public bool RunInBackground; - - //DEVICE & OS - public string DeviceModel; - public string DeviceName; - //public enum DeviceType { Unknown, Handheld, Console, Desktop } - public DeviceType DeviceType; - public string DeviceUniqueId; - public string OperatingSystem; - - //GRAPHICS ABILITIES - public int GraphicsDeviceId; - public string GraphicsDeviceName; - public int GraphicsMemorySize; - public int GraphicsShaderLevel; - - //SYSTEM INFO - public int SystemMemorySize; - public int ProcessorCount; - public int ProcessorFrequency; - public string ProcessorType; - public bool SupportsAccelerometer; - public bool SupportsGyroscope; - public bool SupportsLocationService; - - public void GatherData() - { -#if UNITY_5 - // UNITY_5 Application info - ProductName = Application.productName; - ProductBundle = Application.bundleIdentifier; //Only Used on iOS & Android - Version = Application.version; - Company = Application.companyName; - Platform = Application.platform; - // UNITY_5 Graphics Abilities - GraphicsMultiThreaded = SystemInfo.graphicsMultiThreaded; -#endif -#if UNITY_5 && !UNITY_5_0 - GraphicsType = SystemInfo.graphicsDeviceType; -#endif - - // Application info - DataPath = Application.dataPath; - PersistentDataPath = Application.persistentDataPath; - StreamingAssetsPath = Application.streamingAssetsPath; - TargetFrameRate = Application.targetFrameRate; - UnityVersion = Application.unityVersion; - RunInBackground = Application.runInBackground; - - //DEVICE & OS - DeviceModel = SystemInfo.deviceModel; - DeviceName = SystemInfo.deviceName; - DeviceType = SystemInfo.deviceType; - - DeviceUniqueId = PlayFabSettings.DeviceUniqueIdentifier; - OperatingSystem = SystemInfo.operatingSystem; - - //GRAPHICS ABILITIES - GraphicsDeviceId = SystemInfo.graphicsDeviceID; - GraphicsDeviceName = SystemInfo.graphicsDeviceName; - GraphicsMemorySize = SystemInfo.graphicsMemorySize; - GraphicsShaderLevel = SystemInfo.graphicsShaderLevel; - - //SYSTEM INFO - SystemMemorySize = SystemInfo.systemMemorySize; - ProcessorCount = SystemInfo.processorCount; - //ProcessorFrequency = SystemInfo.processorFrequency; //Not Supported in PRE Unity 5_2 - ProcessorType = SystemInfo.processorType; - SupportsAccelerometer = SystemInfo.supportsAccelerometer; - SupportsGyroscope = SystemInfo.supportsGyroscope; - SupportsLocationService = SystemInfo.supportsLocationService; - } - - public string GenerateReport() - { - StringBuilder sb = new StringBuilder(); - sb.Append("Logging System Info: ========================================\n"); - foreach (var field in GetType().GetTypeInfo().GetFields()) - { - var fld = field.GetValue(this).ToString(); - sb.AppendFormat("System Info - {0}: {1}\n", field.Name, fld); - } - return sb.ToString(); - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs.meta deleted file mode 100755 index 8998e9aa..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabDataGatherer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9021fc3e0230b9a4db0f0e1b104b764b -timeCreated: 1464569227 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs deleted file mode 100755 index 1bab49c8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs +++ /dev/null @@ -1,1674 +0,0 @@ -using PlayFab.SharedModels; -using PlayFab.Internal; - -namespace PlayFab.Events -{ - public partial class PlayFabEvents - { - public delegate void PlayFabErrorEvent(PlayFabRequestCommon request, PlayFabError error); - public delegate void PlayFabResultEvent(TResult result) where TResult : PlayFabResultCommon; - public delegate void PlayFabRequestEvent(TRequest request) where TRequest : PlayFabRequestCommon; - public event PlayFabErrorEvent OnGlobalErrorEvent; - - private static PlayFabEvents _instance; - /// - /// Private constructor because we call PlayFabEvents.init(); - /// - private PlayFabEvents() { } - - public static PlayFabEvents Init() - { - if (_instance == null) - { - _instance = new PlayFabEvents(); - } - PlayFabHttp.ApiProcessingEventHandler += _instance.OnProcessingEvent; - PlayFabHttp.ApiProcessingErrorEventHandler += _instance.OnProcessingErrorEvent; - return _instance; - } - - public void UnregisterInstance(object instance) - { -#if !DISABLE_PLAYFABCLIENT_API - if (OnLoginResultEvent != null) { foreach (var each in OnLoginResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginResultEvent -= (PlayFabResultEvent)each; } } } -#endif -#if ENABLE_PLAYFABADMIN_API - if (OnAdminBanUsersRequestEvent != null) { foreach (var each in OnAdminBanUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminBanUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminBanUsersResultEvent != null) { foreach (var each in OnAdminBanUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminBanUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserAccountInfoRequestEvent != null) { foreach (var each in OnAdminGetUserAccountInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserAccountInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserAccountInfoResultEvent != null) { foreach (var each in OnAdminGetUserAccountInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserAccountInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserBansRequestEvent != null) { foreach (var each in OnAdminGetUserBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserBansResultEvent != null) { foreach (var each in OnAdminGetUserBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminResetUsersRequestEvent != null) { foreach (var each in OnAdminResetUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminResetUsersResultEvent != null) { foreach (var each in OnAdminResetUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRevokeAllBansForUserRequestEvent != null) { foreach (var each in OnAdminRevokeAllBansForUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeAllBansForUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRevokeAllBansForUserResultEvent != null) { foreach (var each in OnAdminRevokeAllBansForUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeAllBansForUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRevokeBansRequestEvent != null) { foreach (var each in OnAdminRevokeBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRevokeBansResultEvent != null) { foreach (var each in OnAdminRevokeBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSendAccountRecoveryEmailRequestEvent != null) { foreach (var each in OnAdminSendAccountRecoveryEmailRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSendAccountRecoveryEmailRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSendAccountRecoveryEmailResultEvent != null) { foreach (var each in OnAdminSendAccountRecoveryEmailResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSendAccountRecoveryEmailResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateBansRequestEvent != null) { foreach (var each in OnAdminUpdateBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateBansResultEvent != null) { foreach (var each in OnAdminUpdateBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserTitleDisplayNameRequestEvent != null) { foreach (var each in OnAdminUpdateUserTitleDisplayNameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserTitleDisplayNameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserTitleDisplayNameResultEvent != null) { foreach (var each in OnAdminUpdateUserTitleDisplayNameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserTitleDisplayNameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminCreatePlayerStatisticDefinitionRequestEvent != null) { foreach (var each in OnAdminCreatePlayerStatisticDefinitionRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminCreatePlayerStatisticDefinitionRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminCreatePlayerStatisticDefinitionResultEvent != null) { foreach (var each in OnAdminCreatePlayerStatisticDefinitionResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminCreatePlayerStatisticDefinitionResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminDeleteUsersRequestEvent != null) { foreach (var each in OnAdminDeleteUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminDeleteUsersResultEvent != null) { foreach (var each in OnAdminDeleteUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetDataReportRequestEvent != null) { foreach (var each in OnAdminGetDataReportRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetDataReportRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetDataReportResultEvent != null) { foreach (var each in OnAdminGetDataReportResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetDataReportResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPlayerStatisticDefinitionsRequestEvent != null) { foreach (var each in OnAdminGetPlayerStatisticDefinitionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerStatisticDefinitionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPlayerStatisticDefinitionsResultEvent != null) { foreach (var each in OnAdminGetPlayerStatisticDefinitionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerStatisticDefinitionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPlayerStatisticVersionsRequestEvent != null) { foreach (var each in OnAdminGetPlayerStatisticVersionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerStatisticVersionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPlayerStatisticVersionsResultEvent != null) { foreach (var each in OnAdminGetPlayerStatisticVersionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerStatisticVersionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserDataRequestEvent != null) { foreach (var each in OnAdminGetUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserDataResultEvent != null) { foreach (var each in OnAdminGetUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserInternalDataRequestEvent != null) { foreach (var each in OnAdminGetUserInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserInternalDataResultEvent != null) { foreach (var each in OnAdminGetUserInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserPublisherDataRequestEvent != null) { foreach (var each in OnAdminGetUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserPublisherDataResultEvent != null) { foreach (var each in OnAdminGetUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserPublisherInternalDataRequestEvent != null) { foreach (var each in OnAdminGetUserPublisherInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserPublisherInternalDataResultEvent != null) { foreach (var each in OnAdminGetUserPublisherInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserPublisherReadOnlyDataRequestEvent != null) { foreach (var each in OnAdminGetUserPublisherReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserPublisherReadOnlyDataResultEvent != null) { foreach (var each in OnAdminGetUserPublisherReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserPublisherReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserReadOnlyDataRequestEvent != null) { foreach (var each in OnAdminGetUserReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserReadOnlyDataResultEvent != null) { foreach (var each in OnAdminGetUserReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminIncrementPlayerStatisticVersionRequestEvent != null) { foreach (var each in OnAdminIncrementPlayerStatisticVersionRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminIncrementPlayerStatisticVersionRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminIncrementPlayerStatisticVersionResultEvent != null) { foreach (var each in OnAdminIncrementPlayerStatisticVersionResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminIncrementPlayerStatisticVersionResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRefundPurchaseRequestEvent != null) { foreach (var each in OnAdminRefundPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRefundPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRefundPurchaseResultEvent != null) { foreach (var each in OnAdminRefundPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRefundPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminResetUserStatisticsRequestEvent != null) { foreach (var each in OnAdminResetUserStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetUserStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminResetUserStatisticsResultEvent != null) { foreach (var each in OnAdminResetUserStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetUserStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminResolvePurchaseDisputeRequestEvent != null) { foreach (var each in OnAdminResolvePurchaseDisputeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResolvePurchaseDisputeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminResolvePurchaseDisputeResultEvent != null) { foreach (var each in OnAdminResolvePurchaseDisputeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResolvePurchaseDisputeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdatePlayerStatisticDefinitionRequestEvent != null) { foreach (var each in OnAdminUpdatePlayerStatisticDefinitionRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdatePlayerStatisticDefinitionRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdatePlayerStatisticDefinitionResultEvent != null) { foreach (var each in OnAdminUpdatePlayerStatisticDefinitionResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdatePlayerStatisticDefinitionResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserDataResultEvent != null) { foreach (var each in OnAdminUpdateUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserInternalDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserInternalDataResultEvent != null) { foreach (var each in OnAdminUpdateUserInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserPublisherDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserPublisherDataResultEvent != null) { foreach (var each in OnAdminUpdateUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserPublisherInternalDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserPublisherInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserPublisherInternalDataResultEvent != null) { foreach (var each in OnAdminUpdateUserPublisherInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserPublisherReadOnlyDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserPublisherReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserPublisherReadOnlyDataResultEvent != null) { foreach (var each in OnAdminUpdateUserPublisherReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserPublisherReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateUserReadOnlyDataRequestEvent != null) { foreach (var each in OnAdminUpdateUserReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateUserReadOnlyDataResultEvent != null) { foreach (var each in OnAdminUpdateUserReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateUserReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminAddNewsRequestEvent != null) { foreach (var each in OnAdminAddNewsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddNewsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminAddNewsResultEvent != null) { foreach (var each in OnAdminAddNewsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddNewsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminAddVirtualCurrencyTypesRequestEvent != null) { foreach (var each in OnAdminAddVirtualCurrencyTypesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddVirtualCurrencyTypesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminAddVirtualCurrencyTypesResultEvent != null) { foreach (var each in OnAdminAddVirtualCurrencyTypesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddVirtualCurrencyTypesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminDeleteStoreRequestEvent != null) { foreach (var each in OnAdminDeleteStoreRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteStoreRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminDeleteStoreResultEvent != null) { foreach (var each in OnAdminDeleteStoreResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteStoreResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetCatalogItemsRequestEvent != null) { foreach (var each in OnAdminGetCatalogItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCatalogItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetCatalogItemsResultEvent != null) { foreach (var each in OnAdminGetCatalogItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCatalogItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPublisherDataRequestEvent != null) { foreach (var each in OnAdminGetPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPublisherDataResultEvent != null) { foreach (var each in OnAdminGetPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetRandomResultTablesRequestEvent != null) { foreach (var each in OnAdminGetRandomResultTablesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetRandomResultTablesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetRandomResultTablesResultEvent != null) { foreach (var each in OnAdminGetRandomResultTablesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetRandomResultTablesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetStoreItemsRequestEvent != null) { foreach (var each in OnAdminGetStoreItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetStoreItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetStoreItemsResultEvent != null) { foreach (var each in OnAdminGetStoreItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetStoreItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetTitleDataRequestEvent != null) { foreach (var each in OnAdminGetTitleDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetTitleDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetTitleDataResultEvent != null) { foreach (var each in OnAdminGetTitleDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetTitleDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetTitleInternalDataRequestEvent != null) { foreach (var each in OnAdminGetTitleInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetTitleInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetTitleInternalDataResultEvent != null) { foreach (var each in OnAdminGetTitleInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetTitleInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminListVirtualCurrencyTypesRequestEvent != null) { foreach (var each in OnAdminListVirtualCurrencyTypesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminListVirtualCurrencyTypesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminListVirtualCurrencyTypesResultEvent != null) { foreach (var each in OnAdminListVirtualCurrencyTypesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminListVirtualCurrencyTypesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRemoveVirtualCurrencyTypesRequestEvent != null) { foreach (var each in OnAdminRemoveVirtualCurrencyTypesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemoveVirtualCurrencyTypesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRemoveVirtualCurrencyTypesResultEvent != null) { foreach (var each in OnAdminRemoveVirtualCurrencyTypesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemoveVirtualCurrencyTypesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetCatalogItemsRequestEvent != null) { foreach (var each in OnAdminSetCatalogItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetCatalogItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetCatalogItemsResultEvent != null) { foreach (var each in OnAdminSetCatalogItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetCatalogItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetStoreItemsRequestEvent != null) { foreach (var each in OnAdminSetStoreItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetStoreItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetStoreItemsResultEvent != null) { foreach (var each in OnAdminSetStoreItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetStoreItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetTitleDataRequestEvent != null) { foreach (var each in OnAdminSetTitleDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetTitleDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetTitleDataResultEvent != null) { foreach (var each in OnAdminSetTitleDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetTitleDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetTitleInternalDataRequestEvent != null) { foreach (var each in OnAdminSetTitleInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetTitleInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetTitleInternalDataResultEvent != null) { foreach (var each in OnAdminSetTitleInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetTitleInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetupPushNotificationRequestEvent != null) { foreach (var each in OnAdminSetupPushNotificationRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetupPushNotificationRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetupPushNotificationResultEvent != null) { foreach (var each in OnAdminSetupPushNotificationResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetupPushNotificationResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateCatalogItemsRequestEvent != null) { foreach (var each in OnAdminUpdateCatalogItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateCatalogItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateCatalogItemsResultEvent != null) { foreach (var each in OnAdminUpdateCatalogItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateCatalogItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateRandomResultTablesRequestEvent != null) { foreach (var each in OnAdminUpdateRandomResultTablesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateRandomResultTablesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateRandomResultTablesResultEvent != null) { foreach (var each in OnAdminUpdateRandomResultTablesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateRandomResultTablesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateStoreItemsRequestEvent != null) { foreach (var each in OnAdminUpdateStoreItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateStoreItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateStoreItemsResultEvent != null) { foreach (var each in OnAdminUpdateStoreItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateStoreItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminAddUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnAdminAddUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminAddUserVirtualCurrencyResultEvent != null) { foreach (var each in OnAdminAddUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetUserInventoryRequestEvent != null) { foreach (var each in OnAdminGetUserInventoryRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserInventoryRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetUserInventoryResultEvent != null) { foreach (var each in OnAdminGetUserInventoryResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetUserInventoryResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGrantItemsToUsersRequestEvent != null) { foreach (var each in OnAdminGrantItemsToUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGrantItemsToUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGrantItemsToUsersResultEvent != null) { foreach (var each in OnAdminGrantItemsToUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGrantItemsToUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRevokeInventoryItemRequestEvent != null) { foreach (var each in OnAdminRevokeInventoryItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeInventoryItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRevokeInventoryItemResultEvent != null) { foreach (var each in OnAdminRevokeInventoryItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRevokeInventoryItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSubtractUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnAdminSubtractUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSubtractUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSubtractUserVirtualCurrencyResultEvent != null) { foreach (var each in OnAdminSubtractUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSubtractUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetMatchmakerGameInfoRequestEvent != null) { foreach (var each in OnAdminGetMatchmakerGameInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetMatchmakerGameInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetMatchmakerGameInfoResultEvent != null) { foreach (var each in OnAdminGetMatchmakerGameInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetMatchmakerGameInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetMatchmakerGameModesRequestEvent != null) { foreach (var each in OnAdminGetMatchmakerGameModesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetMatchmakerGameModesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetMatchmakerGameModesResultEvent != null) { foreach (var each in OnAdminGetMatchmakerGameModesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetMatchmakerGameModesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminModifyMatchmakerGameModesRequestEvent != null) { foreach (var each in OnAdminModifyMatchmakerGameModesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminModifyMatchmakerGameModesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminModifyMatchmakerGameModesResultEvent != null) { foreach (var each in OnAdminModifyMatchmakerGameModesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminModifyMatchmakerGameModesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminAddServerBuildRequestEvent != null) { foreach (var each in OnAdminAddServerBuildRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddServerBuildRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminAddServerBuildResultEvent != null) { foreach (var each in OnAdminAddServerBuildResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddServerBuildResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetServerBuildInfoRequestEvent != null) { foreach (var each in OnAdminGetServerBuildInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetServerBuildInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetServerBuildInfoResultEvent != null) { foreach (var each in OnAdminGetServerBuildInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetServerBuildInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetServerBuildUploadUrlRequestEvent != null) { foreach (var each in OnAdminGetServerBuildUploadUrlRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetServerBuildUploadUrlRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetServerBuildUploadUrlResultEvent != null) { foreach (var each in OnAdminGetServerBuildUploadUrlResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetServerBuildUploadUrlResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminListServerBuildsRequestEvent != null) { foreach (var each in OnAdminListServerBuildsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminListServerBuildsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminListServerBuildsResultEvent != null) { foreach (var each in OnAdminListServerBuildsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminListServerBuildsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminModifyServerBuildRequestEvent != null) { foreach (var each in OnAdminModifyServerBuildRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminModifyServerBuildRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminModifyServerBuildResultEvent != null) { foreach (var each in OnAdminModifyServerBuildResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminModifyServerBuildResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRemoveServerBuildRequestEvent != null) { foreach (var each in OnAdminRemoveServerBuildRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemoveServerBuildRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRemoveServerBuildResultEvent != null) { foreach (var each in OnAdminRemoveServerBuildResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemoveServerBuildResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetPublisherDataRequestEvent != null) { foreach (var each in OnAdminSetPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetPublisherDataResultEvent != null) { foreach (var each in OnAdminSetPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetCloudScriptRevisionRequestEvent != null) { foreach (var each in OnAdminGetCloudScriptRevisionRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCloudScriptRevisionRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetCloudScriptRevisionResultEvent != null) { foreach (var each in OnAdminGetCloudScriptRevisionResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCloudScriptRevisionResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetCloudScriptVersionsRequestEvent != null) { foreach (var each in OnAdminGetCloudScriptVersionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCloudScriptVersionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetCloudScriptVersionsResultEvent != null) { foreach (var each in OnAdminGetCloudScriptVersionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetCloudScriptVersionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminSetPublishedRevisionRequestEvent != null) { foreach (var each in OnAdminSetPublishedRevisionRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetPublishedRevisionRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminSetPublishedRevisionResultEvent != null) { foreach (var each in OnAdminSetPublishedRevisionResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminSetPublishedRevisionResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminUpdateCloudScriptRequestEvent != null) { foreach (var each in OnAdminUpdateCloudScriptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateCloudScriptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminUpdateCloudScriptResultEvent != null) { foreach (var each in OnAdminUpdateCloudScriptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminUpdateCloudScriptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminDeleteContentRequestEvent != null) { foreach (var each in OnAdminDeleteContentRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteContentRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminDeleteContentResultEvent != null) { foreach (var each in OnAdminDeleteContentResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminDeleteContentResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetContentListRequestEvent != null) { foreach (var each in OnAdminGetContentListRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetContentListRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetContentListResultEvent != null) { foreach (var each in OnAdminGetContentListResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetContentListResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetContentUploadUrlRequestEvent != null) { foreach (var each in OnAdminGetContentUploadUrlRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetContentUploadUrlRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetContentUploadUrlResultEvent != null) { foreach (var each in OnAdminGetContentUploadUrlResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetContentUploadUrlResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminResetCharacterStatisticsRequestEvent != null) { foreach (var each in OnAdminResetCharacterStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetCharacterStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminResetCharacterStatisticsResultEvent != null) { foreach (var each in OnAdminResetCharacterStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminResetCharacterStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminAddPlayerTagRequestEvent != null) { foreach (var each in OnAdminAddPlayerTagRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddPlayerTagRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminAddPlayerTagResultEvent != null) { foreach (var each in OnAdminAddPlayerTagResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminAddPlayerTagResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetAllActionGroupsRequestEvent != null) { foreach (var each in OnAdminGetAllActionGroupsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetAllActionGroupsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetAllActionGroupsResultEvent != null) { foreach (var each in OnAdminGetAllActionGroupsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetAllActionGroupsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetAllSegmentsRequestEvent != null) { foreach (var each in OnAdminGetAllSegmentsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetAllSegmentsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetAllSegmentsResultEvent != null) { foreach (var each in OnAdminGetAllSegmentsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetAllSegmentsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPlayerSegmentsRequestEvent != null) { foreach (var each in OnAdminGetPlayerSegmentsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerSegmentsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPlayerSegmentsResultEvent != null) { foreach (var each in OnAdminGetPlayerSegmentsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerSegmentsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPlayersInSegmentRequestEvent != null) { foreach (var each in OnAdminGetPlayersInSegmentRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayersInSegmentRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPlayersInSegmentResultEvent != null) { foreach (var each in OnAdminGetPlayersInSegmentResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayersInSegmentResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminGetPlayerTagsRequestEvent != null) { foreach (var each in OnAdminGetPlayerTagsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerTagsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminGetPlayerTagsResultEvent != null) { foreach (var each in OnAdminGetPlayerTagsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminGetPlayerTagsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAdminRemovePlayerTagRequestEvent != null) { foreach (var each in OnAdminRemovePlayerTagRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemovePlayerTagRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAdminRemovePlayerTagResultEvent != null) { foreach (var each in OnAdminRemovePlayerTagResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAdminRemovePlayerTagResultEvent -= (PlayFabResultEvent)each; } } } - -#endif -#if ENABLE_PLAYFABSERVER_API - if (OnMatchmakerAuthUserRequestEvent != null) { foreach (var each in OnMatchmakerAuthUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerAuthUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakerAuthUserResultEvent != null) { foreach (var each in OnMatchmakerAuthUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerAuthUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnMatchmakerPlayerJoinedRequestEvent != null) { foreach (var each in OnMatchmakerPlayerJoinedRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerPlayerJoinedRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakerPlayerJoinedResultEvent != null) { foreach (var each in OnMatchmakerPlayerJoinedResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerPlayerJoinedResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnMatchmakerPlayerLeftRequestEvent != null) { foreach (var each in OnMatchmakerPlayerLeftRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerPlayerLeftRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakerPlayerLeftResultEvent != null) { foreach (var each in OnMatchmakerPlayerLeftResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerPlayerLeftResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnMatchmakerStartGameRequestEvent != null) { foreach (var each in OnMatchmakerStartGameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerStartGameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakerStartGameResultEvent != null) { foreach (var each in OnMatchmakerStartGameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerStartGameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnMatchmakerUserInfoRequestEvent != null) { foreach (var each in OnMatchmakerUserInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerUserInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakerUserInfoResultEvent != null) { foreach (var each in OnMatchmakerUserInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakerUserInfoResultEvent -= (PlayFabResultEvent)each; } } } - -#endif -#if ENABLE_PLAYFABSERVER_API - if (OnServerAuthenticateSessionTicketRequestEvent != null) { foreach (var each in OnServerAuthenticateSessionTicketRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAuthenticateSessionTicketRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAuthenticateSessionTicketResultEvent != null) { foreach (var each in OnServerAuthenticateSessionTicketResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAuthenticateSessionTicketResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerBanUsersRequestEvent != null) { foreach (var each in OnServerBanUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerBanUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerBanUsersResultEvent != null) { foreach (var each in OnServerBanUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerBanUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayFabIDsFromFacebookIDsRequestEvent != null) { foreach (var each in OnServerGetPlayFabIDsFromFacebookIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayFabIDsFromFacebookIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayFabIDsFromFacebookIDsResultEvent != null) { foreach (var each in OnServerGetPlayFabIDsFromFacebookIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayFabIDsFromFacebookIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayFabIDsFromSteamIDsRequestEvent != null) { foreach (var each in OnServerGetPlayFabIDsFromSteamIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayFabIDsFromSteamIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayFabIDsFromSteamIDsResultEvent != null) { foreach (var each in OnServerGetPlayFabIDsFromSteamIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayFabIDsFromSteamIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserAccountInfoRequestEvent != null) { foreach (var each in OnServerGetUserAccountInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserAccountInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserAccountInfoResultEvent != null) { foreach (var each in OnServerGetUserAccountInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserAccountInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserBansRequestEvent != null) { foreach (var each in OnServerGetUserBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserBansResultEvent != null) { foreach (var each in OnServerGetUserBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRevokeAllBansForUserRequestEvent != null) { foreach (var each in OnServerRevokeAllBansForUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeAllBansForUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRevokeAllBansForUserResultEvent != null) { foreach (var each in OnServerRevokeAllBansForUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeAllBansForUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRevokeBansRequestEvent != null) { foreach (var each in OnServerRevokeBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRevokeBansResultEvent != null) { foreach (var each in OnServerRevokeBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSendPushNotificationRequestEvent != null) { foreach (var each in OnServerSendPushNotificationRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSendPushNotificationRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSendPushNotificationResultEvent != null) { foreach (var each in OnServerSendPushNotificationResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSendPushNotificationResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateBansRequestEvent != null) { foreach (var each in OnServerUpdateBansRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateBansRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateBansResultEvent != null) { foreach (var each in OnServerUpdateBansResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateBansResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerDeleteUsersRequestEvent != null) { foreach (var each in OnServerDeleteUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerDeleteUsersResultEvent != null) { foreach (var each in OnServerDeleteUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetFriendLeaderboardRequestEvent != null) { foreach (var each in OnServerGetFriendLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetFriendLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetFriendLeaderboardResultEvent != null) { foreach (var each in OnServerGetFriendLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetFriendLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetLeaderboardRequestEvent != null) { foreach (var each in OnServerGetLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetLeaderboardResultEvent != null) { foreach (var each in OnServerGetLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetLeaderboardAroundUserRequestEvent != null) { foreach (var each in OnServerGetLeaderboardAroundUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardAroundUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetLeaderboardAroundUserResultEvent != null) { foreach (var each in OnServerGetLeaderboardAroundUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardAroundUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayerCombinedInfoRequestEvent != null) { foreach (var each in OnServerGetPlayerCombinedInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerCombinedInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayerCombinedInfoResultEvent != null) { foreach (var each in OnServerGetPlayerCombinedInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerCombinedInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayerStatisticsRequestEvent != null) { foreach (var each in OnServerGetPlayerStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayerStatisticsResultEvent != null) { foreach (var each in OnServerGetPlayerStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayerStatisticVersionsRequestEvent != null) { foreach (var each in OnServerGetPlayerStatisticVersionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerStatisticVersionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayerStatisticVersionsResultEvent != null) { foreach (var each in OnServerGetPlayerStatisticVersionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerStatisticVersionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserDataRequestEvent != null) { foreach (var each in OnServerGetUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserDataResultEvent != null) { foreach (var each in OnServerGetUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserInternalDataRequestEvent != null) { foreach (var each in OnServerGetUserInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserInternalDataResultEvent != null) { foreach (var each in OnServerGetUserInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserPublisherDataRequestEvent != null) { foreach (var each in OnServerGetUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserPublisherDataResultEvent != null) { foreach (var each in OnServerGetUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserPublisherInternalDataRequestEvent != null) { foreach (var each in OnServerGetUserPublisherInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserPublisherInternalDataResultEvent != null) { foreach (var each in OnServerGetUserPublisherInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserPublisherReadOnlyDataRequestEvent != null) { foreach (var each in OnServerGetUserPublisherReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserPublisherReadOnlyDataResultEvent != null) { foreach (var each in OnServerGetUserPublisherReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserPublisherReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserReadOnlyDataRequestEvent != null) { foreach (var each in OnServerGetUserReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserReadOnlyDataResultEvent != null) { foreach (var each in OnServerGetUserReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserStatisticsRequestEvent != null) { foreach (var each in OnServerGetUserStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserStatisticsResultEvent != null) { foreach (var each in OnServerGetUserStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdatePlayerStatisticsRequestEvent != null) { foreach (var each in OnServerUpdatePlayerStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdatePlayerStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdatePlayerStatisticsResultEvent != null) { foreach (var each in OnServerUpdatePlayerStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdatePlayerStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserDataRequestEvent != null) { foreach (var each in OnServerUpdateUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserDataResultEvent != null) { foreach (var each in OnServerUpdateUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserInternalDataRequestEvent != null) { foreach (var each in OnServerUpdateUserInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserInternalDataResultEvent != null) { foreach (var each in OnServerUpdateUserInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserPublisherDataRequestEvent != null) { foreach (var each in OnServerUpdateUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserPublisherDataResultEvent != null) { foreach (var each in OnServerUpdateUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserPublisherInternalDataRequestEvent != null) { foreach (var each in OnServerUpdateUserPublisherInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserPublisherInternalDataResultEvent != null) { foreach (var each in OnServerUpdateUserPublisherInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserPublisherReadOnlyDataRequestEvent != null) { foreach (var each in OnServerUpdateUserPublisherReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserPublisherReadOnlyDataResultEvent != null) { foreach (var each in OnServerUpdateUserPublisherReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserPublisherReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserReadOnlyDataRequestEvent != null) { foreach (var each in OnServerUpdateUserReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserReadOnlyDataResultEvent != null) { foreach (var each in OnServerUpdateUserReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserStatisticsRequestEvent != null) { foreach (var each in OnServerUpdateUserStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserStatisticsResultEvent != null) { foreach (var each in OnServerUpdateUserStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCatalogItemsRequestEvent != null) { foreach (var each in OnServerGetCatalogItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCatalogItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCatalogItemsResultEvent != null) { foreach (var each in OnServerGetCatalogItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCatalogItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPublisherDataRequestEvent != null) { foreach (var each in OnServerGetPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPublisherDataResultEvent != null) { foreach (var each in OnServerGetPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetTimeRequestEvent != null) { foreach (var each in OnServerGetTimeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTimeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetTimeResultEvent != null) { foreach (var each in OnServerGetTimeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTimeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetTitleDataRequestEvent != null) { foreach (var each in OnServerGetTitleDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetTitleDataResultEvent != null) { foreach (var each in OnServerGetTitleDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetTitleInternalDataRequestEvent != null) { foreach (var each in OnServerGetTitleInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetTitleInternalDataResultEvent != null) { foreach (var each in OnServerGetTitleInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetTitleNewsRequestEvent != null) { foreach (var each in OnServerGetTitleNewsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleNewsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetTitleNewsResultEvent != null) { foreach (var each in OnServerGetTitleNewsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetTitleNewsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetPublisherDataRequestEvent != null) { foreach (var each in OnServerSetPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetPublisherDataResultEvent != null) { foreach (var each in OnServerSetPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetTitleDataRequestEvent != null) { foreach (var each in OnServerSetTitleDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetTitleDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetTitleDataResultEvent != null) { foreach (var each in OnServerSetTitleDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetTitleDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetTitleInternalDataRequestEvent != null) { foreach (var each in OnServerSetTitleInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetTitleInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetTitleInternalDataResultEvent != null) { foreach (var each in OnServerSetTitleInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetTitleInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAddCharacterVirtualCurrencyRequestEvent != null) { foreach (var each in OnServerAddCharacterVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddCharacterVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAddCharacterVirtualCurrencyResultEvent != null) { foreach (var each in OnServerAddCharacterVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddCharacterVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAddUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnServerAddUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAddUserVirtualCurrencyResultEvent != null) { foreach (var each in OnServerAddUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerConsumeItemRequestEvent != null) { foreach (var each in OnServerConsumeItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerConsumeItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerConsumeItemResultEvent != null) { foreach (var each in OnServerConsumeItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerConsumeItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerEvaluateRandomResultTableRequestEvent != null) { foreach (var each in OnServerEvaluateRandomResultTableRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerEvaluateRandomResultTableRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerEvaluateRandomResultTableResultEvent != null) { foreach (var each in OnServerEvaluateRandomResultTableResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerEvaluateRandomResultTableResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterInventoryRequestEvent != null) { foreach (var each in OnServerGetCharacterInventoryRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterInventoryRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterInventoryResultEvent != null) { foreach (var each in OnServerGetCharacterInventoryResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterInventoryResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetRandomResultTablesRequestEvent != null) { foreach (var each in OnServerGetRandomResultTablesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetRandomResultTablesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetRandomResultTablesResultEvent != null) { foreach (var each in OnServerGetRandomResultTablesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetRandomResultTablesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetUserInventoryRequestEvent != null) { foreach (var each in OnServerGetUserInventoryRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserInventoryRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetUserInventoryResultEvent != null) { foreach (var each in OnServerGetUserInventoryResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetUserInventoryResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGrantItemsToCharacterRequestEvent != null) { foreach (var each in OnServerGrantItemsToCharacterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToCharacterRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGrantItemsToCharacterResultEvent != null) { foreach (var each in OnServerGrantItemsToCharacterResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToCharacterResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGrantItemsToUserRequestEvent != null) { foreach (var each in OnServerGrantItemsToUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGrantItemsToUserResultEvent != null) { foreach (var each in OnServerGrantItemsToUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGrantItemsToUsersRequestEvent != null) { foreach (var each in OnServerGrantItemsToUsersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToUsersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGrantItemsToUsersResultEvent != null) { foreach (var each in OnServerGrantItemsToUsersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantItemsToUsersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerModifyItemUsesRequestEvent != null) { foreach (var each in OnServerModifyItemUsesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerModifyItemUsesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerModifyItemUsesResultEvent != null) { foreach (var each in OnServerModifyItemUsesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerModifyItemUsesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerMoveItemToCharacterFromCharacterRequestEvent != null) { foreach (var each in OnServerMoveItemToCharacterFromCharacterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToCharacterFromCharacterRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerMoveItemToCharacterFromCharacterResultEvent != null) { foreach (var each in OnServerMoveItemToCharacterFromCharacterResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToCharacterFromCharacterResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerMoveItemToCharacterFromUserRequestEvent != null) { foreach (var each in OnServerMoveItemToCharacterFromUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToCharacterFromUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerMoveItemToCharacterFromUserResultEvent != null) { foreach (var each in OnServerMoveItemToCharacterFromUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToCharacterFromUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerMoveItemToUserFromCharacterRequestEvent != null) { foreach (var each in OnServerMoveItemToUserFromCharacterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToUserFromCharacterRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerMoveItemToUserFromCharacterResultEvent != null) { foreach (var each in OnServerMoveItemToUserFromCharacterResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerMoveItemToUserFromCharacterResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRedeemCouponRequestEvent != null) { foreach (var each in OnServerRedeemCouponRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRedeemCouponRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRedeemCouponResultEvent != null) { foreach (var each in OnServerRedeemCouponResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRedeemCouponResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerReportPlayerRequestEvent != null) { foreach (var each in OnServerReportPlayerRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerReportPlayerRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerReportPlayerResultEvent != null) { foreach (var each in OnServerReportPlayerResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerReportPlayerResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRevokeInventoryItemRequestEvent != null) { foreach (var each in OnServerRevokeInventoryItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeInventoryItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRevokeInventoryItemResultEvent != null) { foreach (var each in OnServerRevokeInventoryItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRevokeInventoryItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSubtractCharacterVirtualCurrencyRequestEvent != null) { foreach (var each in OnServerSubtractCharacterVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSubtractCharacterVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSubtractCharacterVirtualCurrencyResultEvent != null) { foreach (var each in OnServerSubtractCharacterVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSubtractCharacterVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSubtractUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnServerSubtractUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSubtractUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSubtractUserVirtualCurrencyResultEvent != null) { foreach (var each in OnServerSubtractUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSubtractUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUnlockContainerInstanceRequestEvent != null) { foreach (var each in OnServerUnlockContainerInstanceRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUnlockContainerInstanceRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUnlockContainerInstanceResultEvent != null) { foreach (var each in OnServerUnlockContainerInstanceResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUnlockContainerInstanceResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUnlockContainerItemRequestEvent != null) { foreach (var each in OnServerUnlockContainerItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUnlockContainerItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUnlockContainerItemResultEvent != null) { foreach (var each in OnServerUnlockContainerItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUnlockContainerItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateUserInventoryItemCustomDataRequestEvent != null) { foreach (var each in OnServerUpdateUserInventoryItemCustomDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserInventoryItemCustomDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateUserInventoryItemCustomDataResultEvent != null) { foreach (var each in OnServerUpdateUserInventoryItemCustomDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateUserInventoryItemCustomDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAddFriendRequestEvent != null) { foreach (var each in OnServerAddFriendRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddFriendRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAddFriendResultEvent != null) { foreach (var each in OnServerAddFriendResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddFriendResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetFriendsListRequestEvent != null) { foreach (var each in OnServerGetFriendsListRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetFriendsListRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetFriendsListResultEvent != null) { foreach (var each in OnServerGetFriendsListResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetFriendsListResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRemoveFriendRequestEvent != null) { foreach (var each in OnServerRemoveFriendRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemoveFriendRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRemoveFriendResultEvent != null) { foreach (var each in OnServerRemoveFriendResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemoveFriendResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerDeregisterGameRequestEvent != null) { foreach (var each in OnServerDeregisterGameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeregisterGameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerDeregisterGameResultEvent != null) { foreach (var each in OnServerDeregisterGameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeregisterGameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerNotifyMatchmakerPlayerLeftRequestEvent != null) { foreach (var each in OnServerNotifyMatchmakerPlayerLeftRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerNotifyMatchmakerPlayerLeftRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerNotifyMatchmakerPlayerLeftResultEvent != null) { foreach (var each in OnServerNotifyMatchmakerPlayerLeftResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerNotifyMatchmakerPlayerLeftResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRedeemMatchmakerTicketRequestEvent != null) { foreach (var each in OnServerRedeemMatchmakerTicketRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRedeemMatchmakerTicketRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRedeemMatchmakerTicketResultEvent != null) { foreach (var each in OnServerRedeemMatchmakerTicketResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRedeemMatchmakerTicketResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRefreshGameServerInstanceHeartbeatRequestEvent != null) { foreach (var each in OnServerRefreshGameServerInstanceHeartbeatRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRefreshGameServerInstanceHeartbeatRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRefreshGameServerInstanceHeartbeatResultEvent != null) { foreach (var each in OnServerRefreshGameServerInstanceHeartbeatResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRefreshGameServerInstanceHeartbeatResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRegisterGameRequestEvent != null) { foreach (var each in OnServerRegisterGameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRegisterGameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRegisterGameResultEvent != null) { foreach (var each in OnServerRegisterGameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRegisterGameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetGameServerInstanceDataRequestEvent != null) { foreach (var each in OnServerSetGameServerInstanceDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetGameServerInstanceDataResultEvent != null) { foreach (var each in OnServerSetGameServerInstanceDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetGameServerInstanceStateRequestEvent != null) { foreach (var each in OnServerSetGameServerInstanceStateRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceStateRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetGameServerInstanceStateResultEvent != null) { foreach (var each in OnServerSetGameServerInstanceStateResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceStateResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerSetGameServerInstanceTagsRequestEvent != null) { foreach (var each in OnServerSetGameServerInstanceTagsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceTagsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerSetGameServerInstanceTagsResultEvent != null) { foreach (var each in OnServerSetGameServerInstanceTagsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerSetGameServerInstanceTagsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAwardSteamAchievementRequestEvent != null) { foreach (var each in OnServerAwardSteamAchievementRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAwardSteamAchievementRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAwardSteamAchievementResultEvent != null) { foreach (var each in OnServerAwardSteamAchievementResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAwardSteamAchievementResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerLogEventRequestEvent != null) { foreach (var each in OnServerLogEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerLogEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerLogEventResultEvent != null) { foreach (var each in OnServerLogEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerLogEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerWriteCharacterEventRequestEvent != null) { foreach (var each in OnServerWriteCharacterEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWriteCharacterEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerWriteCharacterEventResultEvent != null) { foreach (var each in OnServerWriteCharacterEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWriteCharacterEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerWritePlayerEventRequestEvent != null) { foreach (var each in OnServerWritePlayerEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWritePlayerEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerWritePlayerEventResultEvent != null) { foreach (var each in OnServerWritePlayerEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWritePlayerEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerWriteTitleEventRequestEvent != null) { foreach (var each in OnServerWriteTitleEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWriteTitleEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerWriteTitleEventResultEvent != null) { foreach (var each in OnServerWriteTitleEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerWriteTitleEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAddSharedGroupMembersRequestEvent != null) { foreach (var each in OnServerAddSharedGroupMembersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddSharedGroupMembersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAddSharedGroupMembersResultEvent != null) { foreach (var each in OnServerAddSharedGroupMembersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddSharedGroupMembersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerCreateSharedGroupRequestEvent != null) { foreach (var each in OnServerCreateSharedGroupRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerCreateSharedGroupRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerCreateSharedGroupResultEvent != null) { foreach (var each in OnServerCreateSharedGroupResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerCreateSharedGroupResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerDeleteSharedGroupRequestEvent != null) { foreach (var each in OnServerDeleteSharedGroupRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteSharedGroupRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerDeleteSharedGroupResultEvent != null) { foreach (var each in OnServerDeleteSharedGroupResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteSharedGroupResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetSharedGroupDataRequestEvent != null) { foreach (var each in OnServerGetSharedGroupDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetSharedGroupDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetSharedGroupDataResultEvent != null) { foreach (var each in OnServerGetSharedGroupDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetSharedGroupDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRemoveSharedGroupMembersRequestEvent != null) { foreach (var each in OnServerRemoveSharedGroupMembersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemoveSharedGroupMembersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRemoveSharedGroupMembersResultEvent != null) { foreach (var each in OnServerRemoveSharedGroupMembersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemoveSharedGroupMembersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateSharedGroupDataRequestEvent != null) { foreach (var each in OnServerUpdateSharedGroupDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateSharedGroupDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateSharedGroupDataResultEvent != null) { foreach (var each in OnServerUpdateSharedGroupDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateSharedGroupDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerExecuteCloudScriptRequestEvent != null) { foreach (var each in OnServerExecuteCloudScriptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerExecuteCloudScriptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerExecuteCloudScriptResultEvent != null) { foreach (var each in OnServerExecuteCloudScriptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerExecuteCloudScriptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetContentDownloadUrlRequestEvent != null) { foreach (var each in OnServerGetContentDownloadUrlRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetContentDownloadUrlRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetContentDownloadUrlResultEvent != null) { foreach (var each in OnServerGetContentDownloadUrlResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetContentDownloadUrlResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerDeleteCharacterFromUserRequestEvent != null) { foreach (var each in OnServerDeleteCharacterFromUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteCharacterFromUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerDeleteCharacterFromUserResultEvent != null) { foreach (var each in OnServerDeleteCharacterFromUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerDeleteCharacterFromUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetAllUsersCharactersRequestEvent != null) { foreach (var each in OnServerGetAllUsersCharactersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllUsersCharactersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetAllUsersCharactersResultEvent != null) { foreach (var each in OnServerGetAllUsersCharactersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllUsersCharactersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterLeaderboardRequestEvent != null) { foreach (var each in OnServerGetCharacterLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterLeaderboardResultEvent != null) { foreach (var each in OnServerGetCharacterLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterStatisticsRequestEvent != null) { foreach (var each in OnServerGetCharacterStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterStatisticsResultEvent != null) { foreach (var each in OnServerGetCharacterStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetLeaderboardAroundCharacterRequestEvent != null) { foreach (var each in OnServerGetLeaderboardAroundCharacterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardAroundCharacterRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetLeaderboardAroundCharacterResultEvent != null) { foreach (var each in OnServerGetLeaderboardAroundCharacterResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardAroundCharacterResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetLeaderboardForUserCharactersRequestEvent != null) { foreach (var each in OnServerGetLeaderboardForUserCharactersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardForUserCharactersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetLeaderboardForUserCharactersResultEvent != null) { foreach (var each in OnServerGetLeaderboardForUserCharactersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetLeaderboardForUserCharactersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGrantCharacterToUserRequestEvent != null) { foreach (var each in OnServerGrantCharacterToUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantCharacterToUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGrantCharacterToUserResultEvent != null) { foreach (var each in OnServerGrantCharacterToUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGrantCharacterToUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateCharacterStatisticsRequestEvent != null) { foreach (var each in OnServerUpdateCharacterStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateCharacterStatisticsResultEvent != null) { foreach (var each in OnServerUpdateCharacterStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterDataRequestEvent != null) { foreach (var each in OnServerGetCharacterDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterDataResultEvent != null) { foreach (var each in OnServerGetCharacterDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterInternalDataRequestEvent != null) { foreach (var each in OnServerGetCharacterInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterInternalDataResultEvent != null) { foreach (var each in OnServerGetCharacterInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetCharacterReadOnlyDataRequestEvent != null) { foreach (var each in OnServerGetCharacterReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetCharacterReadOnlyDataResultEvent != null) { foreach (var each in OnServerGetCharacterReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetCharacterReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateCharacterDataRequestEvent != null) { foreach (var each in OnServerUpdateCharacterDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateCharacterDataResultEvent != null) { foreach (var each in OnServerUpdateCharacterDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateCharacterInternalDataRequestEvent != null) { foreach (var each in OnServerUpdateCharacterInternalDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterInternalDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateCharacterInternalDataResultEvent != null) { foreach (var each in OnServerUpdateCharacterInternalDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterInternalDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerUpdateCharacterReadOnlyDataRequestEvent != null) { foreach (var each in OnServerUpdateCharacterReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerUpdateCharacterReadOnlyDataResultEvent != null) { foreach (var each in OnServerUpdateCharacterReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerUpdateCharacterReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerAddPlayerTagRequestEvent != null) { foreach (var each in OnServerAddPlayerTagRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddPlayerTagRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerAddPlayerTagResultEvent != null) { foreach (var each in OnServerAddPlayerTagResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerAddPlayerTagResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetAllActionGroupsRequestEvent != null) { foreach (var each in OnServerGetAllActionGroupsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllActionGroupsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetAllActionGroupsResultEvent != null) { foreach (var each in OnServerGetAllActionGroupsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllActionGroupsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetAllSegmentsRequestEvent != null) { foreach (var each in OnServerGetAllSegmentsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllSegmentsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetAllSegmentsResultEvent != null) { foreach (var each in OnServerGetAllSegmentsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetAllSegmentsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayerSegmentsRequestEvent != null) { foreach (var each in OnServerGetPlayerSegmentsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerSegmentsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayerSegmentsResultEvent != null) { foreach (var each in OnServerGetPlayerSegmentsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerSegmentsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayersInSegmentRequestEvent != null) { foreach (var each in OnServerGetPlayersInSegmentRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayersInSegmentRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayersInSegmentResultEvent != null) { foreach (var each in OnServerGetPlayersInSegmentResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayersInSegmentResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerGetPlayerTagsRequestEvent != null) { foreach (var each in OnServerGetPlayerTagsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerTagsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerGetPlayerTagsResultEvent != null) { foreach (var each in OnServerGetPlayerTagsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerGetPlayerTagsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnServerRemovePlayerTagRequestEvent != null) { foreach (var each in OnServerRemovePlayerTagRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemovePlayerTagRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnServerRemovePlayerTagResultEvent != null) { foreach (var each in OnServerRemovePlayerTagResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnServerRemovePlayerTagResultEvent -= (PlayFabResultEvent)each; } } } - -#endif -#if !DISABLE_PLAYFABCLIENT_API - if (OnGetPhotonAuthenticationTokenRequestEvent != null) { foreach (var each in OnGetPhotonAuthenticationTokenRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPhotonAuthenticationTokenRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPhotonAuthenticationTokenResultEvent != null) { foreach (var each in OnGetPhotonAuthenticationTokenResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPhotonAuthenticationTokenResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLoginWithAndroidDeviceIDRequestEvent != null) { foreach (var each in OnLoginWithAndroidDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithAndroidDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithCustomIDRequestEvent != null) { foreach (var each in OnLoginWithCustomIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithCustomIDRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithEmailAddressRequestEvent != null) { foreach (var each in OnLoginWithEmailAddressRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithEmailAddressRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithFacebookRequestEvent != null) { foreach (var each in OnLoginWithFacebookRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithFacebookRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithGameCenterRequestEvent != null) { foreach (var each in OnLoginWithGameCenterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithGameCenterRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithGoogleAccountRequestEvent != null) { foreach (var each in OnLoginWithGoogleAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithGoogleAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithIOSDeviceIDRequestEvent != null) { foreach (var each in OnLoginWithIOSDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithIOSDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithKongregateRequestEvent != null) { foreach (var each in OnLoginWithKongregateRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithKongregateRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithPlayFabRequestEvent != null) { foreach (var each in OnLoginWithPlayFabRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithPlayFabRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithSteamRequestEvent != null) { foreach (var each in OnLoginWithSteamRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithSteamRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnLoginWithTwitchRequestEvent != null) { foreach (var each in OnLoginWithTwitchRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLoginWithTwitchRequestEvent -= (PlayFabRequestEvent)each; } } } - - if (OnRegisterPlayFabUserRequestEvent != null) { foreach (var each in OnRegisterPlayFabUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRegisterPlayFabUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRegisterPlayFabUserResultEvent != null) { foreach (var each in OnRegisterPlayFabUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRegisterPlayFabUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAddGenericIDRequestEvent != null) { foreach (var each in OnAddGenericIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddGenericIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAddGenericIDResultEvent != null) { foreach (var each in OnAddGenericIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddGenericIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAddUsernamePasswordRequestEvent != null) { foreach (var each in OnAddUsernamePasswordRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddUsernamePasswordRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAddUsernamePasswordResultEvent != null) { foreach (var each in OnAddUsernamePasswordResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddUsernamePasswordResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetAccountInfoRequestEvent != null) { foreach (var each in OnGetAccountInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetAccountInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetAccountInfoResultEvent != null) { foreach (var each in OnGetAccountInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetAccountInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerCombinedInfoRequestEvent != null) { foreach (var each in OnGetPlayerCombinedInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerCombinedInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerCombinedInfoResultEvent != null) { foreach (var each in OnGetPlayerCombinedInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerCombinedInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromFacebookIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromFacebookIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromFacebookIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromFacebookIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromFacebookIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromFacebookIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromGameCenterIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromGameCenterIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGameCenterIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromGameCenterIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromGameCenterIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGameCenterIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromGenericIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromGenericIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGenericIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromGenericIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromGenericIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGenericIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromGoogleIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromGoogleIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGoogleIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromGoogleIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromGoogleIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromGoogleIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromKongregateIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromKongregateIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromKongregateIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromKongregateIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromKongregateIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromKongregateIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromSteamIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromSteamIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromSteamIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromSteamIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromSteamIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromSteamIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayFabIDsFromTwitchIDsRequestEvent != null) { foreach (var each in OnGetPlayFabIDsFromTwitchIDsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromTwitchIDsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayFabIDsFromTwitchIDsResultEvent != null) { foreach (var each in OnGetPlayFabIDsFromTwitchIDsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayFabIDsFromTwitchIDsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserCombinedInfoRequestEvent != null) { foreach (var each in OnGetUserCombinedInfoRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserCombinedInfoRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserCombinedInfoResultEvent != null) { foreach (var each in OnGetUserCombinedInfoResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserCombinedInfoResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkAndroidDeviceIDRequestEvent != null) { foreach (var each in OnLinkAndroidDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkAndroidDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkAndroidDeviceIDResultEvent != null) { foreach (var each in OnLinkAndroidDeviceIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkAndroidDeviceIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkCustomIDRequestEvent != null) { foreach (var each in OnLinkCustomIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkCustomIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkCustomIDResultEvent != null) { foreach (var each in OnLinkCustomIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkCustomIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkFacebookAccountRequestEvent != null) { foreach (var each in OnLinkFacebookAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkFacebookAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkFacebookAccountResultEvent != null) { foreach (var each in OnLinkFacebookAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkFacebookAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkGameCenterAccountRequestEvent != null) { foreach (var each in OnLinkGameCenterAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkGameCenterAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkGameCenterAccountResultEvent != null) { foreach (var each in OnLinkGameCenterAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkGameCenterAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkGoogleAccountRequestEvent != null) { foreach (var each in OnLinkGoogleAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkGoogleAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkGoogleAccountResultEvent != null) { foreach (var each in OnLinkGoogleAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkGoogleAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkIOSDeviceIDRequestEvent != null) { foreach (var each in OnLinkIOSDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkIOSDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkIOSDeviceIDResultEvent != null) { foreach (var each in OnLinkIOSDeviceIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkIOSDeviceIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkKongregateRequestEvent != null) { foreach (var each in OnLinkKongregateRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkKongregateRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkKongregateResultEvent != null) { foreach (var each in OnLinkKongregateResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkKongregateResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkSteamAccountRequestEvent != null) { foreach (var each in OnLinkSteamAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkSteamAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkSteamAccountResultEvent != null) { foreach (var each in OnLinkSteamAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkSteamAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLinkTwitchRequestEvent != null) { foreach (var each in OnLinkTwitchRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkTwitchRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLinkTwitchResultEvent != null) { foreach (var each in OnLinkTwitchResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLinkTwitchResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRemoveGenericIDRequestEvent != null) { foreach (var each in OnRemoveGenericIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveGenericIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRemoveGenericIDResultEvent != null) { foreach (var each in OnRemoveGenericIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveGenericIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnReportPlayerRequestEvent != null) { foreach (var each in OnReportPlayerRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnReportPlayerRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnReportPlayerResultEvent != null) { foreach (var each in OnReportPlayerResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnReportPlayerResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnSendAccountRecoveryEmailRequestEvent != null) { foreach (var each in OnSendAccountRecoveryEmailRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSendAccountRecoveryEmailRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnSendAccountRecoveryEmailResultEvent != null) { foreach (var each in OnSendAccountRecoveryEmailResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSendAccountRecoveryEmailResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkAndroidDeviceIDRequestEvent != null) { foreach (var each in OnUnlinkAndroidDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkAndroidDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkAndroidDeviceIDResultEvent != null) { foreach (var each in OnUnlinkAndroidDeviceIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkAndroidDeviceIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkCustomIDRequestEvent != null) { foreach (var each in OnUnlinkCustomIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkCustomIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkCustomIDResultEvent != null) { foreach (var each in OnUnlinkCustomIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkCustomIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkFacebookAccountRequestEvent != null) { foreach (var each in OnUnlinkFacebookAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkFacebookAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkFacebookAccountResultEvent != null) { foreach (var each in OnUnlinkFacebookAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkFacebookAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkGameCenterAccountRequestEvent != null) { foreach (var each in OnUnlinkGameCenterAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkGameCenterAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkGameCenterAccountResultEvent != null) { foreach (var each in OnUnlinkGameCenterAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkGameCenterAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkGoogleAccountRequestEvent != null) { foreach (var each in OnUnlinkGoogleAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkGoogleAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkGoogleAccountResultEvent != null) { foreach (var each in OnUnlinkGoogleAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkGoogleAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkIOSDeviceIDRequestEvent != null) { foreach (var each in OnUnlinkIOSDeviceIDRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkIOSDeviceIDRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkIOSDeviceIDResultEvent != null) { foreach (var each in OnUnlinkIOSDeviceIDResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkIOSDeviceIDResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkKongregateRequestEvent != null) { foreach (var each in OnUnlinkKongregateRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkKongregateRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkKongregateResultEvent != null) { foreach (var each in OnUnlinkKongregateResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkKongregateResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkSteamAccountRequestEvent != null) { foreach (var each in OnUnlinkSteamAccountRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkSteamAccountRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkSteamAccountResultEvent != null) { foreach (var each in OnUnlinkSteamAccountResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkSteamAccountResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlinkTwitchRequestEvent != null) { foreach (var each in OnUnlinkTwitchRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkTwitchRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlinkTwitchResultEvent != null) { foreach (var each in OnUnlinkTwitchResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlinkTwitchResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateUserTitleDisplayNameRequestEvent != null) { foreach (var each in OnUpdateUserTitleDisplayNameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserTitleDisplayNameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateUserTitleDisplayNameResultEvent != null) { foreach (var each in OnUpdateUserTitleDisplayNameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserTitleDisplayNameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetFriendLeaderboardRequestEvent != null) { foreach (var each in OnGetFriendLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetFriendLeaderboardResultEvent != null) { foreach (var each in OnGetFriendLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetFriendLeaderboardAroundCurrentUserRequestEvent != null) { foreach (var each in OnGetFriendLeaderboardAroundCurrentUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardAroundCurrentUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetFriendLeaderboardAroundCurrentUserResultEvent != null) { foreach (var each in OnGetFriendLeaderboardAroundCurrentUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardAroundCurrentUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetFriendLeaderboardAroundPlayerRequestEvent != null) { foreach (var each in OnGetFriendLeaderboardAroundPlayerRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardAroundPlayerRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetFriendLeaderboardAroundPlayerResultEvent != null) { foreach (var each in OnGetFriendLeaderboardAroundPlayerResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendLeaderboardAroundPlayerResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetLeaderboardRequestEvent != null) { foreach (var each in OnGetLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetLeaderboardResultEvent != null) { foreach (var each in OnGetLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetLeaderboardAroundCurrentUserRequestEvent != null) { foreach (var each in OnGetLeaderboardAroundCurrentUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundCurrentUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetLeaderboardAroundCurrentUserResultEvent != null) { foreach (var each in OnGetLeaderboardAroundCurrentUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundCurrentUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetLeaderboardAroundPlayerRequestEvent != null) { foreach (var each in OnGetLeaderboardAroundPlayerRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundPlayerRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetLeaderboardAroundPlayerResultEvent != null) { foreach (var each in OnGetLeaderboardAroundPlayerResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundPlayerResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerStatisticsRequestEvent != null) { foreach (var each in OnGetPlayerStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerStatisticsResultEvent != null) { foreach (var each in OnGetPlayerStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerStatisticVersionsRequestEvent != null) { foreach (var each in OnGetPlayerStatisticVersionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerStatisticVersionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerStatisticVersionsResultEvent != null) { foreach (var each in OnGetPlayerStatisticVersionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerStatisticVersionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserDataRequestEvent != null) { foreach (var each in OnGetUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserDataResultEvent != null) { foreach (var each in OnGetUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserPublisherDataRequestEvent != null) { foreach (var each in OnGetUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserPublisherDataResultEvent != null) { foreach (var each in OnGetUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserPublisherReadOnlyDataRequestEvent != null) { foreach (var each in OnGetUserPublisherReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserPublisherReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserPublisherReadOnlyDataResultEvent != null) { foreach (var each in OnGetUserPublisherReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserPublisherReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserReadOnlyDataRequestEvent != null) { foreach (var each in OnGetUserReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserReadOnlyDataResultEvent != null) { foreach (var each in OnGetUserReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserStatisticsRequestEvent != null) { foreach (var each in OnGetUserStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserStatisticsResultEvent != null) { foreach (var each in OnGetUserStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdatePlayerStatisticsRequestEvent != null) { foreach (var each in OnUpdatePlayerStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdatePlayerStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdatePlayerStatisticsResultEvent != null) { foreach (var each in OnUpdatePlayerStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdatePlayerStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateUserDataRequestEvent != null) { foreach (var each in OnUpdateUserDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateUserDataResultEvent != null) { foreach (var each in OnUpdateUserDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateUserPublisherDataRequestEvent != null) { foreach (var each in OnUpdateUserPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateUserPublisherDataResultEvent != null) { foreach (var each in OnUpdateUserPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateUserStatisticsRequestEvent != null) { foreach (var each in OnUpdateUserStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateUserStatisticsResultEvent != null) { foreach (var each in OnUpdateUserStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateUserStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCatalogItemsRequestEvent != null) { foreach (var each in OnGetCatalogItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCatalogItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCatalogItemsResultEvent != null) { foreach (var each in OnGetCatalogItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCatalogItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPublisherDataRequestEvent != null) { foreach (var each in OnGetPublisherDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPublisherDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPublisherDataResultEvent != null) { foreach (var each in OnGetPublisherDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPublisherDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetStoreItemsRequestEvent != null) { foreach (var each in OnGetStoreItemsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetStoreItemsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetStoreItemsResultEvent != null) { foreach (var each in OnGetStoreItemsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetStoreItemsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetTimeRequestEvent != null) { foreach (var each in OnGetTimeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTimeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetTimeResultEvent != null) { foreach (var each in OnGetTimeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTimeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetTitleDataRequestEvent != null) { foreach (var each in OnGetTitleDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTitleDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetTitleDataResultEvent != null) { foreach (var each in OnGetTitleDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTitleDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetTitleNewsRequestEvent != null) { foreach (var each in OnGetTitleNewsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTitleNewsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetTitleNewsResultEvent != null) { foreach (var each in OnGetTitleNewsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTitleNewsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAddUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnAddUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAddUserVirtualCurrencyResultEvent != null) { foreach (var each in OnAddUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnConfirmPurchaseRequestEvent != null) { foreach (var each in OnConfirmPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnConfirmPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnConfirmPurchaseResultEvent != null) { foreach (var each in OnConfirmPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnConfirmPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnConsumeItemRequestEvent != null) { foreach (var each in OnConsumeItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnConsumeItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnConsumeItemResultEvent != null) { foreach (var each in OnConsumeItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnConsumeItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCharacterInventoryRequestEvent != null) { foreach (var each in OnGetCharacterInventoryRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterInventoryRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCharacterInventoryResultEvent != null) { foreach (var each in OnGetCharacterInventoryResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterInventoryResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPurchaseRequestEvent != null) { foreach (var each in OnGetPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPurchaseResultEvent != null) { foreach (var each in OnGetPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetUserInventoryRequestEvent != null) { foreach (var each in OnGetUserInventoryRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserInventoryRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetUserInventoryResultEvent != null) { foreach (var each in OnGetUserInventoryResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetUserInventoryResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnPayForPurchaseRequestEvent != null) { foreach (var each in OnPayForPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnPayForPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnPayForPurchaseResultEvent != null) { foreach (var each in OnPayForPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnPayForPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnPurchaseItemRequestEvent != null) { foreach (var each in OnPurchaseItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnPurchaseItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnPurchaseItemResultEvent != null) { foreach (var each in OnPurchaseItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnPurchaseItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRedeemCouponRequestEvent != null) { foreach (var each in OnRedeemCouponRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRedeemCouponRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRedeemCouponResultEvent != null) { foreach (var each in OnRedeemCouponResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRedeemCouponResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnStartPurchaseRequestEvent != null) { foreach (var each in OnStartPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnStartPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnStartPurchaseResultEvent != null) { foreach (var each in OnStartPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnStartPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnSubtractUserVirtualCurrencyRequestEvent != null) { foreach (var each in OnSubtractUserVirtualCurrencyRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSubtractUserVirtualCurrencyRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnSubtractUserVirtualCurrencyResultEvent != null) { foreach (var each in OnSubtractUserVirtualCurrencyResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSubtractUserVirtualCurrencyResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlockContainerInstanceRequestEvent != null) { foreach (var each in OnUnlockContainerInstanceRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlockContainerInstanceRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlockContainerInstanceResultEvent != null) { foreach (var each in OnUnlockContainerInstanceResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlockContainerInstanceResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUnlockContainerItemRequestEvent != null) { foreach (var each in OnUnlockContainerItemRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlockContainerItemRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUnlockContainerItemResultEvent != null) { foreach (var each in OnUnlockContainerItemResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUnlockContainerItemResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAddFriendRequestEvent != null) { foreach (var each in OnAddFriendRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddFriendRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAddFriendResultEvent != null) { foreach (var each in OnAddFriendResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddFriendResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetFriendsListRequestEvent != null) { foreach (var each in OnGetFriendsListRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendsListRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetFriendsListResultEvent != null) { foreach (var each in OnGetFriendsListResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetFriendsListResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRemoveFriendRequestEvent != null) { foreach (var each in OnRemoveFriendRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveFriendRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRemoveFriendResultEvent != null) { foreach (var each in OnRemoveFriendResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveFriendResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnSetFriendTagsRequestEvent != null) { foreach (var each in OnSetFriendTagsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSetFriendTagsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnSetFriendTagsResultEvent != null) { foreach (var each in OnSetFriendTagsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnSetFriendTagsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRegisterForIOSPushNotificationRequestEvent != null) { foreach (var each in OnRegisterForIOSPushNotificationRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRegisterForIOSPushNotificationRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRegisterForIOSPushNotificationResultEvent != null) { foreach (var each in OnRegisterForIOSPushNotificationResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRegisterForIOSPushNotificationResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRestoreIOSPurchasesRequestEvent != null) { foreach (var each in OnRestoreIOSPurchasesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRestoreIOSPurchasesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRestoreIOSPurchasesResultEvent != null) { foreach (var each in OnRestoreIOSPurchasesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRestoreIOSPurchasesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnValidateIOSReceiptRequestEvent != null) { foreach (var each in OnValidateIOSReceiptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateIOSReceiptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnValidateIOSReceiptResultEvent != null) { foreach (var each in OnValidateIOSReceiptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateIOSReceiptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCurrentGamesRequestEvent != null) { foreach (var each in OnGetCurrentGamesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCurrentGamesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCurrentGamesResultEvent != null) { foreach (var each in OnGetCurrentGamesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCurrentGamesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetGameServerRegionsRequestEvent != null) { foreach (var each in OnGetGameServerRegionsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetGameServerRegionsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetGameServerRegionsResultEvent != null) { foreach (var each in OnGetGameServerRegionsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetGameServerRegionsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnMatchmakeRequestEvent != null) { foreach (var each in OnMatchmakeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnMatchmakeResultEvent != null) { foreach (var each in OnMatchmakeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnMatchmakeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnStartGameRequestEvent != null) { foreach (var each in OnStartGameRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnStartGameRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnStartGameResultEvent != null) { foreach (var each in OnStartGameResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnStartGameResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAndroidDevicePushNotificationRegistrationRequestEvent != null) { foreach (var each in OnAndroidDevicePushNotificationRegistrationRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAndroidDevicePushNotificationRegistrationRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAndroidDevicePushNotificationRegistrationResultEvent != null) { foreach (var each in OnAndroidDevicePushNotificationRegistrationResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAndroidDevicePushNotificationRegistrationResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnValidateGooglePlayPurchaseRequestEvent != null) { foreach (var each in OnValidateGooglePlayPurchaseRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateGooglePlayPurchaseRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnValidateGooglePlayPurchaseResultEvent != null) { foreach (var each in OnValidateGooglePlayPurchaseResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateGooglePlayPurchaseResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnLogEventRequestEvent != null) { foreach (var each in OnLogEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLogEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnLogEventResultEvent != null) { foreach (var each in OnLogEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnLogEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnWriteCharacterEventRequestEvent != null) { foreach (var each in OnWriteCharacterEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWriteCharacterEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnWriteCharacterEventResultEvent != null) { foreach (var each in OnWriteCharacterEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWriteCharacterEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnWritePlayerEventRequestEvent != null) { foreach (var each in OnWritePlayerEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWritePlayerEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnWritePlayerEventResultEvent != null) { foreach (var each in OnWritePlayerEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWritePlayerEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnWriteTitleEventRequestEvent != null) { foreach (var each in OnWriteTitleEventRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWriteTitleEventRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnWriteTitleEventResultEvent != null) { foreach (var each in OnWriteTitleEventResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnWriteTitleEventResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAddSharedGroupMembersRequestEvent != null) { foreach (var each in OnAddSharedGroupMembersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddSharedGroupMembersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAddSharedGroupMembersResultEvent != null) { foreach (var each in OnAddSharedGroupMembersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAddSharedGroupMembersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnCreateSharedGroupRequestEvent != null) { foreach (var each in OnCreateSharedGroupRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnCreateSharedGroupRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnCreateSharedGroupResultEvent != null) { foreach (var each in OnCreateSharedGroupResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnCreateSharedGroupResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetSharedGroupDataRequestEvent != null) { foreach (var each in OnGetSharedGroupDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetSharedGroupDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetSharedGroupDataResultEvent != null) { foreach (var each in OnGetSharedGroupDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetSharedGroupDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRemoveSharedGroupMembersRequestEvent != null) { foreach (var each in OnRemoveSharedGroupMembersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveSharedGroupMembersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRemoveSharedGroupMembersResultEvent != null) { foreach (var each in OnRemoveSharedGroupMembersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRemoveSharedGroupMembersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateSharedGroupDataRequestEvent != null) { foreach (var each in OnUpdateSharedGroupDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateSharedGroupDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateSharedGroupDataResultEvent != null) { foreach (var each in OnUpdateSharedGroupDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateSharedGroupDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnExecuteCloudScriptRequestEvent != null) { foreach (var each in OnExecuteCloudScriptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnExecuteCloudScriptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnExecuteCloudScriptResultEvent != null) { foreach (var each in OnExecuteCloudScriptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnExecuteCloudScriptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCloudScriptUrlRequestEvent != null) { foreach (var each in OnGetCloudScriptUrlRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCloudScriptUrlRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCloudScriptUrlResultEvent != null) { foreach (var each in OnGetCloudScriptUrlResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCloudScriptUrlResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnRunCloudScriptRequestEvent != null) { foreach (var each in OnRunCloudScriptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRunCloudScriptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnRunCloudScriptResultEvent != null) { foreach (var each in OnRunCloudScriptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnRunCloudScriptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetContentDownloadUrlRequestEvent != null) { foreach (var each in OnGetContentDownloadUrlRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetContentDownloadUrlRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetContentDownloadUrlResultEvent != null) { foreach (var each in OnGetContentDownloadUrlResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetContentDownloadUrlResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetAllUsersCharactersRequestEvent != null) { foreach (var each in OnGetAllUsersCharactersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetAllUsersCharactersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetAllUsersCharactersResultEvent != null) { foreach (var each in OnGetAllUsersCharactersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetAllUsersCharactersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCharacterLeaderboardRequestEvent != null) { foreach (var each in OnGetCharacterLeaderboardRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterLeaderboardRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCharacterLeaderboardResultEvent != null) { foreach (var each in OnGetCharacterLeaderboardResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterLeaderboardResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCharacterStatisticsRequestEvent != null) { foreach (var each in OnGetCharacterStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCharacterStatisticsResultEvent != null) { foreach (var each in OnGetCharacterStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetLeaderboardAroundCharacterRequestEvent != null) { foreach (var each in OnGetLeaderboardAroundCharacterRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundCharacterRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetLeaderboardAroundCharacterResultEvent != null) { foreach (var each in OnGetLeaderboardAroundCharacterResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardAroundCharacterResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetLeaderboardForUserCharactersRequestEvent != null) { foreach (var each in OnGetLeaderboardForUserCharactersRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardForUserCharactersRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetLeaderboardForUserCharactersResultEvent != null) { foreach (var each in OnGetLeaderboardForUserCharactersResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetLeaderboardForUserCharactersResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGrantCharacterToUserRequestEvent != null) { foreach (var each in OnGrantCharacterToUserRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGrantCharacterToUserRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGrantCharacterToUserResultEvent != null) { foreach (var each in OnGrantCharacterToUserResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGrantCharacterToUserResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateCharacterStatisticsRequestEvent != null) { foreach (var each in OnUpdateCharacterStatisticsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateCharacterStatisticsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateCharacterStatisticsResultEvent != null) { foreach (var each in OnUpdateCharacterStatisticsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateCharacterStatisticsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCharacterDataRequestEvent != null) { foreach (var each in OnGetCharacterDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCharacterDataResultEvent != null) { foreach (var each in OnGetCharacterDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetCharacterReadOnlyDataRequestEvent != null) { foreach (var each in OnGetCharacterReadOnlyDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterReadOnlyDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetCharacterReadOnlyDataResultEvent != null) { foreach (var each in OnGetCharacterReadOnlyDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetCharacterReadOnlyDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnUpdateCharacterDataRequestEvent != null) { foreach (var each in OnUpdateCharacterDataRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateCharacterDataRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnUpdateCharacterDataResultEvent != null) { foreach (var each in OnUpdateCharacterDataResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnUpdateCharacterDataResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnValidateAmazonIAPReceiptRequestEvent != null) { foreach (var each in OnValidateAmazonIAPReceiptRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateAmazonIAPReceiptRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnValidateAmazonIAPReceiptResultEvent != null) { foreach (var each in OnValidateAmazonIAPReceiptResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnValidateAmazonIAPReceiptResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAcceptTradeRequestEvent != null) { foreach (var each in OnAcceptTradeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAcceptTradeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAcceptTradeResultEvent != null) { foreach (var each in OnAcceptTradeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAcceptTradeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnCancelTradeRequestEvent != null) { foreach (var each in OnCancelTradeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnCancelTradeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnCancelTradeResultEvent != null) { foreach (var each in OnCancelTradeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnCancelTradeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerTradesRequestEvent != null) { foreach (var each in OnGetPlayerTradesRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerTradesRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerTradesResultEvent != null) { foreach (var each in OnGetPlayerTradesResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerTradesResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetTradeStatusRequestEvent != null) { foreach (var each in OnGetTradeStatusRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTradeStatusRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetTradeStatusResultEvent != null) { foreach (var each in OnGetTradeStatusResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetTradeStatusResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnOpenTradeRequestEvent != null) { foreach (var each in OnOpenTradeRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnOpenTradeRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnOpenTradeResultEvent != null) { foreach (var each in OnOpenTradeResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnOpenTradeResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnAttributeInstallRequestEvent != null) { foreach (var each in OnAttributeInstallRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAttributeInstallRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnAttributeInstallResultEvent != null) { foreach (var each in OnAttributeInstallResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnAttributeInstallResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerSegmentsRequestEvent != null) { foreach (var each in OnGetPlayerSegmentsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerSegmentsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerSegmentsResultEvent != null) { foreach (var each in OnGetPlayerSegmentsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerSegmentsResultEvent -= (PlayFabResultEvent)each; } } } - - if (OnGetPlayerTagsRequestEvent != null) { foreach (var each in OnGetPlayerTagsRequestEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerTagsRequestEvent -= (PlayFabRequestEvent)each; } } } - if (OnGetPlayerTagsResultEvent != null) { foreach (var each in OnGetPlayerTagsResultEvent.GetInvocationList()) { if (ReferenceEquals(each.Target, instance)) { OnGetPlayerTagsResultEvent -= (PlayFabResultEvent)each; } } } - -#endif - - } - - private void OnProcessingErrorEvent(PlayFabRequestCommon request, PlayFabError error) - { - //This just forwards the event. - if (_instance.OnGlobalErrorEvent != null) - { - _instance.OnGlobalErrorEvent(request, error); - } - } - - private void OnProcessingEvent(ApiProcessingEventArgs e) - { - - if (e.EventType == ApiProcessingEventType.Pre) - { - var type = e.Request.GetType(); -#if ENABLE_PLAYFABADMIN_API - if (type == typeof(AdminModels.BanUsersRequest)) { if (_instance.OnAdminBanUsersRequestEvent != null) { _instance.OnAdminBanUsersRequestEvent((AdminModels.BanUsersRequest)e.Request); return; } } - if (type == typeof(AdminModels.LookupUserAccountInfoRequest)) { if (_instance.OnAdminGetUserAccountInfoRequestEvent != null) { _instance.OnAdminGetUserAccountInfoRequestEvent((AdminModels.LookupUserAccountInfoRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserBansRequest)) { if (_instance.OnAdminGetUserBansRequestEvent != null) { _instance.OnAdminGetUserBansRequestEvent((AdminModels.GetUserBansRequest)e.Request); return; } } - if (type == typeof(AdminModels.ResetUsersRequest)) { if (_instance.OnAdminResetUsersRequestEvent != null) { _instance.OnAdminResetUsersRequestEvent((AdminModels.ResetUsersRequest)e.Request); return; } } - if (type == typeof(AdminModels.RevokeAllBansForUserRequest)) { if (_instance.OnAdminRevokeAllBansForUserRequestEvent != null) { _instance.OnAdminRevokeAllBansForUserRequestEvent((AdminModels.RevokeAllBansForUserRequest)e.Request); return; } } - if (type == typeof(AdminModels.RevokeBansRequest)) { if (_instance.OnAdminRevokeBansRequestEvent != null) { _instance.OnAdminRevokeBansRequestEvent((AdminModels.RevokeBansRequest)e.Request); return; } } - if (type == typeof(AdminModels.SendAccountRecoveryEmailRequest)) { if (_instance.OnAdminSendAccountRecoveryEmailRequestEvent != null) { _instance.OnAdminSendAccountRecoveryEmailRequestEvent((AdminModels.SendAccountRecoveryEmailRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateBansRequest)) { if (_instance.OnAdminUpdateBansRequestEvent != null) { _instance.OnAdminUpdateBansRequestEvent((AdminModels.UpdateBansRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserTitleDisplayNameRequest)) { if (_instance.OnAdminUpdateUserTitleDisplayNameRequestEvent != null) { _instance.OnAdminUpdateUserTitleDisplayNameRequestEvent((AdminModels.UpdateUserTitleDisplayNameRequest)e.Request); return; } } - if (type == typeof(AdminModels.CreatePlayerStatisticDefinitionRequest)) { if (_instance.OnAdminCreatePlayerStatisticDefinitionRequestEvent != null) { _instance.OnAdminCreatePlayerStatisticDefinitionRequestEvent((AdminModels.CreatePlayerStatisticDefinitionRequest)e.Request); return; } } - if (type == typeof(AdminModels.DeleteUsersRequest)) { if (_instance.OnAdminDeleteUsersRequestEvent != null) { _instance.OnAdminDeleteUsersRequestEvent((AdminModels.DeleteUsersRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetDataReportRequest)) { if (_instance.OnAdminGetDataReportRequestEvent != null) { _instance.OnAdminGetDataReportRequestEvent((AdminModels.GetDataReportRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPlayerStatisticDefinitionsRequest)) { if (_instance.OnAdminGetPlayerStatisticDefinitionsRequestEvent != null) { _instance.OnAdminGetPlayerStatisticDefinitionsRequestEvent((AdminModels.GetPlayerStatisticDefinitionsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPlayerStatisticVersionsRequest)) { if (_instance.OnAdminGetPlayerStatisticVersionsRequestEvent != null) { _instance.OnAdminGetPlayerStatisticVersionsRequestEvent((AdminModels.GetPlayerStatisticVersionsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserDataRequestEvent != null) { _instance.OnAdminGetUserDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserInternalDataRequestEvent != null) { _instance.OnAdminGetUserInternalDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserPublisherDataRequestEvent != null) { _instance.OnAdminGetUserPublisherDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserPublisherInternalDataRequestEvent != null) { _instance.OnAdminGetUserPublisherInternalDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserPublisherReadOnlyDataRequestEvent != null) { _instance.OnAdminGetUserPublisherReadOnlyDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserDataRequest)) { if (_instance.OnAdminGetUserReadOnlyDataRequestEvent != null) { _instance.OnAdminGetUserReadOnlyDataRequestEvent((AdminModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.IncrementPlayerStatisticVersionRequest)) { if (_instance.OnAdminIncrementPlayerStatisticVersionRequestEvent != null) { _instance.OnAdminIncrementPlayerStatisticVersionRequestEvent((AdminModels.IncrementPlayerStatisticVersionRequest)e.Request); return; } } - if (type == typeof(AdminModels.RefundPurchaseRequest)) { if (_instance.OnAdminRefundPurchaseRequestEvent != null) { _instance.OnAdminRefundPurchaseRequestEvent((AdminModels.RefundPurchaseRequest)e.Request); return; } } - if (type == typeof(AdminModels.ResetUserStatisticsRequest)) { if (_instance.OnAdminResetUserStatisticsRequestEvent != null) { _instance.OnAdminResetUserStatisticsRequestEvent((AdminModels.ResetUserStatisticsRequest)e.Request); return; } } - if (type == typeof(AdminModels.ResolvePurchaseDisputeRequest)) { if (_instance.OnAdminResolvePurchaseDisputeRequestEvent != null) { _instance.OnAdminResolvePurchaseDisputeRequestEvent((AdminModels.ResolvePurchaseDisputeRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdatePlayerStatisticDefinitionRequest)) { if (_instance.OnAdminUpdatePlayerStatisticDefinitionRequestEvent != null) { _instance.OnAdminUpdatePlayerStatisticDefinitionRequestEvent((AdminModels.UpdatePlayerStatisticDefinitionRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserDataRequest)) { if (_instance.OnAdminUpdateUserDataRequestEvent != null) { _instance.OnAdminUpdateUserDataRequestEvent((AdminModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserInternalDataRequest)) { if (_instance.OnAdminUpdateUserInternalDataRequestEvent != null) { _instance.OnAdminUpdateUserInternalDataRequestEvent((AdminModels.UpdateUserInternalDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserDataRequest)) { if (_instance.OnAdminUpdateUserPublisherDataRequestEvent != null) { _instance.OnAdminUpdateUserPublisherDataRequestEvent((AdminModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserInternalDataRequest)) { if (_instance.OnAdminUpdateUserPublisherInternalDataRequestEvent != null) { _instance.OnAdminUpdateUserPublisherInternalDataRequestEvent((AdminModels.UpdateUserInternalDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserDataRequest)) { if (_instance.OnAdminUpdateUserPublisherReadOnlyDataRequestEvent != null) { _instance.OnAdminUpdateUserPublisherReadOnlyDataRequestEvent((AdminModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateUserDataRequest)) { if (_instance.OnAdminUpdateUserReadOnlyDataRequestEvent != null) { _instance.OnAdminUpdateUserReadOnlyDataRequestEvent((AdminModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.AddNewsRequest)) { if (_instance.OnAdminAddNewsRequestEvent != null) { _instance.OnAdminAddNewsRequestEvent((AdminModels.AddNewsRequest)e.Request); return; } } - if (type == typeof(AdminModels.AddVirtualCurrencyTypesRequest)) { if (_instance.OnAdminAddVirtualCurrencyTypesRequestEvent != null) { _instance.OnAdminAddVirtualCurrencyTypesRequestEvent((AdminModels.AddVirtualCurrencyTypesRequest)e.Request); return; } } - if (type == typeof(AdminModels.DeleteStoreRequest)) { if (_instance.OnAdminDeleteStoreRequestEvent != null) { _instance.OnAdminDeleteStoreRequestEvent((AdminModels.DeleteStoreRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetCatalogItemsRequest)) { if (_instance.OnAdminGetCatalogItemsRequestEvent != null) { _instance.OnAdminGetCatalogItemsRequestEvent((AdminModels.GetCatalogItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPublisherDataRequest)) { if (_instance.OnAdminGetPublisherDataRequestEvent != null) { _instance.OnAdminGetPublisherDataRequestEvent((AdminModels.GetPublisherDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetRandomResultTablesRequest)) { if (_instance.OnAdminGetRandomResultTablesRequestEvent != null) { _instance.OnAdminGetRandomResultTablesRequestEvent((AdminModels.GetRandomResultTablesRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetStoreItemsRequest)) { if (_instance.OnAdminGetStoreItemsRequestEvent != null) { _instance.OnAdminGetStoreItemsRequestEvent((AdminModels.GetStoreItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetTitleDataRequest)) { if (_instance.OnAdminGetTitleDataRequestEvent != null) { _instance.OnAdminGetTitleDataRequestEvent((AdminModels.GetTitleDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetTitleDataRequest)) { if (_instance.OnAdminGetTitleInternalDataRequestEvent != null) { _instance.OnAdminGetTitleInternalDataRequestEvent((AdminModels.GetTitleDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.ListVirtualCurrencyTypesRequest)) { if (_instance.OnAdminListVirtualCurrencyTypesRequestEvent != null) { _instance.OnAdminListVirtualCurrencyTypesRequestEvent((AdminModels.ListVirtualCurrencyTypesRequest)e.Request); return; } } - if (type == typeof(AdminModels.RemoveVirtualCurrencyTypesRequest)) { if (_instance.OnAdminRemoveVirtualCurrencyTypesRequestEvent != null) { _instance.OnAdminRemoveVirtualCurrencyTypesRequestEvent((AdminModels.RemoveVirtualCurrencyTypesRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateCatalogItemsRequest)) { if (_instance.OnAdminSetCatalogItemsRequestEvent != null) { _instance.OnAdminSetCatalogItemsRequestEvent((AdminModels.UpdateCatalogItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateStoreItemsRequest)) { if (_instance.OnAdminSetStoreItemsRequestEvent != null) { _instance.OnAdminSetStoreItemsRequestEvent((AdminModels.UpdateStoreItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.SetTitleDataRequest)) { if (_instance.OnAdminSetTitleDataRequestEvent != null) { _instance.OnAdminSetTitleDataRequestEvent((AdminModels.SetTitleDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.SetTitleDataRequest)) { if (_instance.OnAdminSetTitleInternalDataRequestEvent != null) { _instance.OnAdminSetTitleInternalDataRequestEvent((AdminModels.SetTitleDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.SetupPushNotificationRequest)) { if (_instance.OnAdminSetupPushNotificationRequestEvent != null) { _instance.OnAdminSetupPushNotificationRequestEvent((AdminModels.SetupPushNotificationRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateCatalogItemsRequest)) { if (_instance.OnAdminUpdateCatalogItemsRequestEvent != null) { _instance.OnAdminUpdateCatalogItemsRequestEvent((AdminModels.UpdateCatalogItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateRandomResultTablesRequest)) { if (_instance.OnAdminUpdateRandomResultTablesRequestEvent != null) { _instance.OnAdminUpdateRandomResultTablesRequestEvent((AdminModels.UpdateRandomResultTablesRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateStoreItemsRequest)) { if (_instance.OnAdminUpdateStoreItemsRequestEvent != null) { _instance.OnAdminUpdateStoreItemsRequestEvent((AdminModels.UpdateStoreItemsRequest)e.Request); return; } } - if (type == typeof(AdminModels.AddUserVirtualCurrencyRequest)) { if (_instance.OnAdminAddUserVirtualCurrencyRequestEvent != null) { _instance.OnAdminAddUserVirtualCurrencyRequestEvent((AdminModels.AddUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetUserInventoryRequest)) { if (_instance.OnAdminGetUserInventoryRequestEvent != null) { _instance.OnAdminGetUserInventoryRequestEvent((AdminModels.GetUserInventoryRequest)e.Request); return; } } - if (type == typeof(AdminModels.GrantItemsToUsersRequest)) { if (_instance.OnAdminGrantItemsToUsersRequestEvent != null) { _instance.OnAdminGrantItemsToUsersRequestEvent((AdminModels.GrantItemsToUsersRequest)e.Request); return; } } - if (type == typeof(AdminModels.RevokeInventoryItemRequest)) { if (_instance.OnAdminRevokeInventoryItemRequestEvent != null) { _instance.OnAdminRevokeInventoryItemRequestEvent((AdminModels.RevokeInventoryItemRequest)e.Request); return; } } - if (type == typeof(AdminModels.SubtractUserVirtualCurrencyRequest)) { if (_instance.OnAdminSubtractUserVirtualCurrencyRequestEvent != null) { _instance.OnAdminSubtractUserVirtualCurrencyRequestEvent((AdminModels.SubtractUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetMatchmakerGameInfoRequest)) { if (_instance.OnAdminGetMatchmakerGameInfoRequestEvent != null) { _instance.OnAdminGetMatchmakerGameInfoRequestEvent((AdminModels.GetMatchmakerGameInfoRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetMatchmakerGameModesRequest)) { if (_instance.OnAdminGetMatchmakerGameModesRequestEvent != null) { _instance.OnAdminGetMatchmakerGameModesRequestEvent((AdminModels.GetMatchmakerGameModesRequest)e.Request); return; } } - if (type == typeof(AdminModels.ModifyMatchmakerGameModesRequest)) { if (_instance.OnAdminModifyMatchmakerGameModesRequestEvent != null) { _instance.OnAdminModifyMatchmakerGameModesRequestEvent((AdminModels.ModifyMatchmakerGameModesRequest)e.Request); return; } } - if (type == typeof(AdminModels.AddServerBuildRequest)) { if (_instance.OnAdminAddServerBuildRequestEvent != null) { _instance.OnAdminAddServerBuildRequestEvent((AdminModels.AddServerBuildRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetServerBuildInfoRequest)) { if (_instance.OnAdminGetServerBuildInfoRequestEvent != null) { _instance.OnAdminGetServerBuildInfoRequestEvent((AdminModels.GetServerBuildInfoRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetServerBuildUploadURLRequest)) { if (_instance.OnAdminGetServerBuildUploadUrlRequestEvent != null) { _instance.OnAdminGetServerBuildUploadUrlRequestEvent((AdminModels.GetServerBuildUploadURLRequest)e.Request); return; } } - if (type == typeof(AdminModels.ListBuildsRequest)) { if (_instance.OnAdminListServerBuildsRequestEvent != null) { _instance.OnAdminListServerBuildsRequestEvent((AdminModels.ListBuildsRequest)e.Request); return; } } - if (type == typeof(AdminModels.ModifyServerBuildRequest)) { if (_instance.OnAdminModifyServerBuildRequestEvent != null) { _instance.OnAdminModifyServerBuildRequestEvent((AdminModels.ModifyServerBuildRequest)e.Request); return; } } - if (type == typeof(AdminModels.RemoveServerBuildRequest)) { if (_instance.OnAdminRemoveServerBuildRequestEvent != null) { _instance.OnAdminRemoveServerBuildRequestEvent((AdminModels.RemoveServerBuildRequest)e.Request); return; } } - if (type == typeof(AdminModels.SetPublisherDataRequest)) { if (_instance.OnAdminSetPublisherDataRequestEvent != null) { _instance.OnAdminSetPublisherDataRequestEvent((AdminModels.SetPublisherDataRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetCloudScriptRevisionRequest)) { if (_instance.OnAdminGetCloudScriptRevisionRequestEvent != null) { _instance.OnAdminGetCloudScriptRevisionRequestEvent((AdminModels.GetCloudScriptRevisionRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetCloudScriptVersionsRequest)) { if (_instance.OnAdminGetCloudScriptVersionsRequestEvent != null) { _instance.OnAdminGetCloudScriptVersionsRequestEvent((AdminModels.GetCloudScriptVersionsRequest)e.Request); return; } } - if (type == typeof(AdminModels.SetPublishedRevisionRequest)) { if (_instance.OnAdminSetPublishedRevisionRequestEvent != null) { _instance.OnAdminSetPublishedRevisionRequestEvent((AdminModels.SetPublishedRevisionRequest)e.Request); return; } } - if (type == typeof(AdminModels.UpdateCloudScriptRequest)) { if (_instance.OnAdminUpdateCloudScriptRequestEvent != null) { _instance.OnAdminUpdateCloudScriptRequestEvent((AdminModels.UpdateCloudScriptRequest)e.Request); return; } } - if (type == typeof(AdminModels.DeleteContentRequest)) { if (_instance.OnAdminDeleteContentRequestEvent != null) { _instance.OnAdminDeleteContentRequestEvent((AdminModels.DeleteContentRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetContentListRequest)) { if (_instance.OnAdminGetContentListRequestEvent != null) { _instance.OnAdminGetContentListRequestEvent((AdminModels.GetContentListRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetContentUploadUrlRequest)) { if (_instance.OnAdminGetContentUploadUrlRequestEvent != null) { _instance.OnAdminGetContentUploadUrlRequestEvent((AdminModels.GetContentUploadUrlRequest)e.Request); return; } } - if (type == typeof(AdminModels.ResetCharacterStatisticsRequest)) { if (_instance.OnAdminResetCharacterStatisticsRequestEvent != null) { _instance.OnAdminResetCharacterStatisticsRequestEvent((AdminModels.ResetCharacterStatisticsRequest)e.Request); return; } } - if (type == typeof(AdminModels.AddPlayerTagRequest)) { if (_instance.OnAdminAddPlayerTagRequestEvent != null) { _instance.OnAdminAddPlayerTagRequestEvent((AdminModels.AddPlayerTagRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetAllActionGroupsRequest)) { if (_instance.OnAdminGetAllActionGroupsRequestEvent != null) { _instance.OnAdminGetAllActionGroupsRequestEvent((AdminModels.GetAllActionGroupsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetAllSegmentsRequest)) { if (_instance.OnAdminGetAllSegmentsRequestEvent != null) { _instance.OnAdminGetAllSegmentsRequestEvent((AdminModels.GetAllSegmentsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPlayersSegmentsRequest)) { if (_instance.OnAdminGetPlayerSegmentsRequestEvent != null) { _instance.OnAdminGetPlayerSegmentsRequestEvent((AdminModels.GetPlayersSegmentsRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPlayersInSegmentRequest)) { if (_instance.OnAdminGetPlayersInSegmentRequestEvent != null) { _instance.OnAdminGetPlayersInSegmentRequestEvent((AdminModels.GetPlayersInSegmentRequest)e.Request); return; } } - if (type == typeof(AdminModels.GetPlayerTagsRequest)) { if (_instance.OnAdminGetPlayerTagsRequestEvent != null) { _instance.OnAdminGetPlayerTagsRequestEvent((AdminModels.GetPlayerTagsRequest)e.Request); return; } } - if (type == typeof(AdminModels.RemovePlayerTagRequest)) { if (_instance.OnAdminRemovePlayerTagRequestEvent != null) { _instance.OnAdminRemovePlayerTagRequestEvent((AdminModels.RemovePlayerTagRequest)e.Request); return; } } -#endif -#if ENABLE_PLAYFABSERVER_API - if (type == typeof(MatchmakerModels.AuthUserRequest)) { if (_instance.OnMatchmakerAuthUserRequestEvent != null) { _instance.OnMatchmakerAuthUserRequestEvent((MatchmakerModels.AuthUserRequest)e.Request); return; } } - if (type == typeof(MatchmakerModels.PlayerJoinedRequest)) { if (_instance.OnMatchmakerPlayerJoinedRequestEvent != null) { _instance.OnMatchmakerPlayerJoinedRequestEvent((MatchmakerModels.PlayerJoinedRequest)e.Request); return; } } - if (type == typeof(MatchmakerModels.PlayerLeftRequest)) { if (_instance.OnMatchmakerPlayerLeftRequestEvent != null) { _instance.OnMatchmakerPlayerLeftRequestEvent((MatchmakerModels.PlayerLeftRequest)e.Request); return; } } - if (type == typeof(MatchmakerModels.StartGameRequest)) { if (_instance.OnMatchmakerStartGameRequestEvent != null) { _instance.OnMatchmakerStartGameRequestEvent((MatchmakerModels.StartGameRequest)e.Request); return; } } - if (type == typeof(MatchmakerModels.UserInfoRequest)) { if (_instance.OnMatchmakerUserInfoRequestEvent != null) { _instance.OnMatchmakerUserInfoRequestEvent((MatchmakerModels.UserInfoRequest)e.Request); return; } } -#endif -#if ENABLE_PLAYFABSERVER_API - if (type == typeof(ServerModels.AuthenticateSessionTicketRequest)) { if (_instance.OnServerAuthenticateSessionTicketRequestEvent != null) { _instance.OnServerAuthenticateSessionTicketRequestEvent((ServerModels.AuthenticateSessionTicketRequest)e.Request); return; } } - if (type == typeof(ServerModels.BanUsersRequest)) { if (_instance.OnServerBanUsersRequestEvent != null) { _instance.OnServerBanUsersRequestEvent((ServerModels.BanUsersRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayFabIDsFromFacebookIDsRequest)) { if (_instance.OnServerGetPlayFabIDsFromFacebookIDsRequestEvent != null) { _instance.OnServerGetPlayFabIDsFromFacebookIDsRequestEvent((ServerModels.GetPlayFabIDsFromFacebookIDsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayFabIDsFromSteamIDsRequest)) { if (_instance.OnServerGetPlayFabIDsFromSteamIDsRequestEvent != null) { _instance.OnServerGetPlayFabIDsFromSteamIDsRequestEvent((ServerModels.GetPlayFabIDsFromSteamIDsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserAccountInfoRequest)) { if (_instance.OnServerGetUserAccountInfoRequestEvent != null) { _instance.OnServerGetUserAccountInfoRequestEvent((ServerModels.GetUserAccountInfoRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserBansRequest)) { if (_instance.OnServerGetUserBansRequestEvent != null) { _instance.OnServerGetUserBansRequestEvent((ServerModels.GetUserBansRequest)e.Request); return; } } - if (type == typeof(ServerModels.RevokeAllBansForUserRequest)) { if (_instance.OnServerRevokeAllBansForUserRequestEvent != null) { _instance.OnServerRevokeAllBansForUserRequestEvent((ServerModels.RevokeAllBansForUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.RevokeBansRequest)) { if (_instance.OnServerRevokeBansRequestEvent != null) { _instance.OnServerRevokeBansRequestEvent((ServerModels.RevokeBansRequest)e.Request); return; } } - if (type == typeof(ServerModels.SendPushNotificationRequest)) { if (_instance.OnServerSendPushNotificationRequestEvent != null) { _instance.OnServerSendPushNotificationRequestEvent((ServerModels.SendPushNotificationRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateBansRequest)) { if (_instance.OnServerUpdateBansRequestEvent != null) { _instance.OnServerUpdateBansRequestEvent((ServerModels.UpdateBansRequest)e.Request); return; } } - if (type == typeof(ServerModels.DeleteUsersRequest)) { if (_instance.OnServerDeleteUsersRequestEvent != null) { _instance.OnServerDeleteUsersRequestEvent((ServerModels.DeleteUsersRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetFriendLeaderboardRequest)) { if (_instance.OnServerGetFriendLeaderboardRequestEvent != null) { _instance.OnServerGetFriendLeaderboardRequestEvent((ServerModels.GetFriendLeaderboardRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetLeaderboardRequest)) { if (_instance.OnServerGetLeaderboardRequestEvent != null) { _instance.OnServerGetLeaderboardRequestEvent((ServerModels.GetLeaderboardRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetLeaderboardAroundUserRequest)) { if (_instance.OnServerGetLeaderboardAroundUserRequestEvent != null) { _instance.OnServerGetLeaderboardAroundUserRequestEvent((ServerModels.GetLeaderboardAroundUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayerCombinedInfoRequest)) { if (_instance.OnServerGetPlayerCombinedInfoRequestEvent != null) { _instance.OnServerGetPlayerCombinedInfoRequestEvent((ServerModels.GetPlayerCombinedInfoRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayerStatisticsRequest)) { if (_instance.OnServerGetPlayerStatisticsRequestEvent != null) { _instance.OnServerGetPlayerStatisticsRequestEvent((ServerModels.GetPlayerStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayerStatisticVersionsRequest)) { if (_instance.OnServerGetPlayerStatisticVersionsRequestEvent != null) { _instance.OnServerGetPlayerStatisticVersionsRequestEvent((ServerModels.GetPlayerStatisticVersionsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserDataRequestEvent != null) { _instance.OnServerGetUserDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserInternalDataRequestEvent != null) { _instance.OnServerGetUserInternalDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserPublisherDataRequestEvent != null) { _instance.OnServerGetUserPublisherDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserPublisherInternalDataRequestEvent != null) { _instance.OnServerGetUserPublisherInternalDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserPublisherReadOnlyDataRequestEvent != null) { _instance.OnServerGetUserPublisherReadOnlyDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserDataRequest)) { if (_instance.OnServerGetUserReadOnlyDataRequestEvent != null) { _instance.OnServerGetUserReadOnlyDataRequestEvent((ServerModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserStatisticsRequest)) { if (_instance.OnServerGetUserStatisticsRequestEvent != null) { _instance.OnServerGetUserStatisticsRequestEvent((ServerModels.GetUserStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdatePlayerStatisticsRequest)) { if (_instance.OnServerUpdatePlayerStatisticsRequestEvent != null) { _instance.OnServerUpdatePlayerStatisticsRequestEvent((ServerModels.UpdatePlayerStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserDataRequest)) { if (_instance.OnServerUpdateUserDataRequestEvent != null) { _instance.OnServerUpdateUserDataRequestEvent((ServerModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserInternalDataRequest)) { if (_instance.OnServerUpdateUserInternalDataRequestEvent != null) { _instance.OnServerUpdateUserInternalDataRequestEvent((ServerModels.UpdateUserInternalDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserDataRequest)) { if (_instance.OnServerUpdateUserPublisherDataRequestEvent != null) { _instance.OnServerUpdateUserPublisherDataRequestEvent((ServerModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserInternalDataRequest)) { if (_instance.OnServerUpdateUserPublisherInternalDataRequestEvent != null) { _instance.OnServerUpdateUserPublisherInternalDataRequestEvent((ServerModels.UpdateUserInternalDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserDataRequest)) { if (_instance.OnServerUpdateUserPublisherReadOnlyDataRequestEvent != null) { _instance.OnServerUpdateUserPublisherReadOnlyDataRequestEvent((ServerModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserDataRequest)) { if (_instance.OnServerUpdateUserReadOnlyDataRequestEvent != null) { _instance.OnServerUpdateUserReadOnlyDataRequestEvent((ServerModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserStatisticsRequest)) { if (_instance.OnServerUpdateUserStatisticsRequestEvent != null) { _instance.OnServerUpdateUserStatisticsRequestEvent((ServerModels.UpdateUserStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCatalogItemsRequest)) { if (_instance.OnServerGetCatalogItemsRequestEvent != null) { _instance.OnServerGetCatalogItemsRequestEvent((ServerModels.GetCatalogItemsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPublisherDataRequest)) { if (_instance.OnServerGetPublisherDataRequestEvent != null) { _instance.OnServerGetPublisherDataRequestEvent((ServerModels.GetPublisherDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetTimeRequest)) { if (_instance.OnServerGetTimeRequestEvent != null) { _instance.OnServerGetTimeRequestEvent((ServerModels.GetTimeRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetTitleDataRequest)) { if (_instance.OnServerGetTitleDataRequestEvent != null) { _instance.OnServerGetTitleDataRequestEvent((ServerModels.GetTitleDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetTitleDataRequest)) { if (_instance.OnServerGetTitleInternalDataRequestEvent != null) { _instance.OnServerGetTitleInternalDataRequestEvent((ServerModels.GetTitleDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetTitleNewsRequest)) { if (_instance.OnServerGetTitleNewsRequestEvent != null) { _instance.OnServerGetTitleNewsRequestEvent((ServerModels.GetTitleNewsRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetPublisherDataRequest)) { if (_instance.OnServerSetPublisherDataRequestEvent != null) { _instance.OnServerSetPublisherDataRequestEvent((ServerModels.SetPublisherDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetTitleDataRequest)) { if (_instance.OnServerSetTitleDataRequestEvent != null) { _instance.OnServerSetTitleDataRequestEvent((ServerModels.SetTitleDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetTitleDataRequest)) { if (_instance.OnServerSetTitleInternalDataRequestEvent != null) { _instance.OnServerSetTitleInternalDataRequestEvent((ServerModels.SetTitleDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.AddCharacterVirtualCurrencyRequest)) { if (_instance.OnServerAddCharacterVirtualCurrencyRequestEvent != null) { _instance.OnServerAddCharacterVirtualCurrencyRequestEvent((ServerModels.AddCharacterVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ServerModels.AddUserVirtualCurrencyRequest)) { if (_instance.OnServerAddUserVirtualCurrencyRequestEvent != null) { _instance.OnServerAddUserVirtualCurrencyRequestEvent((ServerModels.AddUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ServerModels.ConsumeItemRequest)) { if (_instance.OnServerConsumeItemRequestEvent != null) { _instance.OnServerConsumeItemRequestEvent((ServerModels.ConsumeItemRequest)e.Request); return; } } - if (type == typeof(ServerModels.EvaluateRandomResultTableRequest)) { if (_instance.OnServerEvaluateRandomResultTableRequestEvent != null) { _instance.OnServerEvaluateRandomResultTableRequestEvent((ServerModels.EvaluateRandomResultTableRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterInventoryRequest)) { if (_instance.OnServerGetCharacterInventoryRequestEvent != null) { _instance.OnServerGetCharacterInventoryRequestEvent((ServerModels.GetCharacterInventoryRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetRandomResultTablesRequest)) { if (_instance.OnServerGetRandomResultTablesRequestEvent != null) { _instance.OnServerGetRandomResultTablesRequestEvent((ServerModels.GetRandomResultTablesRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetUserInventoryRequest)) { if (_instance.OnServerGetUserInventoryRequestEvent != null) { _instance.OnServerGetUserInventoryRequestEvent((ServerModels.GetUserInventoryRequest)e.Request); return; } } - if (type == typeof(ServerModels.GrantItemsToCharacterRequest)) { if (_instance.OnServerGrantItemsToCharacterRequestEvent != null) { _instance.OnServerGrantItemsToCharacterRequestEvent((ServerModels.GrantItemsToCharacterRequest)e.Request); return; } } - if (type == typeof(ServerModels.GrantItemsToUserRequest)) { if (_instance.OnServerGrantItemsToUserRequestEvent != null) { _instance.OnServerGrantItemsToUserRequestEvent((ServerModels.GrantItemsToUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.GrantItemsToUsersRequest)) { if (_instance.OnServerGrantItemsToUsersRequestEvent != null) { _instance.OnServerGrantItemsToUsersRequestEvent((ServerModels.GrantItemsToUsersRequest)e.Request); return; } } - if (type == typeof(ServerModels.ModifyItemUsesRequest)) { if (_instance.OnServerModifyItemUsesRequestEvent != null) { _instance.OnServerModifyItemUsesRequestEvent((ServerModels.ModifyItemUsesRequest)e.Request); return; } } - if (type == typeof(ServerModels.MoveItemToCharacterFromCharacterRequest)) { if (_instance.OnServerMoveItemToCharacterFromCharacterRequestEvent != null) { _instance.OnServerMoveItemToCharacterFromCharacterRequestEvent((ServerModels.MoveItemToCharacterFromCharacterRequest)e.Request); return; } } - if (type == typeof(ServerModels.MoveItemToCharacterFromUserRequest)) { if (_instance.OnServerMoveItemToCharacterFromUserRequestEvent != null) { _instance.OnServerMoveItemToCharacterFromUserRequestEvent((ServerModels.MoveItemToCharacterFromUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.MoveItemToUserFromCharacterRequest)) { if (_instance.OnServerMoveItemToUserFromCharacterRequestEvent != null) { _instance.OnServerMoveItemToUserFromCharacterRequestEvent((ServerModels.MoveItemToUserFromCharacterRequest)e.Request); return; } } - if (type == typeof(ServerModels.RedeemCouponRequest)) { if (_instance.OnServerRedeemCouponRequestEvent != null) { _instance.OnServerRedeemCouponRequestEvent((ServerModels.RedeemCouponRequest)e.Request); return; } } - if (type == typeof(ServerModels.ReportPlayerServerRequest)) { if (_instance.OnServerReportPlayerRequestEvent != null) { _instance.OnServerReportPlayerRequestEvent((ServerModels.ReportPlayerServerRequest)e.Request); return; } } - if (type == typeof(ServerModels.RevokeInventoryItemRequest)) { if (_instance.OnServerRevokeInventoryItemRequestEvent != null) { _instance.OnServerRevokeInventoryItemRequestEvent((ServerModels.RevokeInventoryItemRequest)e.Request); return; } } - if (type == typeof(ServerModels.SubtractCharacterVirtualCurrencyRequest)) { if (_instance.OnServerSubtractCharacterVirtualCurrencyRequestEvent != null) { _instance.OnServerSubtractCharacterVirtualCurrencyRequestEvent((ServerModels.SubtractCharacterVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ServerModels.SubtractUserVirtualCurrencyRequest)) { if (_instance.OnServerSubtractUserVirtualCurrencyRequestEvent != null) { _instance.OnServerSubtractUserVirtualCurrencyRequestEvent((ServerModels.SubtractUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ServerModels.UnlockContainerInstanceRequest)) { if (_instance.OnServerUnlockContainerInstanceRequestEvent != null) { _instance.OnServerUnlockContainerInstanceRequestEvent((ServerModels.UnlockContainerInstanceRequest)e.Request); return; } } - if (type == typeof(ServerModels.UnlockContainerItemRequest)) { if (_instance.OnServerUnlockContainerItemRequestEvent != null) { _instance.OnServerUnlockContainerItemRequestEvent((ServerModels.UnlockContainerItemRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateUserInventoryItemDataRequest)) { if (_instance.OnServerUpdateUserInventoryItemCustomDataRequestEvent != null) { _instance.OnServerUpdateUserInventoryItemCustomDataRequestEvent((ServerModels.UpdateUserInventoryItemDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.AddFriendRequest)) { if (_instance.OnServerAddFriendRequestEvent != null) { _instance.OnServerAddFriendRequestEvent((ServerModels.AddFriendRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetFriendsListRequest)) { if (_instance.OnServerGetFriendsListRequestEvent != null) { _instance.OnServerGetFriendsListRequestEvent((ServerModels.GetFriendsListRequest)e.Request); return; } } - if (type == typeof(ServerModels.RemoveFriendRequest)) { if (_instance.OnServerRemoveFriendRequestEvent != null) { _instance.OnServerRemoveFriendRequestEvent((ServerModels.RemoveFriendRequest)e.Request); return; } } - if (type == typeof(ServerModels.DeregisterGameRequest)) { if (_instance.OnServerDeregisterGameRequestEvent != null) { _instance.OnServerDeregisterGameRequestEvent((ServerModels.DeregisterGameRequest)e.Request); return; } } - if (type == typeof(ServerModels.NotifyMatchmakerPlayerLeftRequest)) { if (_instance.OnServerNotifyMatchmakerPlayerLeftRequestEvent != null) { _instance.OnServerNotifyMatchmakerPlayerLeftRequestEvent((ServerModels.NotifyMatchmakerPlayerLeftRequest)e.Request); return; } } - if (type == typeof(ServerModels.RedeemMatchmakerTicketRequest)) { if (_instance.OnServerRedeemMatchmakerTicketRequestEvent != null) { _instance.OnServerRedeemMatchmakerTicketRequestEvent((ServerModels.RedeemMatchmakerTicketRequest)e.Request); return; } } - if (type == typeof(ServerModels.RefreshGameServerInstanceHeartbeatRequest)) { if (_instance.OnServerRefreshGameServerInstanceHeartbeatRequestEvent != null) { _instance.OnServerRefreshGameServerInstanceHeartbeatRequestEvent((ServerModels.RefreshGameServerInstanceHeartbeatRequest)e.Request); return; } } - if (type == typeof(ServerModels.RegisterGameRequest)) { if (_instance.OnServerRegisterGameRequestEvent != null) { _instance.OnServerRegisterGameRequestEvent((ServerModels.RegisterGameRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceDataRequest)) { if (_instance.OnServerSetGameServerInstanceDataRequestEvent != null) { _instance.OnServerSetGameServerInstanceDataRequestEvent((ServerModels.SetGameServerInstanceDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceStateRequest)) { if (_instance.OnServerSetGameServerInstanceStateRequestEvent != null) { _instance.OnServerSetGameServerInstanceStateRequestEvent((ServerModels.SetGameServerInstanceStateRequest)e.Request); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceTagsRequest)) { if (_instance.OnServerSetGameServerInstanceTagsRequestEvent != null) { _instance.OnServerSetGameServerInstanceTagsRequestEvent((ServerModels.SetGameServerInstanceTagsRequest)e.Request); return; } } - if (type == typeof(ServerModels.AwardSteamAchievementRequest)) { if (_instance.OnServerAwardSteamAchievementRequestEvent != null) { _instance.OnServerAwardSteamAchievementRequestEvent((ServerModels.AwardSteamAchievementRequest)e.Request); return; } } - if (type == typeof(ServerModels.LogEventRequest)) { if (_instance.OnServerLogEventRequestEvent != null) { _instance.OnServerLogEventRequestEvent((ServerModels.LogEventRequest)e.Request); return; } } - if (type == typeof(ServerModels.WriteServerCharacterEventRequest)) { if (_instance.OnServerWriteCharacterEventRequestEvent != null) { _instance.OnServerWriteCharacterEventRequestEvent((ServerModels.WriteServerCharacterEventRequest)e.Request); return; } } - if (type == typeof(ServerModels.WriteServerPlayerEventRequest)) { if (_instance.OnServerWritePlayerEventRequestEvent != null) { _instance.OnServerWritePlayerEventRequestEvent((ServerModels.WriteServerPlayerEventRequest)e.Request); return; } } - if (type == typeof(ServerModels.WriteTitleEventRequest)) { if (_instance.OnServerWriteTitleEventRequestEvent != null) { _instance.OnServerWriteTitleEventRequestEvent((ServerModels.WriteTitleEventRequest)e.Request); return; } } - if (type == typeof(ServerModels.AddSharedGroupMembersRequest)) { if (_instance.OnServerAddSharedGroupMembersRequestEvent != null) { _instance.OnServerAddSharedGroupMembersRequestEvent((ServerModels.AddSharedGroupMembersRequest)e.Request); return; } } - if (type == typeof(ServerModels.CreateSharedGroupRequest)) { if (_instance.OnServerCreateSharedGroupRequestEvent != null) { _instance.OnServerCreateSharedGroupRequestEvent((ServerModels.CreateSharedGroupRequest)e.Request); return; } } - if (type == typeof(ServerModels.DeleteSharedGroupRequest)) { if (_instance.OnServerDeleteSharedGroupRequestEvent != null) { _instance.OnServerDeleteSharedGroupRequestEvent((ServerModels.DeleteSharedGroupRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetSharedGroupDataRequest)) { if (_instance.OnServerGetSharedGroupDataRequestEvent != null) { _instance.OnServerGetSharedGroupDataRequestEvent((ServerModels.GetSharedGroupDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.RemoveSharedGroupMembersRequest)) { if (_instance.OnServerRemoveSharedGroupMembersRequestEvent != null) { _instance.OnServerRemoveSharedGroupMembersRequestEvent((ServerModels.RemoveSharedGroupMembersRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateSharedGroupDataRequest)) { if (_instance.OnServerUpdateSharedGroupDataRequestEvent != null) { _instance.OnServerUpdateSharedGroupDataRequestEvent((ServerModels.UpdateSharedGroupDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.ExecuteCloudScriptServerRequest)) { if (_instance.OnServerExecuteCloudScriptRequestEvent != null) { _instance.OnServerExecuteCloudScriptRequestEvent((ServerModels.ExecuteCloudScriptServerRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetContentDownloadUrlRequest)) { if (_instance.OnServerGetContentDownloadUrlRequestEvent != null) { _instance.OnServerGetContentDownloadUrlRequestEvent((ServerModels.GetContentDownloadUrlRequest)e.Request); return; } } - if (type == typeof(ServerModels.DeleteCharacterFromUserRequest)) { if (_instance.OnServerDeleteCharacterFromUserRequestEvent != null) { _instance.OnServerDeleteCharacterFromUserRequestEvent((ServerModels.DeleteCharacterFromUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.ListUsersCharactersRequest)) { if (_instance.OnServerGetAllUsersCharactersRequestEvent != null) { _instance.OnServerGetAllUsersCharactersRequestEvent((ServerModels.ListUsersCharactersRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterLeaderboardRequest)) { if (_instance.OnServerGetCharacterLeaderboardRequestEvent != null) { _instance.OnServerGetCharacterLeaderboardRequestEvent((ServerModels.GetCharacterLeaderboardRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterStatisticsRequest)) { if (_instance.OnServerGetCharacterStatisticsRequestEvent != null) { _instance.OnServerGetCharacterStatisticsRequestEvent((ServerModels.GetCharacterStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetLeaderboardAroundCharacterRequest)) { if (_instance.OnServerGetLeaderboardAroundCharacterRequestEvent != null) { _instance.OnServerGetLeaderboardAroundCharacterRequestEvent((ServerModels.GetLeaderboardAroundCharacterRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetLeaderboardForUsersCharactersRequest)) { if (_instance.OnServerGetLeaderboardForUserCharactersRequestEvent != null) { _instance.OnServerGetLeaderboardForUserCharactersRequestEvent((ServerModels.GetLeaderboardForUsersCharactersRequest)e.Request); return; } } - if (type == typeof(ServerModels.GrantCharacterToUserRequest)) { if (_instance.OnServerGrantCharacterToUserRequestEvent != null) { _instance.OnServerGrantCharacterToUserRequestEvent((ServerModels.GrantCharacterToUserRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateCharacterStatisticsRequest)) { if (_instance.OnServerUpdateCharacterStatisticsRequestEvent != null) { _instance.OnServerUpdateCharacterStatisticsRequestEvent((ServerModels.UpdateCharacterStatisticsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterDataRequest)) { if (_instance.OnServerGetCharacterDataRequestEvent != null) { _instance.OnServerGetCharacterDataRequestEvent((ServerModels.GetCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterDataRequest)) { if (_instance.OnServerGetCharacterInternalDataRequestEvent != null) { _instance.OnServerGetCharacterInternalDataRequestEvent((ServerModels.GetCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetCharacterDataRequest)) { if (_instance.OnServerGetCharacterReadOnlyDataRequestEvent != null) { _instance.OnServerGetCharacterReadOnlyDataRequestEvent((ServerModels.GetCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataRequest)) { if (_instance.OnServerUpdateCharacterDataRequestEvent != null) { _instance.OnServerUpdateCharacterDataRequestEvent((ServerModels.UpdateCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataRequest)) { if (_instance.OnServerUpdateCharacterInternalDataRequestEvent != null) { _instance.OnServerUpdateCharacterInternalDataRequestEvent((ServerModels.UpdateCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataRequest)) { if (_instance.OnServerUpdateCharacterReadOnlyDataRequestEvent != null) { _instance.OnServerUpdateCharacterReadOnlyDataRequestEvent((ServerModels.UpdateCharacterDataRequest)e.Request); return; } } - if (type == typeof(ServerModels.AddPlayerTagRequest)) { if (_instance.OnServerAddPlayerTagRequestEvent != null) { _instance.OnServerAddPlayerTagRequestEvent((ServerModels.AddPlayerTagRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetAllActionGroupsRequest)) { if (_instance.OnServerGetAllActionGroupsRequestEvent != null) { _instance.OnServerGetAllActionGroupsRequestEvent((ServerModels.GetAllActionGroupsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetAllSegmentsRequest)) { if (_instance.OnServerGetAllSegmentsRequestEvent != null) { _instance.OnServerGetAllSegmentsRequestEvent((ServerModels.GetAllSegmentsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayersSegmentsRequest)) { if (_instance.OnServerGetPlayerSegmentsRequestEvent != null) { _instance.OnServerGetPlayerSegmentsRequestEvent((ServerModels.GetPlayersSegmentsRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayersInSegmentRequest)) { if (_instance.OnServerGetPlayersInSegmentRequestEvent != null) { _instance.OnServerGetPlayersInSegmentRequestEvent((ServerModels.GetPlayersInSegmentRequest)e.Request); return; } } - if (type == typeof(ServerModels.GetPlayerTagsRequest)) { if (_instance.OnServerGetPlayerTagsRequestEvent != null) { _instance.OnServerGetPlayerTagsRequestEvent((ServerModels.GetPlayerTagsRequest)e.Request); return; } } - if (type == typeof(ServerModels.RemovePlayerTagRequest)) { if (_instance.OnServerRemovePlayerTagRequestEvent != null) { _instance.OnServerRemovePlayerTagRequestEvent((ServerModels.RemovePlayerTagRequest)e.Request); return; } } -#endif -#if !DISABLE_PLAYFABCLIENT_API - if (type == typeof(ClientModels.GetPhotonAuthenticationTokenRequest)) { if (_instance.OnGetPhotonAuthenticationTokenRequestEvent != null) { _instance.OnGetPhotonAuthenticationTokenRequestEvent((ClientModels.GetPhotonAuthenticationTokenRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithAndroidDeviceIDRequest)) { if (_instance.OnLoginWithAndroidDeviceIDRequestEvent != null) { _instance.OnLoginWithAndroidDeviceIDRequestEvent((ClientModels.LoginWithAndroidDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithCustomIDRequest)) { if (_instance.OnLoginWithCustomIDRequestEvent != null) { _instance.OnLoginWithCustomIDRequestEvent((ClientModels.LoginWithCustomIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithEmailAddressRequest)) { if (_instance.OnLoginWithEmailAddressRequestEvent != null) { _instance.OnLoginWithEmailAddressRequestEvent((ClientModels.LoginWithEmailAddressRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithFacebookRequest)) { if (_instance.OnLoginWithFacebookRequestEvent != null) { _instance.OnLoginWithFacebookRequestEvent((ClientModels.LoginWithFacebookRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithGameCenterRequest)) { if (_instance.OnLoginWithGameCenterRequestEvent != null) { _instance.OnLoginWithGameCenterRequestEvent((ClientModels.LoginWithGameCenterRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithGoogleAccountRequest)) { if (_instance.OnLoginWithGoogleAccountRequestEvent != null) { _instance.OnLoginWithGoogleAccountRequestEvent((ClientModels.LoginWithGoogleAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithIOSDeviceIDRequest)) { if (_instance.OnLoginWithIOSDeviceIDRequestEvent != null) { _instance.OnLoginWithIOSDeviceIDRequestEvent((ClientModels.LoginWithIOSDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithKongregateRequest)) { if (_instance.OnLoginWithKongregateRequestEvent != null) { _instance.OnLoginWithKongregateRequestEvent((ClientModels.LoginWithKongregateRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithPlayFabRequest)) { if (_instance.OnLoginWithPlayFabRequestEvent != null) { _instance.OnLoginWithPlayFabRequestEvent((ClientModels.LoginWithPlayFabRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithSteamRequest)) { if (_instance.OnLoginWithSteamRequestEvent != null) { _instance.OnLoginWithSteamRequestEvent((ClientModels.LoginWithSteamRequest)e.Request); return; } } - if (type == typeof(ClientModels.LoginWithTwitchRequest)) { if (_instance.OnLoginWithTwitchRequestEvent != null) { _instance.OnLoginWithTwitchRequestEvent((ClientModels.LoginWithTwitchRequest)e.Request); return; } } - if (type == typeof(ClientModels.RegisterPlayFabUserRequest)) { if (_instance.OnRegisterPlayFabUserRequestEvent != null) { _instance.OnRegisterPlayFabUserRequestEvent((ClientModels.RegisterPlayFabUserRequest)e.Request); return; } } - if (type == typeof(ClientModels.AddGenericIDRequest)) { if (_instance.OnAddGenericIDRequestEvent != null) { _instance.OnAddGenericIDRequestEvent((ClientModels.AddGenericIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.AddUsernamePasswordRequest)) { if (_instance.OnAddUsernamePasswordRequestEvent != null) { _instance.OnAddUsernamePasswordRequestEvent((ClientModels.AddUsernamePasswordRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetAccountInfoRequest)) { if (_instance.OnGetAccountInfoRequestEvent != null) { _instance.OnGetAccountInfoRequestEvent((ClientModels.GetAccountInfoRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerCombinedInfoRequest)) { if (_instance.OnGetPlayerCombinedInfoRequestEvent != null) { _instance.OnGetPlayerCombinedInfoRequestEvent((ClientModels.GetPlayerCombinedInfoRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromFacebookIDsRequest)) { if (_instance.OnGetPlayFabIDsFromFacebookIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromFacebookIDsRequestEvent((ClientModels.GetPlayFabIDsFromFacebookIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGameCenterIDsRequest)) { if (_instance.OnGetPlayFabIDsFromGameCenterIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromGameCenterIDsRequestEvent((ClientModels.GetPlayFabIDsFromGameCenterIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGenericIDsRequest)) { if (_instance.OnGetPlayFabIDsFromGenericIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromGenericIDsRequestEvent((ClientModels.GetPlayFabIDsFromGenericIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGoogleIDsRequest)) { if (_instance.OnGetPlayFabIDsFromGoogleIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromGoogleIDsRequestEvent((ClientModels.GetPlayFabIDsFromGoogleIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromKongregateIDsRequest)) { if (_instance.OnGetPlayFabIDsFromKongregateIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromKongregateIDsRequestEvent((ClientModels.GetPlayFabIDsFromKongregateIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromSteamIDsRequest)) { if (_instance.OnGetPlayFabIDsFromSteamIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromSteamIDsRequestEvent((ClientModels.GetPlayFabIDsFromSteamIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromTwitchIDsRequest)) { if (_instance.OnGetPlayFabIDsFromTwitchIDsRequestEvent != null) { _instance.OnGetPlayFabIDsFromTwitchIDsRequestEvent((ClientModels.GetPlayFabIDsFromTwitchIDsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserCombinedInfoRequest)) { if (_instance.OnGetUserCombinedInfoRequestEvent != null) { _instance.OnGetUserCombinedInfoRequestEvent((ClientModels.GetUserCombinedInfoRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkAndroidDeviceIDRequest)) { if (_instance.OnLinkAndroidDeviceIDRequestEvent != null) { _instance.OnLinkAndroidDeviceIDRequestEvent((ClientModels.LinkAndroidDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkCustomIDRequest)) { if (_instance.OnLinkCustomIDRequestEvent != null) { _instance.OnLinkCustomIDRequestEvent((ClientModels.LinkCustomIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkFacebookAccountRequest)) { if (_instance.OnLinkFacebookAccountRequestEvent != null) { _instance.OnLinkFacebookAccountRequestEvent((ClientModels.LinkFacebookAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkGameCenterAccountRequest)) { if (_instance.OnLinkGameCenterAccountRequestEvent != null) { _instance.OnLinkGameCenterAccountRequestEvent((ClientModels.LinkGameCenterAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkGoogleAccountRequest)) { if (_instance.OnLinkGoogleAccountRequestEvent != null) { _instance.OnLinkGoogleAccountRequestEvent((ClientModels.LinkGoogleAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkIOSDeviceIDRequest)) { if (_instance.OnLinkIOSDeviceIDRequestEvent != null) { _instance.OnLinkIOSDeviceIDRequestEvent((ClientModels.LinkIOSDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkKongregateAccountRequest)) { if (_instance.OnLinkKongregateRequestEvent != null) { _instance.OnLinkKongregateRequestEvent((ClientModels.LinkKongregateAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkSteamAccountRequest)) { if (_instance.OnLinkSteamAccountRequestEvent != null) { _instance.OnLinkSteamAccountRequestEvent((ClientModels.LinkSteamAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.LinkTwitchAccountRequest)) { if (_instance.OnLinkTwitchRequestEvent != null) { _instance.OnLinkTwitchRequestEvent((ClientModels.LinkTwitchAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.RemoveGenericIDRequest)) { if (_instance.OnRemoveGenericIDRequestEvent != null) { _instance.OnRemoveGenericIDRequestEvent((ClientModels.RemoveGenericIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.ReportPlayerClientRequest)) { if (_instance.OnReportPlayerRequestEvent != null) { _instance.OnReportPlayerRequestEvent((ClientModels.ReportPlayerClientRequest)e.Request); return; } } - if (type == typeof(ClientModels.SendAccountRecoveryEmailRequest)) { if (_instance.OnSendAccountRecoveryEmailRequestEvent != null) { _instance.OnSendAccountRecoveryEmailRequestEvent((ClientModels.SendAccountRecoveryEmailRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkAndroidDeviceIDRequest)) { if (_instance.OnUnlinkAndroidDeviceIDRequestEvent != null) { _instance.OnUnlinkAndroidDeviceIDRequestEvent((ClientModels.UnlinkAndroidDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkCustomIDRequest)) { if (_instance.OnUnlinkCustomIDRequestEvent != null) { _instance.OnUnlinkCustomIDRequestEvent((ClientModels.UnlinkCustomIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkFacebookAccountRequest)) { if (_instance.OnUnlinkFacebookAccountRequestEvent != null) { _instance.OnUnlinkFacebookAccountRequestEvent((ClientModels.UnlinkFacebookAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkGameCenterAccountRequest)) { if (_instance.OnUnlinkGameCenterAccountRequestEvent != null) { _instance.OnUnlinkGameCenterAccountRequestEvent((ClientModels.UnlinkGameCenterAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkGoogleAccountRequest)) { if (_instance.OnUnlinkGoogleAccountRequestEvent != null) { _instance.OnUnlinkGoogleAccountRequestEvent((ClientModels.UnlinkGoogleAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkIOSDeviceIDRequest)) { if (_instance.OnUnlinkIOSDeviceIDRequestEvent != null) { _instance.OnUnlinkIOSDeviceIDRequestEvent((ClientModels.UnlinkIOSDeviceIDRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkKongregateAccountRequest)) { if (_instance.OnUnlinkKongregateRequestEvent != null) { _instance.OnUnlinkKongregateRequestEvent((ClientModels.UnlinkKongregateAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkSteamAccountRequest)) { if (_instance.OnUnlinkSteamAccountRequestEvent != null) { _instance.OnUnlinkSteamAccountRequestEvent((ClientModels.UnlinkSteamAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlinkTwitchAccountRequest)) { if (_instance.OnUnlinkTwitchRequestEvent != null) { _instance.OnUnlinkTwitchRequestEvent((ClientModels.UnlinkTwitchAccountRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateUserTitleDisplayNameRequest)) { if (_instance.OnUpdateUserTitleDisplayNameRequestEvent != null) { _instance.OnUpdateUserTitleDisplayNameRequestEvent((ClientModels.UpdateUserTitleDisplayNameRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetFriendLeaderboardRequest)) { if (_instance.OnGetFriendLeaderboardRequestEvent != null) { _instance.OnGetFriendLeaderboardRequestEvent((ClientModels.GetFriendLeaderboardRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetFriendLeaderboardAroundCurrentUserRequest)) { if (_instance.OnGetFriendLeaderboardAroundCurrentUserRequestEvent != null) { _instance.OnGetFriendLeaderboardAroundCurrentUserRequestEvent((ClientModels.GetFriendLeaderboardAroundCurrentUserRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetFriendLeaderboardAroundPlayerRequest)) { if (_instance.OnGetFriendLeaderboardAroundPlayerRequestEvent != null) { _instance.OnGetFriendLeaderboardAroundPlayerRequestEvent((ClientModels.GetFriendLeaderboardAroundPlayerRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetLeaderboardRequest)) { if (_instance.OnGetLeaderboardRequestEvent != null) { _instance.OnGetLeaderboardRequestEvent((ClientModels.GetLeaderboardRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundCurrentUserRequest)) { if (_instance.OnGetLeaderboardAroundCurrentUserRequestEvent != null) { _instance.OnGetLeaderboardAroundCurrentUserRequestEvent((ClientModels.GetLeaderboardAroundCurrentUserRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundPlayerRequest)) { if (_instance.OnGetLeaderboardAroundPlayerRequestEvent != null) { _instance.OnGetLeaderboardAroundPlayerRequestEvent((ClientModels.GetLeaderboardAroundPlayerRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerStatisticsRequest)) { if (_instance.OnGetPlayerStatisticsRequestEvent != null) { _instance.OnGetPlayerStatisticsRequestEvent((ClientModels.GetPlayerStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerStatisticVersionsRequest)) { if (_instance.OnGetPlayerStatisticVersionsRequestEvent != null) { _instance.OnGetPlayerStatisticVersionsRequestEvent((ClientModels.GetPlayerStatisticVersionsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserDataRequest)) { if (_instance.OnGetUserDataRequestEvent != null) { _instance.OnGetUserDataRequestEvent((ClientModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserDataRequest)) { if (_instance.OnGetUserPublisherDataRequestEvent != null) { _instance.OnGetUserPublisherDataRequestEvent((ClientModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserDataRequest)) { if (_instance.OnGetUserPublisherReadOnlyDataRequestEvent != null) { _instance.OnGetUserPublisherReadOnlyDataRequestEvent((ClientModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserDataRequest)) { if (_instance.OnGetUserReadOnlyDataRequestEvent != null) { _instance.OnGetUserReadOnlyDataRequestEvent((ClientModels.GetUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserStatisticsRequest)) { if (_instance.OnGetUserStatisticsRequestEvent != null) { _instance.OnGetUserStatisticsRequestEvent((ClientModels.GetUserStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdatePlayerStatisticsRequest)) { if (_instance.OnUpdatePlayerStatisticsRequestEvent != null) { _instance.OnUpdatePlayerStatisticsRequestEvent((ClientModels.UpdatePlayerStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateUserDataRequest)) { if (_instance.OnUpdateUserDataRequestEvent != null) { _instance.OnUpdateUserDataRequestEvent((ClientModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateUserDataRequest)) { if (_instance.OnUpdateUserPublisherDataRequestEvent != null) { _instance.OnUpdateUserPublisherDataRequestEvent((ClientModels.UpdateUserDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateUserStatisticsRequest)) { if (_instance.OnUpdateUserStatisticsRequestEvent != null) { _instance.OnUpdateUserStatisticsRequestEvent((ClientModels.UpdateUserStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCatalogItemsRequest)) { if (_instance.OnGetCatalogItemsRequestEvent != null) { _instance.OnGetCatalogItemsRequestEvent((ClientModels.GetCatalogItemsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPublisherDataRequest)) { if (_instance.OnGetPublisherDataRequestEvent != null) { _instance.OnGetPublisherDataRequestEvent((ClientModels.GetPublisherDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetStoreItemsRequest)) { if (_instance.OnGetStoreItemsRequestEvent != null) { _instance.OnGetStoreItemsRequestEvent((ClientModels.GetStoreItemsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetTimeRequest)) { if (_instance.OnGetTimeRequestEvent != null) { _instance.OnGetTimeRequestEvent((ClientModels.GetTimeRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetTitleDataRequest)) { if (_instance.OnGetTitleDataRequestEvent != null) { _instance.OnGetTitleDataRequestEvent((ClientModels.GetTitleDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetTitleNewsRequest)) { if (_instance.OnGetTitleNewsRequestEvent != null) { _instance.OnGetTitleNewsRequestEvent((ClientModels.GetTitleNewsRequest)e.Request); return; } } - if (type == typeof(ClientModels.AddUserVirtualCurrencyRequest)) { if (_instance.OnAddUserVirtualCurrencyRequestEvent != null) { _instance.OnAddUserVirtualCurrencyRequestEvent((ClientModels.AddUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ClientModels.ConfirmPurchaseRequest)) { if (_instance.OnConfirmPurchaseRequestEvent != null) { _instance.OnConfirmPurchaseRequestEvent((ClientModels.ConfirmPurchaseRequest)e.Request); return; } } - if (type == typeof(ClientModels.ConsumeItemRequest)) { if (_instance.OnConsumeItemRequestEvent != null) { _instance.OnConsumeItemRequestEvent((ClientModels.ConsumeItemRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCharacterInventoryRequest)) { if (_instance.OnGetCharacterInventoryRequestEvent != null) { _instance.OnGetCharacterInventoryRequestEvent((ClientModels.GetCharacterInventoryRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPurchaseRequest)) { if (_instance.OnGetPurchaseRequestEvent != null) { _instance.OnGetPurchaseRequestEvent((ClientModels.GetPurchaseRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetUserInventoryRequest)) { if (_instance.OnGetUserInventoryRequestEvent != null) { _instance.OnGetUserInventoryRequestEvent((ClientModels.GetUserInventoryRequest)e.Request); return; } } - if (type == typeof(ClientModels.PayForPurchaseRequest)) { if (_instance.OnPayForPurchaseRequestEvent != null) { _instance.OnPayForPurchaseRequestEvent((ClientModels.PayForPurchaseRequest)e.Request); return; } } - if (type == typeof(ClientModels.PurchaseItemRequest)) { if (_instance.OnPurchaseItemRequestEvent != null) { _instance.OnPurchaseItemRequestEvent((ClientModels.PurchaseItemRequest)e.Request); return; } } - if (type == typeof(ClientModels.RedeemCouponRequest)) { if (_instance.OnRedeemCouponRequestEvent != null) { _instance.OnRedeemCouponRequestEvent((ClientModels.RedeemCouponRequest)e.Request); return; } } - if (type == typeof(ClientModels.StartPurchaseRequest)) { if (_instance.OnStartPurchaseRequestEvent != null) { _instance.OnStartPurchaseRequestEvent((ClientModels.StartPurchaseRequest)e.Request); return; } } - if (type == typeof(ClientModels.SubtractUserVirtualCurrencyRequest)) { if (_instance.OnSubtractUserVirtualCurrencyRequestEvent != null) { _instance.OnSubtractUserVirtualCurrencyRequestEvent((ClientModels.SubtractUserVirtualCurrencyRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlockContainerInstanceRequest)) { if (_instance.OnUnlockContainerInstanceRequestEvent != null) { _instance.OnUnlockContainerInstanceRequestEvent((ClientModels.UnlockContainerInstanceRequest)e.Request); return; } } - if (type == typeof(ClientModels.UnlockContainerItemRequest)) { if (_instance.OnUnlockContainerItemRequestEvent != null) { _instance.OnUnlockContainerItemRequestEvent((ClientModels.UnlockContainerItemRequest)e.Request); return; } } - if (type == typeof(ClientModels.AddFriendRequest)) { if (_instance.OnAddFriendRequestEvent != null) { _instance.OnAddFriendRequestEvent((ClientModels.AddFriendRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetFriendsListRequest)) { if (_instance.OnGetFriendsListRequestEvent != null) { _instance.OnGetFriendsListRequestEvent((ClientModels.GetFriendsListRequest)e.Request); return; } } - if (type == typeof(ClientModels.RemoveFriendRequest)) { if (_instance.OnRemoveFriendRequestEvent != null) { _instance.OnRemoveFriendRequestEvent((ClientModels.RemoveFriendRequest)e.Request); return; } } - if (type == typeof(ClientModels.SetFriendTagsRequest)) { if (_instance.OnSetFriendTagsRequestEvent != null) { _instance.OnSetFriendTagsRequestEvent((ClientModels.SetFriendTagsRequest)e.Request); return; } } - if (type == typeof(ClientModels.RegisterForIOSPushNotificationRequest)) { if (_instance.OnRegisterForIOSPushNotificationRequestEvent != null) { _instance.OnRegisterForIOSPushNotificationRequestEvent((ClientModels.RegisterForIOSPushNotificationRequest)e.Request); return; } } - if (type == typeof(ClientModels.RestoreIOSPurchasesRequest)) { if (_instance.OnRestoreIOSPurchasesRequestEvent != null) { _instance.OnRestoreIOSPurchasesRequestEvent((ClientModels.RestoreIOSPurchasesRequest)e.Request); return; } } - if (type == typeof(ClientModels.ValidateIOSReceiptRequest)) { if (_instance.OnValidateIOSReceiptRequestEvent != null) { _instance.OnValidateIOSReceiptRequestEvent((ClientModels.ValidateIOSReceiptRequest)e.Request); return; } } - if (type == typeof(ClientModels.CurrentGamesRequest)) { if (_instance.OnGetCurrentGamesRequestEvent != null) { _instance.OnGetCurrentGamesRequestEvent((ClientModels.CurrentGamesRequest)e.Request); return; } } - if (type == typeof(ClientModels.GameServerRegionsRequest)) { if (_instance.OnGetGameServerRegionsRequestEvent != null) { _instance.OnGetGameServerRegionsRequestEvent((ClientModels.GameServerRegionsRequest)e.Request); return; } } - if (type == typeof(ClientModels.MatchmakeRequest)) { if (_instance.OnMatchmakeRequestEvent != null) { _instance.OnMatchmakeRequestEvent((ClientModels.MatchmakeRequest)e.Request); return; } } - if (type == typeof(ClientModels.StartGameRequest)) { if (_instance.OnStartGameRequestEvent != null) { _instance.OnStartGameRequestEvent((ClientModels.StartGameRequest)e.Request); return; } } - if (type == typeof(ClientModels.AndroidDevicePushNotificationRegistrationRequest)) { if (_instance.OnAndroidDevicePushNotificationRegistrationRequestEvent != null) { _instance.OnAndroidDevicePushNotificationRegistrationRequestEvent((ClientModels.AndroidDevicePushNotificationRegistrationRequest)e.Request); return; } } - if (type == typeof(ClientModels.ValidateGooglePlayPurchaseRequest)) { if (_instance.OnValidateGooglePlayPurchaseRequestEvent != null) { _instance.OnValidateGooglePlayPurchaseRequestEvent((ClientModels.ValidateGooglePlayPurchaseRequest)e.Request); return; } } - if (type == typeof(ClientModels.LogEventRequest)) { if (_instance.OnLogEventRequestEvent != null) { _instance.OnLogEventRequestEvent((ClientModels.LogEventRequest)e.Request); return; } } - if (type == typeof(ClientModels.WriteClientCharacterEventRequest)) { if (_instance.OnWriteCharacterEventRequestEvent != null) { _instance.OnWriteCharacterEventRequestEvent((ClientModels.WriteClientCharacterEventRequest)e.Request); return; } } - if (type == typeof(ClientModels.WriteClientPlayerEventRequest)) { if (_instance.OnWritePlayerEventRequestEvent != null) { _instance.OnWritePlayerEventRequestEvent((ClientModels.WriteClientPlayerEventRequest)e.Request); return; } } - if (type == typeof(ClientModels.WriteTitleEventRequest)) { if (_instance.OnWriteTitleEventRequestEvent != null) { _instance.OnWriteTitleEventRequestEvent((ClientModels.WriteTitleEventRequest)e.Request); return; } } - if (type == typeof(ClientModels.AddSharedGroupMembersRequest)) { if (_instance.OnAddSharedGroupMembersRequestEvent != null) { _instance.OnAddSharedGroupMembersRequestEvent((ClientModels.AddSharedGroupMembersRequest)e.Request); return; } } - if (type == typeof(ClientModels.CreateSharedGroupRequest)) { if (_instance.OnCreateSharedGroupRequestEvent != null) { _instance.OnCreateSharedGroupRequestEvent((ClientModels.CreateSharedGroupRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetSharedGroupDataRequest)) { if (_instance.OnGetSharedGroupDataRequestEvent != null) { _instance.OnGetSharedGroupDataRequestEvent((ClientModels.GetSharedGroupDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.RemoveSharedGroupMembersRequest)) { if (_instance.OnRemoveSharedGroupMembersRequestEvent != null) { _instance.OnRemoveSharedGroupMembersRequestEvent((ClientModels.RemoveSharedGroupMembersRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateSharedGroupDataRequest)) { if (_instance.OnUpdateSharedGroupDataRequestEvent != null) { _instance.OnUpdateSharedGroupDataRequestEvent((ClientModels.UpdateSharedGroupDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.ExecuteCloudScriptRequest)) { if (_instance.OnExecuteCloudScriptRequestEvent != null) { _instance.OnExecuteCloudScriptRequestEvent((ClientModels.ExecuteCloudScriptRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCloudScriptUrlRequest)) { if (_instance.OnGetCloudScriptUrlRequestEvent != null) { _instance.OnGetCloudScriptUrlRequestEvent((ClientModels.GetCloudScriptUrlRequest)e.Request); return; } } - if (type == typeof(ClientModels.RunCloudScriptRequest)) { if (_instance.OnRunCloudScriptRequestEvent != null) { _instance.OnRunCloudScriptRequestEvent((ClientModels.RunCloudScriptRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetContentDownloadUrlRequest)) { if (_instance.OnGetContentDownloadUrlRequestEvent != null) { _instance.OnGetContentDownloadUrlRequestEvent((ClientModels.GetContentDownloadUrlRequest)e.Request); return; } } - if (type == typeof(ClientModels.ListUsersCharactersRequest)) { if (_instance.OnGetAllUsersCharactersRequestEvent != null) { _instance.OnGetAllUsersCharactersRequestEvent((ClientModels.ListUsersCharactersRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCharacterLeaderboardRequest)) { if (_instance.OnGetCharacterLeaderboardRequestEvent != null) { _instance.OnGetCharacterLeaderboardRequestEvent((ClientModels.GetCharacterLeaderboardRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCharacterStatisticsRequest)) { if (_instance.OnGetCharacterStatisticsRequestEvent != null) { _instance.OnGetCharacterStatisticsRequestEvent((ClientModels.GetCharacterStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundCharacterRequest)) { if (_instance.OnGetLeaderboardAroundCharacterRequestEvent != null) { _instance.OnGetLeaderboardAroundCharacterRequestEvent((ClientModels.GetLeaderboardAroundCharacterRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetLeaderboardForUsersCharactersRequest)) { if (_instance.OnGetLeaderboardForUserCharactersRequestEvent != null) { _instance.OnGetLeaderboardForUserCharactersRequestEvent((ClientModels.GetLeaderboardForUsersCharactersRequest)e.Request); return; } } - if (type == typeof(ClientModels.GrantCharacterToUserRequest)) { if (_instance.OnGrantCharacterToUserRequestEvent != null) { _instance.OnGrantCharacterToUserRequestEvent((ClientModels.GrantCharacterToUserRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateCharacterStatisticsRequest)) { if (_instance.OnUpdateCharacterStatisticsRequestEvent != null) { _instance.OnUpdateCharacterStatisticsRequestEvent((ClientModels.UpdateCharacterStatisticsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCharacterDataRequest)) { if (_instance.OnGetCharacterDataRequestEvent != null) { _instance.OnGetCharacterDataRequestEvent((ClientModels.GetCharacterDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetCharacterDataRequest)) { if (_instance.OnGetCharacterReadOnlyDataRequestEvent != null) { _instance.OnGetCharacterReadOnlyDataRequestEvent((ClientModels.GetCharacterDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.UpdateCharacterDataRequest)) { if (_instance.OnUpdateCharacterDataRequestEvent != null) { _instance.OnUpdateCharacterDataRequestEvent((ClientModels.UpdateCharacterDataRequest)e.Request); return; } } - if (type == typeof(ClientModels.ValidateAmazonReceiptRequest)) { if (_instance.OnValidateAmazonIAPReceiptRequestEvent != null) { _instance.OnValidateAmazonIAPReceiptRequestEvent((ClientModels.ValidateAmazonReceiptRequest)e.Request); return; } } - if (type == typeof(ClientModels.AcceptTradeRequest)) { if (_instance.OnAcceptTradeRequestEvent != null) { _instance.OnAcceptTradeRequestEvent((ClientModels.AcceptTradeRequest)e.Request); return; } } - if (type == typeof(ClientModels.CancelTradeRequest)) { if (_instance.OnCancelTradeRequestEvent != null) { _instance.OnCancelTradeRequestEvent((ClientModels.CancelTradeRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerTradesRequest)) { if (_instance.OnGetPlayerTradesRequestEvent != null) { _instance.OnGetPlayerTradesRequestEvent((ClientModels.GetPlayerTradesRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetTradeStatusRequest)) { if (_instance.OnGetTradeStatusRequestEvent != null) { _instance.OnGetTradeStatusRequestEvent((ClientModels.GetTradeStatusRequest)e.Request); return; } } - if (type == typeof(ClientModels.OpenTradeRequest)) { if (_instance.OnOpenTradeRequestEvent != null) { _instance.OnOpenTradeRequestEvent((ClientModels.OpenTradeRequest)e.Request); return; } } - if (type == typeof(ClientModels.AttributeInstallRequest)) { if (_instance.OnAttributeInstallRequestEvent != null) { _instance.OnAttributeInstallRequestEvent((ClientModels.AttributeInstallRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerSegmentsRequest)) { if (_instance.OnGetPlayerSegmentsRequestEvent != null) { _instance.OnGetPlayerSegmentsRequestEvent((ClientModels.GetPlayerSegmentsRequest)e.Request); return; } } - if (type == typeof(ClientModels.GetPlayerTagsRequest)) { if (_instance.OnGetPlayerTagsRequestEvent != null) { _instance.OnGetPlayerTagsRequestEvent((ClientModels.GetPlayerTagsRequest)e.Request); return; } } -#endif - - } - else - { - var type = e.Result.GetType(); -#if ENABLE_PLAYFABADMIN_API - - if (type == typeof(AdminModels.BanUsersResult)) { if (_instance.OnAdminBanUsersResultEvent != null) { _instance.OnAdminBanUsersResultEvent((AdminModels.BanUsersResult)e.Result); return; } } - if (type == typeof(AdminModels.LookupUserAccountInfoResult)) { if (_instance.OnAdminGetUserAccountInfoResultEvent != null) { _instance.OnAdminGetUserAccountInfoResultEvent((AdminModels.LookupUserAccountInfoResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserBansResult)) { if (_instance.OnAdminGetUserBansResultEvent != null) { _instance.OnAdminGetUserBansResultEvent((AdminModels.GetUserBansResult)e.Result); return; } } - if (type == typeof(AdminModels.BlankResult)) { if (_instance.OnAdminResetUsersResultEvent != null) { _instance.OnAdminResetUsersResultEvent((AdminModels.BlankResult)e.Result); return; } } - if (type == typeof(AdminModels.RevokeAllBansForUserResult)) { if (_instance.OnAdminRevokeAllBansForUserResultEvent != null) { _instance.OnAdminRevokeAllBansForUserResultEvent((AdminModels.RevokeAllBansForUserResult)e.Result); return; } } - if (type == typeof(AdminModels.RevokeBansResult)) { if (_instance.OnAdminRevokeBansResultEvent != null) { _instance.OnAdminRevokeBansResultEvent((AdminModels.RevokeBansResult)e.Result); return; } } - if (type == typeof(AdminModels.SendAccountRecoveryEmailResult)) { if (_instance.OnAdminSendAccountRecoveryEmailResultEvent != null) { _instance.OnAdminSendAccountRecoveryEmailResultEvent((AdminModels.SendAccountRecoveryEmailResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateBansResult)) { if (_instance.OnAdminUpdateBansResultEvent != null) { _instance.OnAdminUpdateBansResultEvent((AdminModels.UpdateBansResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserTitleDisplayNameResult)) { if (_instance.OnAdminUpdateUserTitleDisplayNameResultEvent != null) { _instance.OnAdminUpdateUserTitleDisplayNameResultEvent((AdminModels.UpdateUserTitleDisplayNameResult)e.Result); return; } } - if (type == typeof(AdminModels.CreatePlayerStatisticDefinitionResult)) { if (_instance.OnAdminCreatePlayerStatisticDefinitionResultEvent != null) { _instance.OnAdminCreatePlayerStatisticDefinitionResultEvent((AdminModels.CreatePlayerStatisticDefinitionResult)e.Result); return; } } - if (type == typeof(AdminModels.DeleteUsersResult)) { if (_instance.OnAdminDeleteUsersResultEvent != null) { _instance.OnAdminDeleteUsersResultEvent((AdminModels.DeleteUsersResult)e.Result); return; } } - if (type == typeof(AdminModels.GetDataReportResult)) { if (_instance.OnAdminGetDataReportResultEvent != null) { _instance.OnAdminGetDataReportResultEvent((AdminModels.GetDataReportResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPlayerStatisticDefinitionsResult)) { if (_instance.OnAdminGetPlayerStatisticDefinitionsResultEvent != null) { _instance.OnAdminGetPlayerStatisticDefinitionsResultEvent((AdminModels.GetPlayerStatisticDefinitionsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPlayerStatisticVersionsResult)) { if (_instance.OnAdminGetPlayerStatisticVersionsResultEvent != null) { _instance.OnAdminGetPlayerStatisticVersionsResultEvent((AdminModels.GetPlayerStatisticVersionsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserDataResultEvent != null) { _instance.OnAdminGetUserDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserInternalDataResultEvent != null) { _instance.OnAdminGetUserInternalDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserPublisherDataResultEvent != null) { _instance.OnAdminGetUserPublisherDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserPublisherInternalDataResultEvent != null) { _instance.OnAdminGetUserPublisherInternalDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserPublisherReadOnlyDataResultEvent != null) { _instance.OnAdminGetUserPublisherReadOnlyDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserDataResult)) { if (_instance.OnAdminGetUserReadOnlyDataResultEvent != null) { _instance.OnAdminGetUserReadOnlyDataResultEvent((AdminModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.IncrementPlayerStatisticVersionResult)) { if (_instance.OnAdminIncrementPlayerStatisticVersionResultEvent != null) { _instance.OnAdminIncrementPlayerStatisticVersionResultEvent((AdminModels.IncrementPlayerStatisticVersionResult)e.Result); return; } } - if (type == typeof(AdminModels.RefundPurchaseResponse)) { if (_instance.OnAdminRefundPurchaseResultEvent != null) { _instance.OnAdminRefundPurchaseResultEvent((AdminModels.RefundPurchaseResponse)e.Result); return; } } - if (type == typeof(AdminModels.ResetUserStatisticsResult)) { if (_instance.OnAdminResetUserStatisticsResultEvent != null) { _instance.OnAdminResetUserStatisticsResultEvent((AdminModels.ResetUserStatisticsResult)e.Result); return; } } - if (type == typeof(AdminModels.ResolvePurchaseDisputeResponse)) { if (_instance.OnAdminResolvePurchaseDisputeResultEvent != null) { _instance.OnAdminResolvePurchaseDisputeResultEvent((AdminModels.ResolvePurchaseDisputeResponse)e.Result); return; } } - if (type == typeof(AdminModels.UpdatePlayerStatisticDefinitionResult)) { if (_instance.OnAdminUpdatePlayerStatisticDefinitionResultEvent != null) { _instance.OnAdminUpdatePlayerStatisticDefinitionResultEvent((AdminModels.UpdatePlayerStatisticDefinitionResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserDataResultEvent != null) { _instance.OnAdminUpdateUserDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserInternalDataResultEvent != null) { _instance.OnAdminUpdateUserInternalDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserPublisherDataResultEvent != null) { _instance.OnAdminUpdateUserPublisherDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserPublisherInternalDataResultEvent != null) { _instance.OnAdminUpdateUserPublisherInternalDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserPublisherReadOnlyDataResultEvent != null) { _instance.OnAdminUpdateUserPublisherReadOnlyDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateUserDataResult)) { if (_instance.OnAdminUpdateUserReadOnlyDataResultEvent != null) { _instance.OnAdminUpdateUserReadOnlyDataResultEvent((AdminModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(AdminModels.AddNewsResult)) { if (_instance.OnAdminAddNewsResultEvent != null) { _instance.OnAdminAddNewsResultEvent((AdminModels.AddNewsResult)e.Result); return; } } - if (type == typeof(AdminModels.BlankResult)) { if (_instance.OnAdminAddVirtualCurrencyTypesResultEvent != null) { _instance.OnAdminAddVirtualCurrencyTypesResultEvent((AdminModels.BlankResult)e.Result); return; } } - if (type == typeof(AdminModels.DeleteStoreResult)) { if (_instance.OnAdminDeleteStoreResultEvent != null) { _instance.OnAdminDeleteStoreResultEvent((AdminModels.DeleteStoreResult)e.Result); return; } } - if (type == typeof(AdminModels.GetCatalogItemsResult)) { if (_instance.OnAdminGetCatalogItemsResultEvent != null) { _instance.OnAdminGetCatalogItemsResultEvent((AdminModels.GetCatalogItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPublisherDataResult)) { if (_instance.OnAdminGetPublisherDataResultEvent != null) { _instance.OnAdminGetPublisherDataResultEvent((AdminModels.GetPublisherDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetRandomResultTablesResult)) { if (_instance.OnAdminGetRandomResultTablesResultEvent != null) { _instance.OnAdminGetRandomResultTablesResultEvent((AdminModels.GetRandomResultTablesResult)e.Result); return; } } - if (type == typeof(AdminModels.GetStoreItemsResult)) { if (_instance.OnAdminGetStoreItemsResultEvent != null) { _instance.OnAdminGetStoreItemsResultEvent((AdminModels.GetStoreItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetTitleDataResult)) { if (_instance.OnAdminGetTitleDataResultEvent != null) { _instance.OnAdminGetTitleDataResultEvent((AdminModels.GetTitleDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetTitleDataResult)) { if (_instance.OnAdminGetTitleInternalDataResultEvent != null) { _instance.OnAdminGetTitleInternalDataResultEvent((AdminModels.GetTitleDataResult)e.Result); return; } } - if (type == typeof(AdminModels.ListVirtualCurrencyTypesResult)) { if (_instance.OnAdminListVirtualCurrencyTypesResultEvent != null) { _instance.OnAdminListVirtualCurrencyTypesResultEvent((AdminModels.ListVirtualCurrencyTypesResult)e.Result); return; } } - if (type == typeof(AdminModels.BlankResult)) { if (_instance.OnAdminRemoveVirtualCurrencyTypesResultEvent != null) { _instance.OnAdminRemoveVirtualCurrencyTypesResultEvent((AdminModels.BlankResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateCatalogItemsResult)) { if (_instance.OnAdminSetCatalogItemsResultEvent != null) { _instance.OnAdminSetCatalogItemsResultEvent((AdminModels.UpdateCatalogItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateStoreItemsResult)) { if (_instance.OnAdminSetStoreItemsResultEvent != null) { _instance.OnAdminSetStoreItemsResultEvent((AdminModels.UpdateStoreItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.SetTitleDataResult)) { if (_instance.OnAdminSetTitleDataResultEvent != null) { _instance.OnAdminSetTitleDataResultEvent((AdminModels.SetTitleDataResult)e.Result); return; } } - if (type == typeof(AdminModels.SetTitleDataResult)) { if (_instance.OnAdminSetTitleInternalDataResultEvent != null) { _instance.OnAdminSetTitleInternalDataResultEvent((AdminModels.SetTitleDataResult)e.Result); return; } } - if (type == typeof(AdminModels.SetupPushNotificationResult)) { if (_instance.OnAdminSetupPushNotificationResultEvent != null) { _instance.OnAdminSetupPushNotificationResultEvent((AdminModels.SetupPushNotificationResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateCatalogItemsResult)) { if (_instance.OnAdminUpdateCatalogItemsResultEvent != null) { _instance.OnAdminUpdateCatalogItemsResultEvent((AdminModels.UpdateCatalogItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateRandomResultTablesResult)) { if (_instance.OnAdminUpdateRandomResultTablesResultEvent != null) { _instance.OnAdminUpdateRandomResultTablesResultEvent((AdminModels.UpdateRandomResultTablesResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateStoreItemsResult)) { if (_instance.OnAdminUpdateStoreItemsResultEvent != null) { _instance.OnAdminUpdateStoreItemsResultEvent((AdminModels.UpdateStoreItemsResult)e.Result); return; } } - if (type == typeof(AdminModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnAdminAddUserVirtualCurrencyResultEvent != null) { _instance.OnAdminAddUserVirtualCurrencyResultEvent((AdminModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(AdminModels.GetUserInventoryResult)) { if (_instance.OnAdminGetUserInventoryResultEvent != null) { _instance.OnAdminGetUserInventoryResultEvent((AdminModels.GetUserInventoryResult)e.Result); return; } } - if (type == typeof(AdminModels.GrantItemsToUsersResult)) { if (_instance.OnAdminGrantItemsToUsersResultEvent != null) { _instance.OnAdminGrantItemsToUsersResultEvent((AdminModels.GrantItemsToUsersResult)e.Result); return; } } - if (type == typeof(AdminModels.RevokeInventoryResult)) { if (_instance.OnAdminRevokeInventoryItemResultEvent != null) { _instance.OnAdminRevokeInventoryItemResultEvent((AdminModels.RevokeInventoryResult)e.Result); return; } } - if (type == typeof(AdminModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnAdminSubtractUserVirtualCurrencyResultEvent != null) { _instance.OnAdminSubtractUserVirtualCurrencyResultEvent((AdminModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(AdminModels.GetMatchmakerGameInfoResult)) { if (_instance.OnAdminGetMatchmakerGameInfoResultEvent != null) { _instance.OnAdminGetMatchmakerGameInfoResultEvent((AdminModels.GetMatchmakerGameInfoResult)e.Result); return; } } - if (type == typeof(AdminModels.GetMatchmakerGameModesResult)) { if (_instance.OnAdminGetMatchmakerGameModesResultEvent != null) { _instance.OnAdminGetMatchmakerGameModesResultEvent((AdminModels.GetMatchmakerGameModesResult)e.Result); return; } } - if (type == typeof(AdminModels.ModifyMatchmakerGameModesResult)) { if (_instance.OnAdminModifyMatchmakerGameModesResultEvent != null) { _instance.OnAdminModifyMatchmakerGameModesResultEvent((AdminModels.ModifyMatchmakerGameModesResult)e.Result); return; } } - if (type == typeof(AdminModels.AddServerBuildResult)) { if (_instance.OnAdminAddServerBuildResultEvent != null) { _instance.OnAdminAddServerBuildResultEvent((AdminModels.AddServerBuildResult)e.Result); return; } } - if (type == typeof(AdminModels.GetServerBuildInfoResult)) { if (_instance.OnAdminGetServerBuildInfoResultEvent != null) { _instance.OnAdminGetServerBuildInfoResultEvent((AdminModels.GetServerBuildInfoResult)e.Result); return; } } - if (type == typeof(AdminModels.GetServerBuildUploadURLResult)) { if (_instance.OnAdminGetServerBuildUploadUrlResultEvent != null) { _instance.OnAdminGetServerBuildUploadUrlResultEvent((AdminModels.GetServerBuildUploadURLResult)e.Result); return; } } - if (type == typeof(AdminModels.ListBuildsResult)) { if (_instance.OnAdminListServerBuildsResultEvent != null) { _instance.OnAdminListServerBuildsResultEvent((AdminModels.ListBuildsResult)e.Result); return; } } - if (type == typeof(AdminModels.ModifyServerBuildResult)) { if (_instance.OnAdminModifyServerBuildResultEvent != null) { _instance.OnAdminModifyServerBuildResultEvent((AdminModels.ModifyServerBuildResult)e.Result); return; } } - if (type == typeof(AdminModels.RemoveServerBuildResult)) { if (_instance.OnAdminRemoveServerBuildResultEvent != null) { _instance.OnAdminRemoveServerBuildResultEvent((AdminModels.RemoveServerBuildResult)e.Result); return; } } - if (type == typeof(AdminModels.SetPublisherDataResult)) { if (_instance.OnAdminSetPublisherDataResultEvent != null) { _instance.OnAdminSetPublisherDataResultEvent((AdminModels.SetPublisherDataResult)e.Result); return; } } - if (type == typeof(AdminModels.GetCloudScriptRevisionResult)) { if (_instance.OnAdminGetCloudScriptRevisionResultEvent != null) { _instance.OnAdminGetCloudScriptRevisionResultEvent((AdminModels.GetCloudScriptRevisionResult)e.Result); return; } } - if (type == typeof(AdminModels.GetCloudScriptVersionsResult)) { if (_instance.OnAdminGetCloudScriptVersionsResultEvent != null) { _instance.OnAdminGetCloudScriptVersionsResultEvent((AdminModels.GetCloudScriptVersionsResult)e.Result); return; } } - if (type == typeof(AdminModels.SetPublishedRevisionResult)) { if (_instance.OnAdminSetPublishedRevisionResultEvent != null) { _instance.OnAdminSetPublishedRevisionResultEvent((AdminModels.SetPublishedRevisionResult)e.Result); return; } } - if (type == typeof(AdminModels.UpdateCloudScriptResult)) { if (_instance.OnAdminUpdateCloudScriptResultEvent != null) { _instance.OnAdminUpdateCloudScriptResultEvent((AdminModels.UpdateCloudScriptResult)e.Result); return; } } - if (type == typeof(AdminModels.BlankResult)) { if (_instance.OnAdminDeleteContentResultEvent != null) { _instance.OnAdminDeleteContentResultEvent((AdminModels.BlankResult)e.Result); return; } } - if (type == typeof(AdminModels.GetContentListResult)) { if (_instance.OnAdminGetContentListResultEvent != null) { _instance.OnAdminGetContentListResultEvent((AdminModels.GetContentListResult)e.Result); return; } } - if (type == typeof(AdminModels.GetContentUploadUrlResult)) { if (_instance.OnAdminGetContentUploadUrlResultEvent != null) { _instance.OnAdminGetContentUploadUrlResultEvent((AdminModels.GetContentUploadUrlResult)e.Result); return; } } - if (type == typeof(AdminModels.ResetCharacterStatisticsResult)) { if (_instance.OnAdminResetCharacterStatisticsResultEvent != null) { _instance.OnAdminResetCharacterStatisticsResultEvent((AdminModels.ResetCharacterStatisticsResult)e.Result); return; } } - if (type == typeof(AdminModels.AddPlayerTagResult)) { if (_instance.OnAdminAddPlayerTagResultEvent != null) { _instance.OnAdminAddPlayerTagResultEvent((AdminModels.AddPlayerTagResult)e.Result); return; } } - if (type == typeof(AdminModels.GetAllActionGroupsResult)) { if (_instance.OnAdminGetAllActionGroupsResultEvent != null) { _instance.OnAdminGetAllActionGroupsResultEvent((AdminModels.GetAllActionGroupsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetAllSegmentsResult)) { if (_instance.OnAdminGetAllSegmentsResultEvent != null) { _instance.OnAdminGetAllSegmentsResultEvent((AdminModels.GetAllSegmentsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPlayerSegmentsResult)) { if (_instance.OnAdminGetPlayerSegmentsResultEvent != null) { _instance.OnAdminGetPlayerSegmentsResultEvent((AdminModels.GetPlayerSegmentsResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPlayersInSegmentResult)) { if (_instance.OnAdminGetPlayersInSegmentResultEvent != null) { _instance.OnAdminGetPlayersInSegmentResultEvent((AdminModels.GetPlayersInSegmentResult)e.Result); return; } } - if (type == typeof(AdminModels.GetPlayerTagsResult)) { if (_instance.OnAdminGetPlayerTagsResultEvent != null) { _instance.OnAdminGetPlayerTagsResultEvent((AdminModels.GetPlayerTagsResult)e.Result); return; } } - if (type == typeof(AdminModels.RemovePlayerTagResult)) { if (_instance.OnAdminRemovePlayerTagResultEvent != null) { _instance.OnAdminRemovePlayerTagResultEvent((AdminModels.RemovePlayerTagResult)e.Result); return; } } -#endif -#if ENABLE_PLAYFABSERVER_API - - if (type == typeof(MatchmakerModels.AuthUserResponse)) { if (_instance.OnMatchmakerAuthUserResultEvent != null) { _instance.OnMatchmakerAuthUserResultEvent((MatchmakerModels.AuthUserResponse)e.Result); return; } } - if (type == typeof(MatchmakerModels.PlayerJoinedResponse)) { if (_instance.OnMatchmakerPlayerJoinedResultEvent != null) { _instance.OnMatchmakerPlayerJoinedResultEvent((MatchmakerModels.PlayerJoinedResponse)e.Result); return; } } - if (type == typeof(MatchmakerModels.PlayerLeftResponse)) { if (_instance.OnMatchmakerPlayerLeftResultEvent != null) { _instance.OnMatchmakerPlayerLeftResultEvent((MatchmakerModels.PlayerLeftResponse)e.Result); return; } } - if (type == typeof(MatchmakerModels.StartGameResponse)) { if (_instance.OnMatchmakerStartGameResultEvent != null) { _instance.OnMatchmakerStartGameResultEvent((MatchmakerModels.StartGameResponse)e.Result); return; } } - if (type == typeof(MatchmakerModels.UserInfoResponse)) { if (_instance.OnMatchmakerUserInfoResultEvent != null) { _instance.OnMatchmakerUserInfoResultEvent((MatchmakerModels.UserInfoResponse)e.Result); return; } } -#endif -#if ENABLE_PLAYFABSERVER_API - - if (type == typeof(ServerModels.AuthenticateSessionTicketResult)) { if (_instance.OnServerAuthenticateSessionTicketResultEvent != null) { _instance.OnServerAuthenticateSessionTicketResultEvent((ServerModels.AuthenticateSessionTicketResult)e.Result); return; } } - if (type == typeof(ServerModels.BanUsersResult)) { if (_instance.OnServerBanUsersResultEvent != null) { _instance.OnServerBanUsersResultEvent((ServerModels.BanUsersResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayFabIDsFromFacebookIDsResult)) { if (_instance.OnServerGetPlayFabIDsFromFacebookIDsResultEvent != null) { _instance.OnServerGetPlayFabIDsFromFacebookIDsResultEvent((ServerModels.GetPlayFabIDsFromFacebookIDsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayFabIDsFromSteamIDsResult)) { if (_instance.OnServerGetPlayFabIDsFromSteamIDsResultEvent != null) { _instance.OnServerGetPlayFabIDsFromSteamIDsResultEvent((ServerModels.GetPlayFabIDsFromSteamIDsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserAccountInfoResult)) { if (_instance.OnServerGetUserAccountInfoResultEvent != null) { _instance.OnServerGetUserAccountInfoResultEvent((ServerModels.GetUserAccountInfoResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserBansResult)) { if (_instance.OnServerGetUserBansResultEvent != null) { _instance.OnServerGetUserBansResultEvent((ServerModels.GetUserBansResult)e.Result); return; } } - if (type == typeof(ServerModels.RevokeAllBansForUserResult)) { if (_instance.OnServerRevokeAllBansForUserResultEvent != null) { _instance.OnServerRevokeAllBansForUserResultEvent((ServerModels.RevokeAllBansForUserResult)e.Result); return; } } - if (type == typeof(ServerModels.RevokeBansResult)) { if (_instance.OnServerRevokeBansResultEvent != null) { _instance.OnServerRevokeBansResultEvent((ServerModels.RevokeBansResult)e.Result); return; } } - if (type == typeof(ServerModels.SendPushNotificationResult)) { if (_instance.OnServerSendPushNotificationResultEvent != null) { _instance.OnServerSendPushNotificationResultEvent((ServerModels.SendPushNotificationResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateBansResult)) { if (_instance.OnServerUpdateBansResultEvent != null) { _instance.OnServerUpdateBansResultEvent((ServerModels.UpdateBansResult)e.Result); return; } } - if (type == typeof(ServerModels.DeleteUsersResult)) { if (_instance.OnServerDeleteUsersResultEvent != null) { _instance.OnServerDeleteUsersResultEvent((ServerModels.DeleteUsersResult)e.Result); return; } } - if (type == typeof(ServerModels.GetLeaderboardResult)) { if (_instance.OnServerGetFriendLeaderboardResultEvent != null) { _instance.OnServerGetFriendLeaderboardResultEvent((ServerModels.GetLeaderboardResult)e.Result); return; } } - if (type == typeof(ServerModels.GetLeaderboardResult)) { if (_instance.OnServerGetLeaderboardResultEvent != null) { _instance.OnServerGetLeaderboardResultEvent((ServerModels.GetLeaderboardResult)e.Result); return; } } - if (type == typeof(ServerModels.GetLeaderboardAroundUserResult)) { if (_instance.OnServerGetLeaderboardAroundUserResultEvent != null) { _instance.OnServerGetLeaderboardAroundUserResultEvent((ServerModels.GetLeaderboardAroundUserResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayerCombinedInfoResult)) { if (_instance.OnServerGetPlayerCombinedInfoResultEvent != null) { _instance.OnServerGetPlayerCombinedInfoResultEvent((ServerModels.GetPlayerCombinedInfoResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayerStatisticsResult)) { if (_instance.OnServerGetPlayerStatisticsResultEvent != null) { _instance.OnServerGetPlayerStatisticsResultEvent((ServerModels.GetPlayerStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayerStatisticVersionsResult)) { if (_instance.OnServerGetPlayerStatisticVersionsResultEvent != null) { _instance.OnServerGetPlayerStatisticVersionsResultEvent((ServerModels.GetPlayerStatisticVersionsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserDataResultEvent != null) { _instance.OnServerGetUserDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserInternalDataResultEvent != null) { _instance.OnServerGetUserInternalDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserPublisherDataResultEvent != null) { _instance.OnServerGetUserPublisherDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserPublisherInternalDataResultEvent != null) { _instance.OnServerGetUserPublisherInternalDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserPublisherReadOnlyDataResultEvent != null) { _instance.OnServerGetUserPublisherReadOnlyDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserDataResult)) { if (_instance.OnServerGetUserReadOnlyDataResultEvent != null) { _instance.OnServerGetUserReadOnlyDataResultEvent((ServerModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserStatisticsResult)) { if (_instance.OnServerGetUserStatisticsResultEvent != null) { _instance.OnServerGetUserStatisticsResultEvent((ServerModels.GetUserStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdatePlayerStatisticsResult)) { if (_instance.OnServerUpdatePlayerStatisticsResultEvent != null) { _instance.OnServerUpdatePlayerStatisticsResultEvent((ServerModels.UpdatePlayerStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserDataResultEvent != null) { _instance.OnServerUpdateUserDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserInternalDataResultEvent != null) { _instance.OnServerUpdateUserInternalDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserPublisherDataResultEvent != null) { _instance.OnServerUpdateUserPublisherDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserPublisherInternalDataResultEvent != null) { _instance.OnServerUpdateUserPublisherInternalDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserPublisherReadOnlyDataResultEvent != null) { _instance.OnServerUpdateUserPublisherReadOnlyDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserDataResult)) { if (_instance.OnServerUpdateUserReadOnlyDataResultEvent != null) { _instance.OnServerUpdateUserReadOnlyDataResultEvent((ServerModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateUserStatisticsResult)) { if (_instance.OnServerUpdateUserStatisticsResultEvent != null) { _instance.OnServerUpdateUserStatisticsResultEvent((ServerModels.UpdateUserStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCatalogItemsResult)) { if (_instance.OnServerGetCatalogItemsResultEvent != null) { _instance.OnServerGetCatalogItemsResultEvent((ServerModels.GetCatalogItemsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPublisherDataResult)) { if (_instance.OnServerGetPublisherDataResultEvent != null) { _instance.OnServerGetPublisherDataResultEvent((ServerModels.GetPublisherDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetTimeResult)) { if (_instance.OnServerGetTimeResultEvent != null) { _instance.OnServerGetTimeResultEvent((ServerModels.GetTimeResult)e.Result); return; } } - if (type == typeof(ServerModels.GetTitleDataResult)) { if (_instance.OnServerGetTitleDataResultEvent != null) { _instance.OnServerGetTitleDataResultEvent((ServerModels.GetTitleDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetTitleDataResult)) { if (_instance.OnServerGetTitleInternalDataResultEvent != null) { _instance.OnServerGetTitleInternalDataResultEvent((ServerModels.GetTitleDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetTitleNewsResult)) { if (_instance.OnServerGetTitleNewsResultEvent != null) { _instance.OnServerGetTitleNewsResultEvent((ServerModels.GetTitleNewsResult)e.Result); return; } } - if (type == typeof(ServerModels.SetPublisherDataResult)) { if (_instance.OnServerSetPublisherDataResultEvent != null) { _instance.OnServerSetPublisherDataResultEvent((ServerModels.SetPublisherDataResult)e.Result); return; } } - if (type == typeof(ServerModels.SetTitleDataResult)) { if (_instance.OnServerSetTitleDataResultEvent != null) { _instance.OnServerSetTitleDataResultEvent((ServerModels.SetTitleDataResult)e.Result); return; } } - if (type == typeof(ServerModels.SetTitleDataResult)) { if (_instance.OnServerSetTitleInternalDataResultEvent != null) { _instance.OnServerSetTitleInternalDataResultEvent((ServerModels.SetTitleDataResult)e.Result); return; } } - if (type == typeof(ServerModels.ModifyCharacterVirtualCurrencyResult)) { if (_instance.OnServerAddCharacterVirtualCurrencyResultEvent != null) { _instance.OnServerAddCharacterVirtualCurrencyResultEvent((ServerModels.ModifyCharacterVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ServerModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnServerAddUserVirtualCurrencyResultEvent != null) { _instance.OnServerAddUserVirtualCurrencyResultEvent((ServerModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ServerModels.ConsumeItemResult)) { if (_instance.OnServerConsumeItemResultEvent != null) { _instance.OnServerConsumeItemResultEvent((ServerModels.ConsumeItemResult)e.Result); return; } } - if (type == typeof(ServerModels.EvaluateRandomResultTableResult)) { if (_instance.OnServerEvaluateRandomResultTableResultEvent != null) { _instance.OnServerEvaluateRandomResultTableResultEvent((ServerModels.EvaluateRandomResultTableResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterInventoryResult)) { if (_instance.OnServerGetCharacterInventoryResultEvent != null) { _instance.OnServerGetCharacterInventoryResultEvent((ServerModels.GetCharacterInventoryResult)e.Result); return; } } - if (type == typeof(ServerModels.GetRandomResultTablesResult)) { if (_instance.OnServerGetRandomResultTablesResultEvent != null) { _instance.OnServerGetRandomResultTablesResultEvent((ServerModels.GetRandomResultTablesResult)e.Result); return; } } - if (type == typeof(ServerModels.GetUserInventoryResult)) { if (_instance.OnServerGetUserInventoryResultEvent != null) { _instance.OnServerGetUserInventoryResultEvent((ServerModels.GetUserInventoryResult)e.Result); return; } } - if (type == typeof(ServerModels.GrantItemsToCharacterResult)) { if (_instance.OnServerGrantItemsToCharacterResultEvent != null) { _instance.OnServerGrantItemsToCharacterResultEvent((ServerModels.GrantItemsToCharacterResult)e.Result); return; } } - if (type == typeof(ServerModels.GrantItemsToUserResult)) { if (_instance.OnServerGrantItemsToUserResultEvent != null) { _instance.OnServerGrantItemsToUserResultEvent((ServerModels.GrantItemsToUserResult)e.Result); return; } } - if (type == typeof(ServerModels.GrantItemsToUsersResult)) { if (_instance.OnServerGrantItemsToUsersResultEvent != null) { _instance.OnServerGrantItemsToUsersResultEvent((ServerModels.GrantItemsToUsersResult)e.Result); return; } } - if (type == typeof(ServerModels.ModifyItemUsesResult)) { if (_instance.OnServerModifyItemUsesResultEvent != null) { _instance.OnServerModifyItemUsesResultEvent((ServerModels.ModifyItemUsesResult)e.Result); return; } } - if (type == typeof(ServerModels.MoveItemToCharacterFromCharacterResult)) { if (_instance.OnServerMoveItemToCharacterFromCharacterResultEvent != null) { _instance.OnServerMoveItemToCharacterFromCharacterResultEvent((ServerModels.MoveItemToCharacterFromCharacterResult)e.Result); return; } } - if (type == typeof(ServerModels.MoveItemToCharacterFromUserResult)) { if (_instance.OnServerMoveItemToCharacterFromUserResultEvent != null) { _instance.OnServerMoveItemToCharacterFromUserResultEvent((ServerModels.MoveItemToCharacterFromUserResult)e.Result); return; } } - if (type == typeof(ServerModels.MoveItemToUserFromCharacterResult)) { if (_instance.OnServerMoveItemToUserFromCharacterResultEvent != null) { _instance.OnServerMoveItemToUserFromCharacterResultEvent((ServerModels.MoveItemToUserFromCharacterResult)e.Result); return; } } - if (type == typeof(ServerModels.RedeemCouponResult)) { if (_instance.OnServerRedeemCouponResultEvent != null) { _instance.OnServerRedeemCouponResultEvent((ServerModels.RedeemCouponResult)e.Result); return; } } - if (type == typeof(ServerModels.ReportPlayerServerResult)) { if (_instance.OnServerReportPlayerResultEvent != null) { _instance.OnServerReportPlayerResultEvent((ServerModels.ReportPlayerServerResult)e.Result); return; } } - if (type == typeof(ServerModels.RevokeInventoryResult)) { if (_instance.OnServerRevokeInventoryItemResultEvent != null) { _instance.OnServerRevokeInventoryItemResultEvent((ServerModels.RevokeInventoryResult)e.Result); return; } } - if (type == typeof(ServerModels.ModifyCharacterVirtualCurrencyResult)) { if (_instance.OnServerSubtractCharacterVirtualCurrencyResultEvent != null) { _instance.OnServerSubtractCharacterVirtualCurrencyResultEvent((ServerModels.ModifyCharacterVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ServerModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnServerSubtractUserVirtualCurrencyResultEvent != null) { _instance.OnServerSubtractUserVirtualCurrencyResultEvent((ServerModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ServerModels.UnlockContainerItemResult)) { if (_instance.OnServerUnlockContainerInstanceResultEvent != null) { _instance.OnServerUnlockContainerInstanceResultEvent((ServerModels.UnlockContainerItemResult)e.Result); return; } } - if (type == typeof(ServerModels.UnlockContainerItemResult)) { if (_instance.OnServerUnlockContainerItemResultEvent != null) { _instance.OnServerUnlockContainerItemResultEvent((ServerModels.UnlockContainerItemResult)e.Result); return; } } - if (type == typeof(ServerModels.EmptyResult)) { if (_instance.OnServerUpdateUserInventoryItemCustomDataResultEvent != null) { _instance.OnServerUpdateUserInventoryItemCustomDataResultEvent((ServerModels.EmptyResult)e.Result); return; } } - if (type == typeof(ServerModels.EmptyResult)) { if (_instance.OnServerAddFriendResultEvent != null) { _instance.OnServerAddFriendResultEvent((ServerModels.EmptyResult)e.Result); return; } } - if (type == typeof(ServerModels.GetFriendsListResult)) { if (_instance.OnServerGetFriendsListResultEvent != null) { _instance.OnServerGetFriendsListResultEvent((ServerModels.GetFriendsListResult)e.Result); return; } } - if (type == typeof(ServerModels.EmptyResult)) { if (_instance.OnServerRemoveFriendResultEvent != null) { _instance.OnServerRemoveFriendResultEvent((ServerModels.EmptyResult)e.Result); return; } } - if (type == typeof(ServerModels.DeregisterGameResponse)) { if (_instance.OnServerDeregisterGameResultEvent != null) { _instance.OnServerDeregisterGameResultEvent((ServerModels.DeregisterGameResponse)e.Result); return; } } - if (type == typeof(ServerModels.NotifyMatchmakerPlayerLeftResult)) { if (_instance.OnServerNotifyMatchmakerPlayerLeftResultEvent != null) { _instance.OnServerNotifyMatchmakerPlayerLeftResultEvent((ServerModels.NotifyMatchmakerPlayerLeftResult)e.Result); return; } } - if (type == typeof(ServerModels.RedeemMatchmakerTicketResult)) { if (_instance.OnServerRedeemMatchmakerTicketResultEvent != null) { _instance.OnServerRedeemMatchmakerTicketResultEvent((ServerModels.RedeemMatchmakerTicketResult)e.Result); return; } } - if (type == typeof(ServerModels.RefreshGameServerInstanceHeartbeatResult)) { if (_instance.OnServerRefreshGameServerInstanceHeartbeatResultEvent != null) { _instance.OnServerRefreshGameServerInstanceHeartbeatResultEvent((ServerModels.RefreshGameServerInstanceHeartbeatResult)e.Result); return; } } - if (type == typeof(ServerModels.RegisterGameResponse)) { if (_instance.OnServerRegisterGameResultEvent != null) { _instance.OnServerRegisterGameResultEvent((ServerModels.RegisterGameResponse)e.Result); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceDataResult)) { if (_instance.OnServerSetGameServerInstanceDataResultEvent != null) { _instance.OnServerSetGameServerInstanceDataResultEvent((ServerModels.SetGameServerInstanceDataResult)e.Result); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceStateResult)) { if (_instance.OnServerSetGameServerInstanceStateResultEvent != null) { _instance.OnServerSetGameServerInstanceStateResultEvent((ServerModels.SetGameServerInstanceStateResult)e.Result); return; } } - if (type == typeof(ServerModels.SetGameServerInstanceTagsResult)) { if (_instance.OnServerSetGameServerInstanceTagsResultEvent != null) { _instance.OnServerSetGameServerInstanceTagsResultEvent((ServerModels.SetGameServerInstanceTagsResult)e.Result); return; } } - if (type == typeof(ServerModels.AwardSteamAchievementResult)) { if (_instance.OnServerAwardSteamAchievementResultEvent != null) { _instance.OnServerAwardSteamAchievementResultEvent((ServerModels.AwardSteamAchievementResult)e.Result); return; } } - if (type == typeof(ServerModels.LogEventResult)) { if (_instance.OnServerLogEventResultEvent != null) { _instance.OnServerLogEventResultEvent((ServerModels.LogEventResult)e.Result); return; } } - if (type == typeof(ServerModels.WriteEventResponse)) { if (_instance.OnServerWriteCharacterEventResultEvent != null) { _instance.OnServerWriteCharacterEventResultEvent((ServerModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ServerModels.WriteEventResponse)) { if (_instance.OnServerWritePlayerEventResultEvent != null) { _instance.OnServerWritePlayerEventResultEvent((ServerModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ServerModels.WriteEventResponse)) { if (_instance.OnServerWriteTitleEventResultEvent != null) { _instance.OnServerWriteTitleEventResultEvent((ServerModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ServerModels.AddSharedGroupMembersResult)) { if (_instance.OnServerAddSharedGroupMembersResultEvent != null) { _instance.OnServerAddSharedGroupMembersResultEvent((ServerModels.AddSharedGroupMembersResult)e.Result); return; } } - if (type == typeof(ServerModels.CreateSharedGroupResult)) { if (_instance.OnServerCreateSharedGroupResultEvent != null) { _instance.OnServerCreateSharedGroupResultEvent((ServerModels.CreateSharedGroupResult)e.Result); return; } } - if (type == typeof(ServerModels.EmptyResult)) { if (_instance.OnServerDeleteSharedGroupResultEvent != null) { _instance.OnServerDeleteSharedGroupResultEvent((ServerModels.EmptyResult)e.Result); return; } } - if (type == typeof(ServerModels.GetSharedGroupDataResult)) { if (_instance.OnServerGetSharedGroupDataResultEvent != null) { _instance.OnServerGetSharedGroupDataResultEvent((ServerModels.GetSharedGroupDataResult)e.Result); return; } } - if (type == typeof(ServerModels.RemoveSharedGroupMembersResult)) { if (_instance.OnServerRemoveSharedGroupMembersResultEvent != null) { _instance.OnServerRemoveSharedGroupMembersResultEvent((ServerModels.RemoveSharedGroupMembersResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateSharedGroupDataResult)) { if (_instance.OnServerUpdateSharedGroupDataResultEvent != null) { _instance.OnServerUpdateSharedGroupDataResultEvent((ServerModels.UpdateSharedGroupDataResult)e.Result); return; } } - if (type == typeof(ServerModels.ExecuteCloudScriptResult)) { if (_instance.OnServerExecuteCloudScriptResultEvent != null) { _instance.OnServerExecuteCloudScriptResultEvent((ServerModels.ExecuteCloudScriptResult)e.Result); return; } } - if (type == typeof(ServerModels.GetContentDownloadUrlResult)) { if (_instance.OnServerGetContentDownloadUrlResultEvent != null) { _instance.OnServerGetContentDownloadUrlResultEvent((ServerModels.GetContentDownloadUrlResult)e.Result); return; } } - if (type == typeof(ServerModels.DeleteCharacterFromUserResult)) { if (_instance.OnServerDeleteCharacterFromUserResultEvent != null) { _instance.OnServerDeleteCharacterFromUserResultEvent((ServerModels.DeleteCharacterFromUserResult)e.Result); return; } } - if (type == typeof(ServerModels.ListUsersCharactersResult)) { if (_instance.OnServerGetAllUsersCharactersResultEvent != null) { _instance.OnServerGetAllUsersCharactersResultEvent((ServerModels.ListUsersCharactersResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterLeaderboardResult)) { if (_instance.OnServerGetCharacterLeaderboardResultEvent != null) { _instance.OnServerGetCharacterLeaderboardResultEvent((ServerModels.GetCharacterLeaderboardResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterStatisticsResult)) { if (_instance.OnServerGetCharacterStatisticsResultEvent != null) { _instance.OnServerGetCharacterStatisticsResultEvent((ServerModels.GetCharacterStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetLeaderboardAroundCharacterResult)) { if (_instance.OnServerGetLeaderboardAroundCharacterResultEvent != null) { _instance.OnServerGetLeaderboardAroundCharacterResultEvent((ServerModels.GetLeaderboardAroundCharacterResult)e.Result); return; } } - if (type == typeof(ServerModels.GetLeaderboardForUsersCharactersResult)) { if (_instance.OnServerGetLeaderboardForUserCharactersResultEvent != null) { _instance.OnServerGetLeaderboardForUserCharactersResultEvent((ServerModels.GetLeaderboardForUsersCharactersResult)e.Result); return; } } - if (type == typeof(ServerModels.GrantCharacterToUserResult)) { if (_instance.OnServerGrantCharacterToUserResultEvent != null) { _instance.OnServerGrantCharacterToUserResultEvent((ServerModels.GrantCharacterToUserResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateCharacterStatisticsResult)) { if (_instance.OnServerUpdateCharacterStatisticsResultEvent != null) { _instance.OnServerUpdateCharacterStatisticsResultEvent((ServerModels.UpdateCharacterStatisticsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterDataResult)) { if (_instance.OnServerGetCharacterDataResultEvent != null) { _instance.OnServerGetCharacterDataResultEvent((ServerModels.GetCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterDataResult)) { if (_instance.OnServerGetCharacterInternalDataResultEvent != null) { _instance.OnServerGetCharacterInternalDataResultEvent((ServerModels.GetCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.GetCharacterDataResult)) { if (_instance.OnServerGetCharacterReadOnlyDataResultEvent != null) { _instance.OnServerGetCharacterReadOnlyDataResultEvent((ServerModels.GetCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataResult)) { if (_instance.OnServerUpdateCharacterDataResultEvent != null) { _instance.OnServerUpdateCharacterDataResultEvent((ServerModels.UpdateCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataResult)) { if (_instance.OnServerUpdateCharacterInternalDataResultEvent != null) { _instance.OnServerUpdateCharacterInternalDataResultEvent((ServerModels.UpdateCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.UpdateCharacterDataResult)) { if (_instance.OnServerUpdateCharacterReadOnlyDataResultEvent != null) { _instance.OnServerUpdateCharacterReadOnlyDataResultEvent((ServerModels.UpdateCharacterDataResult)e.Result); return; } } - if (type == typeof(ServerModels.AddPlayerTagResult)) { if (_instance.OnServerAddPlayerTagResultEvent != null) { _instance.OnServerAddPlayerTagResultEvent((ServerModels.AddPlayerTagResult)e.Result); return; } } - if (type == typeof(ServerModels.GetAllActionGroupsResult)) { if (_instance.OnServerGetAllActionGroupsResultEvent != null) { _instance.OnServerGetAllActionGroupsResultEvent((ServerModels.GetAllActionGroupsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetAllSegmentsResult)) { if (_instance.OnServerGetAllSegmentsResultEvent != null) { _instance.OnServerGetAllSegmentsResultEvent((ServerModels.GetAllSegmentsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayerSegmentsResult)) { if (_instance.OnServerGetPlayerSegmentsResultEvent != null) { _instance.OnServerGetPlayerSegmentsResultEvent((ServerModels.GetPlayerSegmentsResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayersInSegmentResult)) { if (_instance.OnServerGetPlayersInSegmentResultEvent != null) { _instance.OnServerGetPlayersInSegmentResultEvent((ServerModels.GetPlayersInSegmentResult)e.Result); return; } } - if (type == typeof(ServerModels.GetPlayerTagsResult)) { if (_instance.OnServerGetPlayerTagsResultEvent != null) { _instance.OnServerGetPlayerTagsResultEvent((ServerModels.GetPlayerTagsResult)e.Result); return; } } - if (type == typeof(ServerModels.RemovePlayerTagResult)) { if (_instance.OnServerRemovePlayerTagResultEvent != null) { _instance.OnServerRemovePlayerTagResultEvent((ServerModels.RemovePlayerTagResult)e.Result); return; } } -#endif -#if !DISABLE_PLAYFABCLIENT_API - if (type == typeof(ClientModels.LoginResult)) { if (_instance.OnLoginResultEvent != null) { _instance.OnLoginResultEvent((ClientModels.LoginResult)e.Result); return; } } - - if (type == typeof(ClientModels.GetPhotonAuthenticationTokenResult)) { if (_instance.OnGetPhotonAuthenticationTokenResultEvent != null) { _instance.OnGetPhotonAuthenticationTokenResultEvent((ClientModels.GetPhotonAuthenticationTokenResult)e.Result); return; } } - if (type == typeof(ClientModels.RegisterPlayFabUserResult)) { if (_instance.OnRegisterPlayFabUserResultEvent != null) { _instance.OnRegisterPlayFabUserResultEvent((ClientModels.RegisterPlayFabUserResult)e.Result); return; } } - if (type == typeof(ClientModels.AddGenericIDResult)) { if (_instance.OnAddGenericIDResultEvent != null) { _instance.OnAddGenericIDResultEvent((ClientModels.AddGenericIDResult)e.Result); return; } } - if (type == typeof(ClientModels.AddUsernamePasswordResult)) { if (_instance.OnAddUsernamePasswordResultEvent != null) { _instance.OnAddUsernamePasswordResultEvent((ClientModels.AddUsernamePasswordResult)e.Result); return; } } - if (type == typeof(ClientModels.GetAccountInfoResult)) { if (_instance.OnGetAccountInfoResultEvent != null) { _instance.OnGetAccountInfoResultEvent((ClientModels.GetAccountInfoResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerCombinedInfoResult)) { if (_instance.OnGetPlayerCombinedInfoResultEvent != null) { _instance.OnGetPlayerCombinedInfoResultEvent((ClientModels.GetPlayerCombinedInfoResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromFacebookIDsResult)) { if (_instance.OnGetPlayFabIDsFromFacebookIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromFacebookIDsResultEvent((ClientModels.GetPlayFabIDsFromFacebookIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGameCenterIDsResult)) { if (_instance.OnGetPlayFabIDsFromGameCenterIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromGameCenterIDsResultEvent((ClientModels.GetPlayFabIDsFromGameCenterIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGenericIDsResult)) { if (_instance.OnGetPlayFabIDsFromGenericIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromGenericIDsResultEvent((ClientModels.GetPlayFabIDsFromGenericIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromGoogleIDsResult)) { if (_instance.OnGetPlayFabIDsFromGoogleIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromGoogleIDsResultEvent((ClientModels.GetPlayFabIDsFromGoogleIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromKongregateIDsResult)) { if (_instance.OnGetPlayFabIDsFromKongregateIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromKongregateIDsResultEvent((ClientModels.GetPlayFabIDsFromKongregateIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromSteamIDsResult)) { if (_instance.OnGetPlayFabIDsFromSteamIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromSteamIDsResultEvent((ClientModels.GetPlayFabIDsFromSteamIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayFabIDsFromTwitchIDsResult)) { if (_instance.OnGetPlayFabIDsFromTwitchIDsResultEvent != null) { _instance.OnGetPlayFabIDsFromTwitchIDsResultEvent((ClientModels.GetPlayFabIDsFromTwitchIDsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserCombinedInfoResult)) { if (_instance.OnGetUserCombinedInfoResultEvent != null) { _instance.OnGetUserCombinedInfoResultEvent((ClientModels.GetUserCombinedInfoResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkAndroidDeviceIDResult)) { if (_instance.OnLinkAndroidDeviceIDResultEvent != null) { _instance.OnLinkAndroidDeviceIDResultEvent((ClientModels.LinkAndroidDeviceIDResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkCustomIDResult)) { if (_instance.OnLinkCustomIDResultEvent != null) { _instance.OnLinkCustomIDResultEvent((ClientModels.LinkCustomIDResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkFacebookAccountResult)) { if (_instance.OnLinkFacebookAccountResultEvent != null) { _instance.OnLinkFacebookAccountResultEvent((ClientModels.LinkFacebookAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkGameCenterAccountResult)) { if (_instance.OnLinkGameCenterAccountResultEvent != null) { _instance.OnLinkGameCenterAccountResultEvent((ClientModels.LinkGameCenterAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkGoogleAccountResult)) { if (_instance.OnLinkGoogleAccountResultEvent != null) { _instance.OnLinkGoogleAccountResultEvent((ClientModels.LinkGoogleAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkIOSDeviceIDResult)) { if (_instance.OnLinkIOSDeviceIDResultEvent != null) { _instance.OnLinkIOSDeviceIDResultEvent((ClientModels.LinkIOSDeviceIDResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkKongregateAccountResult)) { if (_instance.OnLinkKongregateResultEvent != null) { _instance.OnLinkKongregateResultEvent((ClientModels.LinkKongregateAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkSteamAccountResult)) { if (_instance.OnLinkSteamAccountResultEvent != null) { _instance.OnLinkSteamAccountResultEvent((ClientModels.LinkSteamAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.LinkTwitchAccountResult)) { if (_instance.OnLinkTwitchResultEvent != null) { _instance.OnLinkTwitchResultEvent((ClientModels.LinkTwitchAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.RemoveGenericIDResult)) { if (_instance.OnRemoveGenericIDResultEvent != null) { _instance.OnRemoveGenericIDResultEvent((ClientModels.RemoveGenericIDResult)e.Result); return; } } - if (type == typeof(ClientModels.ReportPlayerClientResult)) { if (_instance.OnReportPlayerResultEvent != null) { _instance.OnReportPlayerResultEvent((ClientModels.ReportPlayerClientResult)e.Result); return; } } - if (type == typeof(ClientModels.SendAccountRecoveryEmailResult)) { if (_instance.OnSendAccountRecoveryEmailResultEvent != null) { _instance.OnSendAccountRecoveryEmailResultEvent((ClientModels.SendAccountRecoveryEmailResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkAndroidDeviceIDResult)) { if (_instance.OnUnlinkAndroidDeviceIDResultEvent != null) { _instance.OnUnlinkAndroidDeviceIDResultEvent((ClientModels.UnlinkAndroidDeviceIDResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkCustomIDResult)) { if (_instance.OnUnlinkCustomIDResultEvent != null) { _instance.OnUnlinkCustomIDResultEvent((ClientModels.UnlinkCustomIDResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkFacebookAccountResult)) { if (_instance.OnUnlinkFacebookAccountResultEvent != null) { _instance.OnUnlinkFacebookAccountResultEvent((ClientModels.UnlinkFacebookAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkGameCenterAccountResult)) { if (_instance.OnUnlinkGameCenterAccountResultEvent != null) { _instance.OnUnlinkGameCenterAccountResultEvent((ClientModels.UnlinkGameCenterAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkGoogleAccountResult)) { if (_instance.OnUnlinkGoogleAccountResultEvent != null) { _instance.OnUnlinkGoogleAccountResultEvent((ClientModels.UnlinkGoogleAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkIOSDeviceIDResult)) { if (_instance.OnUnlinkIOSDeviceIDResultEvent != null) { _instance.OnUnlinkIOSDeviceIDResultEvent((ClientModels.UnlinkIOSDeviceIDResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkKongregateAccountResult)) { if (_instance.OnUnlinkKongregateResultEvent != null) { _instance.OnUnlinkKongregateResultEvent((ClientModels.UnlinkKongregateAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkSteamAccountResult)) { if (_instance.OnUnlinkSteamAccountResultEvent != null) { _instance.OnUnlinkSteamAccountResultEvent((ClientModels.UnlinkSteamAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlinkTwitchAccountResult)) { if (_instance.OnUnlinkTwitchResultEvent != null) { _instance.OnUnlinkTwitchResultEvent((ClientModels.UnlinkTwitchAccountResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateUserTitleDisplayNameResult)) { if (_instance.OnUpdateUserTitleDisplayNameResultEvent != null) { _instance.OnUpdateUserTitleDisplayNameResultEvent((ClientModels.UpdateUserTitleDisplayNameResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardResult)) { if (_instance.OnGetFriendLeaderboardResultEvent != null) { _instance.OnGetFriendLeaderboardResultEvent((ClientModels.GetLeaderboardResult)e.Result); return; } } - if (type == typeof(ClientModels.GetFriendLeaderboardAroundCurrentUserResult)) { if (_instance.OnGetFriendLeaderboardAroundCurrentUserResultEvent != null) { _instance.OnGetFriendLeaderboardAroundCurrentUserResultEvent((ClientModels.GetFriendLeaderboardAroundCurrentUserResult)e.Result); return; } } - if (type == typeof(ClientModels.GetFriendLeaderboardAroundPlayerResult)) { if (_instance.OnGetFriendLeaderboardAroundPlayerResultEvent != null) { _instance.OnGetFriendLeaderboardAroundPlayerResultEvent((ClientModels.GetFriendLeaderboardAroundPlayerResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardResult)) { if (_instance.OnGetLeaderboardResultEvent != null) { _instance.OnGetLeaderboardResultEvent((ClientModels.GetLeaderboardResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundCurrentUserResult)) { if (_instance.OnGetLeaderboardAroundCurrentUserResultEvent != null) { _instance.OnGetLeaderboardAroundCurrentUserResultEvent((ClientModels.GetLeaderboardAroundCurrentUserResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundPlayerResult)) { if (_instance.OnGetLeaderboardAroundPlayerResultEvent != null) { _instance.OnGetLeaderboardAroundPlayerResultEvent((ClientModels.GetLeaderboardAroundPlayerResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerStatisticsResult)) { if (_instance.OnGetPlayerStatisticsResultEvent != null) { _instance.OnGetPlayerStatisticsResultEvent((ClientModels.GetPlayerStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerStatisticVersionsResult)) { if (_instance.OnGetPlayerStatisticVersionsResultEvent != null) { _instance.OnGetPlayerStatisticVersionsResultEvent((ClientModels.GetPlayerStatisticVersionsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserDataResult)) { if (_instance.OnGetUserDataResultEvent != null) { _instance.OnGetUserDataResultEvent((ClientModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserDataResult)) { if (_instance.OnGetUserPublisherDataResultEvent != null) { _instance.OnGetUserPublisherDataResultEvent((ClientModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserDataResult)) { if (_instance.OnGetUserPublisherReadOnlyDataResultEvent != null) { _instance.OnGetUserPublisherReadOnlyDataResultEvent((ClientModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserDataResult)) { if (_instance.OnGetUserReadOnlyDataResultEvent != null) { _instance.OnGetUserReadOnlyDataResultEvent((ClientModels.GetUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserStatisticsResult)) { if (_instance.OnGetUserStatisticsResultEvent != null) { _instance.OnGetUserStatisticsResultEvent((ClientModels.GetUserStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdatePlayerStatisticsResult)) { if (_instance.OnUpdatePlayerStatisticsResultEvent != null) { _instance.OnUpdatePlayerStatisticsResultEvent((ClientModels.UpdatePlayerStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateUserDataResult)) { if (_instance.OnUpdateUserDataResultEvent != null) { _instance.OnUpdateUserDataResultEvent((ClientModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateUserDataResult)) { if (_instance.OnUpdateUserPublisherDataResultEvent != null) { _instance.OnUpdateUserPublisherDataResultEvent((ClientModels.UpdateUserDataResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateUserStatisticsResult)) { if (_instance.OnUpdateUserStatisticsResultEvent != null) { _instance.OnUpdateUserStatisticsResultEvent((ClientModels.UpdateUserStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCatalogItemsResult)) { if (_instance.OnGetCatalogItemsResultEvent != null) { _instance.OnGetCatalogItemsResultEvent((ClientModels.GetCatalogItemsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPublisherDataResult)) { if (_instance.OnGetPublisherDataResultEvent != null) { _instance.OnGetPublisherDataResultEvent((ClientModels.GetPublisherDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetStoreItemsResult)) { if (_instance.OnGetStoreItemsResultEvent != null) { _instance.OnGetStoreItemsResultEvent((ClientModels.GetStoreItemsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetTimeResult)) { if (_instance.OnGetTimeResultEvent != null) { _instance.OnGetTimeResultEvent((ClientModels.GetTimeResult)e.Result); return; } } - if (type == typeof(ClientModels.GetTitleDataResult)) { if (_instance.OnGetTitleDataResultEvent != null) { _instance.OnGetTitleDataResultEvent((ClientModels.GetTitleDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetTitleNewsResult)) { if (_instance.OnGetTitleNewsResultEvent != null) { _instance.OnGetTitleNewsResultEvent((ClientModels.GetTitleNewsResult)e.Result); return; } } - if (type == typeof(ClientModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnAddUserVirtualCurrencyResultEvent != null) { _instance.OnAddUserVirtualCurrencyResultEvent((ClientModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ClientModels.ConfirmPurchaseResult)) { if (_instance.OnConfirmPurchaseResultEvent != null) { _instance.OnConfirmPurchaseResultEvent((ClientModels.ConfirmPurchaseResult)e.Result); return; } } - if (type == typeof(ClientModels.ConsumeItemResult)) { if (_instance.OnConsumeItemResultEvent != null) { _instance.OnConsumeItemResultEvent((ClientModels.ConsumeItemResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCharacterInventoryResult)) { if (_instance.OnGetCharacterInventoryResultEvent != null) { _instance.OnGetCharacterInventoryResultEvent((ClientModels.GetCharacterInventoryResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPurchaseResult)) { if (_instance.OnGetPurchaseResultEvent != null) { _instance.OnGetPurchaseResultEvent((ClientModels.GetPurchaseResult)e.Result); return; } } - if (type == typeof(ClientModels.GetUserInventoryResult)) { if (_instance.OnGetUserInventoryResultEvent != null) { _instance.OnGetUserInventoryResultEvent((ClientModels.GetUserInventoryResult)e.Result); return; } } - if (type == typeof(ClientModels.PayForPurchaseResult)) { if (_instance.OnPayForPurchaseResultEvent != null) { _instance.OnPayForPurchaseResultEvent((ClientModels.PayForPurchaseResult)e.Result); return; } } - if (type == typeof(ClientModels.PurchaseItemResult)) { if (_instance.OnPurchaseItemResultEvent != null) { _instance.OnPurchaseItemResultEvent((ClientModels.PurchaseItemResult)e.Result); return; } } - if (type == typeof(ClientModels.RedeemCouponResult)) { if (_instance.OnRedeemCouponResultEvent != null) { _instance.OnRedeemCouponResultEvent((ClientModels.RedeemCouponResult)e.Result); return; } } - if (type == typeof(ClientModels.StartPurchaseResult)) { if (_instance.OnStartPurchaseResultEvent != null) { _instance.OnStartPurchaseResultEvent((ClientModels.StartPurchaseResult)e.Result); return; } } - if (type == typeof(ClientModels.ModifyUserVirtualCurrencyResult)) { if (_instance.OnSubtractUserVirtualCurrencyResultEvent != null) { _instance.OnSubtractUserVirtualCurrencyResultEvent((ClientModels.ModifyUserVirtualCurrencyResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlockContainerItemResult)) { if (_instance.OnUnlockContainerInstanceResultEvent != null) { _instance.OnUnlockContainerInstanceResultEvent((ClientModels.UnlockContainerItemResult)e.Result); return; } } - if (type == typeof(ClientModels.UnlockContainerItemResult)) { if (_instance.OnUnlockContainerItemResultEvent != null) { _instance.OnUnlockContainerItemResultEvent((ClientModels.UnlockContainerItemResult)e.Result); return; } } - if (type == typeof(ClientModels.AddFriendResult)) { if (_instance.OnAddFriendResultEvent != null) { _instance.OnAddFriendResultEvent((ClientModels.AddFriendResult)e.Result); return; } } - if (type == typeof(ClientModels.GetFriendsListResult)) { if (_instance.OnGetFriendsListResultEvent != null) { _instance.OnGetFriendsListResultEvent((ClientModels.GetFriendsListResult)e.Result); return; } } - if (type == typeof(ClientModels.RemoveFriendResult)) { if (_instance.OnRemoveFriendResultEvent != null) { _instance.OnRemoveFriendResultEvent((ClientModels.RemoveFriendResult)e.Result); return; } } - if (type == typeof(ClientModels.SetFriendTagsResult)) { if (_instance.OnSetFriendTagsResultEvent != null) { _instance.OnSetFriendTagsResultEvent((ClientModels.SetFriendTagsResult)e.Result); return; } } - if (type == typeof(ClientModels.RegisterForIOSPushNotificationResult)) { if (_instance.OnRegisterForIOSPushNotificationResultEvent != null) { _instance.OnRegisterForIOSPushNotificationResultEvent((ClientModels.RegisterForIOSPushNotificationResult)e.Result); return; } } - if (type == typeof(ClientModels.RestoreIOSPurchasesResult)) { if (_instance.OnRestoreIOSPurchasesResultEvent != null) { _instance.OnRestoreIOSPurchasesResultEvent((ClientModels.RestoreIOSPurchasesResult)e.Result); return; } } - if (type == typeof(ClientModels.ValidateIOSReceiptResult)) { if (_instance.OnValidateIOSReceiptResultEvent != null) { _instance.OnValidateIOSReceiptResultEvent((ClientModels.ValidateIOSReceiptResult)e.Result); return; } } - if (type == typeof(ClientModels.CurrentGamesResult)) { if (_instance.OnGetCurrentGamesResultEvent != null) { _instance.OnGetCurrentGamesResultEvent((ClientModels.CurrentGamesResult)e.Result); return; } } - if (type == typeof(ClientModels.GameServerRegionsResult)) { if (_instance.OnGetGameServerRegionsResultEvent != null) { _instance.OnGetGameServerRegionsResultEvent((ClientModels.GameServerRegionsResult)e.Result); return; } } - if (type == typeof(ClientModels.MatchmakeResult)) { if (_instance.OnMatchmakeResultEvent != null) { _instance.OnMatchmakeResultEvent((ClientModels.MatchmakeResult)e.Result); return; } } - if (type == typeof(ClientModels.StartGameResult)) { if (_instance.OnStartGameResultEvent != null) { _instance.OnStartGameResultEvent((ClientModels.StartGameResult)e.Result); return; } } - if (type == typeof(ClientModels.AndroidDevicePushNotificationRegistrationResult)) { if (_instance.OnAndroidDevicePushNotificationRegistrationResultEvent != null) { _instance.OnAndroidDevicePushNotificationRegistrationResultEvent((ClientModels.AndroidDevicePushNotificationRegistrationResult)e.Result); return; } } - if (type == typeof(ClientModels.ValidateGooglePlayPurchaseResult)) { if (_instance.OnValidateGooglePlayPurchaseResultEvent != null) { _instance.OnValidateGooglePlayPurchaseResultEvent((ClientModels.ValidateGooglePlayPurchaseResult)e.Result); return; } } - if (type == typeof(ClientModels.LogEventResult)) { if (_instance.OnLogEventResultEvent != null) { _instance.OnLogEventResultEvent((ClientModels.LogEventResult)e.Result); return; } } - if (type == typeof(ClientModels.WriteEventResponse)) { if (_instance.OnWriteCharacterEventResultEvent != null) { _instance.OnWriteCharacterEventResultEvent((ClientModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ClientModels.WriteEventResponse)) { if (_instance.OnWritePlayerEventResultEvent != null) { _instance.OnWritePlayerEventResultEvent((ClientModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ClientModels.WriteEventResponse)) { if (_instance.OnWriteTitleEventResultEvent != null) { _instance.OnWriteTitleEventResultEvent((ClientModels.WriteEventResponse)e.Result); return; } } - if (type == typeof(ClientModels.AddSharedGroupMembersResult)) { if (_instance.OnAddSharedGroupMembersResultEvent != null) { _instance.OnAddSharedGroupMembersResultEvent((ClientModels.AddSharedGroupMembersResult)e.Result); return; } } - if (type == typeof(ClientModels.CreateSharedGroupResult)) { if (_instance.OnCreateSharedGroupResultEvent != null) { _instance.OnCreateSharedGroupResultEvent((ClientModels.CreateSharedGroupResult)e.Result); return; } } - if (type == typeof(ClientModels.GetSharedGroupDataResult)) { if (_instance.OnGetSharedGroupDataResultEvent != null) { _instance.OnGetSharedGroupDataResultEvent((ClientModels.GetSharedGroupDataResult)e.Result); return; } } - if (type == typeof(ClientModels.RemoveSharedGroupMembersResult)) { if (_instance.OnRemoveSharedGroupMembersResultEvent != null) { _instance.OnRemoveSharedGroupMembersResultEvent((ClientModels.RemoveSharedGroupMembersResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateSharedGroupDataResult)) { if (_instance.OnUpdateSharedGroupDataResultEvent != null) { _instance.OnUpdateSharedGroupDataResultEvent((ClientModels.UpdateSharedGroupDataResult)e.Result); return; } } - if (type == typeof(ClientModels.ExecuteCloudScriptResult)) { if (_instance.OnExecuteCloudScriptResultEvent != null) { _instance.OnExecuteCloudScriptResultEvent((ClientModels.ExecuteCloudScriptResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCloudScriptUrlResult)) { if (_instance.OnGetCloudScriptUrlResultEvent != null) { _instance.OnGetCloudScriptUrlResultEvent((ClientModels.GetCloudScriptUrlResult)e.Result); return; } } - if (type == typeof(ClientModels.RunCloudScriptResult)) { if (_instance.OnRunCloudScriptResultEvent != null) { _instance.OnRunCloudScriptResultEvent((ClientModels.RunCloudScriptResult)e.Result); return; } } - if (type == typeof(ClientModels.GetContentDownloadUrlResult)) { if (_instance.OnGetContentDownloadUrlResultEvent != null) { _instance.OnGetContentDownloadUrlResultEvent((ClientModels.GetContentDownloadUrlResult)e.Result); return; } } - if (type == typeof(ClientModels.ListUsersCharactersResult)) { if (_instance.OnGetAllUsersCharactersResultEvent != null) { _instance.OnGetAllUsersCharactersResultEvent((ClientModels.ListUsersCharactersResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCharacterLeaderboardResult)) { if (_instance.OnGetCharacterLeaderboardResultEvent != null) { _instance.OnGetCharacterLeaderboardResultEvent((ClientModels.GetCharacterLeaderboardResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCharacterStatisticsResult)) { if (_instance.OnGetCharacterStatisticsResultEvent != null) { _instance.OnGetCharacterStatisticsResultEvent((ClientModels.GetCharacterStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardAroundCharacterResult)) { if (_instance.OnGetLeaderboardAroundCharacterResultEvent != null) { _instance.OnGetLeaderboardAroundCharacterResultEvent((ClientModels.GetLeaderboardAroundCharacterResult)e.Result); return; } } - if (type == typeof(ClientModels.GetLeaderboardForUsersCharactersResult)) { if (_instance.OnGetLeaderboardForUserCharactersResultEvent != null) { _instance.OnGetLeaderboardForUserCharactersResultEvent((ClientModels.GetLeaderboardForUsersCharactersResult)e.Result); return; } } - if (type == typeof(ClientModels.GrantCharacterToUserResult)) { if (_instance.OnGrantCharacterToUserResultEvent != null) { _instance.OnGrantCharacterToUserResultEvent((ClientModels.GrantCharacterToUserResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateCharacterStatisticsResult)) { if (_instance.OnUpdateCharacterStatisticsResultEvent != null) { _instance.OnUpdateCharacterStatisticsResultEvent((ClientModels.UpdateCharacterStatisticsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCharacterDataResult)) { if (_instance.OnGetCharacterDataResultEvent != null) { _instance.OnGetCharacterDataResultEvent((ClientModels.GetCharacterDataResult)e.Result); return; } } - if (type == typeof(ClientModels.GetCharacterDataResult)) { if (_instance.OnGetCharacterReadOnlyDataResultEvent != null) { _instance.OnGetCharacterReadOnlyDataResultEvent((ClientModels.GetCharacterDataResult)e.Result); return; } } - if (type == typeof(ClientModels.UpdateCharacterDataResult)) { if (_instance.OnUpdateCharacterDataResultEvent != null) { _instance.OnUpdateCharacterDataResultEvent((ClientModels.UpdateCharacterDataResult)e.Result); return; } } - if (type == typeof(ClientModels.ValidateAmazonReceiptResult)) { if (_instance.OnValidateAmazonIAPReceiptResultEvent != null) { _instance.OnValidateAmazonIAPReceiptResultEvent((ClientModels.ValidateAmazonReceiptResult)e.Result); return; } } - if (type == typeof(ClientModels.AcceptTradeResponse)) { if (_instance.OnAcceptTradeResultEvent != null) { _instance.OnAcceptTradeResultEvent((ClientModels.AcceptTradeResponse)e.Result); return; } } - if (type == typeof(ClientModels.CancelTradeResponse)) { if (_instance.OnCancelTradeResultEvent != null) { _instance.OnCancelTradeResultEvent((ClientModels.CancelTradeResponse)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerTradesResponse)) { if (_instance.OnGetPlayerTradesResultEvent != null) { _instance.OnGetPlayerTradesResultEvent((ClientModels.GetPlayerTradesResponse)e.Result); return; } } - if (type == typeof(ClientModels.GetTradeStatusResponse)) { if (_instance.OnGetTradeStatusResultEvent != null) { _instance.OnGetTradeStatusResultEvent((ClientModels.GetTradeStatusResponse)e.Result); return; } } - if (type == typeof(ClientModels.OpenTradeResponse)) { if (_instance.OnOpenTradeResultEvent != null) { _instance.OnOpenTradeResultEvent((ClientModels.OpenTradeResponse)e.Result); return; } } - if (type == typeof(ClientModels.AttributeInstallResult)) { if (_instance.OnAttributeInstallResultEvent != null) { _instance.OnAttributeInstallResultEvent((ClientModels.AttributeInstallResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerSegmentsResult)) { if (_instance.OnGetPlayerSegmentsResultEvent != null) { _instance.OnGetPlayerSegmentsResultEvent((ClientModels.GetPlayerSegmentsResult)e.Result); return; } } - if (type == typeof(ClientModels.GetPlayerTagsResult)) { if (_instance.OnGetPlayerTagsResultEvent != null) { _instance.OnGetPlayerTagsResultEvent((ClientModels.GetPlayerTagsResult)e.Result); return; } } -#endif - - } - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs.meta deleted file mode 100755 index b02267cb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabEvents.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 059603d7e53649849b7f08d3b99af79c -timeCreated: 1463538913 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs deleted file mode 100755 index 2c34f290..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs +++ /dev/null @@ -1,271 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Text; -using System.Threading; -using PlayFab.Internal; -using UnityEngine; - -namespace PlayFab.Public -{ -#if !UNITY_WSA && !UNITY_WP8 && !NETFX_CORE - public interface IPlayFabLogger - { - IPAddress ip { get; set; } - int port { get; set; } - string url { get; set; } - - // Unity MonoBehaviour callbacks - void OnEnable(); - void OnDisable(); - void OnDestroy(); - } - - /// - /// This is some unity-log capturing logic, and threading tools that allow logging to be caught and processed on another thread - /// - public abstract class PlayFabLoggerBase : IPlayFabLogger - { - private static readonly StringBuilder Sb = new StringBuilder(); - private readonly Queue LogMessageQueue = new Queue(); - private const int LOG_CACHE_INTERVAL_MS = 10000; - - private Thread _writeLogThread; - private readonly object _threadLock = new object(); - private static readonly TimeSpan _threadKillTimeout = TimeSpan.FromSeconds(60); - private DateTime _threadKillTime = DateTime.UtcNow + _threadKillTimeout; // Kill the thread after 1 minute of inactivity - private bool _isApplicationPlaying = true; - private int _pendingLogsCount; - - public IPAddress ip { get; set; } - public int port { get; set; } - public string url { get; set; } - - protected PlayFabLoggerBase() - { - PlayFabDataGatherer gatherer = new PlayFabDataGatherer(); - gatherer.GatherData(); - var message = gatherer.GenerateReport(); - lock (LogMessageQueue) - { - LogMessageQueue.Enqueue(message); - } - } - - public virtual void OnEnable() - { - PlayFabHttp.instance.StartCoroutine(RegisterLogger()); // Coroutine helper to set up log-callbacks - } - - private IEnumerator RegisterLogger() - { - yield return new WaitForEndOfFrame(); // Effectively just a short wait before activating this registration - if (!string.IsNullOrEmpty(PlayFabSettings.LoggerHost)) - { -#if UNITY_5 - Application.logMessageReceivedThreaded += HandleUnityLog; -#else - Application.RegisterLogCallback(HandleUnityLog); -#endif - } - } - - public virtual void OnDisable() - { - if (!string.IsNullOrEmpty(PlayFabSettings.LoggerHost)) - { -#if UNITY_5 - Application.logMessageReceivedThreaded -= HandleUnityLog; -#else - Application.RegisterLogCallback(null); -#endif - } - } - - public virtual void OnDestroy() - { - _isApplicationPlaying = false; - } - - /// - /// Logs are cached and written in bursts - /// BeginUploadLog is called at the begining of each burst - /// - protected abstract void BeginUploadLog(); - /// - /// Logs are cached and written in bursts - /// UploadLog is called for each cached log, between BeginUploadLog and EndUploadLog - /// - protected abstract void UploadLog(string message); - /// - /// Logs are cached and written in bursts - /// EndUploadLog is called at the end of each burst - /// - protected abstract void EndUploadLog(); - - /// - /// Handler to process Unity logs into our logging system - /// - /// - /// - /// - private void HandleUnityLog(string message, string stacktrace, LogType type) - { - if (!PlayFabSettings.EnableRealTimeLogging) - return; - - Sb.Length = 0; - if (type == LogType.Log || type == LogType.Warning) - { - Sb.Append(type).Append(": ").Append(message); - message = Sb.ToString(); - lock (LogMessageQueue) - { - LogMessageQueue.Enqueue(message); - } - } - else if (type == LogType.Error || type == LogType.Exception) - { - Sb.Append(type).Append(": ").Append(message).Append("\n").Append(stacktrace).Append(StackTraceUtility.ExtractStackTrace()); - message = Sb.ToString(); - lock (LogMessageQueue) - { - LogMessageQueue.Enqueue(message); - } - } - ActivateThreadWorker(); - } - - private void ActivateThreadWorker() - { - lock (_threadLock) - { - if (_writeLogThread != null) - { - return; - } - _writeLogThread = new Thread(WriteLogThreadWorker); - _writeLogThread.Start(); - } - } - - private void WriteLogThreadWorker() - { - try - { - bool active; - lock (_threadLock) - { - // Kill the thread after 1 minute of inactivity - _threadKillTime = DateTime.UtcNow + _threadKillTimeout; - } - - var localLogQueue = new Queue(); - do - { - lock (LogMessageQueue) - { - _pendingLogsCount = LogMessageQueue.Count; - while (LogMessageQueue.Count > 0) // Transfer the messages to the local queue - localLogQueue.Enqueue(LogMessageQueue.Dequeue()); - } - - BeginUploadLog(); - while (localLogQueue.Count > 0) // Transfer the messages to the local queue - UploadLog(localLogQueue.Dequeue()); - EndUploadLog(); - - #region Expire Thread. - // Check if we've been inactive - lock (_threadLock) - { - var now = DateTime.UtcNow; - if (_pendingLogsCount > 0 && _isApplicationPlaying) - { - // Still active, reset the _threadKillTime - _threadKillTime = now + _threadKillTimeout; - } - // Kill the thread after 1 minute of inactivity - active = now <= _threadKillTime; - if (!active) - { - _writeLogThread = null; - } - // This thread will be stopped, so null this now, inside lock (_threadLock) - } - #endregion - - Thread.Sleep(LOG_CACHE_INTERVAL_MS); - } while (active); - - } - catch (Exception e) - { - Debug.LogException(e); - _writeLogThread = null; - } - } - } -#else - public interface IPlayFabLogger - { - string ip { get; set; } - int port { get; set; } - string url { get; set; } - - // Unity MonoBehaviour callbacks - void OnEnable(); - void OnDisable(); - void OnDestroy(); - } - - /// - /// This is just a placeholder. WP8 doesn't support direct threading, but instead makes you use the await command. - /// - public abstract class PlayFabLoggerBase : IPlayFabLogger - { - public string ip { get; set; } - public int port { get; set; } - public string url { get; set; } - - // Unity MonoBehaviour callbacks - public void OnEnable() { } - public void OnDisable() { } - public void OnDestroy() { } - - protected abstract void BeginUploadLog(); - protected abstract void UploadLog(string message); - protected abstract void EndUploadLog(); - } -#endif - - /// - /// This translates the logs up to the PlayFab service via a PlayFab restful API - /// TODO: PLAYFAB - attach these to the PlayFab API - /// - public class PlayFabLogger : PlayFabLoggerBase - { - /// - /// Logs are cached and written in bursts - /// BeginUploadLog is called at the begining of each burst - /// - protected override void BeginUploadLog() - { - } - /// - /// Logs are cached and written in bursts - /// UploadLog is called for each cached log, between BeginUploadLog and EndUploadLog - /// - protected override void UploadLog(string message) - { - } - /// - /// Logs are cached and written in bursts - /// EndUploadLog is called at the end of each burst - /// - protected override void EndUploadLog() - { - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs.meta deleted file mode 100755 index 18ec9f00..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabLogger.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 65702fe1cdebb8e4783afb157a614161 -timeCreated: 1465847308 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs deleted file mode 100755 index 0b907e93..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using PlayFab.Public; -using UnityEngine; - -namespace PlayFab -{ - public enum WebRequestType - { - UnityWww, // High compatability Unity api calls - HttpWebRequest, // High performance multi-threaded api calls - CustomHttp //If this is used, you must set the Http to an IPlayFabHttp object. - } - - [Flags] - public enum PlayFabLogLevel - { - None = 0, - Debug = 1 << 0, - Info = 1 << 1, - Warning = 1 << 2, - Error = 1 << 3, - All = Debug | Info | Warning | Error, - } - - public static partial class PlayFabSettings - { - public static PlayFabSharedSettings PlayFabShared = GetSharedSettingsObject(); - public const string SdkVersion = "2.10.161003"; - public const string BuildIdentifier = "jbuild_unitysdk_0"; - public const string VersionString = "UnitySDK-2.10.161003"; - public const string DefaultPlayFabApiUrl = ".playfabapi.com"; - - public static PlayFabSharedSettings GetSharedSettingsObject() - { - var settingsList = Resources.LoadAll("PlayFabSharedSettings"); - if (settingsList.Length != 1) - { - throw new Exception("Either Missing PlayFabSharedSettings data file or multiple data files exist."); - } - return settingsList[0]; - } - - -#if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API - public static string DeveloperSecretKey - { - set { PlayFabShared.DeveloperSecretKey = value;} - internal get { return PlayFabShared.DeveloperSecretKey; } - } -#endif - - public static string DeviceUniqueIdentifier - { - get - { - var deviceId = ""; -#if UNITY_ANDROID && !UNITY_EDITOR - AndroidJavaClass up = new AndroidJavaClass ("com.unity3d.player.UnityPlayer"); - AndroidJavaObject currentActivity = up.GetStatic ("currentActivity"); - AndroidJavaObject contentResolver = currentActivity.Call ("getContentResolver"); - AndroidJavaClass secure = new AndroidJavaClass ("android.provider.Settings$Secure"); - deviceId = secure.CallStatic ("getString", contentResolver, "android_id"); -#else - deviceId = SystemInfo.deviceUniqueIdentifier; -#endif - return deviceId; - } - } - - - public static string ProductionEnvironmentUrl - { - get { return !string.IsNullOrEmpty(PlayFabShared.ProductionEnvironmentUrl) ? PlayFabShared.ProductionEnvironmentUrl : DefaultPlayFabApiUrl; } - set { PlayFabShared.ProductionEnvironmentUrl = value; } - } - - // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) - public static string TitleId - { - get { return PlayFabShared.TitleId; } - set { PlayFabShared.TitleId = value; } - } - - public static PlayFabLogLevel LogLevel - { - get { return PlayFabShared.LogLevel; } - set { PlayFabShared.LogLevel = value; } - } - - public static WebRequestType RequestType - { - get { return PlayFabShared.RequestType; } - set { PlayFabShared.RequestType = value; } - } - - public static int RequestTimeout - { - get { return PlayFabShared.RequestTimeout; } - set { PlayFabShared.RequestTimeout = value; } - - } - - public static bool RequestKeepAlive - { - get { return PlayFabShared.RequestKeepAlive; } - set { PlayFabShared.RequestKeepAlive = value; } - } - - public static bool CompressApiData - { - get { return PlayFabShared.CompressApiData; } - set { PlayFabShared.CompressApiData = value; } - } - - public static string LoggerHost - { - get { return PlayFabShared.LoggerHost; } - set { PlayFabShared.LoggerHost = value; } - - } - - public static int LoggerPort - { - get { return PlayFabShared.LoggerPort; } - set { PlayFabShared.LoggerPort = value; } - } - - public static bool EnableRealTimeLogging - { - get { return PlayFabShared.EnableRealTimeLogging; } - set { PlayFabShared.EnableRealTimeLogging = value; } - } - - public static int LogCapLimit - { - get { return PlayFabShared.LogCapLimit; } - set { PlayFabShared.LogCapLimit = value; } - } - - public static string GetFullUrl(string apiCall) - { - string output; - var baseUrl = ProductionEnvironmentUrl; - if (baseUrl.StartsWith("http")) - output = baseUrl + apiCall; - else - output = "https://" + TitleId + baseUrl + apiCall; - return output; - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs.meta deleted file mode 100755 index 96dbc65f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayFabSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: aa223f24327e645d39b48f0ca9615e68 -timeCreated: 1462682372 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream.meta deleted file mode 100755 index 7c3bcc39..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f0bf2dc34ef06f246b68722d28ba72f4 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs deleted file mode 100755 index 7d146f97..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs +++ /dev/null @@ -1,981 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace PlayFab.PlayStreamModels -{ - /// - /// The base type for all PlayStream events. - /// See https://api.playfab.com/playstream/docs/PlayStreamEventModels for more information - /// - public abstract class PlayStreamEventBase - { - public string Source; - public string EventId; - public string EntityId; - public string EntityType; - public string EventNamespace; - public string EventName; - public DateTime Timestamp; - public Dictionary CustomTags; - public List History; - public object Reserved; - } - - #region character - public class CharacterConsumedItemEventData : PlayStreamEventBase - { - public string ItemId; - public string ItemInstanceId; - public string CatalogVersion; - public uint PreviousUsesRemaining; - public uint UsesRemaining; - public string TitleId; - public string PlayerId; - } - public class CharacterCreatedEventData : PlayStreamEventBase - { - public DateTime Created; - public string TitleId; - public string PlayerId; - } - public class CharacterInventoryItemAddedEventData : PlayStreamEventBase - { - public string InstanceId; - public string ItemId; - public string DisplayName; - public string Class; - public string CatalogVersion; - public DateTime? Expiration; - public uint? RemainingUses; - public string Annotation; - public string CouponCode; - public List BundleContents; - public string TitleId; - public string PlayerId; - } - public class CharacterStatisticChangedEventData : PlayStreamEventBase - { - public string StatisticName; - public uint Version; - public int StatisticValue; - public int? StatisticPreviousValue; - public string TitleId; - public string PlayerId; - } - public class CharacterVCPurchaseEventData : PlayStreamEventBase - { - public string PurchaseId; - public string ItemId; - public string CatalogVersion; - public string CurrencyCode; - public int Quantity; - public uint UnitPrice; - public string TitleId; - public string PlayerId; - } - public class CharacterVirtualCurrencyBalanceChangedEventData : PlayStreamEventBase - { - public string VirtualCurrencyName; - public int VirtualCurrencyBalance; - public int VirtualCurrencyPreviousBalance; - public string OrderId; - public string TitleId; - public string PlayerId; - } - #endregion character - - #region partner - public class DisplayNameFilteredEventData : PlayStreamEventBase - { - public string PlayerId; - public string DisplayName; - } - #endregion partner - - #region player - public class PlayerAdCampaignAttributionEventData : PlayStreamEventBase - { - public string CampaignId; - public string TitleId; - } - public class PlayerAddedTitleEventData : PlayStreamEventBase - { - public LoginIdentityProvider? Platform; - public string PlatformUserId; - public string DisplayName; - public string TitleId; - } - public class PlayerBannedEventData : PlayStreamEventBase - { - public DateTime? BanExpiration; - public bool PermanentBan; - public string BanId; - public string BanReason; - public string TitleId; - } - public class PlayerCompletedPasswordResetEventData : PlayStreamEventBase - { - public string RecoveryEmailAddress; - public string PasswordResetId; - public string InitiatedFromIPAddress; - public DateTime InitiationTimestamp; - public PasswordResetInitiationSource? InitiatedBy; - public DateTime LinkExpiration; - public string CompletedFromIPAddress; - public DateTime CompletionTimestamp; - public string TitleId; - } - public class PlayerConsumedItemEventData : PlayStreamEventBase - { - public string ItemId; - public string CatalogVersion; - public string ItemInstanceId; - public uint PreviousUsesRemaining; - public uint UsesRemaining; - public string TitleId; - } - public class PlayerCreatedEventData : PlayStreamEventBase - { - public DateTime Created; - public string PublisherId; - public string TitleId; - } - public class PlayerDisplayNameChangedEventData : PlayStreamEventBase - { - public string PreviousDisplayName; - public string DisplayName; - public string TitleId; - } - public class PlayerExecutedCloudScriptEventData : PlayStreamEventBase - { - public string FunctionName; - public ExecuteCloudScriptResult CloudScriptExecutionResult; - public string TitleId; - } - public class PlayerInventoryItemAddedEventData : PlayStreamEventBase - { - public string InstanceId; - public string ItemId; - public string DisplayName; - public string Class; - public string CatalogVersion; - public DateTime? Expiration; - public uint? RemainingUses; - public string Annotation; - public string CouponCode; - public List BundleContents; - public string TitleId; - } - public class PlayerJoinedLobbyEventData : PlayStreamEventBase - { - public string LobbyId; - public string GameMode; - public string Region; - public string TitleId; - } - public class PlayerLeftLobbyEventData : PlayStreamEventBase - { - public string LobbyId; - public string GameMode; - public string Region; - public string TitleId; - } - public class PlayerLinkedAccountEventData : PlayStreamEventBase - { - public LoginIdentityProvider? Origination; - public string OriginationUserId; - public string Username; - public string Email; - public string TitleId; - } - public class PlayerLoggedInEventData : PlayStreamEventBase - { - public LoginIdentityProvider? Platform; - public string PlatformUserId; - public string TitleId; - } - public class PlayerMatchedWithLobbyEventData : PlayStreamEventBase - { - public string LobbyId; - public string GameMode; - public string Region; - public string TitleId; - } - public class PlayerPasswordResetLinkSentEventData : PlayStreamEventBase - { - public string RecoveryEmailAddress; - public string InitiatedFromIPAddress; - public PasswordResetInitiationSource? InitiatedBy; - public string PasswordResetId; - public DateTime LinkExpiration; - public string TitleId; - } - public class PlayerRealMoneyPurchaseEventData : PlayStreamEventBase - { - public string PaymentProvider; - public PaymentType? PaymentType; - public uint OrderTotal; - public uint? TransactionTotal; - public Currency? TransactionCurrency; - public string OrderId; - public string TitleId; - } - public class PlayerRedeemedCouponEventData : PlayStreamEventBase - { - public string CouponCode; - public List GrantedInventoryItems; - public string TitleId; - } - public class PlayerRegisteredPushNotificationsEventData : PlayStreamEventBase - { - public PushNotificationPlatform? Platform; - public string DeviceToken; - public string TitleId; - } - public class PlayerReportedAsAbusiveEventData : PlayStreamEventBase - { - public string ReportedByPlayer; - public string Comment; - public string TitleId; - } - public class PlayerStatisticChangedEventData : PlayStreamEventBase - { - public string StatisticName; - public uint StatisticId; - public uint Version; - public int StatisticValue; - public int? StatisticPreviousValue; - public string TitleId; - } - public class PlayerStatisticDeletedEventData : PlayStreamEventBase - { - public string StatisticName; - public uint StatisticId; - public uint Version; - public int? StatisticPreviousValue; - public string TitleId; - } - public class PlayerTagAddedEventData : PlayStreamEventBase - { - public string TagName; - public string Namespace; - public string TitleId; - } - public class PlayerTagRemovedEventData : PlayStreamEventBase - { - public string TagName; - public string Namespace; - public string TitleId; - } - public class PlayerTriggeredActionExecutedCloudScriptEventData : PlayStreamEventBase - { - public string FunctionName; - public ExecuteCloudScriptResult CloudScriptExecutionResult; - public object TriggeringEventData; - public string TriggeringEventName; - public PlayerProfile TriggeringPlayer; - public string TitleId; - } - public class PlayerUnlinkedAccountEventData : PlayStreamEventBase - { - public LoginIdentityProvider? Origination; - public string OriginationUserId; - public string TitleId; - } - public class PlayerVCPurchaseEventData : PlayStreamEventBase - { - public string PurchaseId; - public string ItemId; - public string CatalogVersion; - public string CurrencyCode; - public int Quantity; - public uint UnitPrice; - public string TitleId; - } - public class PlayerVirtualCurrencyBalanceChangedEventData : PlayStreamEventBase - { - public string VirtualCurrencyName; - public int VirtualCurrencyBalance; - public int VirtualCurrencyPreviousBalance; - public string OrderId; - public string TitleId; - } - #endregion player - - #region session - public class SessionEndedEventData : PlayStreamEventBase - { - public DateTime EndTime; - public string UserId; - public double? KilobytesWritten; - public double SessionLengthMs; - public bool Crashed; - public string TitleId; - } - public class SessionStartedEventData : PlayStreamEventBase - { - public string TemporaryWriteUrl; - public string TitleId; - } - #endregion session - - #region title - public class TitleAddedCloudScriptEventData : PlayStreamEventBase - { - public int Version; - public int Revision; - public bool Published; - public List ScriptNames; - public string UserId; - public string DeveloperId; - } - public class TitleAddedGameBuildEventData : PlayStreamEventBase - { - public string BuildId; - public List Regions; - public int MinFreeGameSlots; - public int MaxGamesPerHost; - public string UserId; - public string DeveloperId; - } - public class TitleCatalogUpdatedEventData : PlayStreamEventBase - { - public string CatalogVersion; - public bool Deleted; - public string UserId; - public string DeveloperId; - } - public class TitleClientRateLimitedEventData : PlayStreamEventBase - { - public string GraphUrl; - public string AlertEventId; - public string API; - public string ErrorCode; - public AlertLevel? Level; - public AlertStates? AlertState; - } - public class TitleExceededLimitEventData : PlayStreamEventBase - { - public string LimitId; - public string LimitDisplayName; - public MetricUnit? Unit; - public double LimitValue; - public double Value; - public Dictionary Details; - } - public class TitleHighErrorRateEventData : PlayStreamEventBase - { - public string GraphUrl; - public string AlertEventId; - public string API; - public string ErrorCode; - public AlertLevel? Level; - public AlertStates? AlertState; - } - public class TitleInitiatedPlayerPasswordResetEventData : PlayStreamEventBase - { - public string PlayerId; - public string PlayerRecoveryEmailAddress; - public string PasswordResetId; - public string UserId; - public string DeveloperId; - } - public class TitleLimitChangedEventData : PlayStreamEventBase - { - public string LimitId; - public string LimitDisplayName; - public MetricUnit? Unit; - public string TransactionId; - public double? PreviousPriceUSD; - public double? PreviousValue; - public double? PriceUSD; - public double? Value; - } - public class TitleModifiedGameBuildEventData : PlayStreamEventBase - { - public string BuildId; - public List Regions; - public int MinFreeGameSlots; - public int MaxGamesPerHost; - public string UserId; - public string DeveloperId; - } - public class TitleNewsUpdatedEventData : PlayStreamEventBase - { - public string NewsId; - public string NewsTitle; - public DateTime DateCreated; - public NewsStatus? Status; - } - public class TitlePublishedCloudScriptEventData : PlayStreamEventBase - { - public int Revision; - public string UserId; - public string DeveloperId; - } - public class TitleRequestedLimitChangeEventData : PlayStreamEventBase - { - public string LimitId; - public string LimitDisplayName; - public MetricUnit? Unit; - public string TransactionId; - public string PreviousLevelName; - public double? PreviousPriceUSD; - public double? PreviousValue; - public string LevelName; - public double? PriceUSD; - public double? Value; - public string UserId; - public string DeveloperId; - } - public class TitleScheduledCloudScriptExecutedEventData : PlayStreamEventBase - { - public NameId ScheduledTask; - public string FunctionName; - public ExecuteCloudScriptResult CloudScriptExecutionResult; - } - public class TitleStatisticVersionChangedEventData : PlayStreamEventBase - { - public string StatisticName; - public uint StatisticVersion; - public StatisticResetIntervalOption? ScheduledResetInterval; - public DateTime? ScheduledResetTime; - } - public class TitleStoreUpdatedEventData : PlayStreamEventBase - { - public string CatalogVersion; - public string StoreId; - public bool Deleted; - public string UserId; - public string DeveloperId; - } - #endregion title - - public enum LoginIdentityProvider - { - Unknown, - PlayFab, - Custom, - GameCenter, - GooglePlay, - Steam, - XBoxLive, - PSN, - Kongregate, - Facebook, - IOSDevice, - AndroidDevice, - Twitch - } - - public enum PasswordResetInitiationSource - { - Self, - Admin - } - - [Serializable] - public class CouponGrantedInventoryItem - { - /// - /// Unique instance ID of the inventory item. - /// - public string InstanceId { get; set;} - /// - /// Catalog item ID of the inventory item. - /// - public string ItemId { get; set;} - /// - /// Catalog version of the inventory item. - /// - public string CatalogVersion { get; set;} - } - - public enum PaymentType - { - Purchase, - ReceiptValidation - } - - public enum Currency - { - AED, - AFN, - ALL, - AMD, - ANG, - AOA, - ARS, - AUD, - AWG, - AZN, - BAM, - BBD, - BDT, - BGN, - BHD, - BIF, - BMD, - BND, - BOB, - BRL, - BSD, - BTN, - BWP, - BYR, - BZD, - CAD, - CDF, - CHF, - CLP, - CNY, - COP, - CRC, - CUC, - CUP, - CVE, - CZK, - DJF, - DKK, - DOP, - DZD, - EGP, - ERN, - ETB, - EUR, - FJD, - FKP, - GBP, - GEL, - GGP, - GHS, - GIP, - GMD, - GNF, - GTQ, - GYD, - HKD, - HNL, - HRK, - HTG, - HUF, - IDR, - ILS, - IMP, - INR, - IQD, - IRR, - ISK, - JEP, - JMD, - JOD, - JPY, - KES, - KGS, - KHR, - KMF, - KPW, - KRW, - KWD, - KYD, - KZT, - LAK, - LBP, - LKR, - LRD, - LSL, - LYD, - MAD, - MDL, - MGA, - MKD, - MMK, - MNT, - MOP, - MRO, - MUR, - MVR, - MWK, - MXN, - MYR, - MZN, - NAD, - NGN, - NIO, - NOK, - NPR, - NZD, - OMR, - PAB, - PEN, - PGK, - PHP, - PKR, - PLN, - PYG, - QAR, - RON, - RSD, - RUB, - RWF, - SAR, - SBD, - SCR, - SDG, - SEK, - SGD, - SHP, - SLL, - SOS, - SPL, - SRD, - STD, - SVC, - SYP, - SZL, - THB, - TJS, - TMT, - TND, - TOP, - TRY, - TTD, - TVD, - TWD, - TZS, - UAH, - UGX, - USD, - UYU, - UZS, - VEF, - VND, - VUV, - WST, - XAF, - XCD, - XDR, - XOF, - XPF, - YER, - ZAR, - ZMW, - ZWD - } - - [Serializable] - public class LogStatement - { - /// - /// 'Debug', 'Info', or 'Error' - /// - public string Level { get; set;} - public string Message { get; set;} - /// - /// Optional object accompanying the message as contextual information - /// - public object Data { get; set;} - } - - [Serializable] - public class ScriptExecutionError - { - /// - /// Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError - /// - public string Error { get; set;} - /// - /// Details about the error - /// - public string Message { get; set;} - /// - /// Point during the execution of the script at which the error occurred, if any - /// - public string StackTrace { get; set;} - } - - [Serializable] - public class ExecuteCloudScriptResult - { - /// - /// The name of the function that executed - /// - public string FunctionName { get; set;} - /// - /// The revision of the CloudScript that executed - /// - public int Revision { get; set;} - /// - /// The object returned from the CloudScript function, if any - /// - public object FunctionResult { get; set;} - /// - /// Entries logged during the function execution. These include both entries logged in the function code using log.info() and log.error() and error entries for API and HTTP request failures. - /// - public List Logs { get; set;} - public double ExecutionTimeSeconds { get; set;} - /// - /// Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP requests. - /// - public double ProcessorTimeSeconds { get; set;} - public uint MemoryConsumedBytes { get; set;} - /// - /// Number of PlayFab API requests issued by the CloudScript function - /// - public int APIRequestsIssued { get; set;} - /// - /// Number of external HTTP requests issued by the CloudScript function - /// - public int HttpRequestsIssued { get; set;} - /// - /// Information about the error, if any, that occured during execution - /// - public ScriptExecutionError Error { get; set;} - } - - [Serializable] - public class AdCampaignAttribution - { - /// - /// Attribution network name - /// - public string Platform { get; set;} - /// - /// Attribution campaign identifier - /// - public string CampaignId { get; set;} - /// - /// UTC time stamp of attribution - /// - public DateTime AttributedAt { get; set;} - } - - public enum PushNotificationPlatform - { - ApplePushNotificationService, - GoogleCloudMessaging - } - - [Serializable] - public class PushNotificationRegistration - { - /// - /// Push notification platform - /// - public PushNotificationPlatform? Platform { get; set;} - /// - /// Notification configured endpoint - /// - public string NotificationEndpointARN { get; set;} - } - - [Serializable] - public class PlayerLinkedAccount - { - /// - /// Authentication platform - /// - public LoginIdentityProvider? Platform { get; set;} - /// - /// Platform user identifier - /// - public string PlatformUserId { get; set;} - /// - /// Linked account's username - /// - public string Username { get; set;} - /// - /// Linked account's email - /// - public string Email { get; set;} - } - - [Serializable] - public class PlayerStatistic - { - /// - /// Statistic ID - /// - public string Id { get; set;} - /// - /// Statistic version (0 if not a versioned statistic) - /// - public int StatisticVersion { get; set;} - /// - /// Current statistic value - /// - public int StatisticValue { get; set;} - /// - /// Statistic name - /// - public string Name { get; set;} - } - - [Serializable] - public class PlayerProfile - { - /// - /// PlayFab Player ID - /// - public string PlayerId { get; set;} - /// - /// Title ID this profile applies to - /// - public string TitleId { get; set;} - /// - /// Player Display Name - /// - public string DisplayName { get; set;} - /// - /// Publisher this player belongs to - /// - public string PublisherId { get; set;} - /// - /// Player account origination - /// - public LoginIdentityProvider? Origination { get; set;} - /// - /// Player record created - /// - public DateTime? Created { get; set;} - /// - /// Last login - /// - public DateTime? LastLogin { get; set;} - /// - /// Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. - /// - public DateTime? BannedUntil { get; set;} - /// - /// Dictionary of player's statistics using only the latest version's value - /// - public Dictionary Statistics { get; set;} - /// - /// A sum of player's total purchases in USD across all currencies. - /// - public uint? TotalValueToDateInUSD { get; set;} - /// - /// Dictionary of player's total purchases by currency. - /// - public Dictionary ValuesToDate { get; set;} - /// - /// List of player's tags for segmentation. - /// - public List Tags { get; set;} - /// - /// Dictionary of player's virtual currency balances - /// - public Dictionary VirtualCurrencyBalances { get; set;} - /// - /// Array of ad campaigns player has been attributed to - /// - public List AdCampaignAttributions { get; set;} - /// - /// Array of configured push notification end points - /// - public List PushNotificationRegistrations { get; set;} - /// - /// Array of third party accounts linked to this player - /// - public List LinkedAccounts { get; set;} - /// - /// Array of player statistics - /// - public List PlayerStatistics { get; set;} - } - - public enum Region - { - USCentral, - USEast, - EUWest, - Singapore, - Japan, - Brazil, - Australia - } - - public enum AlertLevel - { - Warn, - Alert, - Critical - } - - public enum AlertStates - { - Triggered, - Recovered, - ReTriggered - } - - public enum NewsStatus - { - None, - Unpublished, - Published, - Archived - } - - public enum MetricUnit - { - Value, - Count, - Percent, - Milliseconds, - Seconds, - Hours, - Days, - Bits, - Bytes, - Kilobytes, - Megabytes, - Gigabytes, - Terabytes, - Bytes_Per_Second, - MonthlyActiveUsers - } - - public enum StatisticResetIntervalOption - { - Never, - Hour, - Day, - Week, - Month - } - - [Serializable] - public class NameId - { - public string Name { get; set;} - public string Id { get; set;} - } - - public enum SourceType - { - Admin, - BackEnd, - GameClient, - GameServer, - Partner - } - - [Serializable] - public class PlayStreamEventHistory - { - /// - /// The ID of the trigger that caused this event to be created. - /// - public string ParentTriggerId { get; set;} - /// - /// The ID of the previous event that caused this event to be created by hitting a trigger. - /// - public string ParentEventId { get; set;} - /// - /// If true, then this event was allowed to trigger subsequent events in a trigger. - /// - public bool TriggeredEvents { get; set;} - } - -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs.meta deleted file mode 100755 index f567fa99..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/PlayStream/PlayStreamEventDataModels.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ada73ee150f7d7c499750b6803001525 -timeCreated: 1468016317 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources.meta deleted file mode 100755 index ae16aefd..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c770a70afd8f88f40bb0f25e3b0dbb55 -folderAsset: yes -timeCreated: 1468086149 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset deleted file mode 100755 index 95764387..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset.meta deleted file mode 100755 index ba32cafb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 5a92c1fb237627149add1cc3f2a52ca1 -NativeFormatImporter: - userData: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20.meta deleted file mode 100755 index cbb429ee..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bb2334e73f5b30f4b816af2f60b9ed6b -folderAsset: yes -timeCreated: 1468866288 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs deleted file mode 100755 index 96ee83fc..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs +++ /dev/null @@ -1,232 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Net; -using System.Reflection; -using System.Threading; -using PlayFab.Json; -using SignalR.Client._20.Http; -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20 -{ - public class Connection : IConnection - { - private static Version m_assemblyVersion; - private IClientTransport m_transport; - private bool m_initialized; - public event Action Received; - public event Action Error; - public event Action Closed; - public event Action Reconnected; - - public CookieContainer CookieContainer { get; set; } - public ICredentials Credentials { get; set; } - public IEnumerable Groups { get; set; } - public System.Func Sending { get; set; } - public string Url { get; private set; } - public bool IsActive { get; private set; } - public string MessageId { get; set; } - public string ConnectionId { get; set; } - public IDictionary Items { get; private set; } - public string QueryString { get; private set; } - public string ConnectionToken { get; set; } - public string GroupsToken { get; set; } - - public Connection(string url) - : this(url, (string)null) - { - } - - public Connection(string url, IDictionary queryString) - : this(url, CreateQueryString(queryString)) - { - } - - public Connection(string url, string queryString) - { - if (url.Contains("?")) - throw new ArgumentException("Url cannot contain QueryString directly. Pass QueryString values in using available overload.", "url"); - - if (!url.EndsWith("/")) - url += "/"; - - Url = url; - QueryString = queryString; - Groups = new List(); - Items = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - public void Start() - { - // Pick the best transport supported by the client - Start(new DefaultHttpClient()); - } - - public void Start(IHttpClient httpClient) - { - Start(new AutoTransport(httpClient)); - } - - public virtual void Start(IClientTransport transport) - { - if (IsActive) - return; - - IsActive = true; - m_transport = transport; - Negotiate(transport); - } - - private void Negotiate(IClientTransport transport) - { - ManualResetEvent manualResetEvent = new ManualResetEvent(false); - - var signal = transport.Negotiate(this); - signal.Finished += (sender, e) => - { - VerifyProtocolVersion(e.Result.ProtocolVersion); - - ConnectionId = e.Result.ConnectionId; - ConnectionToken = e.Result.ConnectionToken; - - if (Sending != null) - { - var data = Sending(); - StartTransport(data); - manualResetEvent.Set(); - } - else - { - StartTransport(null); - manualResetEvent.Set(); - } - }; - manualResetEvent.WaitOne(); - m_initialized = true; - } - - private void StartTransport(string data) - { - m_transport.Start(this, data); - } - - private void VerifyProtocolVersion(string versionString) - { - Version version; - if (String.IsNullOrEmpty(versionString) || - !TryParseVersion(versionString, out version) || - !(version.Major == 1 && version.Minor == 2)) - { - throw new InvalidOperationException("Incompatible protocol version."); - } - } - - public virtual void Stop() - { - try - { - // Do nothing if the connection was never started - if (!m_initialized) - return; - - m_transport.Stop(this); - - if (Closed != null) - Closed(); - } - finally - { - IsActive = false; - m_initialized = false; - } - } - - public EventSignal Send(string data) - { - return Send(data); - } - - public EventSignal Send(string data) - { - if (!m_initialized) - throw new InvalidOperationException("Start must be called before data can be sent"); - - return m_transport.Send(this, data); - } - - void IConnection.OnReceived(JsonObject message) - { - OnReceived(message); - } - - protected virtual void OnReceived(JsonObject message) - { - if (Received != null) - Received(message.ToString()); - } - - void IConnection.OnError(Exception error) - { - if (Error != null) - Error(error); - } - - void IConnection.OnReconnected() - { - if (Reconnected != null) - Reconnected(); - } - - void IConnection.PrepareRequest(IRequest request) - { - request.UserAgent = CreateUserAgentString("SignalR.Client"); - if (Credentials != null) - request.Credentials = Credentials; - - if (CookieContainer != null) - request.CookieContainer = CookieContainer; - - } - - private static string CreateUserAgentString(string client) - { - if (m_assemblyVersion == null) - m_assemblyVersion = new AssemblyName(typeof(Connection).Assembly.FullName).Version; - - return String.Format( - CultureInfo.InvariantCulture, - "{0}/{1} ({2})", - client, - m_assemblyVersion, - Environment.OSVersion); - } - - private static bool TryParseVersion(string versionString, out Version version) - { - try - { - version = new Version(versionString); - return true; - } - catch (ArgumentException) - { - version = new Version(); - return false; - } - } - - private static string CreateQueryString(IDictionary queryString) - { - var _stringList = new List(); - foreach (var keyValue in queryString) - { - _stringList.Add(keyValue.Key + "=" + keyValue.Value); - } - return String.Join("&", _stringList.ToArray()); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs.meta deleted file mode 100755 index ffc4ce69..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Connection.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bda842e6cfcef09439e1ae6202da5dc0 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs deleted file mode 100755 index 14de9643..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20 -{ - public static class ConnectionExtensions - { - public static T GetValue(IConnection connection, string key) - { - object _value; - if (connection.Items.TryGetValue(key, out _value)) - return (T)_value; - - return default(T); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs.meta deleted file mode 100755 index b4c23fd5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/ConnectionExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7a938fc4f6573774abecf21bb21e1a85 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs deleted file mode 100755 index 027cfe7f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs +++ /dev/null @@ -1,22 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20 -{ - internal class DisposableAction : IDisposable - { - private readonly Action m_action; - - public DisposableAction(System.Action action) - { - m_action = action; - } - - public void Dispose() - { - m_action(); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs.meta deleted file mode 100755 index 5d4be86f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/DisposableAction.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8b5decf629519ff4abee2ef7e18136ba -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http.meta deleted file mode 100755 index 661884e9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 5ac4907c6bf9cbf4c9d14d233da255d1 -folderAsset: yes -timeCreated: 1467844118 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs deleted file mode 100755 index bdf832c4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs +++ /dev/null @@ -1,14 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Http -{ - public class CallbackDetail - { - public bool IsFaulted { get; set; } - public Exception Exception { get; set; } - public T Result { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs.meta deleted file mode 100755 index 63162157..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/CallbackDetail.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8d9e1e22f06d38e4eb2a25454ccfc9cb -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs deleted file mode 100755 index 4c2c0a2e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20.Http -{ - public class DefaultHttpClient : IHttpClient - { - public EventSignal GetAsync(string url, Action prepareRequest) - { - var _returnSignal = new EventSignal(); - var _signal = HttpHelper.GetAsync(url, request => prepareRequest(new HttpWebRequestWrapper(request))); - - _signal.Finished += (sender, e) => _returnSignal.OnFinish(new HttpWebResponseWrapper(e.Result.Result) - { - Exception = e.Result.Exception, - IsFaulted = e.Result.IsFaulted - }); - - return _returnSignal; - } - - public EventSignal PostAsync(string url, Action prepareRequest, Dictionary postData) - { - var _returnSignal = new EventSignal(); - var _signal = HttpHelper.PostAsync(url, request => - prepareRequest(new HttpWebRequestWrapper(request)), postData); - - _signal.Finished += (sender, e) => _returnSignal.OnFinish( - new HttpWebResponseWrapper(e.Result.Result) - { - Exception = e.Result.Exception, - IsFaulted = e.Result.IsFaulted - }); - return _returnSignal; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs.meta deleted file mode 100755 index b706d2a0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/DefaultHttpClient.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f58b18848b8a17f4dab28dd04a1a699b -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs deleted file mode 100755 index 148520ec..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs +++ /dev/null @@ -1,206 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Text; -using SignalR.Client._20.Transports; -using SignalR.Infrastructure; - -namespace SignalR.Client._20.Http -{ - internal static class HttpHelper - { - public static EventSignal> PostAsync(string url) - { - return PostInternal(url, null, null); - } - - public static void PostAsync(string url, IDictionary postData) - { - PostInternal(url, null, postData); - } - - public static EventSignal> PostAsync( - string url, - Action requestPreparer) - { - return PostInternal(url, requestPreparer, null); - } - - public static EventSignal> PostAsync( - string url, - Action requestPreparer, - IDictionary postData) - { - return PostInternal(url, requestPreparer, postData); - } - - public static string ReadAsString(HttpWebResponse response) - { - try - { - using (response) - { - using (var stream = response.GetResponseStream()) - { - using (var reader = new StreamReader(stream)) - { - return reader.ReadToEnd(); - } - } - } - } - catch - { - return null; - } - } - - private static EventSignal> PostInternal( - string url, - Action requestPreparer, - IDictionary postData) - { - var _request = (HttpWebRequest)HttpWebRequest.Create(url); - - if (requestPreparer != null) - requestPreparer(_request); - - var buffer = ProcessPostData(postData); - - _request.Method = "POST"; - _request.ContentType = "application/x-www-form-urlencoded"; - // Set the content length if the buffer is non-null - _request.ContentLength = buffer != null ? buffer.LongLength : 0; - - EventSignal> _signal = - new EventSignal>(); - - if (buffer == null) - { - // If there's nothing to be written to the request then just get the response - GetResponseAsync(_request, _signal); - return _signal; - } - - RequestState _requestState = new RequestState - { - PostData = buffer, - Request = _request, - Response = _signal - }; - - try - { - _request.BeginGetRequestStream(GetRequestStreamCallback, _requestState); - } - catch (Exception ex) - { - _signal.OnFinish(new CallbackDetail { IsFaulted = true, Exception = ex }); - } - return _signal; - } - - public static EventSignal> GetAsync(string url) - { - return GetAsync(url, null); - } - - public static EventSignal> GetAsync(string url, Action requestPreparer) - { - var _request = (HttpWebRequest)HttpWebRequest.Create(url); - if (requestPreparer != null) - { - requestPreparer(_request); - } - var signal = new EventSignal>(); - GetResponseAsync(_request, signal); - return signal; - } - - public static void GetResponseAsync(HttpWebRequest request, EventSignal> signal) - { - try - { - request.BeginGetResponse( - GetResponseCallback, - new RequestState - { - Request = request, - PostData = new byte[] { }, - Response = signal - }); - } - catch (Exception ex) - { - signal.OnFinish(new CallbackDetail { Exception = ex, IsFaulted = true }); - } - } - - private static void GetRequestStreamCallback(IAsyncResult asynchronousResult) - { - RequestState _requestState = (RequestState)asynchronousResult.AsyncState; - - // End the operation - try - { - Stream _postStream = _requestState.Request.EndGetRequestStream(asynchronousResult); - - // Write to the request stream. - _postStream.Write(_requestState.PostData, 0, _requestState.PostData.Length); - _postStream.Close(); - } - catch (WebException exception) - { - _requestState.Response.OnFinish(new CallbackDetail - { - IsFaulted = true, - Exception = exception - }); - return; - } - - // Start the asynchronous operation to get the response - _requestState.Request.BeginGetResponse(GetResponseCallback, _requestState); - } - - private static void GetResponseCallback(IAsyncResult asynchronousResult) - { - RequestState _requestState = (RequestState)asynchronousResult.AsyncState; - - // End the operation - try - { - HttpWebResponse _response = (HttpWebResponse)_requestState.Request.EndGetResponse(asynchronousResult); - _requestState.Response.OnFinish(new CallbackDetail - { - Result = _response - }); - } - catch (Exception ex) - { - _requestState.Response.OnFinish(new CallbackDetail { IsFaulted = true, Exception = ex }); - } - } - - private static byte[] ProcessPostData(IDictionary postData) - { - if (postData == null || postData.Count == 0) - return null; - - var _stringB = new StringBuilder(); - foreach (var pair in postData) - { - if (_stringB.Length > 0) - _stringB.Append("&"); - - if (String.IsNullOrEmpty(pair.Value)) - continue; - _stringB.AppendFormat("{0}={1}", pair.Key, UriQueryUtility.UrlEncode(pair.Value)); - } - return Encoding.UTF8.GetBytes(_stringB.ToString()); - } - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs.meta deleted file mode 100755 index 2381676d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a38515a2c3abf4649b0ec9ed430bb367 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs deleted file mode 100755 index 212d9a08..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs +++ /dev/null @@ -1,70 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Net; - -namespace SignalR.Client._20.Http -{ - public class HttpWebRequestWrapper : IRequest - { - private readonly HttpWebRequest m_request; - - public HttpWebRequestWrapper(HttpWebRequest request) - { - m_request = request; - } - - public string UserAgent - { - get - { - return m_request.UserAgent; - } - set - { - m_request.UserAgent = value; - } - } - - public ICredentials Credentials - { - get - { - return m_request.Credentials; - } - set - { - m_request.Credentials = value; - } - } - - public CookieContainer CookieContainer - { - get - { - return m_request.CookieContainer; - } - set - { - m_request.CookieContainer = value; - } - } - - public string Accept - { - get - { - return m_request.Accept; - } - set - { - m_request.Accept = value; - } - } - - public void Abort() - { - m_request.Abort(); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs.meta deleted file mode 100755 index 16e00d54..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebRequestWrapper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a05ff0b87f76b63498213451917133e0 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs deleted file mode 100755 index 49aef3f7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs +++ /dev/null @@ -1,38 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.IO; -using System.Net; - -namespace SignalR.Client._20.Http -{ - public class HttpWebResponseWrapper : IResponse - { - private readonly HttpWebResponse m_response; - - public HttpWebResponseWrapper(HttpWebResponse response) - { - m_response = response; - } - - public string ReadAsString() - { - return HttpHelper.ReadAsString(m_response); - } - - public Stream GetResponseStream() - { - return m_response.GetResponseStream(); - } - - public void Close() - { - ((IDisposable)m_response).Dispose(); - } - - public bool IsFaulted { get; set; } - - public Exception Exception { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs.meta deleted file mode 100755 index 7f3e0cf5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/HttpWebResponseWrapper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 19a6a6dbd9d55444c90437f41bda31a8 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs deleted file mode 100755 index e29d6451..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs +++ /dev/null @@ -1,16 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20.Http -{ - public interface IHttpClient - { - EventSignal GetAsync(string url, Action prepareRequest); - - EventSignal PostAsync(string url, Action prepareRequest, Dictionary postData); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs.meta deleted file mode 100755 index 071c0e09..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClient.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 83149f98edda6324d84a06317d68416a -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs deleted file mode 100755 index 88c5417e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20.Http -{ - public static class IHttpClientExtensions - { - public static EventSignal PostAsync( - IHttpClient client, - string url, - Action prepareRequest) - { - return client.PostAsync(url, prepareRequest, null); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs.meta deleted file mode 100755 index e2f94fdb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IHttpClientExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 36fe59444171f8a44b020590dbe6b597 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs deleted file mode 100755 index c6c4f801..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Net; - -namespace SignalR.Client._20.Http -{ - public interface IRequest - { - string UserAgent { get; set; } - - ICredentials Credentials { get; set; } - - CookieContainer CookieContainer { get; set; } - - string Accept { get; set; } - - void Abort(); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs.meta deleted file mode 100755 index ecbfbaff..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IRequest.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3ca2a9df330cd0346b6d1b45edbee6f9 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs deleted file mode 100755 index dae702b5..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs +++ /dev/null @@ -1,21 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.IO; - -namespace SignalR.Client._20.Http -{ - public interface IResponse - { - string ReadAsString(); - - Stream GetResponseStream(); - - void Close(); - - bool IsFaulted { get; set; } - - Exception Exception { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs.meta deleted file mode 100755 index f3055ba3..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/IResponse.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bb69ffe84cdf6e54ca20ac491cd6f9a8 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs deleted file mode 100755 index 06f81f56..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs +++ /dev/null @@ -1,15 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using SignalR.Client._20.Transports; -using System.Net; - -namespace SignalR.Client._20.Http -{ - public class RequestState - { - public HttpWebRequest Request { get; set; } - public EventSignal> Response { get; set; } - public byte[] PostData { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs.meta deleted file mode 100755 index 9a43cfe6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Http/RequestState.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 31f7608df9210674f9f0b049be4264e8 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs.meta deleted file mode 100755 index e032fd49..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8bfe5eecb753da8499d16be6eb0fa7e3 -folderAsset: yes -timeCreated: 1467844118 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs deleted file mode 100755 index c2bddc5b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs +++ /dev/null @@ -1,83 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Collections.Generic; -using SignalR.Client._20.Transports; -using PlayFab.Json; - -namespace SignalR.Client._20.Hubs -{ - public class HubConnection : Connection - { - private readonly Dictionary m_hubs = new Dictionary(); - - public HubConnection(string url) - : base(GetUrl(url)) - { - } - - public HubConnection(string url, IDictionary queryString) - : base(GetUrl(url), queryString) - { - } - - public override void Start(IClientTransport transport) - { - Sending += OnConnectionSending; - base.Start(transport); - } - - public override void Stop() - { - Sending -= OnConnectionSending; - base.Stop(); - } - - protected override void OnReceived(JsonObject message) - { - var _invocation = PlayFabSimpleJson.DeserializeObject(message.ToString()); - HubProxy _hubProxy; - - if (m_hubs.TryGetValue(_invocation.Hub, out _hubProxy)) - { - if (_invocation.State != null) - { - foreach (var state in _invocation.State) - { - _hubProxy[state.Key] = state.Value; - } - } - _hubProxy.InvokeEvent(_invocation.Method, _invocation.Args); - } - base.OnReceived(message); - } - - public IHubProxy CreateProxy(string hubName) - { - HubProxy _hubProxy; - if (!m_hubs.TryGetValue(hubName, out _hubProxy)) - { - _hubProxy = new HubProxy(this, hubName); - m_hubs[hubName] = _hubProxy; - } - return _hubProxy; - } - - private string OnConnectionSending() - { - var _data = new List(); - foreach (var p in m_hubs) - { - _data.Add(new HubRegistrationData { Name = p.Key }); - } - return PlayFabSimpleJson.SerializeObject(_data); - } - - private static string GetUrl(string url) - { - if (!url.EndsWith("/")) - url += "/"; - return url + "signalr"; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs.meta deleted file mode 100755 index c0c02611..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubConnection.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e58c2c36976089c478942b8cd62eed17 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs deleted file mode 100755 index b3c7619f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Collections.Generic; -using PlayFab.Json; - -namespace SignalR.Client._20.Hubs -{ - public class HubInvocation - { - [JsonProperty(PropertyName = "I")] - public string CallbackId { get; set; } - - [JsonProperty(PropertyName = "H")] - public string Hub { get; set; } - - [JsonProperty(PropertyName = "M")] - public string Method { get; set; } - - [JsonProperty(PropertyName = "A")] - public object[] Args { get; set; } - - [JsonProperty(PropertyName = "S", NullValueHandling = NullValueHandling.Ignore)] - public Dictionary State { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs.meta deleted file mode 100755 index f11adeb8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubInvocation.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a1e54fe0e99884f4797db1d2d221736c -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs deleted file mode 100755 index 003a0148..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Hubs -{ - [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)] - public sealed class HubMethodAttribute : Attribute - { - // See the attribute guidelines at - // http://go.microsoft.com/fwlink/?LinkId=85236 - private readonly string m_method; - - // This is a positional argument - public HubMethodAttribute(string method) - { - m_method = method; - } - - public string Method - { - get { return m_method; } - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs.meta deleted file mode 100755 index a4644e8c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubMethodAttribute.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 57f01f4c248416445b52442cf015df2a -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs deleted file mode 100755 index 30facc53..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs +++ /dev/null @@ -1,115 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using SignalR.Client._20.Transports; -using PlayFab.Json; -namespace SignalR.Client._20.Hubs -{ - public class HubProxy : IHubProxy - { - private readonly string m_hubName; - private readonly IConnection m_connection; - private readonly Dictionary m_state = - new Dictionary(StringComparer.OrdinalIgnoreCase); - private readonly Dictionary m_subscriptions = - new Dictionary(StringComparer.OrdinalIgnoreCase); - - public HubProxy(IConnection connection, string hubName) - { - m_connection = connection; - m_hubName = hubName; - } - - public object this[string name] - { - get - { - object value; - m_state.TryGetValue(name, out value); - return value; - } - set - { - m_state[name] = value; - } - } - - public Subscription Subscribe(string eventName) - { - if (eventName == null) - throw new ArgumentNullException("eventName"); - - Subscription _subscription; - if (!m_subscriptions.TryGetValue(eventName, out _subscription)) - { - _subscription = new Subscription(); - m_subscriptions.Add(eventName, _subscription); - } - - return _subscription; - } - - public EventSignal Invoke(string method, params object[] args) - { - return Invoke(method, args); - } - - public EventSignal Invoke(string method, params object[] args) - { - if (method == null) - throw new ArgumentNullException("method"); - - var hubData = new HubInvocation - { - Hub = m_hubName, - Method = method, - Args = args, - State = m_state, - CallbackId = "1" - }; - - var _value = PlayFabSimpleJson.SerializeObject(hubData); - var _newSignal = new OptionalEventSignal(); - var _signal = m_connection.Send>(_value); - - _signal.Finished += (sender, e) => - { - if (e.Result != null) - { - if (e.Result.Error != null) - throw new InvalidOperationException(e.Result.Error); - - HubResult _hubResult = e.Result; - if (_hubResult.State != null) - { - foreach (var pair in _hubResult.State) - { - this[pair.Key] = pair.Value; - } - } - - _newSignal.OnFinish(_hubResult.Result); - } - else - { - _newSignal.OnFinish(default(T)); - } - }; - return _newSignal; - } - - public void InvokeEvent(string eventName, object[] args) - { - Subscription eventObj; - if (m_subscriptions.TryGetValue(eventName, out eventObj)) - eventObj.OnData(args); - } - - public IEnumerable GetSubscriptions() - { - return m_subscriptions.Keys; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs.meta deleted file mode 100755 index 67d4f2c6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubProxy.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 87976ecd36425f6419a7c542e69f49cb -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs deleted file mode 100755 index cf13815f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs +++ /dev/null @@ -1,10 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20.Hubs -{ - public class HubRegistrationData - { - public string Name { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs.meta deleted file mode 100755 index 785bc24b..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubRegistrationData.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 09fcfd62a1fbf7e4d924a20e987f60bd -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs deleted file mode 100755 index dd9515f6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs +++ /dev/null @@ -1,19 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Collections.Generic; -using PlayFab.Json; - -namespace SignalR.Client._20.Hubs -{ - public class HubResult - { - [JsonProperty(PropertyName = "R")] - public T Result { get; set; } - - [JsonProperty(PropertyName = "E")] - public string Error { get; set; } - - [JsonProperty(PropertyName = "S")] - public IDictionary State { get; set; } - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs.meta deleted file mode 100755 index 6e94eeed..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/HubResult.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ff1d0f82cc1c08c4fbcaf14f09d59af6 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs deleted file mode 100755 index a13de2b4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs +++ /dev/null @@ -1,30 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Hubs -{ - public class Hubservable : IObservable - { - private readonly string m_eventName; - private readonly HubProxy m_proxy; - - public Hubservable(HubProxy proxy, string eventName) - { - m_proxy = proxy; - m_eventName = eventName; - } - - public IDisposable Subscribe(IObserver observer) - { - var _subscription = m_proxy.Subscribe(m_eventName); - _subscription.Data += observer.OnNext; - - return new DisposableAction(() => - { - _subscription.Data -= observer.OnNext; - }); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs.meta deleted file mode 100755 index a3f99f1c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Hubservable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: af418f35b6847e74ea75a35c5e271955 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs deleted file mode 100755 index 654701dc..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs +++ /dev/null @@ -1,18 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20.Hubs -{ - public interface IHubProxy - { - object this[string name] { get; set; } - - Subscription Subscribe(string eventName); - - EventSignal Invoke(string method, params object[] args); - - EventSignal Invoke(string method, params object[] args); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs.meta deleted file mode 100755 index 9026f791..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IHubProxy.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6a1ff50faabfb5e4bb911e93c557c251 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs deleted file mode 100755 index 4d897f74..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Hubs -{ - public interface IObservable - { - IDisposable Subscribe(IObserver observer); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs.meta deleted file mode 100755 index ec470458..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObservable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0b9b8c60abaa2424189eb28b73530846 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs deleted file mode 100755 index cfdf1f42..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs +++ /dev/null @@ -1,10 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20.Hubs -{ - public interface IObserver - { - void OnNext(T value); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs.meta deleted file mode 100755 index 972880b6..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/IObserver.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 710f693ead7b5104aab8f494b2fa092f -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs deleted file mode 100755 index 3242a978..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using PlayFab.Json; -namespace SignalR.Client._20.Hubs -{ - public static class HubProxyExtensions - { - public static T GetValue(IHubProxy proxy, string name) - { - object _value = proxy[name]; - return Convert(_value); - } - - private static T Convert(object obj) - { - if (obj == null) - return default(T); - - if (typeof(T).IsAssignableFrom(obj.GetType())) - return (T)obj; - - return PlayFabSimpleJson.DeserializeObject(obj.ToString()); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs.meta deleted file mode 100755 index b0e7a662..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/ProxyExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a05cc00e7f1dec34aaf684e1e69a3be3 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs deleted file mode 100755 index 5994437a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs +++ /dev/null @@ -1,18 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Hubs -{ - public class Subscription - { - public event Action Data; - - internal void OnData(object[] data) - { - if (Data != null) - Data(data); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs.meta deleted file mode 100755 index f62e108e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Hubs/Subscription.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a38eabac4242aac448545fa7379335d4 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs deleted file mode 100755 index d85bb342..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs +++ /dev/null @@ -1,42 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.Net; -using SignalR.Client._20.Http; -using SignalR.Client._20.Transports; -using PlayFab.Json; - -namespace SignalR.Client._20 -{ - public interface IConnection - { - bool IsActive { get; } - string MessageId { get; set; } - Func Sending { get; set; } - IEnumerable Groups { get; set; } - IDictionary Items { get; } - string ConnectionId { get; } - string Url { get; } - string QueryString { get; } - string ConnectionToken { get; } - string GroupsToken { get; } - - ICredentials Credentials { get; set; } - CookieContainer CookieContainer { get; set; } - - event Action Closed; - event Action Error; - event Action Received; - - void Stop(); - EventSignal Send(string data); - EventSignal Send(string data); - - void OnReceived(JsonObject data); - void OnError(Exception ex); - void OnReconnected(); - void PrepareRequest(IRequest request); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs.meta deleted file mode 100755 index d1ab8bea..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/IConnection.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6f8b859669eabfd42b13635480c49f95 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure.meta deleted file mode 100755 index 244500f0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8b1421947faad694da1f2f0377a17843 -folderAsset: yes -timeCreated: 1467844118 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs deleted file mode 100755 index c225a231..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs +++ /dev/null @@ -1,64 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Text; - -namespace SignalR.Client._20.Infrastructure -{ - public class ChunkBuffer - { - private int m_offset; - private readonly StringBuilder m_buffer; - private readonly StringBuilder m_lineBuilder; - - public ChunkBuffer() - { - m_buffer = new StringBuilder(); - m_lineBuilder = new StringBuilder(); - } - - public bool HasChunks - { - get - { - return m_offset < m_buffer.Length; - } - } - - public string ReadLine() - { - // Lock while reading so that we can make safe assumptions about the buffer indices - lock (m_buffer) - { - for (int i = m_offset; i < m_buffer.Length; i++, m_offset++) - { - if (m_buffer[i] == '\n') - { - m_buffer.Remove(0, m_offset + 1); - - string _line = m_lineBuilder.ToString(); - m_lineBuilder.Length = 0; - m_offset = 0; - return _line; - } - m_lineBuilder.Append(m_buffer[i]); - } - return null; - } - } - - public void Add(byte[] buffer, int length) - { - lock (m_buffer) - { - m_buffer.Append(Encoding.UTF8.GetString(buffer, 0, length)); - } - } - - public void Add(ArraySegment buffer) - { - m_buffer.Append(Encoding.UTF8.GetString(buffer.Array, buffer.Offset, buffer.Count)); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs.meta deleted file mode 100755 index efbd5d45..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/ChunkBuffer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ccd49ff8c8d6c694986f08e7930cb160 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs deleted file mode 100755 index f33f4ed8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs +++ /dev/null @@ -1,22 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Infrastructure -{ - internal class DisposableAction : IDisposable - { - private readonly Action m_action; - - public DisposableAction(System.Action action) - { - m_action = action; - } - - public void Dispose() - { - m_action(); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs.meta deleted file mode 100755 index ac92d227..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/DisposableAction.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 12dc6b61c6c6c9a4cbc4a918139a25dc -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs deleted file mode 100755 index 99a4b491..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.IO; -using SignalR.Client._20.Http; -using SignalR.Client._20.Transports; - -namespace SignalR.Client._20.Infrastructure -{ - internal static class StreamExtensions - { - public static void ReadAsync(EventSignal> signal, Stream stream, byte[] buffer) - { - var _state = new StreamState - { - Stream = stream, - Response = signal, - Buffer = buffer - }; - - ReadAsyncInternal(_state); - } - - internal static void ReadAsyncInternal(StreamState streamState) - { - try - { - streamState.Stream.BeginRead( - streamState.Buffer, - 0, - streamState.Buffer.Length, - GetResponseCallback, - streamState); - } - catch (Exception exception) - { - streamState.Response.OnFinish(new CallbackDetail - { - IsFaulted = true, - Exception = exception - }); - } - } - - private static void GetResponseCallback(IAsyncResult asynchronousResult) - { - StreamState streamState = (StreamState)asynchronousResult.AsyncState; - - // End the operation - try - { - var response = streamState.Stream.EndRead(asynchronousResult); - streamState.Response.OnFinish(new CallbackDetail - { - Result = response - }); - } - catch (Exception ex) - { - try - { - ReadAsyncInternal(streamState); - } - catch (Exception) - { - streamState.Response.OnFinish(new CallbackDetail - { - IsFaulted = true, - Exception = ex - }); - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs.meta deleted file mode 100755 index 47abc65a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 648f5ccddaab8194d98457a8c9b6b3e4 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs deleted file mode 100755 index 52564d9f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs +++ /dev/null @@ -1,16 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using SignalR.Client._20.Http; -using SignalR.Client._20.Transports; -using System.IO; - -namespace SignalR.Client._20.Infrastructure -{ - internal class StreamState - { - public Stream Stream { get; set; } - public byte[] Buffer { get; set; } - public EventSignal> Response { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs.meta deleted file mode 100755 index 1d286a59..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/StreamState.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c823367c7fcef424a8eb4f1cb1ef3559 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs deleted file mode 100755 index 41c3e0fa..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) Microsoft Open Technologies, Inc. - * All rights reserved. - * - * Microsoft Open Technologies would like to thank its contributors, a list of whom are at http://aspnetwebstack.codeplex.com/wikipage?title=Contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - */ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Text; - -namespace SignalR.Infrastructure -{ - // Taken from System.Net.Http.Formatting.Internal.UriQueryUtility.cs (http://aspnetwebstack.codeplex.com/) - - /// - /// Helpers for encoding, decoding, and parsing URI query components. - /// - internal static class UriQueryUtility - { - // The implementation below is ported from WebUtility for use in .Net 4 - -#region UrlEncode implementation - - private static byte[] UrlEncode(byte[] bytes, int offset, int count, bool alwaysCreateNewReturnValue) - { - byte[] encoded = UrlEncode(bytes, offset, count); - - return (alwaysCreateNewReturnValue && (encoded != null) && (encoded == bytes)) - ? (byte[])encoded.Clone() - : encoded; - } - - private static byte[] UrlEncode(byte[] bytes, int offset, int count) - { - if (!ValidateUrlEncodingParameters(bytes, offset, count)) - { - return null; - } - - int cSpaces = 0; - int cUnsafe = 0; - - // count them first - for (int i = 0; i < count; i++) - { - char ch = (char)bytes[offset + i]; - - if (ch == ' ') - cSpaces++; - else if (!IsUrlSafeChar(ch)) - cUnsafe++; - } - - // nothing to expand? - if (cSpaces == 0 && cUnsafe == 0) - return bytes; - - // expand not 'safe' characters into %XX, spaces to +s - byte[] expandedBytes = new byte[count + cUnsafe * 2]; - int pos = 0; - - for (int i = 0; i < count; i++) - { - byte b = bytes[offset + i]; - char ch = (char)b; - - if (IsUrlSafeChar(ch)) - { - expandedBytes[pos++] = b; - } - else if (ch == ' ') - { - expandedBytes[pos++] = (byte)'+'; - } - else - { - expandedBytes[pos++] = (byte)'%'; - expandedBytes[pos++] = (byte)IntToHex((b >> 4) & 0xf); - expandedBytes[pos++] = (byte)IntToHex(b & 0x0f); - } - } - - return expandedBytes; - } - -#endregion - -#region UrlEncode public methods - - public static string UrlEncode(string str) - { - if (str == null) - return null; - - byte[] bytes = Encoding.UTF8.GetBytes(str); - byte[] encodedBytes = UrlEncode(bytes, 0, bytes.Length, false); - return Encoding.UTF8.GetString(encodedBytes, 0, encodedBytes.Length); - } - - public static byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count) - { - return UrlEncode(bytes, offset, count, true); - } - -#endregion - -#region UrlDecode implementation - - private static string UrlDecodeInternal(string value, Encoding encoding) - { - if (value == null) - { - return null; - } - - int count = value.Length; - UrlDecoder helper = new UrlDecoder(count, encoding); - - // go through the string's chars collapsing %XX and %uXXXX and - // appending each char as char, with exception of %XX constructs - // that are appended as bytes - - for (int pos = 0; pos < count; pos++) - { - char ch = value[pos]; - - if (ch == '+') - { - ch = ' '; - } - else if (ch == '%' && pos < count - 2) - { - if (value[pos + 1] == 'u' && pos < count - 5) - { - int h1 = HexToInt(value[pos + 2]); - int h2 = HexToInt(value[pos + 3]); - int h3 = HexToInt(value[pos + 4]); - int h4 = HexToInt(value[pos + 5]); - - if (h1 >= 0 && h2 >= 0 && h3 >= 0 && h4 >= 0) - { // valid 4 hex chars - ch = (char)((h1 << 12) | (h2 << 8) | (h3 << 4) | h4); - pos += 5; - - // only add as char - helper.AddChar(ch); - continue; - } - } - else - { - int h1 = HexToInt(value[pos + 1]); - int h2 = HexToInt(value[pos + 2]); - - if (h1 >= 0 && h2 >= 0) - { // valid 2 hex chars - byte b = (byte)((h1 << 4) | h2); - pos += 2; - - // don't add as char - helper.AddByte(b); - continue; - } - } - } - - if ((ch & 0xFF80) == 0) - helper.AddByte((byte)ch); // 7 bit have to go as bytes because of Unicode - else - helper.AddChar(ch); - } - - return helper.GetString(); - } - - private static byte[] UrlDecodeInternal(byte[] bytes, int offset, int count) - { - if (!ValidateUrlEncodingParameters(bytes, offset, count)) - { - return null; - } - - int decodedBytesCount = 0; - byte[] decodedBytes = new byte[count]; - - for (int i = 0; i < count; i++) - { - int pos = offset + i; - byte b = bytes[pos]; - - if (b == '+') - { - b = (byte)' '; - } - else if (b == '%' && i < count - 2) - { - int h1 = HexToInt((char)bytes[pos + 1]); - int h2 = HexToInt((char)bytes[pos + 2]); - - if (h1 >= 0 && h2 >= 0) - { // valid 2 hex chars - b = (byte)((h1 << 4) | h2); - i += 2; - } - } - - decodedBytes[decodedBytesCount++] = b; - } - - if (decodedBytesCount < decodedBytes.Length) - { - byte[] newDecodedBytes = new byte[decodedBytesCount]; - Array.Copy(decodedBytes, newDecodedBytes, decodedBytesCount); - decodedBytes = newDecodedBytes; - } - - return decodedBytes; - } - -#endregion - -#region UrlDecode public methods - - public static string UrlDecode(string str) - { - if (str == null) - return null; - - return UrlDecodeInternal(str, Encoding.UTF8); - } - - public static byte[] UrlDecodeToBytes(byte[] bytes, int offset, int count) - { - return UrlDecodeInternal(bytes, offset, count); - } - -#endregion - -#region Helper methods - - private static int HexToInt(char h) - { - return (h >= '0' && h <= '9') ? h - '0' : - (h >= 'a' && h <= 'f') ? h - 'a' + 10 : - (h >= 'A' && h <= 'F') ? h - 'A' + 10 : - -1; - } - - private static char IntToHex(int n) - { - if (n <= 9) - return (char)(n + (int)'0'); - else - return (char)(n - 10 + (int)'a'); - } - - // Set of safe chars, from RFC 1738.4 minus '+' - private static bool IsUrlSafeChar(char ch) - { - if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9') - return true; - - switch (ch) - { - case '-': - case '_': - case '.': - case '!': - case '*': - case '(': - case ')': - return true; - } - - return false; - } - - private static bool ValidateUrlEncodingParameters(byte[] bytes, int offset, int count) - { - if (bytes == null && count == 0) - return false; - if (bytes == null) - { - throw new ArgumentNullException("bytes"); - } - if (offset < 0 || offset > bytes.Length) - { - throw new ArgumentOutOfRangeException("offset"); - } - if (count < 0 || offset + count > bytes.Length) - { - throw new ArgumentOutOfRangeException("count"); - } - - return true; - } - -#endregion - -#region UrlDecoder nested class - - // Internal class to facilitate URL decoding -- keeps char buffer and byte buffer, allows appending of either chars or bytes - private class UrlDecoder - { - private int _bufferSize; - - // Accumulate characters in a special array - private int _numChars; - private char[] _charBuffer; - - // Accumulate bytes for decoding into characters in a special array - private int _numBytes; - private byte[] _byteBuffer; - - // Encoding to convert chars to bytes - private Encoding _encoding; - - private void FlushBytes() - { - if (_numBytes > 0) - { - _numChars += _encoding.GetChars(_byteBuffer, 0, _numBytes, _charBuffer, _numChars); - _numBytes = 0; - } - } - - internal UrlDecoder(int bufferSize, Encoding encoding) - { - _bufferSize = bufferSize; - _encoding = encoding; - - _charBuffer = new char[bufferSize]; - // byte buffer created on demand - } - - internal void AddChar(char ch) - { - if (_numBytes > 0) - FlushBytes(); - - _charBuffer[_numChars++] = ch; - } - - internal void AddByte(byte b) - { - if (_byteBuffer == null) - _byteBuffer = new byte[_bufferSize]; - - _byteBuffer[_numBytes++] = b; - } - - internal String GetString() - { - if (_numBytes > 0) - FlushBytes(); - - if (_numChars > 0) - return new String(_charBuffer, 0, _numChars); - else - return String.Empty; - } - } - -#endregion - } -} - -#endif diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs.meta deleted file mode 100755 index 98194d8a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Infrastructure/UriQueryUtility.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bb24126f715150b49976cf4dce1172d0 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md deleted file mode 100755 index d32a7dca..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jenya Y. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md.meta deleted file mode 100755 index 405a6fa7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/LICENSE.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ee3b704457f948441b6fa6a474c2e5ba -timeCreated: 1469150910 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs deleted file mode 100755 index d231e638..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API - -namespace SignalR.Client._20 -{ - //[DebuggerDisplay("{ConnectionId} {Url} -> {ProtocolVersion}")] - public class NegotiationResponse - { - public string ConnectionId { get; set; } - public string Url { get; set; } - public string ProtocolVersion { get; set; } - public string ConnectionToken { get; set; } - public double DisconnectTimeout { get; set; } - public bool TryWebSockets { get; set; } - public double? KeepAliveTimeout { get; set; } - public double TransportConnectTimeout { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs.meta deleted file mode 100755 index b28ea875..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/NegotiationResponse.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fca86a413d0505f418f43f489c373797 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties.meta deleted file mode 100755 index d4e4ea4c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ba873ef1bcb4a0b41b73d5a9c1612bae -folderAsset: yes -timeCreated: 1467844118 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs deleted file mode 100755 index a77bff9a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SignalR.Client.20")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SignalR.Client.20")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("68a1f25f-9e0a-47d9-92df-b1c30bf6dc01")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs.meta deleted file mode 100755 index f80c7ad9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Properties/AssemblyInfo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 82fb855fddceedd448daef5eae51a88b -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md deleted file mode 100755 index 3e663774..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md +++ /dev/null @@ -1,27 +0,0 @@ - -# SignalR Client for .NET 2.0 - -[![Build status](https://ci.appveyor.com/api/projects/status/8k5ldu0s82ln76ah/branch/master?svg=true)](https://ci.appveyor.com/project/jenyayel/signalr-client-20/branch/master) -[![Issue Stats](http://www.issuestats.com/github/jenyayel/SignalR.Client.20/badge/issue)](http://www.issuestats.com/github/jenyayel/SignalR.Client.20) - -Client for SignalR which supports protocol 1.2 targeting .NET 2.0. The library can be easily compiled into Unity3D projects. - -Client and server samples located under [demo folder](https://github.com/jenyayel/SignalR.Client.20/tree/master/source/Demo). Client's API is the same as for the standard/original SignalR client library: - -```csharp -// setup proxy -HubConnection connection = new HubConnection("http://localhost:58438/"); -IHubProxy proxy = connection.CreateProxy("TestHub"); - -// subscribe to event -proxy.Subscribe("ClientPing").Data += data => -{ - JToken data = data[0] as JToken; - Console.WriteLine("Received push from server: [{0}]}", data["message"].ToString()); -}; - -// start connection -connection.Start(); -``` - - diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md.meta deleted file mode 100755 index c88a5f35..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d28fbd9fcd4b82b468a4bd3cfa76c08f -timeCreated: 1469150932 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports.meta deleted file mode 100755 index dc9a5a3f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ebdbcce5b41eca94cb1c7beb076ef0b0 -folderAsset: yes -timeCreated: 1467844118 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs deleted file mode 100755 index 218edf43..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs +++ /dev/null @@ -1,196 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using SignalR.Client._20.Http; -using SignalR.Client._20.Infrastructure; -using System; -//using System.Diagnostics; -using System.IO; -using System.Threading; - -namespace SignalR.Client._20.Transports -{ - public class AsyncStreamReader - { - private readonly Stream m_stream; - private readonly ChunkBuffer m_buffer; - private readonly Action m_initializeCallback; - private readonly Action m_closeCallback; - private readonly IConnection m_connection; - private int m_processingQueue; - private int m_reading; - private bool m_processingBuffer; - - public AsyncStreamReader(Stream stream, - IConnection connection, - Action initializeCallback, - Action closeCallback) - { - m_initializeCallback = initializeCallback; - m_closeCallback = closeCallback; - m_stream = stream; - m_connection = connection; - m_buffer = new ChunkBuffer(); - } - - public bool Reading - { - get - { - return m_reading == 1; - } - } - - public void StartReading() - { - //Debug.WriteLine("AsyncStreamReader: StartReading"); - if (Interlocked.Exchange(ref m_reading, 1) == 0) - ReadLoop(); - } - - public void StopReading(bool raiseCloseCallback) - { - if (Interlocked.Exchange(ref m_reading, 0) == 1 - && raiseCloseCallback) - m_closeCallback(); - } - - private void ReadLoop() - { - if (!Reading) - return; - - var _buffer = new byte[1024]; - var _signal = new EventSignal>(); - - _signal.Finished += (sender, e) => - { - if (e.Result.IsFaulted) - { - Exception exception = e.Result.Exception.GetBaseException(); - - if (!HttpBasedTransport.IsRequestAborted(exception)) - { - if (!(exception is IOException)) - m_connection.OnError(exception); - StopReading(true); - } - return; - } - - int _read = e.Result.Result; - - if (_read > 0) - // Put chunks in the buffer - m_buffer.Add(_buffer, _read); - - if (_read == 0) - { - // Stop any reading we're doing - StopReading(true); - return; - } - - // Keep reading the next set of data - ReadLoop(); - - if (_read <= _buffer.Length) - // If we read less than we wanted or if we filled the buffer, process it - ProcessBuffer(); - }; - StreamExtensions.ReadAsync(_signal, m_stream, _buffer); - } - - private void ProcessBuffer() - { - if (!Reading) - return; - - if (m_processingBuffer) - { - // Increment the number of times we should process messages - m_processingQueue++; - return; - } - - m_processingBuffer = true; - - int _total = Math.Max(1, m_processingQueue); - - for (int i = 0; i < _total; i++) - { - if (!Reading) - return; - ProcessChunks(); - } - - if (m_processingQueue > 0) - m_processingQueue -= _total; - - m_processingBuffer = false; - } - - private void ProcessChunks() - { - //Debug.WriteLine("AsyncStreamReader: ProcessChunks"); - while (Reading && m_buffer.HasChunks) - { - string _line = m_buffer.ReadLine(); - - // No new lines in the buffer so stop processing - if (_line == null) - break; - - if (!Reading) - return; - - // Try parsing the sseEvent - SseEvent _sseEvent; - if (!SseEvent.TryParse(_line, out _sseEvent)) - continue; - - if (!Reading) - return; - - //Debug.WriteLine("AsyncStreamReader: SSE READ [{0}]", _sseEvent.ToString()); - - switch (_sseEvent.Type) - { - case EventType.Id: - m_connection.MessageId = _sseEvent.Data; - break; - case EventType.Data: - if (_sseEvent.Data.Equals("initialized", StringComparison.OrdinalIgnoreCase)) - { - if (m_initializeCallback != null) - // Mark the connection as started - m_initializeCallback(); - } - else - { - if (Reading) - { - // We don't care about timeout messages here since it will just reconnect - // as part of being a long running request - bool _timedOutReceived; - bool _disconnectReceived; - - HttpBasedTransport.ProcessResponse( - m_connection, - _sseEvent.Data, - out _timedOutReceived, - out _disconnectReceived); - - if (_disconnectReceived) - m_connection.Stop(); - - if (_timedOutReceived) - return; - } - } - break; - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs.meta deleted file mode 100755 index 95bd2190..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AsyncStreamReader.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3270528e55e10c14ab810a226bde7454 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs deleted file mode 100755 index 7c3713a7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs +++ /dev/null @@ -1,71 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using SignalR.Client._20.Http; - -namespace SignalR.Client._20.Transports -{ - public class AutoTransport : IClientTransport - { - private IClientTransport m_transport; // Transport that's in use - private readonly IClientTransport[] m_transports; // List of transports in fallback order - private readonly IHttpClient m_httpClient; - - public AutoTransport(IHttpClient httpClient) - { - m_httpClient = httpClient; - m_transports = new IClientTransport[] { - new ServerSentEventsTransport(httpClient), - new LongPollingTransport(httpClient) - }; - } - - public EventSignal Negotiate(IConnection connection) - { - return HttpBasedTransport.GetNegotiationResponse(m_httpClient, connection); - } - - public void Start(IConnection connection, string data) - { - // Resolve the transport - ResolveTransport(connection, data, 0); - } - - private void ResolveTransport(IConnection connection, string data, int index) - { - // Pick the current transport - IClientTransport _transport = m_transports[index]; - - try - { - _transport.Start(connection, data); - m_transport = _transport; - } - catch (Exception) - { - var _next = index + 1; - if (_next < m_transports.Length) - { - // Try the next transport - ResolveTransport(connection, data, _next); - } - else - { - // If there's nothing else to try then just fail - throw new NotSupportedException("The transports available were not supported on this client."); - } - } - } - - public EventSignal Send(IConnection connection, string data) - { - return m_transport.Send(connection, data); - } - - public void Stop(IConnection connection) - { - m_transport.Stop(connection); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs.meta deleted file mode 100755 index f1b23d81..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/AutoTransport.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b652d1e6bf4dacc4eadbaba023cb01e3 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs deleted file mode 100755 index d184c46d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs +++ /dev/null @@ -1,15 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20.Transports -{ - internal class CancellationTokenSource - { - public bool IsCancellationRequested { get; private set; } - - public void Cancel() - { - IsCancellationRequested = true; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs.meta deleted file mode 100755 index be33df69..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CancellationTokenSource.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 83705eace0429a3488a7a86fe946c25d -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs deleted file mode 100755 index 76553cb9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Transports -{ - public class CustomEventArgs : EventArgs - { - public T Result { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs.meta deleted file mode 100755 index e1f56ac4..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/CustomEventArgs.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5aac13c912cba6e4aa034604b2436d1b -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs deleted file mode 100755 index 68e2dd7a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs +++ /dev/null @@ -1,58 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Threading; - -namespace SignalR.Client._20.Transports -{ - public class EventSignal - { - private int m_attemptCount; - private readonly int m_maxAttempts; - - public event EventHandler> Finished; - - public EventSignal(int maxAttempts) - { - m_maxAttempts = maxAttempts; - } - - public EventSignal() - : this(5) - { - } - - public void OnFinish(T result) - { - var _handler = Finished; - - if (_handler == null) - { - if (maxAttemptsReached()) - { - handleNoEventHandler(); - return; - } - m_attemptCount++; - Thread.SpinWait(1000); - OnFinish(result); - return; - } - - _handler.Invoke(this, new CustomEventArgs - { - Result = result - }); - } - - protected virtual void handleNoEventHandler() - { - throw new InvalidOperationException("You must attach an event handler to the event signal within a reasonable amount of time."); - } - - private bool maxAttemptsReached() - { - return m_attemptCount > m_maxAttempts; - } - } -} -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs.meta deleted file mode 100755 index 728dd131..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/EventSignal.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 43d8456e7ccfd7d438a5392304088821 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs deleted file mode 100755 index 261c6f73..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs +++ /dev/null @@ -1,241 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using SignalR.Client._20.Http; -using PlayFab.Json; - -namespace SignalR.Client._20.Transports -{ - public abstract class HttpBasedTransport : IClientTransport - { - // The receive query strings - private const string c_receiveQueryStringWithGroups = "?transport={0}&connectionId={1}&messageId={2}&groups={3}&connectionData={4}{5}&connectionToken={6}&groupsToken={7}"; - private const string c_receiveQueryString = "?transport={0}&connectionId={1}&messageId={2}&connectionData={3}{4}&connectionToken={5}"; - - private const string c_sendQueryString = "?transport={0}&connectionToken={1}{2}"; // The send query string - protected readonly string m_transport; // The transport name - protected const string c_httpRequestKey = "http.Request"; - protected readonly IHttpClient m_httpClient; - - public HttpBasedTransport(IHttpClient httpClient, string transport) - { - m_httpClient = httpClient; - m_transport = transport; - } - - public EventSignal Negotiate(IConnection connection) - { - return GetNegotiationResponse(m_httpClient, connection); - } - - internal static EventSignal GetNegotiationResponse( - IHttpClient httpClient, - IConnection connection) - { - string _negotiateUrl = connection.Url + "negotiate"; - - var _negotiateSignal = new EventSignal(); - var _signal = httpClient.GetAsync(_negotiateUrl, connection.PrepareRequest); - - _signal.Finished += (sender, e) => - { - string _raw = e.Result.ReadAsString(); - if (_raw == null) - throw new InvalidOperationException("Server negotiation failed."); - - _negotiateSignal.OnFinish(PlayFabSimpleJson.DeserializeObject(_raw)); - }; - return _negotiateSignal; - } - - public void Start(IConnection connection, string data) - { - OnStart(connection, data, () => { }, exception => { throw exception; }); - } - - protected abstract void OnStart(IConnection connection, string data, System.Action initializeCallback, Action errorCallback); - - public EventSignal Send(IConnection connection, string data) - { - string _url = connection.Url + "send"; - string _customQueryString = GetCustomQueryString(connection); - - _url += String.Format( - c_sendQueryString, - m_transport, - Uri.EscapeDataString(connection.ConnectionToken), - _customQueryString); - - var _postData = new Dictionary { - { "data", data }, - }; - - var _returnSignal = new EventSignal(); - var _postSignal = m_httpClient.PostAsync(_url, connection.PrepareRequest, _postData); - - _postSignal.Finished += (sender, e) => - { - string _raw = e.Result.ReadAsString(); - - if (String.IsNullOrEmpty(_raw)) - { - _returnSignal.OnFinish(default(T)); - return; - } - - _returnSignal.OnFinish(PlayFabSimpleJson.DeserializeObject(_raw)); - }; - return _returnSignal; - } - - protected string GetReceiveQueryStringWithGroups(IConnection connection, string data) - { - return String.Format( - c_receiveQueryStringWithGroups, - m_transport, - Uri.EscapeDataString(connection.ConnectionId), - Convert.ToString(connection.MessageId), - GetSerializedGroups(connection), - data, - GetCustomQueryString(connection), - Uri.EscapeDataString(connection.ConnectionToken), - connection.GroupsToken); - } - - protected string GetSerializedGroups(IConnection connection) - { - return Uri.EscapeDataString(PlayFabSimpleJson.SerializeObject(connection.Groups)); - } - - protected string GetReceiveQueryString(IConnection connection, string data) - { - return String.Format( - c_receiveQueryString, - m_transport, - Uri.EscapeDataString(connection.ConnectionId), - Convert.ToString(connection.MessageId), - data, - GetCustomQueryString(connection), - Uri.EscapeDataString(connection.ConnectionToken)); - } - - protected virtual Action PrepareRequest(IConnection connection) - { - return request => - { - // Setup the user agent along with any other defaults - connection.PrepareRequest(request); - connection.Items[c_httpRequestKey] = request; - }; - } - - public static bool IsRequestAborted(Exception exception) - { - var _webException = exception as WebException; - return (_webException != null && _webException.Status == WebExceptionStatus.RequestCanceled); - } - - public void Stop(IConnection connection) - { - var _httpRequest = ConnectionExtensions.GetValue(connection, c_httpRequestKey); - if (_httpRequest != null) - { - try - { - OnBeforeAbort(connection); - _httpRequest.Abort(); - } - catch (NotImplementedException) - { - // If this isn't implemented then do nothing - } - } - } - - protected virtual void OnBeforeAbort(IConnection connection) - { - } - - public static void ProcessResponse(IConnection connection, string response, out bool timedOut, out bool disconnected) - { - timedOut = false; - disconnected = false; - - if (String.IsNullOrEmpty(response)) - return; - - if (connection.MessageId == null) - connection.MessageId = null; - - try - { - var _result = PlayFabSimpleJson.DeserializeObject(response); - - if (!_result.Any()) - return; - - timedOut = _result.ContainsKey("TimedOut") && bool.Parse(_result["TimedOut"].ToString()); - disconnected = _result.ContainsKey("Disconnect") && bool.Parse(_result["Disconnect"].ToString()); - - if (disconnected) - return; - - var messages = _result["M"] as JsonArray; - - if (messages != null) - { - foreach (var message in messages) - { - try - { - connection.OnReceived((JsonObject)message); - } - catch (Exception ex) - { - connection.OnError(ex); - } - } - - connection.MessageId = _result.ContainsKey("C") ? _result["C"].ToString() : ""; - - - JsonObject transportData = null; - object triedData; - if (_result.TryGetValue("T", out triedData)) - { - transportData = triedData as JsonObject; - } - - if (transportData != null) - { - var groups = (JsonArray)transportData["G"]; - if (groups != null) - { - var groupList = new List(); - foreach (var groupFromTransport in groups) - { - groupList.Add(groupFromTransport.ToString()); - } - connection.Groups = groupList; - } - } - } - } - catch (Exception ex) - { - connection.OnError(ex); - } - } - - private static string GetCustomQueryString(IConnection connection) - { - return String.IsNullOrEmpty(connection.QueryString) - ? "" - : "&" + connection.QueryString; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs.meta deleted file mode 100755 index 49a441b0..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/HttpBasedTransport.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0c8028f859e20f045ae9aa0ce6a1f428 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs deleted file mode 100755 index daefb07a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs +++ /dev/null @@ -1,16 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20.Transports -{ - public interface IClientTransport - { - void Start(IConnection connection, string data); - - EventSignal Send(IConnection connection, string data); - - void Stop(IConnection connection); - - EventSignal Negotiate(IConnection connection); - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs.meta deleted file mode 100755 index f1db66a8..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/IClientTransport.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ee1eb4d49981dc743884cfaa54a53317 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs deleted file mode 100755 index 96ed933d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs +++ /dev/null @@ -1,175 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using SignalR.Client._20.Http; - -namespace SignalR.Client._20.Transports -{ - public class LongPollingTransport : HttpBasedTransport - { - private static readonly TimeSpan m_errorDelay = TimeSpan.FromSeconds(2); - - public TimeSpan ReconnectDelay { get; set; } - - public LongPollingTransport() - : this(new DefaultHttpClient()) - { - } - - public LongPollingTransport(IHttpClient httpClient) - : base(httpClient, "longPolling") - { - ReconnectDelay = TimeSpan.FromSeconds(5); - } - - protected override void OnStart(IConnection connection, string data, System.Action initializeCallback, Action errorCallback) - { - PollingLoop(connection, data, initializeCallback, errorCallback, false); - } - - private void PollingLoop(IConnection connection, string data, System.Action initializeCallback, Action errorCallback, bool raiseReconnect) - { - string _url = connection.Url; - var _reconnectTokenSource = new CancellationTokenSource(); - int _reconnectFired = 0; - - if (connection.MessageId == null) - _url += "connect"; - else if (raiseReconnect) - _url += "reconnect"; - - _url += GetReceiveQueryString(connection, data); - - //Debug.WriteLine("LongPollingTransport: PollingLoop for [{0}]", _url); - - var _signal = m_httpClient.PostAsync( - _url, - PrepareRequest(connection), - new Dictionary { - { "groups", GetSerializedGroups(connection) } - }); - - _signal.Finished += (sender, e) => - { - // Clear the pending request - connection.Items.Remove(c_httpRequestKey); - - bool _shouldRaiseReconnect = false; - bool _disconnectedReceived = false; - - try - { - if (!e.Result.IsFaulted) - { - if (raiseReconnect) - // If the timeout for the reconnect hasn't fired as yet just fire the - // event here before any incoming messages are processed - FireReconnected(connection, _reconnectTokenSource, ref _reconnectFired); - - // Get the response - var _raw = e.Result.ReadAsString(); - - //Debug.WriteLine("LongPollingTransport: Receive [{0}]", _raw); - - if (!String.IsNullOrEmpty(_raw)) - ProcessResponse(connection, _raw, out _shouldRaiseReconnect, out _disconnectedReceived); - } - } - finally - { - if (_disconnectedReceived) - connection.Stop(); - else - { - bool _requestAborted = false; - - if (e.Result.IsFaulted) - { - // Cancel the previous reconnect event - _reconnectTokenSource.Cancel(); - - // Raise the reconnect event if we successfully reconnect after failing - _shouldRaiseReconnect = true; - - // Get the underlying exception - Exception exception = e.Result.Exception.GetBaseException(); - - // If the error callback isn't null then raise it and don't continue polling - if (errorCallback != null) - { - // Raise on error - connection.OnError(exception); - - // Call the callback - errorCallback(exception); - } - else - { - // Figure out if the request was aborted - _requestAborted = IsRequestAborted(exception); - - // Sometimes a connection might have been closed by the server before we get to write anything - // so just try again and don't raise OnError. - if (!_requestAborted && !(exception is IOException)) - { - // Raise on error - connection.OnError(exception); - - // If the connection is still active after raising the error event wait for 2 seconds - // before polling again so we aren't hammering the server - Thread.Sleep(m_errorDelay); - if (connection.IsActive) - { - PollingLoop( - connection, - data, - null, // initializeCallback - null, // errorCallback - _shouldRaiseReconnect); // raiseReconnect - } - } - } - } - else - { - // Continue polling if there was no error - if (connection.IsActive) - { - PollingLoop( - connection, - data, - null, // initializeCallback - null, // errorCallback - _shouldRaiseReconnect); // raiseReconnect - } - } - } - } - }; - - if (initializeCallback != null) - initializeCallback(); - - if (raiseReconnect) - { - Thread.Sleep(ReconnectDelay); - - // Fire the reconnect event after the delay. This gives the - FireReconnected(connection, _reconnectTokenSource, ref _reconnectFired); - } - } - - private static void FireReconnected(IConnection connection, - CancellationTokenSource reconnectTokenSource, - ref int reconnectedFired) - { - if (!reconnectTokenSource.IsCancellationRequested - && Interlocked.Exchange(ref reconnectedFired, 1) == 0) - connection.OnReconnected(); - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs.meta deleted file mode 100755 index c4cd5dc1..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/LongPollingTransport.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8b455658e08be594ba80e999aabd221e -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs deleted file mode 100755 index b48ab59d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -namespace SignalR.Client._20.Transports -{ - public class OptionalEventSignal : EventSignal - { - protected override void handleNoEventHandler() - { - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs.meta deleted file mode 100755 index 7bce7f60..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/OptionalEventSignal.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8ba49b668e528244f83c3b0799ba2fe2 -timeCreated: 1467844119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs deleted file mode 100755 index 585fd9ca..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs +++ /dev/null @@ -1,203 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using SignalR.Client._20.Http; -using UnityEngine; - -namespace SignalR.Client._20.Transports -{ - public class ServerSentEventsTransport : HttpBasedTransport - { - private const string m_readerKey = "sse.reader"; - private int m_initializedCalled; - private static readonly TimeSpan m_reconnectDelay = TimeSpan.FromSeconds(2); - private TimeSpan m_connectionTimeout; // Time allowed before failing the connect request - private int m_connectionRetry; - - public ServerSentEventsTransport() - : this(new DefaultHttpClient()) - { - } - - public ServerSentEventsTransport(IHttpClient httpClient) - : base(httpClient, "serverSentEvents") - { - m_connectionTimeout = TimeSpan.FromSeconds(2); - m_connectionRetry = 30; - } - - protected override void OnStart(IConnection connection, - string data, - Action initializeCallback, - Action errorCallback) - { - OpenConnection(connection, data, initializeCallback, errorCallback); - } - - protected override void OnBeforeAbort(IConnection connection) - { - // Get the reader from the connection and stop it - AsyncStreamReader _reader = ConnectionExtensions.GetValue(connection, m_readerKey); - if (_reader != null) - { - // Stop reading data from the stream - _reader.StopReading(false); - - // Remove the reader - connection.Items.Remove(m_readerKey); - } - } - - private void Reconnect(IConnection connection, string data) - { - if (!connection.IsActive) - return; - - // Wait for a bit before reconnecting - Thread.Sleep(m_reconnectDelay); - - // Now attempt a reconnect - OpenConnection(connection, data, null, null); - } - - private void OpenConnection(IConnection connection, - string data, - Action initializeCallback, - Action errorCallback) - { - // If we're reconnecting add /connect to the url - bool _reconnecting = initializeCallback == null; - string _url = (_reconnecting ? connection.Url : connection.Url + "connect"); - Action _prepareRequest = PrepareRequest(connection); - EventSignal _signal; - - if (shouldUsePost(connection)) - { - _url += GetReceiveQueryString(connection, data); - //Debug.WriteLine("ServerSentEventsTransport: POST {0}", _url); - - _signal = m_httpClient.PostAsync( - _url, - request => - { - _prepareRequest(request); - request.Accept = "text/event-stream"; - }, - new Dictionary { - { - "groups", GetSerializedGroups(connection) } - }); - } - else - { - _url += GetReceiveQueryStringWithGroups(connection, data); - //Debug.WriteLine("ServerSentEventsTransport: GET {0}", _url); - - _signal = m_httpClient.GetAsync( - _url, - request => - { - _prepareRequest(request); - request.Accept = "text/event-stream"; - }); - } - - _signal.Finished += (sender, e) => - { - if (e.Result.IsFaulted) - { - Exception _exception = e.Result.Exception.GetBaseException(); - - if (!HttpBasedTransport.IsRequestAborted(_exception)) - { - if (errorCallback != null && - Interlocked.Exchange(ref m_initializedCalled, 1) == 0) - errorCallback(_exception); - else if (_reconnecting) - // Only raise the error event if we failed to reconnect - connection.OnError(_exception); - } - - if (_reconnecting) - { - // Retry - Reconnect(connection, data); - return; - } - } - else - { - // Get the reseponse stream and read it for messages - IResponse _response = e.Result; - Stream _stream = _response.GetResponseStream(); - AsyncStreamReader _reader = new AsyncStreamReader( - _stream, - connection, - () => - { - if (Interlocked.CompareExchange(ref m_initializedCalled, 1, 0) == 0) - initializeCallback(); - }, - () => - { - _response.Close(); - Reconnect(connection, data); - }); - - if (_reconnecting) - // Raise the reconnect event if the connection comes back up - connection.OnReconnected(); - - _reader.StartReading(); - - // Set the reader for this connection - connection.Items[m_readerKey] = _reader; - } - }; - - if (initializeCallback != null) - { - int _tryed = 0; - while (true) - { - _tryed++; - //Debug.WriteLine("Checking if connection initialized for the {0} time: ", _tryed.ToString()); - - Thread.Sleep(m_connectionTimeout); - if (Interlocked.CompareExchange(ref m_initializedCalled, 1, 0) == 0) - { - if (_tryed < m_connectionRetry) - { - //Debug.WriteLine("Connection initialized failed after {0} times.", _tryed.ToString()); - continue; - } - - //Debug.WriteLine("Giving up on connection initializing."); - Debug.Log("stopping"); - // Stop the connection - Stop(connection); - - // Connection timeout occurred - errorCallback(new TimeoutException()); - - break; - } - else - { - //Debug.WriteLine("Connection initialized succeed."); - break; - } - } - } - } - - private static bool shouldUsePost(IConnection connection) - { - return new List(connection.Groups).Count > 20; - } - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs.meta deleted file mode 100755 index d59164be..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/ServerSentEventsTransport.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 02c2d4f767618ac4b83529e18ce1f88e -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs deleted file mode 100755 index 0ece5958..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs +++ /dev/null @@ -1,50 +0,0 @@ -#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API -using System; - -namespace SignalR.Client._20.Transports -{ - public class SseEvent - { - public EventType Type { get; private set; } - public string Data { get; private set; } - - public SseEvent(EventType type, string data) - { - Type = type; - Data = data; - } - - public static bool TryParse(string line, out SseEvent sseEvent) - { - sseEvent = null; - - if (line.StartsWith("data:", StringComparison.OrdinalIgnoreCase)) - { - string data = line.Substring("data:".Length).Trim(); - sseEvent = new SseEvent(EventType.Data, data); - return true; - } - else if (line.StartsWith("id:", StringComparison.OrdinalIgnoreCase)) - { - string data = line.Substring("id:".Length).Trim(); - sseEvent = new SseEvent(EventType.Id, data); - return true; - } - - return false; - } - - public override string ToString() - { - return String.Format("Type: [{0}] Data: [{1}]", Type, Data); - } - } - - public enum EventType - { - Id, - Data - } -} - -#endif \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs.meta deleted file mode 100755 index 526874fb..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/Shared/SignalR.NET20/Transports/SseEvent.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 023f255ca4a11ce458aade6bf4c2e744 -timeCreated: 1467844118 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml deleted file mode 100755 index af0c6e5d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml.meta deleted file mode 100755 index cd55d60f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFabSdk/link.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dc2c3070dc174cc45a4aaf1a5e38263d -timeCreated: 1468524880 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes.meta deleted file mode 100644 index 46bcb966..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 377585673bfae43d3ad4fa10ec3d5a6e -folderAsset: yes -timeCreated: 1456766634 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel.meta deleted file mode 100644 index 2adcda43..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2826225f07950442f89b6716864d862a -folderAsset: yes -timeCreated: 1456766646 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art.meta deleted file mode 100644 index 4abcef8c..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 64d35ba36324d4e43abd3a75c4d51ecc -folderAsset: yes -timeCreated: 1456766673 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png deleted file mode 100644 index 4130a353..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png.meta deleted file mode 100644 index a35f9bf2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Art/Playfab_logo_RGB.png.meta +++ /dev/null @@ -1,57 +0,0 @@ -fileFormatVersion: 2 -guid: 43d6db12710cd4a49b2bc9d6ef36ef91 -timeCreated: 1456767017 -licenseType: Pro -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 2048 - textureSettings: - filterMode: 2 - aniso: 16 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 8 - buildTargetSettings: [] - spriteSheet: - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs.meta deleted file mode 100644 index 12ce3299..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 5c95321d5327d4932a674496ddf88850 -folderAsset: yes -timeCreated: 1456766624 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab deleted file mode 100644 index c237bc4f..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab.meta deleted file mode 100644 index ea2fac6d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Prefabs/Main Camera.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d75dc7ae9d0d34ebdbd3f4ff9fd95a17 -timeCreated: 1456766662 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes.meta deleted file mode 100644 index 9e08632d..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 355784b58556f48979af6c514789cbe0 -folderAsset: yes -timeCreated: 1456207899 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity deleted file mode 100644 index 7e07c6ca..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity.meta deleted file mode 100644 index fd94dbcd..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scenes/PrizeWheel.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7f17a4064ccf541d585d2ea8085fd480 -timeCreated: 1456207916 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts.meta deleted file mode 100644 index 3b351ab7..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 98b2914882a1c4fba99ec4083f777a25 -folderAsset: yes -timeCreated: 1456207922 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs deleted file mode 100644 index 3d1fd408..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs +++ /dev/null @@ -1,144 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -using System; -using System.Collections.Generic; -using PlayFab; -using PlayFab.ClientModels; - -public class PrizeWheelDemo : MonoBehaviour { - // UI - public Button spin; - public Text spinTicketBalance; - public Text timeUntilNextFreeSpin; - public Text itemCount; - - // INSPECTOR TWEAKABLES - public string playFabTitleId = string.Empty; - - // Use this for initialization - void Start () - { - LockUI(); - // set TitleID in the SDK - PlayFab.PlayFabSettings.TitleId = this.playFabTitleId; - if(string.IsNullOrEmpty(PlayFab.PlayFabSettings.TitleId)) - { - Debug.LogWarning("Title Id was not set. To continue, enter your title id in the inspector."); - } - AuthenticateWithPlayFab(); - } - - public void OnSpinClicked() - { - TryToSpin(); - } - - void SetUI(int tickets, int items, string nextFree) - { - this.spinTicketBalance.text = string.Format("x{0}", tickets); - this.itemCount.text = string.Format("{0}", items); - this.timeUntilNextFreeSpin.text = string.Format("{0}", nextFree); - } - - void UnlockUI() - { - this.spin.interactable = true; - this.itemCount.gameObject.SetActive(true); - this.timeUntilNextFreeSpin.gameObject.SetActive(true); - this.spinTicketBalance.gameObject.SetActive(true); - } - - void LockUI() - { - this.spin.interactable = false; - this.itemCount.gameObject.SetActive(false); - this.timeUntilNextFreeSpin.gameObject.SetActive(false); - this.spinTicketBalance.gameObject.SetActive(false); - } - - - void AuthenticateWithPlayFab() - { - Debug.Log("Logging into PlayFab..."); - LoginWithCustomIDRequest request = new LoginWithCustomIDRequest() { TitleId = this.playFabTitleId, CustomId = SystemInfo.deviceUniqueIdentifier, CreateAccount = true }; - PlayFabClientAPI.LoginWithCustomID(request, OnLoginCallback, OnApiCallError, null); - } - - void OnLoginCallback (LoginResult result) - { - Debug.Log(string.Format("Login Successful. Welcome Player:{0}!", result.PlayFabId)); - Debug.Log(string.Format("Your session ticket is: {0}", result.SessionTicket)); - GetInventory(); - } - - void GetInventory() - { - Debug.Log("Getting the player inventory..."); - GetUserInventoryRequest request = new GetUserInventoryRequest(); - PlayFabClientAPI.GetUserInventory(request, GetInventoryCallback, OnApiCallError); - } - - void GetInventoryCallback (GetUserInventoryResult result) - { - Debug.Log(string.Format("Inventory retrieved. You have {0} items.", result.Inventory.Count)); - - int stBalance; - result.VirtualCurrency.TryGetValue("ST", out stBalance); - - VirtualCurrencyRechargeTime rechargeDetails; - - string freeTicketDisplay = string.Format("Capped"); - if(result.VirtualCurrencyRechargeTimes.TryGetValue("ST", out rechargeDetails)) - { - if(stBalance < rechargeDetails.RechargeMax) - { - DateTime nextFreeTicket = new DateTime(); - nextFreeTicket = DateTime.Now.AddSeconds(rechargeDetails.SecondsToRecharge); - Debug.Log(string.Format("You have {0} Spin Tickets.", stBalance)); - Debug.Log(string.Format("Your next free ticket will arrive at: {0}", nextFreeTicket)); - freeTicketDisplay = string.Format("{0}", nextFreeTicket); - } - else - { - Debug.Log(string.Format("Tickets only regenerate to a maximum of {0}, and you currently have {1}.", rechargeDetails.RechargeMax, stBalance)); - } - - } - - SetUI(stBalance, result.Inventory.Count, freeTicketDisplay); - UnlockUI(); - } - - void TryToSpin() - { - Debug.Log("Attempting to spin..."); - PurchaseItemRequest request = new PurchaseItemRequest() { ItemId = "PrizeWheel1", VirtualCurrency = "ST", Price = 1 }; - PlayFabClientAPI.PurchaseItem(request, TryToSpinCallback, OnApiCallError); - } - - void TryToSpinCallback (PurchaseItemResult result) - { - Debug.Log("Ticket Accepted! \nSPINNING..."); - Debug.Log(string.Format("SPIN RESULT: {0}", result.Items[1].DisplayName)); - - GetInventory(); - } - - - void OnApiCallError(PlayFabError err) - { - string http = string.Format("HTTP:{0}", err.HttpCode); - string message = string.Format("ERROR:{0} -- {1}", err.Error, err.ErrorMessage); - string details = string.Empty; - - if(err.ErrorDetails != null) - { - foreach(var detail in err.ErrorDetails) - { - details += string.Format("{0} \n", detail.ToString()); - } - } - - Debug.LogError(string.Format("{0}\n {1}\n {2}\n", http, message, details)); - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs.meta deleted file mode 100644 index 02648da9..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/PlayFab_Recipes/PrizeWheel/Scripts/PrizeWheelDemo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: cf61c8ce047a44bc4b403982cb58016d -timeCreated: 1456207941 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins.meta deleted file mode 100755 index aad98a0e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7cacccf5f4c7c314d81de73f72124e4c -folderAsset: yes -timeCreated: 1468616383 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared.meta deleted file mode 100755 index 2a46bb2a..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 48e3de8e4f107aa4c92c9ae5769b388e -folderAsset: yes -timeCreated: 1468524875 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs deleted file mode 100755 index 9847ece2..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs +++ /dev/null @@ -1,302 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PlayFab -{ - /// - /// Error codes returned by PlayFabAPIs - /// - public enum PlayFabErrorCode - { - Unknown = 1, - Success = 0, - InvalidParams = 1000, - AccountNotFound = 1001, - AccountBanned = 1002, - InvalidUsernameOrPassword = 1003, - InvalidTitleId = 1004, - InvalidEmailAddress = 1005, - EmailAddressNotAvailable = 1006, - InvalidUsername = 1007, - InvalidPassword = 1008, - UsernameNotAvailable = 1009, - InvalidSteamTicket = 1010, - AccountAlreadyLinked = 1011, - LinkedAccountAlreadyClaimed = 1012, - InvalidFacebookToken = 1013, - AccountNotLinked = 1014, - FailedByPaymentProvider = 1015, - CouponCodeNotFound = 1016, - InvalidContainerItem = 1017, - ContainerNotOwned = 1018, - KeyNotOwned = 1019, - InvalidItemIdInTable = 1020, - InvalidReceipt = 1021, - ReceiptAlreadyUsed = 1022, - ReceiptCancelled = 1023, - GameNotFound = 1024, - GameModeNotFound = 1025, - InvalidGoogleToken = 1026, - UserIsNotPartOfDeveloper = 1027, - InvalidTitleForDeveloper = 1028, - TitleNameConflicts = 1029, - UserisNotValid = 1030, - ValueAlreadyExists = 1031, - BuildNotFound = 1032, - PlayerNotInGame = 1033, - InvalidTicket = 1034, - InvalidDeveloper = 1035, - InvalidOrderInfo = 1036, - RegistrationIncomplete = 1037, - InvalidPlatform = 1038, - UnknownError = 1039, - SteamApplicationNotOwned = 1040, - WrongSteamAccount = 1041, - TitleNotActivated = 1042, - RegistrationSessionNotFound = 1043, - NoSuchMod = 1044, - FileNotFound = 1045, - DuplicateEmail = 1046, - ItemNotFound = 1047, - ItemNotOwned = 1048, - ItemNotRecycleable = 1049, - ItemNotAffordable = 1050, - InvalidVirtualCurrency = 1051, - WrongVirtualCurrency = 1052, - WrongPrice = 1053, - NonPositiveValue = 1054, - InvalidRegion = 1055, - RegionAtCapacity = 1056, - ServerFailedToStart = 1057, - NameNotAvailable = 1058, - InsufficientFunds = 1059, - InvalidDeviceID = 1060, - InvalidPushNotificationToken = 1061, - NoRemainingUses = 1062, - InvalidPaymentProvider = 1063, - PurchaseInitializationFailure = 1064, - DuplicateUsername = 1065, - InvalidBuyerInfo = 1066, - NoGameModeParamsSet = 1067, - BodyTooLarge = 1068, - ReservedWordInBody = 1069, - InvalidTypeInBody = 1070, - InvalidRequest = 1071, - ReservedEventName = 1072, - InvalidUserStatistics = 1073, - NotAuthenticated = 1074, - StreamAlreadyExists = 1075, - ErrorCreatingStream = 1076, - StreamNotFound = 1077, - InvalidAccount = 1078, - PurchaseDoesNotExist = 1080, - InvalidPurchaseTransactionStatus = 1081, - APINotEnabledForGameClientAccess = 1082, - NoPushNotificationARNForTitle = 1083, - BuildAlreadyExists = 1084, - BuildPackageDoesNotExist = 1085, - CustomAnalyticsEventsNotEnabledForTitle = 1087, - InvalidSharedGroupId = 1088, - NotAuthorized = 1089, - MissingTitleGoogleProperties = 1090, - InvalidItemProperties = 1091, - InvalidPSNAuthCode = 1092, - InvalidItemId = 1093, - PushNotEnabledForAccount = 1094, - PushServiceError = 1095, - ReceiptDoesNotContainInAppItems = 1096, - ReceiptContainsMultipleInAppItems = 1097, - InvalidBundleID = 1098, - JavascriptException = 1099, - InvalidSessionTicket = 1100, - UnableToConnectToDatabase = 1101, - InternalServerError = 1110, - InvalidReportDate = 1111, - ReportNotAvailable = 1112, - DatabaseThroughputExceeded = 1113, - InvalidGameTicket = 1115, - ExpiredGameTicket = 1116, - GameTicketDoesNotMatchLobby = 1117, - LinkedDeviceAlreadyClaimed = 1118, - DeviceAlreadyLinked = 1119, - DeviceNotLinked = 1120, - PartialFailure = 1121, - PublisherNotSet = 1122, - ServiceUnavailable = 1123, - VersionNotFound = 1124, - RevisionNotFound = 1125, - InvalidPublisherId = 1126, - DownstreamServiceUnavailable = 1127, - APINotIncludedInTitleUsageTier = 1128, - DAULimitExceeded = 1129, - APIRequestLimitExceeded = 1130, - InvalidAPIEndpoint = 1131, - BuildNotAvailable = 1132, - ConcurrentEditError = 1133, - ContentNotFound = 1134, - CharacterNotFound = 1135, - CloudScriptNotFound = 1136, - ContentQuotaExceeded = 1137, - InvalidCharacterStatistics = 1138, - PhotonNotEnabledForTitle = 1139, - PhotonApplicationNotFound = 1140, - PhotonApplicationNotAssociatedWithTitle = 1141, - InvalidEmailOrPassword = 1142, - FacebookAPIError = 1143, - InvalidContentType = 1144, - KeyLengthExceeded = 1145, - DataLengthExceeded = 1146, - TooManyKeys = 1147, - FreeTierCannotHaveVirtualCurrency = 1148, - MissingAmazonSharedKey = 1149, - AmazonValidationError = 1150, - InvalidPSNIssuerId = 1151, - PSNInaccessible = 1152, - ExpiredAuthToken = 1153, - FailedToGetEntitlements = 1154, - FailedToConsumeEntitlement = 1155, - TradeAcceptingUserNotAllowed = 1156, - TradeInventoryItemIsAssignedToCharacter = 1157, - TradeInventoryItemIsBundle = 1158, - TradeStatusNotValidForCancelling = 1159, - TradeStatusNotValidForAccepting = 1160, - TradeDoesNotExist = 1161, - TradeCancelled = 1162, - TradeAlreadyFilled = 1163, - TradeWaitForStatusTimeout = 1164, - TradeInventoryItemExpired = 1165, - TradeMissingOfferedAndAcceptedItems = 1166, - TradeAcceptedItemIsBundle = 1167, - TradeAcceptedItemIsStackable = 1168, - TradeInventoryItemInvalidStatus = 1169, - TradeAcceptedCatalogItemInvalid = 1170, - TradeAllowedUsersInvalid = 1171, - TradeInventoryItemDoesNotExist = 1172, - TradeInventoryItemIsConsumed = 1173, - TradeInventoryItemIsStackable = 1174, - TradeAcceptedItemsMismatch = 1175, - InvalidKongregateToken = 1176, - FeatureNotConfiguredForTitle = 1177, - NoMatchingCatalogItemForReceipt = 1178, - InvalidCurrencyCode = 1179, - NoRealMoneyPriceForCatalogItem = 1180, - TradeInventoryItemIsNotTradable = 1181, - TradeAcceptedCatalogItemIsNotTradable = 1182, - UsersAlreadyFriends = 1183, - LinkedIdentifierAlreadyClaimed = 1184, - CustomIdNotLinked = 1185, - TotalDataSizeExceeded = 1186, - DeleteKeyConflict = 1187, - InvalidXboxLiveToken = 1188, - ExpiredXboxLiveToken = 1189, - ResettableStatisticVersionRequired = 1190, - NotAuthorizedByTitle = 1191, - NoPartnerEnabled = 1192, - InvalidPartnerResponse = 1193, - APINotEnabledForGameServerAccess = 1194, - StatisticNotFound = 1195, - StatisticNameConflict = 1196, - StatisticVersionClosedForWrites = 1197, - StatisticVersionInvalid = 1198, - APIClientRequestRateLimitExceeded = 1199, - InvalidJSONContent = 1200, - InvalidDropTable = 1201, - StatisticVersionAlreadyIncrementedForScheduledInterval = 1202, - StatisticCountLimitExceeded = 1203, - StatisticVersionIncrementRateExceeded = 1204, - ContainerKeyInvalid = 1205, - CloudScriptExecutionTimeLimitExceeded = 1206, - NoWritePermissionsForEvent = 1207, - CloudScriptFunctionArgumentSizeExceeded = 1208, - CloudScriptAPIRequestCountExceeded = 1209, - CloudScriptAPIRequestError = 1210, - CloudScriptHTTPRequestError = 1211, - InsufficientGuildRole = 1212, - GuildNotFound = 1213, - OverLimit = 1214, - EventNotFound = 1215, - InvalidEventField = 1216, - InvalidEventName = 1217, - CatalogNotConfigured = 1218, - OperationNotSupportedForPlatform = 1219, - SegmentNotFound = 1220, - StoreNotFound = 1221, - InvalidStatisticName = 1222, - TitleNotQualifiedForLimit = 1223, - InvalidServiceLimitLevel = 1224, - ServiceLimitLevelInTransition = 1225, - CouponAlreadyRedeemed = 1226, - GameServerBuildSizeLimitExceeded = 1227, - GameServerBuildCountLimitExceeded = 1228, - VirtualCurrencyCountLimitExceeded = 1229, - VirtualCurrencyCodeExists = 1230, - TitleNewsItemCountLimitExceeded = 1231, - InvalidTwitchToken = 1232, - TwitchResponseError = 1233, - ProfaneDisplayName = 1234, - UserAlreadyAdded = 1235, - InvalidVirtualCurrencyCode = 1236, - VirtualCurrencyCannotBeDeleted = 1237, - IdentifierAlreadyClaimed = 1238, - IdentifierNotLinked = 1239, - InvalidContinuationToken = 1240, - ExpiredContinuationToken = 1241, - InvalidSegment = 1242, - InvalidSessionId = 1243, - SessionLogNotFound = 1244, - InvalidSearchTerm = 1245, - TwoFactorAuthenticationTokenRequired = 1246, - GameServerHostCountLimitExceeded = 1247, - PlayerTagCountLimitExceeded = 1248, - RequestAlreadyRunning = 1249, - ActionGroupNotFound = 1250, - MaximumSegmentBulkActionJobsRunning = 1251, - NoActionsOnPlayersInSegmentJob = 1252, - DuplicateStatisticName = 1253, - ScheduledTaskNameConflict = 1254, - ScheduledTaskCreateConflict = 1255, - InvalidScheduledTaskName = 1256, - InvalidTaskSchedule = 1257 - } - - public delegate void ErrorCallback(PlayFabError error); - - public class PlayFabError - { - public int HttpCode; - public string HttpStatus; - public PlayFabErrorCode Error; - public string ErrorMessage; - public Dictionary > ErrorDetails; - public object CustomData; - - public override string ToString() { - var sb = new System.Text.StringBuilder(); - if (ErrorDetails != null) { - foreach (var kv in ErrorDetails) { - sb.Append(kv.Key); - sb.Append(": "); - sb.Append(string.Join(", ", kv.Value.ToArray())); - sb.Append(" | "); - } - } - return string.Format("PlayFabError({0}, {1}, {2} {3}", Error, ErrorMessage, HttpCode, HttpStatus) + (sb.Length > 0 ? " - Details: " + sb.ToString() + ")" : ")"); - } - - [ThreadStatic] - private static StringBuilder _tempSb; - public string GenerateErrorReport() - { - if (_tempSb == null) - _tempSb = new StringBuilder(); - _tempSb.Length = 0; - _tempSb.Append(ErrorMessage); - if (ErrorDetails != null) - foreach (var pair in ErrorDetails) - foreach (var msg in pair.Value) - _tempSb.Append("\n").Append(pair.Key).Append(": ").Append(msg); - return _tempSb.ToString(); - } - } -} diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs.meta b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs.meta deleted file mode 100755 index 1104460f..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/Assets/Plugins/PlayFabShared/PlayFabErrors.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ed146f2193bb8ef49ad1200eefdab503 -timeCreated: 1468524876 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/PrizeWheelRecipe.unitypackage b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/PrizeWheelRecipe.unitypackage deleted file mode 100644 index 2bc9cafb..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/PrizeWheelRecipe.unitypackage and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/AudioManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/AudioManager.asset deleted file mode 100644 index 38afce28..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/AudioManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ClusterInputManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index 25aa9b95..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ClusterInputManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/DynamicsManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index 6c6d0c0d..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/DynamicsManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorBuildSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index db838363..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorBuildSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorSettings.asset deleted file mode 100644 index e2031daa..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/EditorSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/GraphicsSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index 79d37c7c..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/GraphicsSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/InputManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/InputManager.asset deleted file mode 100644 index 31648127..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/InputManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NavMeshAreas.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index c12291a7..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NavMeshAreas.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NetworkManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NetworkManager.asset deleted file mode 100644 index 549944fa..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/NetworkManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/Physics2DSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index 3f9ac7d1..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/Physics2DSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index 29341362..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectVersion.txt b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index 069bc88e..00000000 --- a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1,2 +0,0 @@ -m_EditorVersion: 5.4.0f3 -m_StandardAssetsVersion: 0 diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/QualitySettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/QualitySettings.asset deleted file mode 100644 index 3882fbdf..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/QualitySettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TagManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TagManager.asset deleted file mode 100644 index f370ff3a..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TagManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TimeManager.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TimeManager.asset deleted file mode 100644 index a686ed5b..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/TimeManager.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityAdsSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 0ac8b8bd..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityAdsSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityConnectSettings.asset b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index 33272e86..00000000 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheel/ProjectSettings/UnityConnectSettings.asset and /dev/null differ diff --git a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage index a8b40d64..7b1bd04c 100644 Binary files a/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage and b/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage differ diff --git a/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json b/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json index 08be7aa3..d157de4f 100644 --- a/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json +++ b/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json @@ -109,15 +109,13 @@ "CustomData": "null", "Consumable": { "UsageCount": 1, - "UsagePeriod": null, + "UsagePeriod": 3, "UsagePeriodGroup": null }, "Container": null, "Bundle": { "BundledItems": [], - "BundledResultTables": [ - "PrizeWheel1" - ], + "BundledResultTables": [], "BundledVirtualCurrencies": null }, "CanBecomeCharacter": false, diff --git a/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json b/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json index 91a9fbd0..3394ea2b 100644 --- a/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json +++ b/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json @@ -4,22 +4,22 @@ { "ResultItemType": "ItemId", "ResultItem": "Card1", - "Weight": 10000 + "Weight": 33 }, { "ResultItemType": "ItemId", "ResultItem": "Card2", - "Weight": 10000 + "Weight": 33 }, { "ResultItemType": "ItemId", "ResultItem": "Card3", - "Weight": 10000 + "Weight": 33 }, { "ResultItemType": "ItemId", "ResultItem": "SpinAgain", - "Weight": 303 + "Weight": 1 } ] -}] \ No newline at end of file +}] diff --git a/Recipes/PrizeWheel/README.md b/Recipes/PrizeWheel/README.md index a2001d37..d0e5ee65 100644 --- a/Recipes/PrizeWheel/README.md +++ b/Recipes/PrizeWheel/README.md @@ -1,41 +1,57 @@ ## Daily Prize Wheel ### Description: -A daily prize wheel gives players a 'spin' to receive a prize in exchange for a ticket. Tickets in this example are using PlayFab's regenerating Virtual Currency to ensure that the player is granted 1 ticket each day. The simplest way to achieve our intended "wheel of prizes' mechanic is to use a bundle or container with a drop table to control the distribution odds to receiving each item. +A daily prize wheel gives players a 'spin' to receive a prize in exchange for a ticket. Tickets in this example are using PlayFab's regenerating Virtual Currency to ensure that the player is granted 1 ticket each day. The simplest way to achieve our intended 'wheel of prizes' mechanic is to use a bundle or container with a drop table to control the distribution odds of receiving each item. -This technique ensures that players can only 'spin' at most one time per 24 hour period. Additionally, you can easily cap how many 'spin' tickets can be saved through the Virtual Currency settings. In this example we are allowing the player to bank up to 5 spin tickets +This technique ensures that players can only 'spin' at most one time per 24 hour period. Additionally, you can easily cap how many 'spin' tickets can be saved through the Virtual Currency settings. In this example we are allowing the player to bank up to 5 spin tickets. ### Ingredients (Building Blocks): - * [Accounts](https://api.playfab.com/docs/building-blocks#Accounts) - * [Player Inventory](https://api.playfab.com/docs/building-blocks#Player_Inventory) - * [Virtual Currency](https://api.playfab.com/docs/building-blocks#Virtual_Currency) - * [Catalog & CatalogItems (Bundle / Container)](https://api.playfab.com/docs/building-blocks#Catalog) - * [Drop Table](https://api.playfab.com/docs/building-blocks#Drop_Table) + * [Accounts](https://docs.microsoft.com/gaming/playfab/miscellaneous/hold-topics/building-blocks#accounts) + * [Player Inventory/Item Instance](https://docs.microsoft.com/gaming/playfab/miscellaneous/hold-topics/building-blocks#player-inventoryitem-instance) + * [Virtual Currency](https://docs.microsoft.com/gaming/playfab/miscellaneous/hold-topics/building-blocks#virtual-currency) + * [Catalog/Virtual Goods](https://docs.microsoft.com/gaming/playfab/miscellaneous/hold-topics/building-blocks#catalogvirtual-goods) + * [Drop Table](https://docs.microsoft.com/gaming/playfab/miscellaneous/hold-topics/building-blocks#drop-tables) -###Preparation: - 1. Under the **Economy > Currencies** section of the Game Manager add a Virtual Currency to match the following parameters: +### Preparation: + 1. Under the **Economy > Currency** tab of Game Manager add a Virtual Currency to match the following parameters: | Property | Value | Detail ---: | :---: | --- Code | ST | Abbreviation for our VC Name | Spin Ticket | Name of our VC - Initial Deposit | 1 | ensure that the player can spin on their first login - Recharge Rate | 1 | this sets the VC to regenerate 1 unit per day - Recharge Max | 5 | this caps the regeneration to the specified number, this is useful for allowing players to bank up to 5 spin tickets at a time + Initial Deposit | 1 | Ensures that the player can spin on their first login + Recharge Rate | 1 | Sets the VC to regenerate 1 unit per day + Recharge Max | 5 | Caps the regeneration to the specified number, this is useful for allowing players to bank up to 5 spin tickets at a time - 2. Next, under the Catalog tab, add a new catalog called **PrizeWheel**. - 3. After the catalog is created, navigate within the catalog to the **Drop Tables** tab. - 4. Upload [this JSON file](/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json). The drop table should contain all of the items on the 'wheel'. - 5. Finally, navigate back to the top-level catalogs view and click on the small black arrow in the top-right corner of the "PrizeWheel Catalog". Choose the Upload JSON option and provide [this catalog file](/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json) or use your own. - * If using your own, ensure that you have items that can be granted to a player. + 2. Under the **Catalogs** tab, select **Upload JSON** and upload [this JSON file](/Recipes/PrizeWheel/PlayFab-JSON/Catalog.json) - this will automatically create a catalog called **PrizeWheel** with the following five items: + + | DisplayName | Type | Detail + ---: | :---: | --- + Card No. 1 | Item | First prize option + Card No. 2 | Item | Second prize option + Card No. 3 | Item | Third prize option + Prize Wheel No. 1 | Item | This represents the spin that needs to be purchased for 1 Spin Ticket (ST) + Spin Again! | Bundle | This bundle contains 1 Spin Ticket (ST) to allow another spin + + 3. Select **Edit Catalog > Make Primary Catalog > Save** + 4. Navigate within the catalog to the **Drop Tables** tab. + 5. Upload [this JSON file](/Recipes/PrizeWheel/PlayFab-JSON/DropTable.json). The drop table contains all of the items on the 'wheel', giving a 33% chance for each Card item to be chosen, and a 1% chance to spin again. + 6. Navigate within the catalog to the **Items** tab. + 7. Select the **PrizeWheel1** item - this needs to be converted to a bundle containing the drop table. + 8. Under **Convert To...** select **Show Options > Convert to bundle** + 9. Select **Save Item** + 10. Under **Bundle Contents** select **Add to bundle > Drop Tables** + 11. Add the **PrizeWheel1** drop table and save the bundle + + **NOTE:** Instead of simply uploading the catalog JSON with Prize Wheel No. 1 as a bundle, steps 6-11 are necessary due to a bit of a chicken-and-egg problem: the catalog JSON cannot upload successfully, since the drop table doesn't exist; and if we swap the upload order, the drop table JSON will also fail, since the items don't exist. ### Mechanic Walkthrough: 1. Client obtains a valid session ticket via one of the various authentication pathways (required to make Client API Calls) 2. After logging-in the client needs a mechanism to trigger a spin 3. After triggering the spin, the client attempts to purchase a SpinResult in exchange for 1 Spin Ticket 4. After receiving the client's request, PlayFab will: - * Deduct a Spin Ticket from the Player's VC balance - * Award the bundle / container to the player's inventory - * Send a response with the updated information back to the client + * Deduct a Spin Ticket from the Player's VC balance + * Award the bundle / container to the player's inventory + * Send a response with the updated information back to the client 5. Upon receiving the response, the client can display the award to the player. ---- @@ -46,9 +62,9 @@ Import the following asset packages into a new or existing Unity project: * Ensure you have the latest SDK [here](https://github.com/PlayFab/UnitySDK/raw/versioned/Packages/UnitySDK.unitypackage). * Ensure you have the recipe files [here](https://github.com/PlayFab/PlayFab-Samples/raw/master/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage) - 1. Add assets to your project. - 2. Open the PrizeWheel scene. - 3. Add your title ID to the PrizeWheel.cs script via the Unity Inspector. + 1. Follow the [Unity Quickstart](https://docs.microsoft.com/en-us/gaming/playfab/sdks/unity3d/quickstart) to download and install the PlayFab SDK (follow the steps up to "Making your first API call"). + 2. Add [PrizeWheelRecipe.unitypackage](https://github.com/PlayFab/PlayFab-Samples/raw/master/Recipes/PrizeWheel/Example-Unity3d/PrizeWheelRecipe.unitypackage) to your project by navigating to **Assets > Import Package > Custom Package**. + 3. Open the PrizeWheel scene. 4. Run the scene and observe the console for call-by-call status updates. ----