From 932aa3ff6c30b8a6e3629155b71d90779d31f88d Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Tue, 29 Oct 2024 17:34:29 +0800 Subject: [PATCH 01/21] SDK-3945 Upgrade project version to 2021 --- Assets/Plugins/Android.meta | 8 + .../Loader/loaderSpriteSheet.png.meta | 57 ++++++- .../Runtime/Components/KeyboardHandler.cs | 2 +- Assets/Xsolla/README.md | 6 +- Packages/manifest.json | 7 +- Packages/packages-lock.json | 29 +++- ProjectSettings/MemorySettings.asset | 35 ++++ ProjectSettings/ProjectSettings.asset | 160 ++++++++++-------- ProjectSettings/ProjectVersion.txt | 4 +- ProjectSettings/VersionControlSettings.asset | 8 + ProjectSettings/boot.config | 0 11 files changed, 230 insertions(+), 86 deletions(-) create mode 100644 Assets/Plugins/Android.meta create mode 100644 ProjectSettings/MemorySettings.asset create mode 100644 ProjectSettings/VersionControlSettings.asset create mode 100644 ProjectSettings/boot.config diff --git a/Assets/Plugins/Android.meta b/Assets/Plugins/Android.meta new file mode 100644 index 000000000..5fe90d4fe --- /dev/null +++ b/Assets/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d1dd0646fee2349d0a420d4dd786f592 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Xsolla.Demo/Common/Resources/Loader/loaderSpriteSheet.png.meta b/Assets/Xsolla.Demo/Common/Resources/Loader/loaderSpriteSheet.png.meta index 07aafa1a4..29794c3e6 100644 --- a/Assets/Xsolla.Demo/Common/Resources/Loader/loaderSpriteSheet.png.meta +++ b/Assets/Xsolla.Demo/Common/Resources/Loader/loaderSpriteSheet.png.meta @@ -129,7 +129,7 @@ TextureImporter: 213: -8551393072588562937 second: loaderSpriteSheet_41 externalObjects: {} - serializedVersion: 11 + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -149,6 +149,8 @@ TextureImporter: isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -157,9 +159,9 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 wrapW: 1 @@ -180,10 +182,14 @@ TextureImporter: textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + cookieLightType: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform @@ -1152,6 +1158,49 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] + nameFileIdTable: + loaderSpriteSheet_0: 6119179956306705436 + loaderSpriteSheet_1: 1948489414981681935 + loaderSpriteSheet_10: 8553483687825724800 + loaderSpriteSheet_11: 7890587224968203100 + loaderSpriteSheet_12: 2871688170348923043 + loaderSpriteSheet_13: 5812960832756341595 + loaderSpriteSheet_14: 3245247103846377162 + loaderSpriteSheet_15: 6856543823031600404 + loaderSpriteSheet_16: -3446213605989861964 + loaderSpriteSheet_17: -2805336891603062751 + loaderSpriteSheet_18: -3932502503603644002 + loaderSpriteSheet_19: 2860573761358439906 + loaderSpriteSheet_2: 8592928864191464020 + loaderSpriteSheet_20: -5661561341143207235 + loaderSpriteSheet_21: 4522568316164718453 + loaderSpriteSheet_22: 278471870626291434 + loaderSpriteSheet_23: -3723127413795190189 + loaderSpriteSheet_24: 8127241859420271755 + loaderSpriteSheet_25: 712597168446126503 + loaderSpriteSheet_26: 5615135359246611760 + loaderSpriteSheet_27: 2550811609107427872 + loaderSpriteSheet_28: -5598349933160234038 + loaderSpriteSheet_29: 5425292048495204703 + loaderSpriteSheet_3: 2687939678679945948 + loaderSpriteSheet_30: -4088510770622287462 + loaderSpriteSheet_31: 2276996122718442864 + loaderSpriteSheet_32: -4958585348392455297 + loaderSpriteSheet_33: 6690881725231492936 + loaderSpriteSheet_34: 3598315828308138026 + loaderSpriteSheet_35: 4537377108205226020 + loaderSpriteSheet_36: -2822592693041478996 + loaderSpriteSheet_37: 4459260560982961239 + loaderSpriteSheet_38: 9059153791551676260 + loaderSpriteSheet_39: 8947128539939747193 + loaderSpriteSheet_4: -6887036681257653664 + loaderSpriteSheet_40: -7226275827021487436 + loaderSpriteSheet_41: -8551393072588562937 + loaderSpriteSheet_5: 4183692060191070421 + loaderSpriteSheet_6: -8779921962958882512 + loaderSpriteSheet_7: 8070440983743358974 + loaderSpriteSheet_8: -3347228366132722978 + loaderSpriteSheet_9: -7550757938432500779 spritePackingTag: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 diff --git a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Components/KeyboardHandler.cs b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Components/KeyboardHandler.cs index e66666804..ae4ba6fdb 100644 --- a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Components/KeyboardHandler.cs +++ b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Components/KeyboardHandler.cs @@ -14,7 +14,7 @@ public class KeyboardHandler : MonoBehaviour, IBrowserHandler private void OnApplicationFocus(bool hasFocus) { if (hasFocus && Page != null) - Page.UpKeyAsync("alt"); + Page.UpKeyAsync("Alt"); } public void Run(BrowserPage page, CancellationToken cancellationToken) diff --git a/Assets/Xsolla/README.md b/Assets/Xsolla/README.md index 4920972c5..d6775126e 100644 --- a/Assets/Xsolla/README.md +++ b/Assets/Xsolla/README.md @@ -62,7 +62,7 @@ To start with the SDK, you need to install this asset and set up a project in [X ### Subscriptions * Selling subscriptions. -* Subscription renewal and cancelation. +* Subscription renewal and cancellation. * Subscription management from a user’s dashboard. **INFO:** You can add and manage subscription plans via Xsolla Publisher Account. @@ -92,7 +92,7 @@ To start with the SDK, you need to install this asset and set up a project in [X * 64-bit OS * Windows 7 SP1 and later * macOS 10.12 and later -* The version of Unity not earlier than 2019.4.19f1 +* The version of Unity not earlier than 2021.3.45f1 ### Target OS @@ -103,8 +103,6 @@ To start with the SDK, you need to install this asset and set up a project in [X Additionally, the asset supports [creating WebGL build](https://developers.xsolla.com/sdk/unity/how-tos/application-build/#unity_sdk_how_to_build_webgl) to run your application in a browser. -The SDK uses [Google Mobile Services](https://www.android.com/gms/) and doesn’t support builds for devices without Google Mobile Services, such as Huawei. - **NOTE:** We recommend you use the Mono compiler for desktop platforms as it’s compatible with the provided in-game browser. If you use other browser solutions, you can use the IL2CPP compiler instead. You can use either Mono or IL2CPP compilers to create game builds for Android. diff --git a/Packages/manifest.json b/Packages/manifest.json index 1ced70228..d60957cf9 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -2,9 +2,10 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.ide.rider": "1.2.1", - "com.unity.nuget.newtonsoft-json": "3.0.1", - "com.unity.test-framework": "1.1.27", + "com.unity.ide.rider": "3.0.31", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.test-framework": "1.1.33", "com.unity.ugui": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 9702ccdce..9b5608110 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -20,23 +20,32 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "1.2.1", + "version": "3.0.31", "depth": 0, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.1" + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.22", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" }, "url": "https://packages.unity.com" }, "com.unity.nuget.newtonsoft-json": { - "version": "3.0.1", + "version": "3.2.1", "depth": 0, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.27", + "version": "1.1.33", "depth": 0, "source": "registry", "dependencies": { @@ -188,6 +197,18 @@ "depth": 0, "source": "builtin", "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.uielementsnative": "1.0.0" + } + }, + "com.unity.modules.uielementsnative": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" } diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 000000000..5b5faceca --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 03bd7337f..2eb4294d9 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 20 + serializedVersion: 24 productGUID: c38a2e7bf7acd2c4299a80923d451ffd AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -48,7 +48,10 @@ PlayerSettings: defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 + unsupportedMSAAFallback: 0 m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 @@ -66,6 +69,13 @@ PlayerSettings: androidRenderOutsideSafeArea: 0 androidUseSwappy: 0 androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 1 @@ -113,11 +123,14 @@ PlayerSettings: switchNVNOtherPoolsGranularity: 16777216 switchNVNMaxPublicTextureIDCount: 0 switchNVNMaxPublicSamplerIDCount: 0 + switchMaxWorkerMultiple: 8 stadiaPresentMode: 0 stadiaTargetFramerate: 0 vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 m_SupportedAspectRatios: 4:3: 1 5:4: 1 @@ -132,46 +145,27 @@ PlayerSettings: xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - lumin: - depthFormat: 0 - frameTiming: 2 - enableGLCache: 0 - glCacheMaxBlobSize: 524288 - glCacheMaxFileSize: 8388608 - oculus: - sharedDepthBuffer: 1 - dashSupport: 1 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 0 enable360StereoCapture: 0 isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 useHDRDisplay: 0 D3DHDRBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: Android: com.xsolla.sdk.unity.Example Standalone: com.xsolla.sdk.unity.Example iPhone: com.xsolla.sdk.unity.Example - buildNumber: {} + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 24 AndroidTargetSdkVersion: 33 @@ -188,10 +182,10 @@ PlayerSettings: StripUnusedMeshComponents: 1 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 10.0 + iOSTargetOSVersionString: 12.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 10.0 + tvOSTargetOSVersionString: 12.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -225,10 +219,11 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + macOSURLSchemes: [] iOSBackgroundModes: 0 iOSMetalForceHardShadows: 0 metalEditorSupport: 1 @@ -244,10 +239,20 @@ PlayerSettings: iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: 5f34be1353de5cf4398729fda238591b templatePackageId: com.unity.template.2d@1.0.2 templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 5 + AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} AndroidKeystoreName: @@ -264,6 +269,9 @@ PlayerSettings: height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 150 m_BuildTargetIcons: [] @@ -361,6 +369,7 @@ PlayerSettings: m_Kind: 1 m_SubKind: m_BuildTargetBatching: [] + m_BuildTargetShaderSettings: [] m_BuildTargetGraphicsJobs: - m_BuildTarget: MacStandaloneSupport m_GraphicsJobs: 0 @@ -395,8 +404,16 @@ PlayerSettings: m_GraphicsJobMode: 0 - m_BuildTarget: XboxOnePlayer m_GraphicsJobMode: 0 - m_BuildTargetGraphicsAPIs: [] + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AndroidPlayer + m_APIs: 0b00000008000000 + m_Automatic: 0 m_BuildTargetVRSettings: [] + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 openGLRequireES31: 0 openGLRequireES31AEP: 0 openGLRequireES32: 0 @@ -407,6 +424,8 @@ PlayerSettings: tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: [] m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -416,12 +435,16 @@ PlayerSettings: cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + bluetoothUsageDescription: + switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 switchSocketAllocatorPoolSize: 128 switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: switchTitleNames_0: @@ -497,7 +520,6 @@ PlayerSettings: switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 switchApplicationErrorCodeCategory: @@ -539,6 +561,7 @@ PlayerSettings: switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64 @@ -549,9 +572,12 @@ PlayerSettings: switchSocketBufferEfficiency: 4 switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 1 switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -622,35 +648,11 @@ PlayerSettings: ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] ps4attribVROutputEnabled: 0 - ps5ParamFilePath: - ps5VideoOutPixelFormat: 0 - ps5VideoOutInitialWidth: 1920 - ps5VideoOutOutputMode: 1 - ps5BackgroundImagePath: - ps5StartupImagePath: - ps5Pic2Path: - ps5StartupImagesFolder: - ps5IconImagesFolder: - ps5SaveDataImagePath: - ps5SdkOverride: - ps5BGMPath: - ps5ShareOverlayImagePath: - ps5NPConfigZipPath: - ps5Passcode: dVI5ZuGXbEWRK5RhRXdCdG5nG5azdNMK - ps5UseResolutionFallback: 0 - ps5UseAudio3dBackend: 0 - ps5ScriptOptimizationLevel: 2 - ps5Audio3dVirtualSpeakerCount: 14 - ps5UpdateReferencePackage: - ps5disableAutoHideSplash: 0 - ps5OperatingSystemCanDisableSplashScreen: 0 - ps5IncludedModules: [] - ps5SharedBinaryContentLabels: [] - ps5SharedBinarySystemFolders: [] monoEnv: splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} @@ -667,22 +669,41 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 2 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 - webGLWasmStreaming: 0 + webGLDecompressionFallback: 0 + webGLPowerPreference: 2 scriptingDefineSymbols: - 1: STEAMWORKS_NET - 4: STEAMWORKS_NET + Android: STEAMWORKS_NET + Standalone: STEAMWORKS_NET + iPhone: STEAMWORKS_NET + additionalCompilerArguments: {} platformArchitecture: iPhone: 1 scriptingBackend: Android: 0 Standalone: 0 il2cppCompilerConfiguration: {} - managedStrippingLevel: {} + managedStrippingLevel: + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Lumin: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + Stadia: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 incrementalIl2cppBuild: {} suppressCommonWarnings: 1 allowUnsafeCode: 0 + useDeterministicCompilation: 1 + enableRoslynAnalyzers: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 gcIncremental: 0 @@ -714,11 +735,13 @@ PlayerSettings: metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} metroSplashScreenUseBackgroundColor: 0 + syncCapabilities: 0 platformCapabilities: {} metroTargetDeviceFamilies: {} metroFTAName: metroFTAFileTypes: [] metroProtocolName: + vcxProjDefaultLanguage: XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -746,10 +769,7 @@ PlayerSettings: XboxOneXTitleMemory: 8 XboxOneOverrideIdentityName: XboxOneOverrideIdentityPublisher: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + vrEditorSettings: {} cloudServicesEnabled: UNet: 1 luminIcon: @@ -764,11 +784,15 @@ PlayerSettings: m_VersionCode: 1 m_VersionName: apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: organizationId: cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 0 + playerDataPath: + forceSRGBBlit: 1 + virtualTexturingSupportEnabled: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index b6a81cb4a..8386a0523 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.4.27f1 -m_EditorVersionWithRevision: 2019.4.27f1 (23dc10685eb4) +m_EditorVersion: 2021.3.45f1 +m_EditorVersionWithRevision: 2021.3.45f1 (0da89fac8e79) diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 000000000..dca288142 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/ProjectSettings/boot.config b/ProjectSettings/boot.config new file mode 100644 index 000000000..e69de29bb From a43834079669c7897ac54e8294457a818ae90f03 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 30 Oct 2024 17:15:11 +0800 Subject: [PATCH 02/21] SDK-4043 Fix saving settings asset after changes --- .../Editor/XsollaSettingsEditor.Debugging.cs | 11 +++++++++-- .../Editor/XsollaSettingsEditor.Desktop.cs | 15 +++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Debugging.cs b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Debugging.cs index 1b307dd8f..06ffa2227 100644 --- a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Debugging.cs +++ b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Debugging.cs @@ -20,10 +20,17 @@ private bool EditorSettings() EditorGUILayout.BeginVertical(GroupAreaStyle); EditorGUILayout.LabelField("Debugging", GroupHeaderStyle); - XsollaSettings.LogLevel = (LogLevel) EditorGUILayout.Popup(new GUIContent(LOG_LEVEL_LABEL, LOG_LEVEL_TOOLTIP), (int) XsollaSettings.LogLevel, LogLevelOptions); + var changed = false; + + var logLevel = (LogLevel) EditorGUILayout.Popup(new GUIContent(LOG_LEVEL_LABEL, LOG_LEVEL_TOOLTIP), (int) XsollaSettings.LogLevel, LogLevelOptions); + if (logLevel != XsollaSettings.LogLevel) + { + XsollaSettings.LogLevel = logLevel; + changed = true; + } EditorGUILayout.EndVertical(); - return false; + return changed; } } } \ No newline at end of file diff --git a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Desktop.cs b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Desktop.cs index b26975c0c..fdbfe6cbd 100644 --- a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Desktop.cs +++ b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Desktop.cs @@ -1,4 +1,4 @@ -using UnityEditor; +using UnityEditor; using UnityEngine; namespace Xsolla.Core @@ -7,7 +7,7 @@ public partial class XsollaSettingsEditor { private const string PACK_IN_APP_BROWSER_LABEL = "Pack In-App Browser in Build"; private const string PACK_IN_APP_BROWSER_TOOLTIP = "If enabled, the build of your application includes all in-app browser files. " + - "If not, the latest version of browser files (300 MB) is downloaded when the user first opens an in-app browser."; + "If not, the latest version of browser files (300 MB) is downloaded when the user first opens an in-app browser."; private bool DesktopSettings() { @@ -15,9 +15,16 @@ private bool DesktopSettings() EditorGUILayout.BeginVertical(GroupAreaStyle); EditorGUILayout.LabelField("Desktop", GroupHeaderStyle); + var changed = false; + if (XsollaSettings.InAppBrowserEnabled) { - XsollaSettings.PackInAppBrowserInBuild = EditorGUILayout.Toggle(new GUIContent(PACK_IN_APP_BROWSER_LABEL, PACK_IN_APP_BROWSER_TOOLTIP), XsollaSettings.PackInAppBrowserInBuild); + var packInAppBrowserInBuild = EditorGUILayout.Toggle(new GUIContent(PACK_IN_APP_BROWSER_LABEL, PACK_IN_APP_BROWSER_TOOLTIP), XsollaSettings.PackInAppBrowserInBuild); + if (packInAppBrowserInBuild != XsollaSettings.PackInAppBrowserInBuild) + { + XsollaSettings.PackInAppBrowserInBuild = packInAppBrowserInBuild; + changed = true; + } } else { @@ -27,7 +34,7 @@ private bool DesktopSettings() } EditorGUILayout.EndVertical(); - return false; + return changed; } } } \ No newline at end of file From 13b32b4f51fa830331051988cbfdb24c9041060c Mon Sep 17 00:00:00 2001 From: Mariia Date: Fri, 1 Nov 2024 11:22:38 +0500 Subject: [PATCH 03/21] Added reference links for supported countries, currencies and PS locales --- Assets/Xsolla/Cart/XsollaCart.cs | 4 +- Assets/Xsolla/Catalog/XsollaCatalog.cs | 38 +++++++------------ Assets/Xsolla/GameKeys/XsollaGameKeys.cs | 22 +++++------ Assets/Xsolla/Inventory/XsollaInventory.cs | 3 +- Assets/Xsolla/Orders/XsollaOrders.cs | 12 +++--- .../Subscriptions/XsollaSubscriptions.cs | 26 +++++-------- 6 files changed, 42 insertions(+), 63 deletions(-) diff --git a/Assets/Xsolla/Cart/XsollaCart.cs b/Assets/Xsolla/Cart/XsollaCart.cs index 1cadfc293..e1f11acf4 100644 --- a/Assets/Xsolla/Cart/XsollaCart.cs +++ b/Assets/Xsolla/Cart/XsollaCart.cs @@ -15,8 +15,8 @@ public static class XsollaCart /// Called after local cache of cart items was successfully updated. /// Called after the request resulted with an error. /// Unique cart identifier. - /// Defines localization of item's text fields.
The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// The currency in which prices are displayed. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) (USD by default). + /// Defines localization of item's text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// The currency in which prices are displayed (USD by default). Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/). public static void GetCartItems(Action onSuccess, Action onError, string cartId = null, string locale = null, string currency = null) { var url = string.IsNullOrEmpty(cartId) diff --git a/Assets/Xsolla/Catalog/XsollaCatalog.cs b/Assets/Xsolla/Catalog/XsollaCatalog.cs index 8a4a705ed..5cc9c0a7c 100644 --- a/Assets/Xsolla/Catalog/XsollaCatalog.cs +++ b/Assets/Xsolla/Catalog/XsollaCatalog.cs @@ -18,10 +18,8 @@ public static class XsollaCatalog /// Called after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default).
- /// Leave empty to use the default value. - /// Country to calculate regional prices and restrictions to catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculated based on the user's IP address if not specified. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetCatalog(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") { @@ -49,9 +47,7 @@ public static void GetCatalog(Action onSuccess, Action onErro /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after server response. /// Called after the request resulted with an error. - /// Response language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default).
- /// Leave empty to use the default value. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. public static void GetCatalogSimplified(Action onSuccess, Action onError, string locale = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_items/all") @@ -77,9 +73,8 @@ public static void GetCatalogSimplified(Action onSuccess, Actio /// Called after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. public static void GetGroupItems(string groupExternalId, Action onSuccess, Action onError, int? limit = null, int? offset = null, string locale = null, string country = null, string additionalFields = null) { @@ -108,8 +103,7 @@ public static void GetGroupItems(string groupExternalId, Action onSu /// Called after the request resulted with an error. /// Limit for the number of elements on the page. /// Number of the element from which the list is generated (the count starts from 0). - /// Defines localization of the item text fields.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). + /// Defines localization of the item text fields.[Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. public static void GetItemGroups(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null) { var url = new UrlBuilder($"{BaseUrl}/items/groups") @@ -133,9 +127,8 @@ public static void GetItemGroups(Action onSuccess, Action onError /// Called after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetVirtualCurrencyList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { @@ -164,9 +157,8 @@ public static void GetVirtualCurrencyList(Action onSuccess /// Called after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetVirtualCurrencyPackagesList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { @@ -196,9 +188,8 @@ public static void GetVirtualCurrencyPackagesList(ActionCalled after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Defines localization of the item text fields.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Defines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. public static void GetBundles(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { @@ -227,9 +218,8 @@ public static void GetBundles(Action onSuccess, Action onErr /// Bundle SKU. /// Called after the cart is successfully filled. /// Called after the request resulted with an error. - /// Defines localization of the item text fields.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Defines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). public static void GetBundle(string sku, Action onSuccess, Action onError, string locale = null, string country = null) { var url = new UrlBuilder($"{BaseUrl}/items/bundle/sku/{sku}") diff --git a/Assets/Xsolla/GameKeys/XsollaGameKeys.cs b/Assets/Xsolla/GameKeys/XsollaGameKeys.cs index 8cca2361d..692f2e12e 100644 --- a/Assets/Xsolla/GameKeys/XsollaGameKeys.cs +++ b/Assets/Xsolla/GameKeys/XsollaGameKeys.cs @@ -14,8 +14,8 @@ public static class XsollaGameKeys /// Called after the request resulted with an error. /// Limit for the number of elements on the page. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language. Two-letter lowercase language code per ISO 639-1. - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). If you do not specify the country explicitly, it will be defined by the user IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetGamesList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") { @@ -41,8 +41,8 @@ public static void GetGamesList(Action onSuccess, Action onErr /// Item SKU. /// Called after server response. /// Called after the request resulted with an error. - /// Response language. Two-letter lowercase language code per ISO 639-1. - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). If you do not specify the country explicitly, it will be defined by the user IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetGameForCatalog(string itemSku, Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = "long_description") { @@ -66,8 +66,8 @@ public static void GetGameForCatalog(string itemSku, Action onSuccess, /// Item SKU. /// Called after server response. /// Called after the request resulted with an error. - /// Response language. Two-letter lowercase language code per ISO 639-1. - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). If you do not specify the country explicitly, it will be defined by the user IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetGameKeyForCatalog(string itemSku, Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = "long_description") { @@ -93,8 +93,8 @@ public static void GetGameKeyForCatalog(string itemSku, Action onS /// Called after the request resulted with an error. /// Limit for the number of elements on the page. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language. Two-letter lowercase language code per ISO 639-1. - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). If you do not specify the country explicitly, it will be defined by the user IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetGamesListBySpecifiedGroup(string groupId, Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") { @@ -122,8 +122,8 @@ public static void GetGamesListBySpecifiedGroup(string groupId, ActionCalled after the request resulted with an error. /// Limit for the number of elements on the page. /// Number of the element from which the list is generated (the count starts from 0). - /// Response language. Two-letter lowercase language code per ISO 639-1. - /// Country used to calculate regional prices and restrictions for the catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). If you do not specify the country explicitly, it will be defined by the user IP address. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. public static void GetGameKeysListBySpecifiedGroup(string groupId, Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") { @@ -211,4 +211,4 @@ public static void RedeemGameCode(string gameCode, bool sandbox, Action onSucces ErrorGroup.LoginErrors); } } -} \ No newline at end of file +} diff --git a/Assets/Xsolla/Inventory/XsollaInventory.cs b/Assets/Xsolla/Inventory/XsollaInventory.cs index 77f466b78..851fea1e2 100644 --- a/Assets/Xsolla/Inventory/XsollaInventory.cs +++ b/Assets/Xsolla/Inventory/XsollaInventory.cs @@ -39,8 +39,7 @@ public static void GetVirtualCurrencyBalance(Action onS /// Called after the request resulted with an error. /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. /// Number of the element from which the list is generated (the count starts from 0). - /// Defines localization of item's text fields.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). + /// Defines localization of item's text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Publishing platform the user plays on.
/// Can be `xsolla` (default), `playstation_network`, `xbox_live`, `pc_standalone`, `nintendo_shop`, `google_play`, `app_store_ios`, `android_standalone`, `ios_standalone`, `android_other`, `ios_other`, or `pc_other`. public static void GetInventoryItems(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string platform = null) diff --git a/Assets/Xsolla/Orders/XsollaOrders.cs b/Assets/Xsolla/Orders/XsollaOrders.cs index e36aa6633..a015bbf2a 100644 --- a/Assets/Xsolla/Orders/XsollaOrders.cs +++ b/Assets/Xsolla/Orders/XsollaOrders.cs @@ -44,12 +44,11 @@ public static void CheckOrderStatus(int orderId, Action onSuccess, /// Creates a new payment token. /// /// The total amount to be paid by the user. - /// Default purchase currency. Three-letter code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) (USD by default). + /// Default purchase currency (USD by default). Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/). /// Purchase description. Used to describe the purchase if there are no specific items. /// Called after the successful item purchase. /// Called after the request resulted with an error. - /// Interface language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). + /// Interface language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Transaction's external ID. /// Payment method ID. /// Your custom parameters represented as a valid JSON set of key-value pairs. @@ -85,12 +84,11 @@ public static void CreatePaymentToken( /// Creates a new payment token. /// /// The total amount to be paid by the user. - /// Default purchase currency. Three-letter code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) (USD by deafault). + /// Default purchase currency (USD by default). Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/). /// Used to describe a purchase if it includes a list of specific items. /// Called after the successful item purchase. /// Called after the request resulted with an error. - /// Interface language.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). + /// Interface language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Transaction's external ID. /// Payment method ID. /// Your custom parameters represented as a valid JSON set of key-value pairs. @@ -153,4 +151,4 @@ private static CreatePaymentTokenRequest.Settings GeneratePaymentTokenSettings(s return settings; } } -} \ No newline at end of file +} diff --git a/Assets/Xsolla/Subscriptions/XsollaSubscriptions.cs b/Assets/Xsolla/Subscriptions/XsollaSubscriptions.cs index e10233f68..0a0083618 100644 --- a/Assets/Xsolla/Subscriptions/XsollaSubscriptions.cs +++ b/Assets/Xsolla/Subscriptions/XsollaSubscriptions.cs @@ -18,10 +18,8 @@ public static class XsollaSubscriptions /// List of subscription plan external IDs (32 characters per ID). Plan external ID can be found in Publisher Account in the **Subscriptions > Subscription plans** section next to the plan name. /// Limit for the number of elements on the page (15 elements are displayed by default). /// Number of elements from which the list is generated (the count starts from 0). - /// Language of the UI.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default).
- /// By default, it is determined by the user's IP address. - /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// Language of the UI. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). public static void GetSubscriptionPublicPlans(Action onSuccess, Action onError, int[] planId = null, string[] planExternalId = null, int limit = 50, int offset = 0, string locale = null, string country = null) { var url = new UrlBuilder($"{BaseUrl}/public/v1/projects/{StoreProjectId}/user_plans") @@ -48,9 +46,7 @@ public static void GetSubscriptionPublicPlans(Action onSuccess, Actio /// Called after the request resulted with an error. /// Limit for the number of elements on the page (15 elements are displayed by default). /// Number of elements from which the list is generated (the count starts from 0). - /// Language of the UI.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default).
- /// By default, it is determined by the user's IP address. + /// Language of the UI. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. public static void GetSubscriptions(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null) { var url = new UrlBuilder($"{BaseUrl}/user/v1/projects/{StoreProjectId}/subscriptions") @@ -74,9 +70,7 @@ public static void GetSubscriptions(Action onSuccess, Action< /// Subscription ID. /// Called after subscription data have been successfully received. /// Called after the request resulted with an error. - /// Language of the UI.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default).
- /// By default, it is determined by the user's IP address. + /// Language of the UI. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. public static void GetSubscriptionDetails(int subscriptionId, Action onSuccess, Action onError, string locale = null) { var url = new UrlBuilder($"{BaseUrl}/user/v1/projects/{StoreProjectId}/subscriptions/{subscriptionId}") @@ -143,7 +137,7 @@ public static void GetSubscriptionRenewalUrl(int subscriptionId, ActionCalled after the URL has been successfully received. /// Called after the request resulted with an error. /// Pay Station UI settings. - /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). By default, it is determined by the user's IP address. + /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). public static void GetSubscriptionPurchaseUrl(string planExternalId, Action onSuccess, Action onError, PaymentSettings settings = null, string country = null) { var url = new UrlBuilder($"{BaseUrl}/user/v1/projects/{StoreProjectId}/subscriptions/buy") @@ -171,7 +165,7 @@ public static void GetSubscriptionPurchaseUrl(string planExternalId, ActionCalled after the URL has been successfully received. /// Called after the request resulted with an error. /// Settings. - /// User's country. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Affects the choice of locale and currency. By default, it is determined by the user's IP address. + /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). public static void GetSubscriptionManagementUrl(Action onSuccess, Action onError, PaymentSettings settings = null, string country = null) { var url = new UrlBuilder($"{BaseUrl}/user/v1/projects/{StoreProjectId}/subscriptions/manage") @@ -201,10 +195,8 @@ public static void GetSubscriptionManagementUrl(Action onSuccess, A /// List of subscription plan external IDs (32 characters per ID). Plan external ID can be found in Publisher Account in the **Subscriptions > Subscription plans** section next to the plan name. /// Limit for the number of elements on the page (15 elements are displayed by default). /// Number of elements from which the list is generated (the count starts from 0). - /// Language of the UI.
- /// The following languages are supported: Arabic (`ar`), Bulgarian (`bg`), Czech (`cs`), German (`de`), Spanish (`es`), French (`fr`), Hebrew (`he`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Polish (`pl`), Portuguese (`pt`), Romanian (`ro`), Russian (`ru`), Thai (`th`), Turkish (`tr`), Vietnamese (`vi`), Chinese Simplified (`cn`), Chinese Traditional (`tw`), English (`en`, default). - /// By default, it is determined by the user's IP address. - /// User's country. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Affects the choice of locale and currency. By default, it is determined by the user's IP address. + /// Language of the UI. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// User's country. Affects the choice of locale and currency. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). public static void GetSubscriptionPlans(Action onSuccess, Action onError, int[] planId = null, string[] planExternalId = null, int limit = 50, int offset = 0, string locale = null, string country = null) { var url = new UrlBuilder($"{BaseUrl}/user/v1/projects/{StoreProjectId}/plans") @@ -267,4 +259,4 @@ private static PaymentSettings CheckAndFillPaymentSettings(PaymentSettings setti return settings; } } -} \ No newline at end of file +} From 24b158df08a975e611cc1e3c177e94cd40e2a01c Mon Sep 17 00:00:00 2001 From: "t.vorobyova" Date: Sat, 2 Nov 2024 17:23:28 +0500 Subject: [PATCH 04/21] SEC-4232 update sec tools --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01270582f..04d83a36f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,8 @@ include: ref: 'master' file: 'gitlab-ci-template.yml' - project: 'security/security-tools' - ref: 'v1' - file: 'gitlab-ci.yml' + ref: 'v2' + file: 'adapter/sdk/security-tools-store-unity-sdk.yml' stages: - build From b47e7964b542342c24cdd0b0fd65a42d1e24c1dc Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Mon, 4 Nov 2024 11:53:59 +0800 Subject: [PATCH 05/21] SDK-4043 Fix saving asset after using "fill by pa" way --- .../Xsolla/Core/Settings/Editor/AutoFillTool/AutoFillTool.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Xsolla/Core/Settings/Editor/AutoFillTool/AutoFillTool.cs b/Assets/Xsolla/Core/Settings/Editor/AutoFillTool/AutoFillTool.cs index 524981b02..788519eb3 100644 --- a/Assets/Xsolla/Core/Settings/Editor/AutoFillTool/AutoFillTool.cs +++ b/Assets/Xsolla/Core/Settings/Editor/AutoFillTool/AutoFillTool.cs @@ -445,7 +445,8 @@ private void ApplySelection(int[] selection) XsollaSettings.LoginId = loginID ?? string.Empty; XsollaSettings.OAuthClientId = OAuthID ?? default(int); XsollaSettings.CallbackUrl = redirectURL ?? string.Empty; - + + XsollaSettingsEditor.SaveSettingsAsset(); XDebug.Log("Settings applied"); #endif } From 72ef9914c01c37ca76ed0c368b63b2276bea012c Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 6 Nov 2024 23:27:56 +0800 Subject: [PATCH 06/21] SDK-3980 Increase log coverage --- .../Runtime/Infrastructure/BrowserDriver.cs | 7 ++++-- .../Runtime/Infrastructure/BrowserPage.cs | 4 +-- .../Infrastructure/MainThreadLogger.cs | 6 ++--- .../Runtime/XsollaInAppBrowser.cs | 2 +- .../Xsolla/Core/Browser/XsollaWebBrowser.cs | 4 +-- Assets/Xsolla/Core/Internal/XDebug.cs | 23 ++++++++++++++--- .../Core/Token/Internal/TokenAutoRefresher.cs | 2 ++ Assets/Xsolla/Core/Token/XsollaToken.cs | 25 ++++++++++++++++--- .../Core/WebRequests/WebRequestHelper.cs | 2 +- 9 files changed, 55 insertions(+), 20 deletions(-) diff --git a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserDriver.cs b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserDriver.cs index af6d30e5a..f2759a4d9 100644 --- a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserDriver.cs +++ b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserDriver.cs @@ -2,6 +2,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; +using Newtonsoft.Json; using PuppeteerSharp; namespace Xsolla.XsollaBrowser @@ -62,7 +63,6 @@ private async void DriverThread() { MainThreadLogger.Log("Browser driver thread started"); Thread.Sleep(50); - MainThreadLogger.Log("Start fetching browser"); var fetcherOptions = new BrowserFetcherOptions { Product = FetchOptions.Product, @@ -70,6 +70,8 @@ private async void DriverThread() Path = FetchOptions.Path }; + MainThreadLogger.Log($"Start fetching browser\n. Options: {JsonConvert.SerializeObject(fetcherOptions)}"); + var fetcher = new BrowserFetcher(fetcherOptions); fetcher.DownloadProgressChanged += OnDownloadProgressChanged; await fetcher.DownloadAsync(FetchOptions.Revision); @@ -77,7 +79,6 @@ private async void DriverThread() MainThreadLogger.Log("Finish fetching browser"); Thread.Sleep(50); - MainThreadLogger.Log("Start launching browser"); var launchOptions = new PuppeteerSharp.LaunchOptions { Product = FetchOptions.Product, @@ -91,6 +92,8 @@ private async void DriverThread() } }; + MainThreadLogger.Log($"Start launching browser\n. Options: {JsonConvert.SerializeObject(launchOptions)}"); + #pragma warning disable CS1701 Browser = await Puppeteer.LaunchAsync(launchOptions); #pragma warning restore CS1701 diff --git a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserPage.cs b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserPage.cs index d37d6e694..a8b226e0a 100644 --- a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserPage.cs +++ b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/BrowserPage.cs @@ -11,13 +11,11 @@ public class BrowserPage private readonly CommandsProcessor CommandsProcessor; private readonly MainThreadExecutor MainThreadExecutor; - private readonly MainThreadLogger MainThreadLogger; - public BrowserPage(CommandsProcessor commandsProcessor, MainThreadExecutor mainThreadExecutor, MainThreadLogger mainThreadLogger) + public BrowserPage(CommandsProcessor commandsProcessor, MainThreadExecutor mainThreadExecutor) { CommandsProcessor = commandsProcessor; MainThreadExecutor = mainThreadExecutor; - MainThreadLogger = mainThreadLogger; } public Vector2Int ViewportSize { get; private set; } diff --git a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/MainThreadLogger.cs b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/MainThreadLogger.cs index d9940e52b..0c5975aa0 100644 --- a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/MainThreadLogger.cs +++ b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/Infrastructure/MainThreadLogger.cs @@ -1,10 +1,10 @@ -using UnityEngine; +using Xsolla.Core; namespace Xsolla.XsollaBrowser { public class MainThreadLogger { - private const string LOG_PREFIX = "[Xsolla BROWSER]"; + private const string TAG = "[Xsolla BROWSER]"; private readonly MainThreadExecutor MainThreadExecutor; @@ -16,7 +16,7 @@ public MainThreadLogger(MainThreadExecutor mainThreadExecutor) public void Log(string message) { if (MainThreadExecutor) - MainThreadExecutor.Enqueue(() => Debug.Log($"{LOG_PREFIX} {message}")); + MainThreadExecutor.Enqueue(() => XDebug.Log(TAG, message)); } } } \ No newline at end of file diff --git a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/XsollaInAppBrowser.cs b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/XsollaInAppBrowser.cs index ee2c240b1..d9cf58a8e 100644 --- a/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/XsollaInAppBrowser.cs +++ b/Assets/Xsolla/Core/Browser/XsollaBrowser/Runtime/XsollaInAppBrowser.cs @@ -182,7 +182,7 @@ private Task CreatedDriver(FetchOptions fetchOptions, LaunchOptions launchOption private void CreatePage() { - BrowserPage = new BrowserPage(CommandsProcessor, MainThreadExecutor, MainThreadLogger) { + BrowserPage = new BrowserPage(CommandsProcessor, MainThreadExecutor) { OnUrlChangedAction = x => UrlChangeEvent?.Invoke(x), AlertDialogCommand = (message, accept) => AlertDialogEvent?.Invoke(message, accept), ConfirmDialogCommand = (message, accept, dismiss) => ConfirmDialogEvent?.Invoke(message, accept, dismiss) diff --git a/Assets/Xsolla/Core/Browser/XsollaWebBrowser.cs b/Assets/Xsolla/Core/Browser/XsollaWebBrowser.cs index d5129ecdc..6db6bb20a 100644 --- a/Assets/Xsolla/Core/Browser/XsollaWebBrowser.cs +++ b/Assets/Xsolla/Core/Browser/XsollaWebBrowser.cs @@ -35,7 +35,7 @@ public static IInAppBrowser InAppBrowser _inAppBrowserGameObject.name = "XsollaWebBrowser"; Object.DontDestroyOnLoad(_inAppBrowserGameObject); _inAppBrowser = _inAppBrowserGameObject.GetComponent(); - _inAppBrowser.CloseEvent += info => Close(); + _inAppBrowser.CloseEvent += _ => Close(); } } @@ -108,7 +108,7 @@ public static void OpenPurchaseUI(string paymentToken, bool forcePlatformBrowser public static void Open(string url, bool forcePlatformBrowser = false) { - XDebug.Log($"WebBrowser. Open url: {url}"); + XDebug.Log($"XsollaWebBrowser. Open url: {url}"); #if UNITY_EDITOR || UNITY_STANDALONE if (InAppBrowser != null && !forcePlatformBrowser) InAppBrowser.Open(url); diff --git a/Assets/Xsolla/Core/Internal/XDebug.cs b/Assets/Xsolla/Core/Internal/XDebug.cs index fb331c0d2..e331dbed1 100644 --- a/Assets/Xsolla/Core/Internal/XDebug.cs +++ b/Assets/Xsolla/Core/Internal/XDebug.cs @@ -4,23 +4,38 @@ namespace Xsolla.Core { public static class XDebug { - private const string LOG_PREFIX = "[Xsolla SDK]"; + private const string TAG = "[Xsolla SDK]"; public static void Log(object message, bool ignoreLogLevel = false) + { + Log(TAG, message, ignoreLogLevel); + } + + public static void Log(string tag, object message, bool ignoreLogLevel = false) { if (XsollaSettings.LogLevel == LogLevel.InfoWarningsErrors || ignoreLogLevel) - Debug.Log($"{LOG_PREFIX} {message}"); + Debug.Log($"{tag} {message}"); } public static void LogWarning(object message, bool ignoreLogLevel = false) + { + LogWarning(TAG, message, ignoreLogLevel); + } + + public static void LogWarning(string tag, object message, bool ignoreLogLevel = false) { if (XsollaSettings.LogLevel <= LogLevel.WarningsErrors || ignoreLogLevel) - Debug.LogWarning($"{LOG_PREFIX} {message}"); + Debug.LogWarning($"{tag} {message}"); } public static void LogError(object message) { - Debug.LogError($"{LOG_PREFIX} {message}"); + LogError(TAG, message); + } + + public static void LogError(string tag, object message) + { + Debug.LogError($"{tag} {message}"); } } } \ No newline at end of file diff --git a/Assets/Xsolla/Core/Token/Internal/TokenAutoRefresher.cs b/Assets/Xsolla/Core/Token/Internal/TokenAutoRefresher.cs index a4ebf6c17..bc4994075 100644 --- a/Assets/Xsolla/Core/Token/Internal/TokenAutoRefresher.cs +++ b/Assets/Xsolla/Core/Token/Internal/TokenAutoRefresher.cs @@ -13,6 +13,8 @@ public static void Check(Error error, Action onError, Action onSuccess) return; } + XDebug.Log("Token is invalid. Trying to refresh token"); + XsollaAuth.RefreshToken( () => onSuccess?.Invoke(), onError); diff --git a/Assets/Xsolla/Core/Token/XsollaToken.cs b/Assets/Xsolla/Core/Token/XsollaToken.cs index 1885ebb4d..273623d35 100644 --- a/Assets/Xsolla/Core/Token/XsollaToken.cs +++ b/Assets/Xsolla/Core/Token/XsollaToken.cs @@ -20,7 +20,7 @@ public static void Create(string accessToken) accessToken = accessToken }; - XDebug.Log($"Token created (access only). Access: {accessToken}"); + XDebug.Log($"XsollaToken created (access only)\nAccess token: {accessToken}"); SaveInstance(); } @@ -31,7 +31,7 @@ public static void Create(string accessToken, string refreshToken) refreshToken = refreshToken }; - XDebug.Log($"Token created (access and refresh). Access: {accessToken} Refresh: {refreshToken}"); + XDebug.Log($"XsollaToken created (access and refresh)\nAccess token: {accessToken}\nRefresh token: {refreshToken}"); SaveInstance(); } @@ -47,11 +47,28 @@ private static void SaveInstance() public static bool TryLoadInstance() { if (!PlayerPrefs.HasKey(SaveKey)) + { + XDebug.Log("XsollaToken not found in PlayerPrefs"); return false; + } var json = PlayerPrefs.GetString(SaveKey); - Instance = ParseUtils.FromJson(json); - return Instance != null; + var data = ParseUtils.FromJson(json); + + if (data == null || string.IsNullOrEmpty(data.accessToken)) + { + XDebug.Log("XsollaToken not found in PlayerPrefs"); + return false; + } + + Instance = data; + + if (string.IsNullOrEmpty(RefreshToken)) + XDebug.Log($"XsollaToken loaded (access only)\nAccess token: {AccessToken}"); + else + XDebug.Log($"XsollaToken loaded (access and refresh)\nAccess token: {AccessToken}\nRefresh token: {RefreshToken}"); + + return true; } public static void DeleteSavedInstance() diff --git a/Assets/Xsolla/Core/WebRequests/WebRequestHelper.cs b/Assets/Xsolla/Core/WebRequests/WebRequestHelper.cs index 5259e831a..e09836761 100644 --- a/Assets/Xsolla/Core/WebRequests/WebRequestHelper.cs +++ b/Assets/Xsolla/Core/WebRequests/WebRequestHelper.cs @@ -16,7 +16,7 @@ public static WebRequestHelper Instance { get { - if (_instance == null) + if (!_instance) _instance = new GameObject("WebRequestHelper").AddComponent(); return _instance; From feedaf6eff0338d4d232c57a47fad657f1a92e69 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 13 Nov 2024 13:09:51 +0800 Subject: [PATCH 07/21] SDK-3727 Add methods without pagination to catalog --- Assets/Tests/Catalog/GetBundlesTests.cs | 38 ++- Assets/Tests/Catalog/GetCatalogTests.cs | 29 +- Assets/Tests/Catalog/GetGroupItemsTests.cs | 35 ++- .../Catalog/GetVirtualCurrencyListTests.cs | 33 ++- .../GetVirtualCurrencyPackagesListTests.cs | 23 ++ .../Inventory/Scripts/Sdk/CatalogLogic.cs | 8 +- Assets/Xsolla/Catalog/Entities/BundleItems.cs | 1 + Assets/Xsolla/Catalog/XsollaCatalog.cs | 279 +++++++++++++++++- .../Samples/DisplayCatalog/BundlesPage.cs | 2 +- .../VirtualCurrencyPackagesPage.cs | 2 +- .../VirtualItemsByGroupsPage.cs | 2 +- .../DisplayCatalog/VirtualItemsPage.cs | 2 +- .../SellForRealMoney/VirtualItemsPage.cs | 2 +- .../VirtualItemsPage.cs | 2 +- 14 files changed, 401 insertions(+), 57 deletions(-) diff --git a/Assets/Tests/Catalog/GetBundlesTests.cs b/Assets/Tests/Catalog/GetBundlesTests.cs index 7da1a395d..312e3f554 100644 --- a/Assets/Tests/Catalog/GetBundlesTests.cs +++ b/Assets/Tests/Catalog/GetBundlesTests.cs @@ -8,21 +8,39 @@ namespace Xsolla.Tests.Catalog { public class GetBundlesTests : CatalogTestsBase { + [UnityTest] + public IEnumerator GetAllBundles_Default_Success() + { + DeleteSavedToken(); + + var isComplete = false; + XsollaCatalog.GetAllBundles(items => { + isComplete = true; + Assert.NotNull(items); + Assert.NotNull(items.items); + Assert.Greater(items.items.Length, 0); + CheckPersonalization(items.items, false); + }, error => { + isComplete = true; + Assert.Fail(error?.errorMessage); + }); + + yield return new WaitUntil(() => isComplete); + } + [UnityTest] public IEnumerator GetBundles_Default_Success() { DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetBundles(items => - { + XsollaCatalog.GetBundles(items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); Assert.Greater(items.items.Length, 0); CheckPersonalization(items.items, false); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }); @@ -37,12 +55,10 @@ public IEnumerator GetBundles_Parametrized_Success() var isComplete = false; XsollaCatalog.GetBundles( - items => - { + items => { isComplete = true; Assert.AreEqual(items.items.Length, 1); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }, @@ -60,12 +76,10 @@ public IEnumerator GetBundles_Personalized_HasPersonalizedItem() var isComplete = false; XsollaCatalog.GetBundles( - items => - { + items => { isComplete = true; CheckPersonalization(items.items, true); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }); diff --git a/Assets/Tests/Catalog/GetCatalogTests.cs b/Assets/Tests/Catalog/GetCatalogTests.cs index fccd9eedd..1acae857f 100644 --- a/Assets/Tests/Catalog/GetCatalogTests.cs +++ b/Assets/Tests/Catalog/GetCatalogTests.cs @@ -8,6 +8,29 @@ namespace Xsolla.Tests.Catalog { public class GetCatalogTests : CatalogTestsBase { + [UnityTest] + public IEnumerator GetCatalogFull_Success() + { + DeleteSavedToken(); + + var isComplete = false; + XsollaCatalog.GetCatalogFull( + items => { + isComplete = true; + Assert.NotNull(items); + Assert.NotNull(items.items); + Assert.Greater(items.items.Length, 0); + CheckPersonalization(items.items, false); + CheckPromotion(items.items, false); + }, + error => { + isComplete = true; + Assert.Fail(error?.errorMessage); + }); + + yield return new WaitUntil(() => isComplete); + } + [UnityTest] public IEnumerator GetCatalog_Success() { @@ -15,8 +38,7 @@ public IEnumerator GetCatalog_Success() var isComplete = false; XsollaCatalog.GetCatalog( - items => - { + items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); @@ -24,8 +46,7 @@ public IEnumerator GetCatalog_Success() CheckPersonalization(items.items, false); CheckPromotion(items.items, false); }, - error => - { + error => { isComplete = true; Assert.Fail(error?.errorMessage); }); diff --git a/Assets/Tests/Catalog/GetGroupItemsTests.cs b/Assets/Tests/Catalog/GetGroupItemsTests.cs index aa6a41b20..21c8a8ecb 100644 --- a/Assets/Tests/Catalog/GetGroupItemsTests.cs +++ b/Assets/Tests/Catalog/GetGroupItemsTests.cs @@ -8,6 +8,29 @@ namespace Xsolla.Tests.Catalog { public class GetGroupItemsTests : CatalogTestsBase { + [UnityTest] + public IEnumerator GetAllGroupItems_Default_Success() + { + DeleteSavedToken(); + + var isComplete = false; + XsollaCatalog.GetAllGroupItems( + "Featured", + items => { + isComplete = true; + Assert.NotNull(items); + Assert.NotNull(items.items); + Assert.Greater(items.items.Length, 0); + CheckPromotion(items.items, false); + }, + error => { + isComplete = true; + Assert.Fail(error?.errorMessage); + }); + + yield return new WaitUntil(() => isComplete); + } + [UnityTest] public IEnumerator GetGroupItems_Default_Success() { @@ -16,16 +39,14 @@ public IEnumerator GetGroupItems_Default_Success() var isComplete = false; XsollaCatalog.GetGroupItems( "Featured", - items => - { + items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); Assert.Greater(items.items.Length, 0); CheckPromotion(items.items, false); }, - error => - { + error => { isComplete = true; Assert.Fail(error?.errorMessage); }); @@ -41,13 +62,11 @@ public IEnumerator GetGroupItems_Parametrized_Success() var isComplete = false; XsollaCatalog.GetGroupItems( "Featured", - items => - { + items => { isComplete = true; Assert.AreEqual(items.items.Length, 10); }, - error => - { + error => { isComplete = true; Assert.Fail(error?.errorMessage); }, diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs index 3501c2088..10cc6a92b 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs @@ -8,6 +8,27 @@ namespace Xsolla.Tests.Catalog { public class GetVirtualCurrencyListTests : CatalogTestsBase { + [UnityTest] + public IEnumerator GetAllVirtualCurrencyList_Default_Success() + { + yield return CheckSession(); + + var isComplete = false; + XsollaCatalog.GetAllVirtualCurrencyList( + items => { + isComplete = true; + Assert.NotNull(items); + Assert.NotNull(items.items); + Assert.Greater(items.items.Length, 0); + }, + error => { + isComplete = true; + Assert.Fail(error?.errorMessage); + }); + + yield return new WaitUntil(() => isComplete); + } + [UnityTest] public IEnumerator GetVirtualCurrencyList_Default_Success() { @@ -15,15 +36,13 @@ public IEnumerator GetVirtualCurrencyList_Default_Success() var isComplete = false; XsollaCatalog.GetVirtualCurrencyList( - items => - { + items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); Assert.Greater(items.items.Length, 0); }, - error => - { + error => { isComplete = true; Assert.Fail(error?.errorMessage); }); @@ -38,13 +57,11 @@ public IEnumerator GetVirtualCurrencyList_Parametrized_Success() var isComplete = false; XsollaCatalog.GetVirtualCurrencyList( - items => - { + items => { isComplete = true; Assert.AreEqual(items.items.Length, 1); }, - error => - { + error => { isComplete = true; Assert.Fail(error?.errorMessage); }, diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs index 1f35c4cf3..9ccab66df 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs @@ -8,6 +8,29 @@ namespace Xsolla.Tests.Catalog { public class GetVirtualCurrencyPackagesListTests : CatalogTestsBase { + [UnityTest] + public IEnumerator GetAllVirtualCurrencyPackagesList_Default_Success() + { + DeleteSavedToken(); + + var isComplete = false; + XsollaCatalog.GetAllVirtualCurrencyPackagesList( + packages => + { + isComplete = true; + Assert.NotNull(packages); + Assert.NotNull(packages.items); + Assert.Greater(packages.items.Length, 0); + CheckPersonalization(packages.items, false); + }, error => + { + isComplete = true; + Assert.Fail(error?.errorMessage); + }); + + yield return new WaitUntil(() => isComplete); + } + [UnityTest] public IEnumerator GetVirtualCurrencyPackagesList_Default_Success() { diff --git a/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs b/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs index 98a6308ef..df6fc13a2 100644 --- a/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs +++ b/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs @@ -22,7 +22,7 @@ public class CatalogLogic : MonoSingleton public void GetVirtualCurrencies(Action> onSuccess, Action onError = null) { - XsollaCatalog.GetVirtualCurrencyList(items => + XsollaCatalog.GetAllVirtualCurrencyList(items => { var currencies = items.items.ToList(); if (currencies.Any()) @@ -58,7 +58,7 @@ public void GetCatalogVirtualItems(Action> onSucce public void GetCatalogVirtualCurrencyPackages(Action> onSuccess, Action onError = null) { - XsollaCatalog.GetVirtualCurrencyPackagesList(packages => + XsollaCatalog.GetAllVirtualCurrencyPackagesList(packages => { var currencies = new List(); foreach (var package in packages.items) @@ -100,7 +100,7 @@ public void GetCatalogBundles(Action> onSuccess, Ac { if (!_refreshBundlesInProgress) { - XsollaCatalog.GetBundles(bundles => + XsollaCatalog.GetAllBundles(bundles => { var bundleItems = new List(); bundles.items.ToList().ForEach(b => @@ -155,7 +155,7 @@ private void RequestStoreItems(Action> onSuccess, Action if (!_refreshItemsInProgress) { _refreshItemsInProgress = true; - XsollaCatalog.GetCatalog(items => + XsollaCatalog.GetCatalogFull(items => { _refreshItemsInProgress = false; _itemsCacheTime = DateTime.Now; diff --git a/Assets/Xsolla/Catalog/Entities/BundleItems.cs b/Assets/Xsolla/Catalog/Entities/BundleItems.cs index b385ecf34..3e78b63d1 100644 --- a/Assets/Xsolla/Catalog/Entities/BundleItems.cs +++ b/Assets/Xsolla/Catalog/Entities/BundleItems.cs @@ -6,6 +6,7 @@ namespace Xsolla.Catalog [Serializable] public class BundleItems { + public bool has_more; public BundleItem[] items; } diff --git a/Assets/Xsolla/Catalog/XsollaCatalog.cs b/Assets/Xsolla/Catalog/XsollaCatalog.cs index 5cc9c0a7c..9c9daaee3 100644 --- a/Assets/Xsolla/Catalog/XsollaCatalog.cs +++ b/Assets/Xsolla/Catalog/XsollaCatalog.cs @@ -8,6 +8,58 @@ public static class XsollaCatalog { private static string BaseUrl => $"https://store.xsolla.com/api/v2/project/{XsollaSettings.StoreProjectId}"; + //TEXTREVIEW + /// + /// Returns a list of virtual items according to pagination settings. + /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. + /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). + /// Called after virtual items were successfully received. + /// Called after the request resulted with an error. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. + public static void GetCatalogFull(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = "long_description") + { + var items = new List(); + const int limit = 50; + var offset = 0; + + processRequest(); + return; + + void processRequest() + { + GetCatalog( + handleResponse, + onError, + limit, + offset, + locale, + country, + additionalFields); + } + + void handleResponse(StoreItems response) + { + items.AddRange(response.items); + + if (!response.has_more) + { + onSuccess(new StoreItems { + has_more = false, + items = items.ToArray() + }); + } + else + { + offset += limit; + processRequest(); + } + } + } + /// /// Returns a list of virtual items according to pagination settings. /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. @@ -63,6 +115,59 @@ public static void GetCatalogSimplified(Action onSuccess, Actio ErrorGroup.ItemsListErrors); } + ///TEXTREVIEW + /// + /// Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. + /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). + /// Group external ID. + /// Called after server response. + /// Called after the request resulted with an error. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. + public static void GetAllGroupItems(string groupExternalId, Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + { + var items = new List(); + const int limit = 50; + var offset = 0; + + processRequest(); + return; + + void processRequest() + { + GetGroupItems( + groupExternalId, + handleResponse, + onError, + limit, + offset, + locale, + country, + additionalFields); + } + + void handleResponse(StoreItems response) + { + items.AddRange(response.items); + + if (!response.has_more) + { + onSuccess(new StoreItems { + has_more = false, + items = items.ToArray() + }); + } + else + { + offset += limit; + processRequest(); + } + } + } + /// /// Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. /// If used after user authentication, the method returns items that match the personalization rules for the current user. @@ -101,14 +206,10 @@ public static void GetGroupItems(string groupExternalId, Action onSu /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual item groups were successfully received. /// Called after the request resulted with an error. - /// Limit for the number of elements on the page. - /// Number of the element from which the list is generated (the count starts from 0). /// Defines localization of the item text fields.[Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. - public static void GetItemGroups(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null) + public static void GetItemGroups(Action onSuccess, Action onError, string locale = null) { var url = new UrlBuilder($"{BaseUrl}/items/groups") - .AddLimit(limit) - .AddOffset(offset) .AddLocale(locale) .Build(); @@ -116,7 +217,57 @@ public static void GetItemGroups(Action onSuccess, Action onError SdkType.Store, url, onSuccess, - error => TokenAutoRefresher.Check(error, onError, () => GetItemGroups(onSuccess, onError, limit, offset, locale))); + error => TokenAutoRefresher.Check(error, onError, () => GetItemGroups(onSuccess, onError, locale))); + } + + ///TEXTREVIEW + /// + /// Returns a list of virtual currencies according to pagination settings. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). + /// Called after virtual currencies were successfully received. + /// Called after the request resulted with an error. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. + public static void GetAllVirtualCurrencyList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + { + var items = new List(); + const int limit = 50; + var offset = 0; + + processRequest(); + return; + + void processRequest() + { + GetVirtualCurrencyList( + handleResponse, + onError, + limit, + offset, + locale, + country, + additionalFields); + } + + void handleResponse(VirtualCurrencyItems response) + { + items.AddRange(response.items); + + if (!response.has_more) + { + onSuccess(new VirtualCurrencyItems { + has_more = false, + items = items.ToArray() + }); + } + else + { + offset += limit; + processRequest(); + } + } } /// @@ -148,6 +299,57 @@ public static void GetVirtualCurrencyList(Action onSuccess ErrorGroup.ItemsListErrors); } + ///TEXTREVIEW + /// + /// Returns a list of virtual currency packages according to pagination settings. The list includes packages for which display in the store is enabled in the settings. + /// If used after user authentication, the method returns packages that match the personalization rules for the current user. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). + /// Called after virtual currency packages were successfully received. + /// Called after the request resulted with an error. + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. + public static void GetAllVirtualCurrencyPackagesList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + { + var items = new List(); + const int limit = 50; + var offset = 0; + + processRequest(); + return; + + void processRequest() + { + GetVirtualCurrencyPackagesList( + handleResponse, + onError, + limit, + offset, + locale, + country, + additionalFields); + } + + void handleResponse(VirtualCurrencyPackages response) + { + items.AddRange(response.items); + + if (!response.has_more) + { + onSuccess(new VirtualCurrencyPackages { + has_more = false, + items = items.ToArray() + }); + } + else + { + offset += limit; + processRequest(); + } + } + } + /// /// Returns a list of virtual currency packages according to pagination settings. The list includes packages for which display in the store is enabled in the settings. /// If used after user authentication, the method returns packages that match the personalization rules for the current user. @@ -179,6 +381,57 @@ public static void GetVirtualCurrencyPackagesList(Action + /// Returns a list of bundles according to pagination settings. The list includes bundles for which display in the store is enabled in the settings. + /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/#unreal_engine_sdk_how_to_bundles). + /// Called after bundles are successfully received. + /// Called after the request resulted with an error. + /// Defines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. + public static void GetAllBundles(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + { + var items = new List(); + const int limit = 2; + var offset = 0; + + processRequest(); + return; + + void processRequest() + { + GetBundles( + handleResponse, + onError, + limit, + offset, + locale, + country, + additionalFields); + } + + void handleResponse(BundleItems response) + { + items.AddRange(response.items); + + if (!response.has_more) + { + onSuccess(new BundleItems { + has_more = false, + items = items.ToArray() + }); + } + else + { + offset += limit; + processRequest(); + } + } + } + /// /// Returns a list of bundles according to pagination settings. The list includes bundles for which display in the store is enabled in the settings. /// If used after user authentication, the method returns items that match the personalization rules for the current user. @@ -395,8 +648,7 @@ public static void Purchase(string itemSku, Action onSuccess, Actio { CreateOrder( itemSku, - orderData => - { + orderData => { onOrderCreated?.Invoke(orderData); XsollaWebBrowser.OpenPurchaseUI( @@ -406,8 +658,7 @@ public static void Purchase(string itemSku, Action onSuccess, Actio platformSpecificAppearance); OrderTrackingService.AddOrderForTracking(orderData.order_id, - true, () => - { + true, () => { if (XsollaWebBrowser.InAppBrowser?.IsOpened ?? false) XsollaWebBrowser.Close(); @@ -437,8 +688,7 @@ public static void PurchaseForVirtualCurrency(string itemSku, string priceSku, A CreateOrderByVirtualCurrency( itemSku, priceSku, - orderId => - { + orderId => { onOrderCreated?.Invoke(orderId); OrderTrackingService.AddOrderForTracking( @@ -465,8 +715,7 @@ public static void PurchaseFreeItem(string itemSku, Action onSucces { CreateOrderWithFreeItem( itemSku, - orderId => - { + orderId => { onOrderCreated?.Invoke(orderId); OrderTrackingService.AddOrderForTracking( @@ -478,4 +727,4 @@ public static void PurchaseFreeItem(string itemSku, Action onSucces customHeaders); } } -} +} \ No newline at end of file diff --git a/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs index c37b7b3a4..4e0357632 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // Starting the bundle request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetBundles(OnBundlesRequestSuccess, OnError); + XsollaCatalog.GetAllBundles(OnBundlesRequestSuccess, OnError); } private void OnBundlesRequestSuccess(BundleItems bundleItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs index 4314a46c5..f1a527d0a 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // After successful authentication starting the request for packages from store // Pass the callback functions for success and error cases - XsollaCatalog.GetVirtualCurrencyPackagesList(OnPackagesRequestSuccess, OnError); + XsollaCatalog.GetAllVirtualCurrencyPackagesList(OnPackagesRequestSuccess, OnError); } private void OnPackagesRequestSuccess(VirtualCurrencyPackages packageItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs index 301797962..d0aec7ec5 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs @@ -27,7 +27,7 @@ private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalog(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs index 0eb280bb7..d4c2d3850 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs @@ -23,7 +23,7 @@ private void Start() private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication - XsollaCatalog.GetCatalog(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs b/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs index 872be47c8..253fd271f 100644 --- a/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs @@ -23,7 +23,7 @@ private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalog(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs b/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs index 34a991124..f606655f5 100644 --- a/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // After successful authentication starting the request for catalog from store // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalog(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) From 84bb399c77573eb021707c736572b8e6edc2808e Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 13 Nov 2024 15:49:37 +0800 Subject: [PATCH 08/21] SDK-3727 Rename catalog methods --- Assets/Tests/Catalog/GetBundlesTests.cs | 8 +- Assets/Tests/Catalog/GetCatalogTests.cs | 4 +- Assets/Tests/Catalog/GetGroupItemsTests.cs | 6 +- .../Catalog/GetVirtualCurrencyListTests.cs | 6 +- .../GetVirtualCurrencyPackagesListTests.cs | 8 +- .../Inventory/Scripts/Sdk/CatalogLogic.cs | 8 +- Assets/Xsolla/Catalog/XsollaCatalog.cs | 112 ++++++++++++------ .../Samples/DisplayCatalog/BundlesPage.cs | 2 +- .../VirtualCurrencyPackagesPage.cs | 2 +- .../VirtualItemsByGroupsPage.cs | 2 +- .../DisplayCatalog/VirtualItemsPage.cs | 2 +- .../SellForRealMoney/VirtualItemsPage.cs | 2 +- .../VirtualItemsPage.cs | 2 +- 13 files changed, 99 insertions(+), 65 deletions(-) diff --git a/Assets/Tests/Catalog/GetBundlesTests.cs b/Assets/Tests/Catalog/GetBundlesTests.cs index 312e3f554..68f484a14 100644 --- a/Assets/Tests/Catalog/GetBundlesTests.cs +++ b/Assets/Tests/Catalog/GetBundlesTests.cs @@ -14,7 +14,7 @@ public IEnumerator GetAllBundles_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetAllBundles(items => { + XsollaCatalog.GetBundles(items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); @@ -34,7 +34,7 @@ public IEnumerator GetBundles_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetBundles(items => { + XsollaCatalog.GetPaginatedBundles(items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); @@ -54,7 +54,7 @@ public IEnumerator GetBundles_Parametrized_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetBundles( + XsollaCatalog.GetPaginatedBundles( items => { isComplete = true; Assert.AreEqual(items.items.Length, 1); @@ -75,7 +75,7 @@ public IEnumerator GetBundles_Personalized_HasPersonalizedItem() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetBundles( + XsollaCatalog.GetPaginatedBundles( items => { isComplete = true; CheckPersonalization(items.items, true); diff --git a/Assets/Tests/Catalog/GetCatalogTests.cs b/Assets/Tests/Catalog/GetCatalogTests.cs index 1acae857f..5f7da935b 100644 --- a/Assets/Tests/Catalog/GetCatalogTests.cs +++ b/Assets/Tests/Catalog/GetCatalogTests.cs @@ -14,7 +14,7 @@ public IEnumerator GetCatalogFull_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetCatalogFull( + XsollaCatalog.GetItems( items => { isComplete = true; Assert.NotNull(items); @@ -37,7 +37,7 @@ public IEnumerator GetCatalog_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetCatalog( + XsollaCatalog.GetItems( items => { isComplete = true; Assert.NotNull(items); diff --git a/Assets/Tests/Catalog/GetGroupItemsTests.cs b/Assets/Tests/Catalog/GetGroupItemsTests.cs index 21c8a8ecb..4bdbdddf5 100644 --- a/Assets/Tests/Catalog/GetGroupItemsTests.cs +++ b/Assets/Tests/Catalog/GetGroupItemsTests.cs @@ -14,7 +14,7 @@ public IEnumerator GetAllGroupItems_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetAllGroupItems( + XsollaCatalog.GetGroupItems( "Featured", items => { isComplete = true; @@ -37,7 +37,7 @@ public IEnumerator GetGroupItems_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetGroupItems( + XsollaCatalog.GetPaginatedGroupItems( "Featured", items => { isComplete = true; @@ -60,7 +60,7 @@ public IEnumerator GetGroupItems_Parametrized_Success() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetGroupItems( + XsollaCatalog.GetPaginatedGroupItems( "Featured", items => { isComplete = true; diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs index 10cc6a92b..f258d8424 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs @@ -14,7 +14,7 @@ public IEnumerator GetAllVirtualCurrencyList_Default_Success() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetAllVirtualCurrencyList( + XsollaCatalog.GetVirtualCurrencyList( items => { isComplete = true; Assert.NotNull(items); @@ -35,7 +35,7 @@ public IEnumerator GetVirtualCurrencyList_Default_Success() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetVirtualCurrencyList( + XsollaCatalog.GetPaginatedVirtualCurrencyList( items => { isComplete = true; Assert.NotNull(items); @@ -56,7 +56,7 @@ public IEnumerator GetVirtualCurrencyList_Parametrized_Success() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetVirtualCurrencyList( + XsollaCatalog.GetPaginatedVirtualCurrencyList( items => { isComplete = true; Assert.AreEqual(items.items.Length, 1); diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs index 9ccab66df..8c49987ca 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs @@ -14,7 +14,7 @@ public IEnumerator GetAllVirtualCurrencyPackagesList_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetAllVirtualCurrencyPackagesList( + XsollaCatalog.GetVirtualCurrencyPackagesList( packages => { isComplete = true; @@ -37,7 +37,7 @@ public IEnumerator GetVirtualCurrencyPackagesList_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetVirtualCurrencyPackagesList( + XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( packages => { isComplete = true; @@ -60,7 +60,7 @@ public IEnumerator GetVirtualCurrencyPackagesList_Parametrized_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetVirtualCurrencyPackagesList( + XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( packages => { isComplete = true; @@ -83,7 +83,7 @@ public IEnumerator GetVirtualCurrencyPackagesList_Personalized_HasPersonalizedIt yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetVirtualCurrencyPackagesList( + XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( packages => { isComplete = true; diff --git a/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs b/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs index df6fc13a2..30fc910b9 100644 --- a/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs +++ b/Assets/Xsolla.Demo/Inventory/Scripts/Sdk/CatalogLogic.cs @@ -22,7 +22,7 @@ public class CatalogLogic : MonoSingleton public void GetVirtualCurrencies(Action> onSuccess, Action onError = null) { - XsollaCatalog.GetAllVirtualCurrencyList(items => + XsollaCatalog.GetVirtualCurrencyList(items => { var currencies = items.items.ToList(); if (currencies.Any()) @@ -58,7 +58,7 @@ public void GetCatalogVirtualItems(Action> onSucce public void GetCatalogVirtualCurrencyPackages(Action> onSuccess, Action onError = null) { - XsollaCatalog.GetAllVirtualCurrencyPackagesList(packages => + XsollaCatalog.GetVirtualCurrencyPackagesList(packages => { var currencies = new List(); foreach (var package in packages.items) @@ -100,7 +100,7 @@ public void GetCatalogBundles(Action> onSuccess, Ac { if (!_refreshBundlesInProgress) { - XsollaCatalog.GetAllBundles(bundles => + XsollaCatalog.GetBundles(bundles => { var bundleItems = new List(); bundles.items.ToList().ForEach(b => @@ -155,7 +155,7 @@ private void RequestStoreItems(Action> onSuccess, Action if (!_refreshItemsInProgress) { _refreshItemsInProgress = true; - XsollaCatalog.GetCatalogFull(items => + XsollaCatalog.GetItems(items => { _refreshItemsInProgress = false; _itemsCacheTime = DateTime.Now; diff --git a/Assets/Xsolla/Catalog/XsollaCatalog.cs b/Assets/Xsolla/Catalog/XsollaCatalog.cs index 9c9daaee3..b0d622e1d 100644 --- a/Assets/Xsolla/Catalog/XsollaCatalog.cs +++ b/Assets/Xsolla/Catalog/XsollaCatalog.cs @@ -8,9 +8,8 @@ public static class XsollaCatalog { private static string BaseUrl => $"https://store.xsolla.com/api/v2/project/{XsollaSettings.StoreProjectId}"; - //TEXTREVIEW - /// - /// Returns a list of virtual items according to pagination settings. + /// //TEXTREVIEW + /// Returns a list of virtual items /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. /// If used after user authentication, the method returns items that match the personalization rules for the current user. /// @@ -20,7 +19,7 @@ public static class XsollaCatalog /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetCatalogFull(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = "long_description") + public static void GetItems(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = "long_description") { var items = new List(); const int limit = 50; @@ -31,7 +30,7 @@ public static void GetCatalogFull(Action onSuccess, Action on void processRequest() { - GetCatalog( + GetPaginatedItems( handleResponse, onError, limit, @@ -60,7 +59,7 @@ void handleResponse(StoreItems response) } } - /// + /// //TEXTREVIEW /// Returns a list of virtual items according to pagination settings. /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. /// If used after user authentication, the method returns items that match the personalization rules for the current user. @@ -73,7 +72,7 @@ void handleResponse(StoreItems response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetCatalog(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") + public static void GetPaginatedItems(Action onSuccess, Action onError, int limit, int offset, string locale = null, string country = null, string additionalFields = "long_description") { var url = new UrlBuilder($"{BaseUrl}/items/virtual_items") .AddLimit(limit) @@ -88,7 +87,7 @@ public static void GetCatalog(Action onSuccess, Action onErro url, WebRequestHeader.AuthHeader(), onSuccess, - error => TokenAutoRefresher.Check(error, onError, () => GetCatalog(onSuccess, onError, limit, offset, locale, country, additionalFields)), + error => TokenAutoRefresher.Check(error, onError, () => GetPaginatedItems(onSuccess, onError, limit, offset, locale, country, additionalFields)), ErrorGroup.ItemsListErrors); } @@ -115,9 +114,8 @@ public static void GetCatalogSimplified(Action onSuccess, Actio ErrorGroup.ItemsListErrors); } - ///TEXTREVIEW - /// - /// Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. + /// //TEXTREVIEW + /// Returns a list of items for the specified group. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. /// If used after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). @@ -127,7 +125,7 @@ public static void GetCatalogSimplified(Action onSuccess, Actio /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetAllGroupItems(string groupExternalId, Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + public static void GetGroupItems(string groupExternalId, Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) { var items = new List(); const int limit = 50; @@ -138,7 +136,7 @@ public static void GetAllGroupItems(string groupExternalId, Action o void processRequest() { - GetGroupItems( + GetPaginatedGroupItems( groupExternalId, handleResponse, onError, @@ -168,7 +166,7 @@ void handleResponse(StoreItems response) } } - /// + /// //TEXTREVIEW /// Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. /// If used after user authentication, the method returns items that match the personalization rules for the current user. /// @@ -181,7 +179,7 @@ void handleResponse(StoreItems response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetGroupItems(string groupExternalId, Action onSuccess, Action onError, int? limit = null, int? offset = null, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedGroupItems(string groupExternalId, Action onSuccess, Action onError, int? limit = null, int? offset = null, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_items/group/{groupExternalId}") .AddLimit(limit) @@ -196,7 +194,7 @@ public static void GetGroupItems(string groupExternalId, Action onSu url, WebRequestHeader.AuthHeader(), onSuccess, - error => TokenAutoRefresher.Check(error, onError, () => GetGroupItems(groupExternalId, onSuccess, onError, limit, offset, locale, country, additionalFields)), + error => TokenAutoRefresher.Check(error, onError, () => GetPaginatedGroupItems(groupExternalId, onSuccess, onError, limit, offset, locale, country, additionalFields)), ErrorGroup.ItemsListErrors); } @@ -207,10 +205,12 @@ public static void GetGroupItems(string groupExternalId, Action onSu /// Called after virtual item groups were successfully received. /// Called after the request resulted with an error. /// Defines localization of the item text fields.[Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. - public static void GetItemGroups(Action onSuccess, Action onError, string locale = null) + /// Promo code. Unique case-sensitive code. Contains letters and numbers // TEXTREVIEW + public static void GetItemGroups(Action onSuccess, Action onError, string locale = null, string promoCode = null) { var url = new UrlBuilder($"{BaseUrl}/items/groups") .AddLocale(locale) + .AddParam("promo_code", promoCode) .Build(); WebRequestHelper.Instance.GetRequest( @@ -220,9 +220,8 @@ public static void GetItemGroups(Action onSuccess, Action onError error => TokenAutoRefresher.Check(error, onError, () => GetItemGroups(onSuccess, onError, locale))); } - ///TEXTREVIEW /// - /// Returns a list of virtual currencies according to pagination settings. + /// Returns a list of virtual currencies. //TEXTREVIEW /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currencies were successfully received. @@ -230,7 +229,7 @@ public static void GetItemGroups(Action onSuccess, Action onError /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetAllVirtualCurrencyList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + public static void GetVirtualCurrencyList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) { var items = new List(); const int limit = 50; @@ -241,7 +240,7 @@ public static void GetAllVirtualCurrencyList(Action onSucc void processRequest() { - GetVirtualCurrencyList( + GetPaginatedVirtualCurrencyList( handleResponse, onError, limit, @@ -271,7 +270,7 @@ void handleResponse(VirtualCurrencyItems response) } /// - /// Returns a list of virtual currencies according to pagination settings. + /// Returns a list of virtual currencies according to pagination settings. //TEXTREVIEW /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currencies were successfully received. @@ -281,7 +280,7 @@ void handleResponse(VirtualCurrencyItems response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetVirtualCurrencyList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedVirtualCurrencyList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_currency") .AddLimit(limit) @@ -295,13 +294,13 @@ public static void GetVirtualCurrencyList(Action onSuccess SdkType.Store, url, onSuccess, - error => TokenAutoRefresher.Check(error, onError, () => GetVirtualCurrencyList(onSuccess, onError, limit, offset, locale, country, additionalFields)), + error => TokenAutoRefresher.Check(error, onError, () => GetPaginatedVirtualCurrencyList(onSuccess, onError, limit, offset, locale, country, additionalFields)), ErrorGroup.ItemsListErrors); } - ///TEXTREVIEW /// - /// Returns a list of virtual currency packages according to pagination settings. The list includes packages for which display in the store is enabled in the settings. + /// Returns a list of virtual currency packages. //TEXTREVIEW + /// The list includes packages for which display in the store is enabled in the settings. /// If used after user authentication, the method returns packages that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). @@ -310,7 +309,7 @@ public static void GetVirtualCurrencyList(Action onSuccess /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetAllVirtualCurrencyPackagesList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + public static void GetVirtualCurrencyPackagesList(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) { var items = new List(); const int limit = 50; @@ -321,7 +320,7 @@ public static void GetAllVirtualCurrencyPackagesList(Action - /// Returns a list of virtual currency packages according to pagination settings. The list includes packages for which display in the store is enabled in the settings. + /// Returns a list of virtual currency packages according to pagination settings. //TEXTREVIEW + /// The list includes packages for which display in the store is enabled in the settings. /// If used after user authentication, the method returns packages that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). @@ -362,7 +362,7 @@ void handleResponse(VirtualCurrencyPackages response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetVirtualCurrencyPackagesList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedVirtualCurrencyPackagesList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_currency/package") .AddLimit(limit) @@ -377,13 +377,13 @@ public static void GetVirtualCurrencyPackagesList(Action TokenAutoRefresher.Check(error, onError, () => GetVirtualCurrencyPackagesList(onSuccess, onError, limit, offset, locale, country, additionalFields)), + error => TokenAutoRefresher.Check(error, onError, () => GetPaginatedVirtualCurrencyPackagesList(onSuccess, onError, limit, offset, locale, country, additionalFields)), ErrorGroup.ItemsListErrors); } - ///TEXTREVIEW /// - /// Returns a list of bundles according to pagination settings. The list includes bundles for which display in the store is enabled in the settings. + /// Returns a list of bundles. //TEXTREVIEW + /// The list includes bundles for which display in the store is enabled in the settings. /// If used after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/#unreal_engine_sdk_how_to_bundles). @@ -392,10 +392,10 @@ public static void GetVirtualCurrencyPackagesList(ActionDefines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetAllBundles(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) + public static void GetBundles(Action onSuccess, Action onError, string locale = null, string country = null, string additionalFields = null) { var items = new List(); - const int limit = 2; + const int limit = 50; var offset = 0; processRequest(); @@ -403,7 +403,7 @@ public static void GetAllBundles(Action onSuccess, Action on void processRequest() { - GetBundles( + GetPaginatedBundles( handleResponse, onError, limit, @@ -433,7 +433,8 @@ void handleResponse(BundleItems response) } /// - /// Returns a list of bundles according to pagination settings. The list includes bundles for which display in the store is enabled in the settings. + /// Returns a list of bundles according to pagination settings. //TEXTREVIEW + /// The list includes bundles for which display in the store is enabled in the settings. /// If used after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/#unreal_engine_sdk_how_to_bundles). @@ -444,7 +445,7 @@ void handleResponse(BundleItems response) /// Defines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetBundles(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedBundles(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/bundle") .AddLimit(limit) @@ -459,7 +460,7 @@ public static void GetBundles(Action onSuccess, Action onErr url, WebRequestHeader.AuthHeader(), onSuccess, - error => TokenAutoRefresher.Check(error, onError, () => GetBundles(onSuccess, onError, limit, offset, locale, country, additionalFields)), + error => TokenAutoRefresher.Check(error, onError, () => GetPaginatedBundles(onSuccess, onError, limit, offset, locale, country, additionalFields)), ErrorGroup.ItemsListErrors); } @@ -726,5 +727,38 @@ public static void PurchaseFreeItem(string itemSku, Action onSucces purchaseParams, customHeaders); } + + /// + /// [Obsolete. Use GetItems instead] Returns a list of virtual items according to pagination settings. //TEXTREVIEW + /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. + /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// + /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). + /// Called after virtual items were successfully received. + /// Called after the request resulted with an error. + /// Limit for the number of elements on the page. The maximum number of elements on a page is 50. + /// Number of the element from which the list is generated (the count starts from 0). + /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. + /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). + /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. + [Obsolete("Use GetItems instead.")] + public static void GetCatalog(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = "long_description") + { + var url = new UrlBuilder($"{BaseUrl}/items/virtual_items") + .AddLimit(limit) + .AddOffset(offset) + .AddLocale(locale) + .AddCountry(country) + .AddAdditionalFields(additionalFields) + .Build(); + + WebRequestHelper.Instance.GetRequest( + SdkType.Store, + url, + WebRequestHeader.AuthHeader(), + onSuccess, + error => TokenAutoRefresher.Check(error, onError, () => GetCatalog(onSuccess, onError, limit, offset, locale, country, additionalFields)), + ErrorGroup.ItemsListErrors); + } } } \ No newline at end of file diff --git a/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs index 4e0357632..c37b7b3a4 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/BundlesPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // Starting the bundle request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetAllBundles(OnBundlesRequestSuccess, OnError); + XsollaCatalog.GetBundles(OnBundlesRequestSuccess, OnError); } private void OnBundlesRequestSuccess(BundleItems bundleItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs index f1a527d0a..4314a46c5 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualCurrencyPackagesPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // After successful authentication starting the request for packages from store // Pass the callback functions for success and error cases - XsollaCatalog.GetAllVirtualCurrencyPackagesList(OnPackagesRequestSuccess, OnError); + XsollaCatalog.GetVirtualCurrencyPackagesList(OnPackagesRequestSuccess, OnError); } private void OnPackagesRequestSuccess(VirtualCurrencyPackages packageItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs index d0aec7ec5..189e7708c 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsByGroupsPage.cs @@ -27,7 +27,7 @@ private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetItems(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs index d4c2d3850..804729360 100644 --- a/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/DisplayCatalog/VirtualItemsPage.cs @@ -23,7 +23,7 @@ private void Start() private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication - XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetItems(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs b/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs index 253fd271f..e75bfdaa6 100644 --- a/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/SellForRealMoney/VirtualItemsPage.cs @@ -23,7 +23,7 @@ private void OnAuthenticationSuccess() { // Starting the items request from the store after successful authentication // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetItems(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) diff --git a/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs b/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs index f606655f5..3b3031821 100644 --- a/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs +++ b/Assets/Xsolla/Samples/SellForVirtualCurrency/VirtualItemsPage.cs @@ -24,7 +24,7 @@ private void OnAuthenticationSuccess() { // After successful authentication starting the request for catalog from store // Pass the callback functions for success and error cases - XsollaCatalog.GetCatalogFull(OnItemsRequestSuccess, OnError); + XsollaCatalog.GetItems(OnItemsRequestSuccess, OnError); } private void OnItemsRequestSuccess(StoreItems storeItems) From 8e0c18186d2fe125568ac439212ec3ff9c85c3f0 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 13 Nov 2024 16:18:47 +0800 Subject: [PATCH 09/21] SDK-3727 Make limit and offset parameters required --- Assets/Xsolla/Catalog/XsollaCatalog.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Xsolla/Catalog/XsollaCatalog.cs b/Assets/Xsolla/Catalog/XsollaCatalog.cs index b0d622e1d..f8ed01e95 100644 --- a/Assets/Xsolla/Catalog/XsollaCatalog.cs +++ b/Assets/Xsolla/Catalog/XsollaCatalog.cs @@ -179,7 +179,7 @@ void handleResponse(StoreItems response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetPaginatedGroupItems(string groupExternalId, Action onSuccess, Action onError, int? limit = null, int? offset = null, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedGroupItems(string groupExternalId, Action onSuccess, Action onError, int limit, int offset, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_items/group/{groupExternalId}") .AddLimit(limit) @@ -280,7 +280,7 @@ void handleResponse(VirtualCurrencyItems response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetPaginatedVirtualCurrencyList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedVirtualCurrencyList(Action onSuccess, Action onError, int limit, int offset, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_currency") .AddLimit(limit) @@ -362,7 +362,7 @@ void handleResponse(VirtualCurrencyPackages response) /// Response language. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. These fields will be in a response if you send them in a request. Available fields `media_list`, `order`, and `long_description`. - public static void GetPaginatedVirtualCurrencyPackagesList(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedVirtualCurrencyPackagesList(Action onSuccess, Action onError, int limit, int offset, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/virtual_currency/package") .AddLimit(limit) @@ -445,7 +445,7 @@ void handleResponse(BundleItems response) /// Defines localization of the item text fields. [Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. /// Country for which to calculate regional prices and restrictions in a catalog. Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Calculations are based on the user's IP address if the country is not specified. Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/in-game-store/references/supported-countries/). /// The list of additional fields. This fields will be in a response if you send its in a request. Available fields `media_list`, `order`, `long_description`. - public static void GetPaginatedBundles(Action onSuccess, Action onError, int limit = 50, int offset = 0, string locale = null, string country = null, string additionalFields = null) + public static void GetPaginatedBundles(Action onSuccess, Action onError, int limit, int offset, string locale = null, string country = null, string additionalFields = null) { var url = new UrlBuilder($"{BaseUrl}/items/bundle") .AddLimit(limit) From 0668e8fb0d223e2f8a2ae5e0e41475dfa3cf0dc3 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Thu, 14 Nov 2024 12:36:13 +0800 Subject: [PATCH 10/21] SDK-3727 Fix tests --- Assets/Tests/Catalog/GetBundlesTests.cs | 4 +-- Assets/Tests/Catalog/GetGroupItemsTests.cs | 7 +++-- .../Catalog/GetVirtualCurrencyListTests.cs | 2 +- .../GetVirtualCurrencyPackagesListTests.cs | 31 +++++++------------ 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/Assets/Tests/Catalog/GetBundlesTests.cs b/Assets/Tests/Catalog/GetBundlesTests.cs index 68f484a14..2b8e643e6 100644 --- a/Assets/Tests/Catalog/GetBundlesTests.cs +++ b/Assets/Tests/Catalog/GetBundlesTests.cs @@ -34,7 +34,7 @@ public IEnumerator GetBundles_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetPaginatedBundles(items => { + XsollaCatalog.GetItems(items => { isComplete = true; Assert.NotNull(items); Assert.NotNull(items.items); @@ -75,7 +75,7 @@ public IEnumerator GetBundles_Personalized_HasPersonalizedItem() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetPaginatedBundles( + XsollaCatalog.GetItems( items => { isComplete = true; CheckPersonalization(items.items, true); diff --git a/Assets/Tests/Catalog/GetGroupItemsTests.cs b/Assets/Tests/Catalog/GetGroupItemsTests.cs index 4bdbdddf5..264c2dfbe 100644 --- a/Assets/Tests/Catalog/GetGroupItemsTests.cs +++ b/Assets/Tests/Catalog/GetGroupItemsTests.cs @@ -37,7 +37,7 @@ public IEnumerator GetGroupItems_Default_Success() DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetPaginatedGroupItems( + XsollaCatalog.GetGroupItems( "Featured", items => { isComplete = true; @@ -70,9 +70,10 @@ public IEnumerator GetGroupItems_Parametrized_Success() isComplete = true; Assert.Fail(error?.errorMessage); }, + 10, + 0, locale: "en_US", - country: "US", - limit: 10); + country: "US"); yield return new WaitUntil(() => isComplete); } diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs index f258d8424..2e20489f3 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyListTests.cs @@ -35,7 +35,7 @@ public IEnumerator GetVirtualCurrencyList_Default_Success() yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetPaginatedVirtualCurrencyList( + XsollaCatalog.GetVirtualCurrencyList( items => { isComplete = true; Assert.NotNull(items); diff --git a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs index 8c49987ca..60bd6ac7d 100644 --- a/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs +++ b/Assets/Tests/Catalog/GetVirtualCurrencyPackagesListTests.cs @@ -15,38 +15,34 @@ public IEnumerator GetAllVirtualCurrencyPackagesList_Default_Success() var isComplete = false; XsollaCatalog.GetVirtualCurrencyPackagesList( - packages => - { + packages => { isComplete = true; Assert.NotNull(packages); Assert.NotNull(packages.items); Assert.Greater(packages.items.Length, 0); CheckPersonalization(packages.items, false); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }); yield return new WaitUntil(() => isComplete); } - + [UnityTest] public IEnumerator GetVirtualCurrencyPackagesList_Default_Success() { DeleteSavedToken(); var isComplete = false; - XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( - packages => - { + XsollaCatalog.GetVirtualCurrencyPackagesList( + packages => { isComplete = true; Assert.NotNull(packages); Assert.NotNull(packages.items); Assert.Greater(packages.items.Length, 0); CheckPersonalization(packages.items, false); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }); @@ -61,16 +57,15 @@ public IEnumerator GetVirtualCurrencyPackagesList_Parametrized_Success() var isComplete = false; XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( - packages => - { + packages => { isComplete = true; Assert.AreEqual(packages.items.Length, 1); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }, 1, + 0, locale: "en_US", country: "US"); @@ -83,13 +78,11 @@ public IEnumerator GetVirtualCurrencyPackagesList_Personalized_HasPersonalizedIt yield return CheckSession(); var isComplete = false; - XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList( - packages => - { + XsollaCatalog.GetVirtualCurrencyPackagesList( + packages => { isComplete = true; CheckPersonalization(packages.items, true); - }, error => - { + }, error => { isComplete = true; Assert.Fail(error?.errorMessage); }); From a6ab4474278ffd639907dbd3e531f1cbdd2febf7 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Tue, 19 Nov 2024 13:00:45 +0800 Subject: [PATCH 11/21] SDK-4040 Remove obsolete stages from cicd --- .gitlab-ci.yml | 577 +++++++++++++--------------------------- cicd/autotests.bat | 18 -- cicd/autotests.py | 15 ++ cicd/build-demo-ios.sh | 37 --- cicd/build-demo-mac.sh | 23 -- cicd/build-demo-win.bat | 26 -- cicd/build_demo.py | 26 ++ cicd/code-analysis.bat | 24 -- cicd/diawi.py | 16 ++ cicd/package-export.bat | 55 ---- cicd/unity.py | 41 +++ cicd/utils.py | 15 ++ 12 files changed, 293 insertions(+), 580 deletions(-) delete mode 100644 cicd/autotests.bat create mode 100644 cicd/autotests.py delete mode 100644 cicd/build-demo-ios.sh delete mode 100644 cicd/build-demo-mac.sh delete mode 100644 cicd/build-demo-win.bat create mode 100644 cicd/build_demo.py delete mode 100644 cicd/code-analysis.bat create mode 100644 cicd/diawi.py delete mode 100644 cicd/package-export.bat create mode 100644 cicd/unity.py create mode 100644 cicd/utils.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04d83a36f..500b9906b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,506 +7,292 @@ include: file: 'adapter/sdk/security-tools-store-unity-sdk.yml' stages: - - build - - code-analysis - autotests - - package-export - - build-demo-2019 - - build-demo-2020 - - build-demo-2021 - - build-demo-2022 - - build-demo-6000 - - build-demo-ios - - build-demo-macos + - demo_2021 + - demo_2022 + - demo_6000 + - build - deploy - linking - security scan variables: - PROJECT_PATH: $CI_PROJECT_DIR - AUTOTESTS_BAT: "cicd/autotests.bat" - PACKAGE_BAT: "cicd/package-export.bat" - PACKAGE_NAME: xsolla-commerce-sdk.unitypackage - BUILD_ROOT_PATH: "Builds" - BUILD_SCRIPT_WIN: "cicd/build-demo-win.bat" - BUILD_SCRIPT_IOS: "cicd/build-demo-ios.sh" - BUILD_SCRIPT_MACOS: "cicd/build-demo-mac.sh" + AUTOTESTS_SCRIPT: "cicd/autotests.py" + BUILD_DEMO_SCRIPT: "cicd/build_demo.py" BUILD_TARGET_WINDOWS: "StandaloneWindows64" BUILD_TARGET_WEBGL: "WebGL" BUILD_TARGET_ANDROID: "Android" BUILD_TARGET_IOS: "iOS" BUILD_TARGET_MACOS: "StandaloneOSX" UNITY_2019_VERSION: "2019.4.27f1" - UNITY_2020_VERSION: "2020.3.14f1" UNITY_2021_VERSION: "2021.1.13f1" UNITY_2022_VERSION: "2022.3.26f1" UNITY_6000_VERSION: "6000.0.9f1" - GIT_CLEAN_FLAGS: -ffdx - -# ================================================================================================================= -# DOCS - -build doc: - stage: build - only: - - /^v.*/ - image: node:14-alpine3.15 - script: - - apk update && apk add doxygen graphviz ttf-freefont zip git - - doxygen Documentation/Autogen/Doxyfile >/dev/null - - git clone https://$GITHUB_ACCESS_TOKEN@github.com/xsolla/sdk-reference-parser-unity-ue.git - - mkdir -p sdk-reference-parser-unity-ue/src - - mkdir -p sdk-reference-parser-unity-ue/dist - - mv Documentation/Autogen/html/ sdk-reference-parser-unity-ue/src >/dev/null - - cd sdk-reference-parser-unity-ue - - npm install - - npm start - - mv -v dist/html/* dist >/dev/null - - cd dist && zip -r $CI_PROJECT_DIR/build.zip * >/dev/null - artifacts: - paths: - - build.zip - tags: - - devops - -deploy doc: - stage: deploy - extends: .deploy doc - only: - - /^v.*/ - dependencies: - - build doc - environment: - name: doc/$CI_COMMIT_REF_SLUG - url: https://$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.doc.srv.local/$URL_SLUG - on_stop: stop doc - when: manual - tags: - - sshclient - -current doc: - extends: .current doc - only: - - /^v.*/ - dependencies: - - deploy doc - environment: - name: doc/current - url: https://developers.xsolla.com/sdk-code-references/unity-store - tags: - - sshclient - -stop doc: - extends: .stop doc - environment: - name: doc/$CI_COMMIT_REF_SLUG - action: stop - only: - - /^v.*/ - tags: - - sshclient - dependencies: [] - -# ================================================================================================================= -# CODE ANALYSIS - -analyze-code: - stage: code-analysis - allow_failure: true - script: - - call cicd\code-analysis.bat - artifacts: - name: "SDK_analyze_code_logs_%CI_COMMIT_REF_NAME%" - when: on_failure - paths: - - Logs - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows # ================================================================================================================= -# AUTOTESTS +# JOBS BASE -run_autotests: - stage: autotests - script: - - call %AUTOTESTS_BAT% %PROJECT_PATH% %UNITY_2019_VERSION% +.win_job_base: + resource_group: win_runner artifacts: - name: "AUTOTESTS_%CI_COMMIT_REF_NAME%" when: always - paths: - - Logs/autotest_results.txt expire_in: 3 days dependencies: [] tags: - sdk_ci - windows - -# ================================================================================================================= -# PACKAGE EXPORT -export_package: - stage: package-export - script: - - call %PACKAGE_BAT% %PROJECT_PATH% %UNITY_2019_VERSION% %PACKAGE_NAME% %BUILD_ROOT_PATH% +.mac_job_base: + resource_group: mac_runner + before_script: + - chmod 755 fastlane/scripts/diawi_callback_helper.sh artifacts: - name: "PACKAGE_%CI_COMMIT_REF_NAME%" when: always - paths: - - Logs/export_results.txt - - Logs/create_results.txt - - Logs/import_results.txt - - Logs/xsolla-commerce-sdk.unitypackage expire_in: 3 days dependencies: [] tags: - sdk_ci - - windows + - mac # ================================================================================================================= -# UNITY 2019 +# AUTOTESTS -build-windows-2019: - stage: build-demo-2019 +autotests_job: + extends: .win_job_base + stage: autotests script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2019_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WINDOWS% + - python %AUTOTESTS_SCRIPT% %CI_PROJECT_DIR% %UNITY_2019_VERSION% artifacts: - name: "%UNITY_2019_VERSION%_%BUILD_TARGET_WINDOWS%_%CI_COMMIT_REF_NAME%" - when: always + when: on_failure + name: "autotests-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WINDOWS%-%UNITY_2019_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Logs/autotests_report.log + +# ================================================================================================================= +# DEMO 2021 -build-webgl-2019: - stage: build-demo-2019 +demo_2021_win: + extends: .win_job_base + stage: demo_2021 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2019_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WEBGL% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2021_VERSION% %BUILD_TARGET_WINDOWS% artifacts: - name: "%UNITY_2019_VERSION%_%BUILD_TARGET_WEBGL%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2021-win-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WEBGL%-%UNITY_2019_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-android-2019: - stage: build-demo-2019 +demo_2021_android: + extends: .win_job_base + stage: demo_2021 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2019_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_ANDROID% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2021_VERSION% %BUILD_TARGET_ANDROID% artifacts: - name: "%UNITY_2019_VERSION%_%BUILD_TARGET_ANDROID%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2021-android-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_ANDROID%-%UNITY_2019_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -# ================================================================================================================= -# UNITY 2020 - -build-windows-2020: - stage: build-demo-2020 +demo_2021_webgl: + extends: .win_job_base + stage: demo_2021 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2020_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WINDOWS% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2021_VERSION% %BUILD_TARGET_WEBGL% artifacts: - name: "%UNITY_2020_VERSION%_%BUILD_TARGET_WINDOWS%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2021-webgl-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WINDOWS%-%UNITY_2020_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-webgl-2020: - stage: build-demo-2020 +demo_2021_ios: + extends: .mac_job_base + stage: demo_2021 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2020_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WEBGL% + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_2021_VERSION $BUILD_TARGET_IOS artifacts: - name: "%UNITY_2020_VERSION%_%BUILD_TARGET_WEBGL%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2021-ios-$CI_COMMIT_REF_SLUG" paths: - - Builds/%BUILD_TARGET_WEBGL%-%UNITY_2020_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-android-2020: - stage: build-demo-2020 +demo_2021_mac: + extends: .mac_job_base + stage: demo_2021 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2020_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_ANDROID% + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_2021_VERSION $BUILD_TARGET_MACOS artifacts: - name: "%UNITY_2020_VERSION%_%BUILD_TARGET_ANDROID%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2021-mac-$CI_COMMIT_REF_SLUG" paths: - - Builds/%BUILD_TARGET_ANDROID%-%UNITY_2020_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds # ================================================================================================================= -# UNITY 2021 +# DEMO 2022 -build-windows-2021: - stage: build-demo-2021 +demo_2022_win: + extends: .win_job_base + stage: demo_2022 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2021_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WINDOWS% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2022_VERSION% %BUILD_TARGET_WINDOWS% artifacts: - name: "%UNITY_2021_VERSION%_%BUILD_TARGET_WINDOWS%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2022-win-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WINDOWS%-%UNITY_2021_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-webgl-2021: - stage: build-demo-2021 +demo_2022_android: + extends: .win_job_base + stage: demo_2022 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2021_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WEBGL% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2022_VERSION% %BUILD_TARGET_ANDROID% artifacts: - name: "%UNITY_2021_VERSION%_%BUILD_TARGET_WEBGL%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2022-android-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WEBGL%-%UNITY_2021_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-android-2021: - stage: build-demo-2021 +demo_2022_webgl: + extends: .win_job_base + stage: demo_2022 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2021_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_ANDROID% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_2022_VERSION% %BUILD_TARGET_WEBGL% artifacts: - name: "%UNITY_2021_VERSION%_%BUILD_TARGET_ANDROID%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2022-webgl-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_ANDROID%-%UNITY_2021_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows - -# ================================================================================================================= -# UNITY 2022 + - Builds -build-windows-2022: - stage: build-demo-2022 +demo_2022_ios: + extends: .mac_job_base + stage: demo_2022 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2022_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WINDOWS% + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_2022_VERSION $BUILD_TARGET_IOS artifacts: - name: "%UNITY_2022_VERSION%_%BUILD_TARGET_WINDOWS%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2022-ios-$CI_COMMIT_REF_SLUG" paths: - - Builds/%BUILD_TARGET_WINDOWS%-%UNITY_2022_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -build-webgl-2022: - stage: build-demo-2022 +demo_2022_mac: + extends: .mac_job_base + stage: demo_2022 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2022_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WEBGL% + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_2022_VERSION $BUILD_TARGET_MACOS artifacts: - name: "%UNITY_2022_VERSION%_%BUILD_TARGET_WEBGL%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-2022-mac-$CI_COMMIT_REF_SLUG" paths: - - Builds/%BUILD_TARGET_WEBGL%-%UNITY_2022_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows - -build-android-2022: - stage: build-demo-2022 - script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_2022_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_ANDROID% - artifacts: - name: "%UNITY_2022_VERSION%_%BUILD_TARGET_ANDROID%_%CI_COMMIT_REF_NAME%" - when: always - paths: - - Builds/%BUILD_TARGET_ANDROID%-%UNITY_2022_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds # ================================================================================================================= -# UNITY 6000 +# DEMO 6000 -.build-windows-6000: - stage: build-demo-6000 +demo_6000_win: + extends: .win_job_base + stage: demo_6000 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_6000_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WINDOWS% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_6000_VERSION% %BUILD_TARGET_WINDOWS% artifacts: - name: "%UNITY_6000_VERSION%_%BUILD_TARGET_WINDOWS%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-6000-win-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WINDOWS%-%UNITY_6000_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -.build-webgl-6000: - stage: build-demo-6000 +demo_6000_android: + extends: .win_job_base + stage: demo_6000 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_6000_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_WEBGL% + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_6000_VERSION% %BUILD_TARGET_ANDROID% artifacts: - name: "%UNITY_6000_VERSION%_%BUILD_TARGET_WEBGL%_%CI_COMMIT_REF_NAME%" - when: always + name: "demo-6000-android-%CI_COMMIT_REF_SLUG%" paths: - - Builds/%BUILD_TARGET_WEBGL%-%UNITY_6000_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows + - Builds -.build-android-6000: - stage: build-demo-6000 +demo_6000_webgl: + extends: .win_job_base + stage: demo_6000 script: - - call %BUILD_SCRIPT_WIN% %PROJECT_PATH% %UNITY_6000_VERSION% %BUILD_ROOT_PATH% %BUILD_TARGET_ANDROID% - artifacts: - name: "%UNITY_6000_VERSION%_%BUILD_TARGET_ANDROID%_%CI_COMMIT_REF_NAME%" - when: always - paths: - - Builds/%BUILD_TARGET_ANDROID%-%UNITY_6000_VERSION% - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - windows - -# ================================================================================================================= -# IOS DEMO - -.build-ios-demo: - stage: build-demo-ios - resource_group: ios_build_group - before_script: - - export IOS_SIGN_TEAM_ID=$IOS_SIGN_TEAM_ID - - export IOS_PROVISION_ID=$IOS_PROVISION_ID - - chmod 755 fastlane/scripts/diawi_callback_helper.sh + - python %BUILD_DEMO_SCRIPT% %CI_PROJECT_DIR% %UNITY_6000_VERSION% %BUILD_TARGET_WEBGL% artifacts: - when: always + name: "demo-6000-webgl-%CI_COMMIT_REF_SLUG%" paths: - - "Builds/build.log" - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - mac - -build-ios-2019: - extends: .build-ios-demo - script: - - sh $BUILD_SCRIPT_IOS $PROJECT_PATH $UNITY_2019_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_IOS - -build-ios-2020: - extends: .build-ios-demo - script: - - sh $BUILD_SCRIPT_IOS $PROJECT_PATH $UNITY_2020_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_IOS - -build-ios-2021: - extends: .build-ios-demo - script: - - sh $BUILD_SCRIPT_IOS $PROJECT_PATH $UNITY_2021_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_IOS - -build-ios-2022: - extends: .build-ios-demo - script: - - sh $BUILD_SCRIPT_IOS $PROJECT_PATH $UNITY_2022_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_IOS + - Builds -build-ios-6000: - extends: .build-ios-demo +demo_6000_ios: + extends: .mac_job_base + stage: demo_6000 script: - - sh $BUILD_SCRIPT_IOS $PROJECT_PATH $UNITY_6000_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_IOS - -# ================================================================================================================= -# MACOS DEMO - -.build-macos-demo: - stage: build-demo-macos - resource_group: mac_build_group - artifacts: - when: always - expire_in: 3 days - dependencies: [] - tags: - - sdk_ci - - mac - -build-macos-2019: - extends: .build-macos-demo - script: - - sh $BUILD_SCRIPT_MACOS $PROJECT_PATH $UNITY_2019_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_MACOS + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_6000_VERSION $BUILD_TARGET_IOS artifacts: + name: "demo-6000-ios-$CI_COMMIT_REF_SLUG" paths: - - Builds/$BUILD_TARGET_MACOS-$UNITY_2019_VERSION/XsollaInGameStoreUnityAsset.app + - Builds -build-macos-2020: - extends: .build-macos-demo +demo_6000_mac: + extends: .mac_job_base + stage: demo_6000 script: - - sh $BUILD_SCRIPT_MACOS $PROJECT_PATH $UNITY_2020_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_MACOS + - python3 $BUILD_DEMO_SCRIPT $CI_PROJECT_DIR $UNITY_6000_VERSION $BUILD_TARGET_MACOS artifacts: + name: "demo-6000-mac-$CI_COMMIT_REF_SLUG" paths: - - Builds/$BUILD_TARGET_MACOS-$UNITY_2020_VERSION/XsollaInGameStoreUnityAsset.app + - Builds -build-macos-2021: - extends: .build-macos-demo - script: - - sh $BUILD_SCRIPT_MACOS $PROJECT_PATH $UNITY_2021_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_MACOS - artifacts: - paths: - - Builds/$BUILD_TARGET_MACOS-$UNITY_2021_VERSION/XsollaInGameStoreUnityAsset.app +# ================================================================================================================= +# DOCS -build-macos-2022: - extends: .build-macos-demo +build doc: + stage: build + only: + - /^v.*/ + image: node:14-alpine3.15 script: - - sh $BUILD_SCRIPT_MACOS $PROJECT_PATH $UNITY_2022_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_MACOS + - apk update && apk add doxygen graphviz ttf-freefont zip git + - doxygen Documentation/Autogen/Doxyfile >/dev/null + - git clone https://$GITHUB_ACCESS_TOKEN@github.com/xsolla/sdk-reference-parser-unity-ue.git + - mkdir -p sdk-reference-parser-unity-ue/src + - mkdir -p sdk-reference-parser-unity-ue/dist + - mv Documentation/Autogen/html/ sdk-reference-parser-unity-ue/src >/dev/null + - cd sdk-reference-parser-unity-ue + - npm install + - npm start + - mv -v dist/html/* dist >/dev/null + - cd dist && zip -r $CI_PROJECT_DIR/build.zip * >/dev/null artifacts: paths: - - Builds/$BUILD_TARGET_MACOS-$UNITY_2022_VERSION/XsollaInGameStoreUnityAsset.app + - build.zip + tags: + - devops -build-macos-6000: - extends: .build-macos-demo - script: - - sh $BUILD_SCRIPT_MACOS $PROJECT_PATH $UNITY_6000_VERSION $BUILD_ROOT_PATH $BUILD_TARGET_MACOS - artifacts: - paths: - - Builds/$BUILD_TARGET_MACOS-$UNITY_6000_VERSION/XsollaInGameStoreUnityAsset.app +deploy doc: + stage: deploy + extends: .deploy doc + only: + - /^v.*/ + dependencies: + - build doc + environment: + name: doc/$CI_COMMIT_REF_SLUG + url: https://$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.doc.srv.local/$URL_SLUG + on_stop: stop doc + when: manual + tags: + - sshclient + +current doc: + extends: .current doc + only: + - /^v.*/ + dependencies: + - deploy doc + environment: + name: doc/current + url: https://developers.xsolla.com/sdk-code-references/unity-store + tags: + - sshclient +stop doc: + extends: .stop doc + environment: + name: doc/$CI_COMMIT_REF_SLUG + action: stop + only: + - /^v.*/ + tags: + - sshclient + dependencies: [] # ========================================================================================================================= -# DEPLOY DEMO STAGE +# DEPLOY DEMO deploy stage: stage: deploy @@ -518,9 +304,9 @@ deploy stage: except: - branches dependencies: - - build-webgl-2019 + - demo_2021_webgl script: - - /usr/local/bin/helper deploy ./Builds/${BUILD_TARGET_WEBGL}-${UNITY_2019_VERSION} + - /usr/local/bin/helper deploy ./Builds current stage: stage: linking @@ -544,18 +330,15 @@ stop stage: script: - /usr/local/bin/helper stop -# ========================================================================================================================= -# DEPLOY DEMO PROD - deploy prod: stage: deploy extends: .deploy prod variables: ENV: prod dependencies: - - build-webgl-2019 + - demo_2021_webgl script: - - /usr/local/bin/helper deploy ./Builds/${BUILD_TARGET_WEBGL}-${UNITY_2019_VERSION} + - /usr/local/bin/helper deploy ./Builds current prod: stage: linking @@ -569,4 +352,4 @@ stop prod: stage: deploy extends: .stop prod script: - - /usr/local/bin/helper stop + - /usr/local/bin/helper stop \ No newline at end of file diff --git a/cicd/autotests.bat b/cicd/autotests.bat deleted file mode 100644 index c2fb73038..000000000 --- a/cicd/autotests.bat +++ /dev/null @@ -1,18 +0,0 @@ -@echo OFF - -set PROJECT_PATH=%1 -set UNITY_VERSION=%2 -set UNITY_PATH="C:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Unity.exe" -set LOGS_PATH=%PROJECT_PATH%\Logs\autotest_results.txt - -echo "#### Start Autotests ####" -echo "PROJECT_PATH: %PROJECT_PATH%" -echo "UNITY_VERSION: %UNITY_VERSION%" -echo "%UNITY_PATH% -batchmode -runTests -projectPath %PROJECT_PATH% -testResults %LOGS_PATH%" -call %UNITY_PATH% -batchmode -runTests -projectPath %PROJECT_PATH% -testResults %LOGS_PATH% - -if errorlevel 0 echo "#### All Tests Successful ####" -if errorlevel 2 echo "#### Some tests have failed, check the Logs ####" -if errorlevel 3 echo "#### RUN FAILURE, check the Logs ####" -echo "#### Autotests Ended With Errorlevel:%errorlevel% ####" -exit /b %errorlevel% \ No newline at end of file diff --git a/cicd/autotests.py b/cicd/autotests.py new file mode 100644 index 000000000..a762200d8 --- /dev/null +++ b/cicd/autotests.py @@ -0,0 +1,15 @@ +import os +import subprocess +import sys +import unity +import utils + + +utils.validate_args_count(3) +project_dir = sys.argv[1] +engine_version = sys.argv[2] + +report_path = os.path.join(project_dir, 'Logs', 'autotests_report.log') + +tests_result = unity.execute_tests(project_dir, engine_version, report_path) +sys.exit(tests_result) \ No newline at end of file diff --git a/cicd/build-demo-ios.sh b/cicd/build-demo-ios.sh deleted file mode 100644 index 1f69fa0c0..000000000 --- a/cicd/build-demo-ios.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -echo "" -echo "#### Generate XCode project ####" -PROJECT_PATH=$1 -UNITY_VERSION=$2 -BUILD_ROOT=$3 -BUILD_TARGET=$4 - -BUILD_LOG_PATH="$BUILD_ROOT/build.log" -BUILD_ROOT=$BUILD_ROOT'/'$BUILD_TARGET-$UNITY_VERSION -UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity" - -echo "PROJECT_PATH: ${PROJECT_PATH}" -echo "UNITY_VERSION: ${UNITY_VERSION}" -echo "BUILD_ROOT: ${BUILD_ROOT}" -echo "BUILD_TARGET: ${BUILD_TARGET}" -echo "BUILD_LOG_PATH: ${BUILD_LOG_PATH}" -echo "UNITY_PATH: ${UNITY_PATH}" - -if [ -d "$BUILD_ROOT" ]; then rm -Rf $BUILD_ROOT; fi -mkdir -p "$BUILD_ROOT" - -echo $UNITY_PATH -batchmode -quit -projectPath $PROJECT_PATH -customBuildPath "$BUILD_ROOT" -buildTarget "$BUILD_TARGET" -executeMethod "Xsolla.DevTools.BuildsManager.Build" -logFile "$BUILD_LOG_PATH" -$UNITY_PATH -batchmode -quit -projectPath $PROJECT_PATH -customBuildPath "$BUILD_ROOT" -buildTarget "$BUILD_TARGET" -executeMethod "Xsolla.DevTools.BuildsManager.Build" -logFile "$BUILD_LOG_PATH" - -EXIT_CODE=$? -if [ $EXIT_CODE -ne 0 ]; then - exit $EXIT_CODE -fi - -echo "" -echo "#### Build .ipa file ####" -export BUILD_ROOT -export UNITY_VERSION -bundle exec fastlane diawi_build - diff --git a/cicd/build-demo-mac.sh b/cicd/build-demo-mac.sh deleted file mode 100644 index 05f2bdac1..000000000 --- a/cicd/build-demo-mac.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -echo "" -echo "#### Build unity project ####" -PROJECT_PATH=$1 -UNITY_VERSION=$2 -BUILD_ROOT=$3 -BUILD_TARGET=$4 - -BUILD_LOG_PATH="$BUILD_ROOT/build.log" -BUILD_ROOT=$BUILD_ROOT'/'$BUILD_TARGET-$UNITY_VERSION -UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity" - -echo "PROJECT_PATH: ${PROJECT_PATH}" -echo "UNITY_VERSION: ${UNITY_VERSION}" -echo "BUILD_ROOT: ${BUILD_ROOT}" -echo "BUILD_TARGET: ${BUILD_TARGET}" -echo "BUILD_LOG_PATH: ${BUILD_LOG_PATH}" -echo "UNITY_PATH: ${UNITY_PATH}" -mkdir %BUILD_ROOT% - -echo $UNITY_PATH -batchmode -quit -projectPath $PROJECT_PATH -customBuildPath "$BUILD_ROOT" -buildTarget "$BUILD_TARGET" -executeMethod "Xsolla.DevTools.BuildsManager.Build" -logFile "$BUILD_LOG_PATH" -$UNITY_PATH -batchmode -quit -projectPath $PROJECT_PATH -customBuildPath "$BUILD_ROOT" -buildTarget "$BUILD_TARGET" -executeMethod "Xsolla.DevTools.BuildsManager.Build" -logFile "$BUILD_LOG_PATH" \ No newline at end of file diff --git a/cicd/build-demo-win.bat b/cicd/build-demo-win.bat deleted file mode 100644 index be924041f..000000000 --- a/cicd/build-demo-win.bat +++ /dev/null @@ -1,26 +0,0 @@ -@echo OFF - -echo "" -echo "#### Build unity project ####" -set PROJECT_PATH=%1 -set UNITY_VERSION=%2 -set BUILD_ROOT=%3 -set BUILD_TARGET=%4 - -set BUILD_ROOT=%PROJECT_PATH%\%BUILD_ROOT%\%BUILD_TARGET%-%UNITY_VERSION% -set BUILD_LOG_PATH=%BUILD_ROOT%\build.log -set UNITY_PATH="C:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Unity.exe" - -echo "PROJECT_PATH: %PROJECT_PATH%" -echo "UNITY_VERSION: %UNITY_VERSION%" -echo "BUILD_ROOT: %BUILD_ROOT%" -echo "BUILD_TARGET: %BUILD_TARGET%" -echo "BUILD_LOG_PATH: %BUILD_LOG_PATH%" -echo "UNITY_PATH: %UNITY_PATH%" - -mkdir %BUILD_ROOT% - -echo "%UNITY_PATH% -batchmode -quit -projectPath %PROJECT_PATH% -customBuildPath "%BUILD_ROOT%" -customBuildTarget "%BUILD_TARGET%" -executeMethod Xsolla.DevTools.BuildsManager.Build -logFile "%BUILD_LOG_PATH%"" -call %UNITY_PATH% -batchmode -quit -projectPath %PROJECT_PATH% -customBuildPath "%BUILD_ROOT%" -buildTarget "%BUILD_TARGET%" -executeMethod Xsolla.DevTools.BuildsManager.Build -logFile "%BUILD_LOG_PATH%" - -exit /b %errorlevel% \ No newline at end of file diff --git a/cicd/build_demo.py b/cicd/build_demo.py new file mode 100644 index 000000000..057ac578a --- /dev/null +++ b/cicd/build_demo.py @@ -0,0 +1,26 @@ +import os +import subprocess +import sys +import unity +import utils +import diawi + + +utils.validate_args_count(4) +project_dir = sys.argv[1] +engine_version = sys.argv[2] +build_target = sys.argv[3] + +build_root = os.path.join(project_dir, 'Builds') +unity_path = unity._get_unity_path(engine_version) +report_path = os.path.join(project_dir, 'Builds', 'build_report.log') + +os.makedirs(build_root, exist_ok=True) + +build_result = unity.build_demo(project_dir, engine_version, build_root, build_target, report_path) + +if build_result != 0 or build_target != 'iOS': + sys.exit(build_result) + +diawi_result = diawi.build_diawi(engine_version, build_root) +sys.exit(diawi_result) \ No newline at end of file diff --git a/cicd/code-analysis.bat b/cicd/code-analysis.bat deleted file mode 100644 index 2c4e95796..000000000 --- a/cicd/code-analysis.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo OFF - -rem using system variables: -rem RESHARPER_2021.1.3_BIN -rem UNITY_2019.4.27F1_BIN -rem XMLSTARLET_1.6.1_BIN - -set PROJECT_PATH=%cd% - -set LOGS_PATH=%PROJECT_PATH%\Logs -mkdir "%LOGS_PATH%" - -"%UNITY_2019.4.27F1_BIN%" -batchmode -nographics -logFile "%LOGS_PATH%\solution-generate.log" -executeMethod "UnityEditor.SyncVS.SyncSolution" -projectPath "%PROJECT_PATH%" -quit - -set REPORT_PATH="%LOGS_PATH%\code-analysis-report.xml" - -%RESHARPER_2021.1.3_BIN% "store-unity-sdk.sln" -o="%REPORT_PATH%" -s="ERROR" --dotnetcoresdk=3.1.412 - -FOR /F %%i IN ('%XMLSTARLET_1.6.1_BIN% sel -t -v "count(/Report/IssueTypes/IssueType)" %REPORT_PATH%') DO set ISSUES=%%i - -echo "ISSUES: %ISSUES%" -if %ISSUES% NEQ 0 ( - exit 1 - ) diff --git a/cicd/diawi.py b/cicd/diawi.py new file mode 100644 index 000000000..95ee3793f --- /dev/null +++ b/cicd/diawi.py @@ -0,0 +1,16 @@ +import os +import subprocess + + +def build_diawi(engine_version, build_root): + os.environ['UNITY_VERSION'] = engine_version + os.environ['BUILD_ROOT'] = build_root + + result = subprocess.run( + ["bundle", + "exec", "fastlane", + "diawi_build" + ] + ) + + return result.returncode \ No newline at end of file diff --git a/cicd/package-export.bat b/cicd/package-export.bat deleted file mode 100644 index 4f107f5ad..000000000 --- a/cicd/package-export.bat +++ /dev/null @@ -1,55 +0,0 @@ -set PROJECT_PATH=%1 -set UNITY_VERSION=%2 -set PACKAGE_NAME=%3 -set NEW_PROJ_PATH=%4 -set PACKAGE_PATH=%PROJECT_PATH%\Logs\%PACKAGE_NAME% -set UNITY_PATH="C:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Unity.exe" - -echo "" -echo "#### Export Package ####" -set LOGS_PATH=%PROJECT_PATH%\Logs\export_results.txt -echo "PROJECT_PATH: %PROJECT_PATH%" -echo "UNITY_VERSION: %UNITY_VERSION%" -echo "%UNITY_PATH% -batchmode -projectPath %PROJECT_PATH% -exportPackage "Assets\Xsolla" "Assets\DevTools" %PACKAGE_PATH% -logFile %LOGS_PATH% -quit" -call %UNITY_PATH% -batchmode -projectPath %PROJECT_PATH% -exportPackage "Assets\Xsolla" "Assets\DevTools" %PACKAGE_PATH% -logFile %LOGS_PATH% -quit -echo "## Export Ended With Errorlevel:%errorlevel% ##" -if not %errorlevel%==0 goto end - -echo "" -echo "#### Create New Project ####" -echo "NEW_PROJ_PATH: %NEW_PROJ_PATH%" -if exist %NEW_PROJ_PATH%\ ( -echo "## Deleting existing folder" -@RD /S /Q %NEW_PROJ_PATH% -) -echo "## Creating new folder" -mkdir %NEW_PROJ_PATH% -echo "## Creating new project" -set LOGS_PATH=%PROJECT_PATH%\Logs\create_results.txt -echo "%UNITY_PATH% -batchmode -createProject %NEW_PROJ_PATH% -logFile %LOGS_PATH% -quit" -call %UNITY_PATH% -batchmode -createProject %NEW_PROJ_PATH% -logFile %LOGS_PATH% -quit -echo "## Create Ended With Errorlevel:%errorlevel% ##" -if not %errorlevel%==0 goto end - -echo "" -echo "#### Import Package ####" -set LOGS_PATH=%PROJECT_PATH%\Logs\import_results.txt -echo "%UNITY_PATH% -batchmode -projectPath %NEW_PROJ_PATH% -importPackage %PACKAGE_PATH% -logFile %LOGS_PATH% -quit" -call %UNITY_PATH% -batchmode -projectPath %NEW_PROJ_PATH% -importPackage %PACKAGE_PATH% -logFile %LOGS_PATH% -quit -echo "## Import Ended With Errorlevel:%errorlevel% ##" -if not %errorlevel%==0 goto end - -echo "" -echo "#### Copy Manifest ####" -if exist %NEW_PROJ_PATH%\Packages\ ( -echo "## Deleting existing folder" -@RD /S /Q %NEW_PROJ_PATH%\Packages\ -) -echo "mkdir %NEW_PROJ_PATH%\Packages" -mkdir %NEW_PROJ_PATH%\Packages -echo "xcopy /s %PROJECT_PATH%\Packages %NEW_PROJ_PATH%\Packages" -xcopy /s /e /q %PROJECT_PATH%\Packages %NEW_PROJ_PATH%\Packages -echo "## Copy Ended With Errorlevel:%errorlevel% ##" - -:end -exit /b %errorlevel% \ No newline at end of file diff --git a/cicd/unity.py b/cicd/unity.py new file mode 100644 index 000000000..bec28ba93 --- /dev/null +++ b/cicd/unity.py @@ -0,0 +1,41 @@ +import os +import subprocess +import utils + + +def execute_tests(project_dir, engine_version, report_path): + unity_path = _get_unity_path(engine_version) + result = subprocess.run( + [ + unity_path, + "-batchmode", + "-runTests", + "-projectPath", project_dir, + "-testResults", report_path + ] + ) + return result.returncode + + +def build_demo(project_dir, engine_version, build_root, build_target, report_path): + unity_path = _get_unity_path(engine_version) + result = subprocess.run( + [ + unity_path, + "-batchmode", + "-quit", + "-projectPath", project_dir, + "-customBuildPath", build_root, + "-buildTarget", build_target, + "-executeMethod", "Xsolla.DevTools.BuildsManager.Build", + "-logFile", report_path + ] + ) + return result.returncode + + +def _get_unity_path(engine_version): + if utils.is_macos(): + return f"/Applications/Unity/Hub/Editor/{engine_version}/Unity.app/Contents/MacOS/Unity" + else: + return f"C:\\Program Files\\Unity\\Hub\\Editor\\{engine_version}\\Editor\\Unity.exe" diff --git a/cicd/utils.py b/cicd/utils.py new file mode 100644 index 000000000..e69c22426 --- /dev/null +++ b/cicd/utils.py @@ -0,0 +1,15 @@ +import sys +import yaml + +def finish_with_error(message): + print(message) + sys.exit(1) + + +def validate_args_count(expected_args_count): + if len(sys.argv) != expected_args_count: + finish_with_error("Arguments count error. Expected: " + str(expected_args_count) + ", actual: " + str(len(sys.argv))) + + +def is_macos(): + return sys.platform == 'darwin' \ No newline at end of file From d51f433c4bc9eb8b4c9f85fdeb5af71c323fd8b7 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Tue, 26 Nov 2024 18:00:17 +0800 Subject: [PATCH 12/21] SDK-3897 Add UnlinkSocialProvider method --- .../Friends/FriendSystemSocialNetwork.cs | 11 +- .../Login/Scripts/Friends/UserFriends.cs | 2 - .../Xsolla/UserAccount/XsollaUserAccount.cs | 22 ++++ ProjectSettings/SceneTemplateSettings.json | 121 ++++++++++++++++++ 4 files changed, 153 insertions(+), 3 deletions(-) create mode 100644 ProjectSettings/SceneTemplateSettings.json diff --git a/Assets/Xsolla.Demo/Login/Scripts/Friends/FriendSystemSocialNetwork.cs b/Assets/Xsolla.Demo/Login/Scripts/Friends/FriendSystemSocialNetwork.cs index d7be9d987..abd389a5b 100644 --- a/Assets/Xsolla.Demo/Login/Scripts/Friends/FriendSystemSocialNetwork.cs +++ b/Assets/Xsolla.Demo/Login/Scripts/Friends/FriendSystemSocialNetwork.cs @@ -4,6 +4,7 @@ using UnityEngine; using UnityEngine.UI; using Xsolla.Core; +using Xsolla.UserAccount; namespace Xsolla.Demo { @@ -99,7 +100,15 @@ private void SetState(State state) private void UnlinkSocialProvider() { - XDebug.Log("We can not unlink social provider yet. So do nothing."); + XsollaUserAccount.UnlinkSocialProvider( + provider, + () => + { + StoreDemoPopup.ShowSuccess("Social provider unlinked"); + UserAccountLogic.Instance.PurgeSocialProvidersCache(); + UserFriends.Instance.UpdateFriends(RefreshState, StoreDemoPopup.ShowError); + }, + StoreDemoPopup.ShowError); } private void LinkSocialProvider() diff --git a/Assets/Xsolla.Demo/Login/Scripts/Friends/UserFriends.cs b/Assets/Xsolla.Demo/Login/Scripts/Friends/UserFriends.cs index 71f98dcb9..e6bcacd8f 100644 --- a/Assets/Xsolla.Demo/Login/Scripts/Friends/UserFriends.cs +++ b/Assets/Xsolla.Demo/Login/Scripts/Friends/UserFriends.cs @@ -87,7 +87,6 @@ void handleError(Error error) private IEnumerator UpdateFriendsCoroutine(Action onSuccess, Action onError) { bool? isTokenValid = null; - bool socialBusy = true; bool friendsBusy = true; bool blockedBusy = true; bool pendingBusy = true; @@ -102,7 +101,6 @@ private IEnumerator UpdateFriendsCoroutine(Action onSuccess, Action onErr if (isTokenValid == true) { - // UpdateUserSocialFriends(() => socialBusy = false, onError); UpdateUserFriends(() => friendsBusy = false, onError); UpdateBlockedUsers(() => blockedBusy = false, onError); UpdatePendingUsers(() => pendingBusy = false, onError); diff --git a/Assets/Xsolla/UserAccount/XsollaUserAccount.cs b/Assets/Xsolla/UserAccount/XsollaUserAccount.cs index 402f036eb..b9420de25 100644 --- a/Assets/Xsolla/UserAccount/XsollaUserAccount.cs +++ b/Assets/Xsolla/UserAccount/XsollaUserAccount.cs @@ -686,6 +686,28 @@ public static void LinkSocialProvider(SocialProvider providerName, Action TokenAutoRefresher.Check(error, onError, () => LinkSocialProvider(providerName, onSuccess, onError, redirectUri))); } + //TEXTREVIEW + /// + /// Unlinks social network that can be used for authentication to the current account. + /// + /// Name of a social network. Provider must be connected to Login in Publisher Account.
+ /// Can be `amazon`, `apple`, `baidu`, `battlenet`, `discord`, `facebook`, `github`, `google`, `instagram`, `kakao`, `linkedin`, `mailru`, `microsoft`, `msn`, `naver`, `ok`, `paradox`, `paypal`, `psn`, `qq`, `reddit`, `steam`, `twitch`, `twitter`, `vimeo`, `vk`, `wechat`, `weibo`, `yahoo`, `yandex`, `youtube`, `xbox`, `playstation`. + /// Called after the social network successfully unlinked. + /// Called after the request resulted with an error. + public static void UnlinkSocialProvider(SocialProvider providerName, Action onSuccess, Action onError) + { + var providerValue = providerName.ToApiParameter(); + var url = new UrlBuilder($"{BaseUrl}/users/me/social_providers/{providerValue}") + .Build(); + + WebRequestHelper.Instance.DeleteRequest( + SdkType.Login, + url, + WebRequestHeader.AuthHeader(), + onSuccess, + error => TokenAutoRefresher.Check(error, onError, () => UnlinkSocialProvider(providerName, onSuccess, onError))); + } + /// /// Returns the list of social networks linked to the user account. /// diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 000000000..5e97f8393 --- /dev/null +++ b/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,121 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicMaterial", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "defaultInstantiationMode": 0 + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "defaultInstantiationMode": 1 + }, + "newSceneOverride": 0 +} \ No newline at end of file From 6ac24c965c6611833495a3f6259c34ba48655884 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Mon, 2 Dec 2024 14:46:20 +0800 Subject: [PATCH 13/21] SDK-4094 Make sdk parameter of purchase token optional --- Assets/Xsolla/Core/Entities/PurchaseParams.cs | 6 ++++++ Assets/Xsolla/Core/Utils/PurchaseParamsGenerator.cs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/Xsolla/Core/Entities/PurchaseParams.cs b/Assets/Xsolla/Core/Entities/PurchaseParams.cs index 9c46c1bb0..e6199e9cb 100644 --- a/Assets/Xsolla/Core/Entities/PurchaseParams.cs +++ b/Assets/Xsolla/Core/Entities/PurchaseParams.cs @@ -54,5 +54,11 @@ public class PurchaseParams /// Defines the way the Google Pay payment method is displayed. If true, the button for quick payment via Google Pay is displayed at the top of the payment UI. If `true`, Google Pay is displayed in the list of payment methods according to the PayRank algorithm. `false` by default. ///
public bool? google_pay_quick_payment_button; + + ///TEXTREVIEW + /// + /// Disables the `sdk` parameter in the `Payment` token. `false` by default. + /// + public bool disable_sdk_parameter; } } \ No newline at end of file diff --git a/Assets/Xsolla/Core/Utils/PurchaseParamsGenerator.cs b/Assets/Xsolla/Core/Utils/PurchaseParamsGenerator.cs index f75b3e6ae..24ff3658e 100644 --- a/Assets/Xsolla/Core/Utils/PurchaseParamsGenerator.cs +++ b/Assets/Xsolla/Core/Utils/PurchaseParamsGenerator.cs @@ -16,7 +16,9 @@ public static PurchaseParamsRequest GeneratePurchaseParamsRequest(PurchaseParams ProcessUiCloseButton(settings.ui, purchaseParams); ProcessGooglePayQuickButton(settings, purchaseParams); - ProcessSdkTokenSettings(settings); + + if (purchaseParams == null || !purchaseParams.disable_sdk_parameter) + ProcessSdkTokenSettings(settings); if (settings.redirect_policy != null) settings.return_url = settings.redirect_policy.return_url; From bb2bc089b49e784207e8886073f7015db4a4c84b Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 4 Dec 2024 13:35:58 +0800 Subject: [PATCH 14/21] SDK-4100 Remove deprecated editor build scripts --- .gitlab-ci.yml | 6 +- Assets/DevTools/AndroidFilesProcessor.meta | 8 - .../AndroidFilesProcessor.cs | 27 --- .../AndroidFilesProcessor.cs.meta | 3 - .../ApiLevelProcessor.cs | 16 -- .../ApiLevelProcessor.cs.meta | 3 - .../BaseProjectTemplateProcessor.cs | 29 ---- .../BaseProjectTemplateProcessor.cs.meta | 3 - .../GradlePathProcessor.cs | 28 --- .../GradlePathProcessor.cs.meta | 3 - .../GradleTemplateProcessor.cs | 35 ---- .../GradleTemplateProcessor.cs.meta | 3 - .../LauncherTemplateProcessor.cs | 35 ---- .../LauncherTemplateProcessor.cs.meta | 3 - .../MainTemplateProcessor.cs | 35 ---- .../MainTemplateProcessor.cs.meta | 3 - .../ManifestProcessor.cs | 101 ----------- .../ManifestProcessor.cs.meta | 3 - .../AndroidFilesProcessor/Templates.meta | 3 - .../Templates/AndroidManifest.xml | 16 -- .../Templates/baseProjectTemplate-2019.gradle | 29 ---- .../Templates/gradle-patch.txt | 19 --- .../Templates/gradle-patch.txt.meta | 7 - .../Templates/gradleTemplate-2019.properties | 7 - .../gradleTemplate-2019.properties.meta | 7 - .../Templates/gradleTemplate-2020.properties | 9 - .../gradleTemplate-2020.properties.meta | 7 - .../Templates/gradleTemplate-2021.properties | 9 - .../gradleTemplate-2022.properties.meta | 7 - .../Templates/gradleTemplate-6000.properties | 8 - .../gradleTemplate-6000.properties.meta | 7 - .../Templates/launcherTemplate-2019.gradle | 80 --------- .../launcherTemplate-2019.gradle.meta | 7 - .../Templates/launcherTemplate-2020.gradle | 59 ------- .../launcherTemplate-2020.gradle.meta | 7 - .../Templates/launcherTemplate-2021.gradle | 59 ------- .../launcherTemplate-2021.gradle.meta | 7 - .../Templates/launcherTemplate-2022.gradle | 61 ------- .../launcherTemplate-2022.gradle.meta | 7 - .../Templates/launcherTemplate-6000.gradle | 71 -------- .../launcherTemplate-6000.gradle.meta | 7 - .../Templates/mainTemplate-2019.gradle | 89 ---------- .../Templates/mainTemplate-2019.gradle.meta | 7 - .../Templates/mainTemplate-2020.gradle | 91 ---------- .../Templates/mainTemplate-2020.gradle.meta | 7 - .../Templates/mainTemplate-2021.gradle.meta | 7 - .../Templates/mainTemplate-2022.gradle | 76 --------- .../Templates/mainTemplate-2022.gradle.meta | 7 - .../Templates/mainTemplate-6000.gradle | 81 --------- .../Templates/mainTemplate-6000.gradle.meta | 7 - .../DevTools/AndroidFilesProcessor/Utils.cs | 54 ------ .../AndroidFilesProcessor/Utils.cs.meta | 3 - Assets/DevTools/PackagesManager.cs | 161 ------------------ Assets/DevTools/PackagesManager.cs.meta | 3 - Assets/Plugins/Android/AndroidManifest.xml | 15 ++ .../Android}/AndroidManifest.xml.meta | 2 +- .../Android/gradleTemplate.properties} | 0 .../Android/gradleTemplate.properties.meta} | 2 +- .../Android/mainTemplate.gradle} | 24 +-- .../Android/mainTemplate.gradle.meta} | 2 +- .../Xsolla/Core/Editor/XsollaDependencies.xml | 18 -- .../AndroidResolverDependencies.xml | 28 +-- ProjectSettings/GvhProjectSettings.xml | 4 +- ProjectSettings/ProjectSettings.asset | 6 +- ProjectSettings/UnityConnectSettings.asset | 2 + 65 files changed, 39 insertions(+), 1501 deletions(-) delete mode 100644 Assets/DevTools/AndroidFilesProcessor.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle.meta delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Utils.cs delete mode 100644 Assets/DevTools/AndroidFilesProcessor/Utils.cs.meta delete mode 100644 Assets/DevTools/PackagesManager.cs delete mode 100644 Assets/DevTools/PackagesManager.cs.meta create mode 100644 Assets/Plugins/Android/AndroidManifest.xml rename Assets/{DevTools/AndroidFilesProcessor/Templates => Plugins/Android}/AndroidManifest.xml.meta (75%) rename Assets/{DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties => Plugins/Android/gradleTemplate.properties} (100%) rename Assets/{DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties.meta => Plugins/Android/gradleTemplate.properties.meta} (74%) rename Assets/{DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle => Plugins/Android/mainTemplate.gradle} (55%) rename Assets/{DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle.meta => Plugins/Android/mainTemplate.gradle.meta} (74%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 500b9906b..c3ef67815 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,9 +25,9 @@ variables: BUILD_TARGET_IOS: "iOS" BUILD_TARGET_MACOS: "StandaloneOSX" UNITY_2019_VERSION: "2019.4.27f1" - UNITY_2021_VERSION: "2021.1.13f1" - UNITY_2022_VERSION: "2022.3.26f1" - UNITY_6000_VERSION: "6000.0.9f1" + UNITY_2021_VERSION: "2021.3.45f1" + UNITY_2022_VERSION: "2022.3.53f1" + UNITY_6000_VERSION: "6000.0.29f1" # ================================================================================================================= # JOBS BASE diff --git a/Assets/DevTools/AndroidFilesProcessor.meta b/Assets/DevTools/AndroidFilesProcessor.meta deleted file mode 100644 index b4aecd40f..000000000 --- a/Assets/DevTools/AndroidFilesProcessor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cdc05c47edfa1a443857443798e7ba44 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs deleted file mode 100644 index 1bdee569f..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs +++ /dev/null @@ -1,27 +0,0 @@ -#if UNITY_ANDROID -using UnityEditor.Build; -using UnityEditor.Build.Reporting; - -namespace Xsolla.DevTools -{ - public class AndroidFilesProcessor : IPreprocessBuildWithReport - { - public int callbackOrder => -1000; - - public void OnPreprocessBuild(BuildReport report) - { - Utils.ClearTargetDir(); - - ApiLevelProcessor.Process(); - GradlePathProcessor.Process(); - - ManifestProcessor.Process(); - - GradleTemplateProcessor.Process(); - BaseProjectTemplateProcessor.Process(); - MainTemplateProcessor.Process(); - LauncherTemplateProcessor.Process(); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs.meta deleted file mode 100644 index 685f6f864..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/AndroidFilesProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d5386e9a034644ada5ecae5be47bb266 -timeCreated: 1644437697 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs deleted file mode 100644 index 376b7e257..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs +++ /dev/null @@ -1,16 +0,0 @@ -#if UNITY_ANDROID - -namespace Xsolla.DevTools -{ - public static class ApiLevelProcessor - { - public static void Process() - { -#if UNITY_6000_0_OR_NEWER - UnityEditor.PlayerSettings.Android.minSdkVersion = UnityEditor.AndroidSdkVersions.AndroidApiLevel24; - UnityEditor.PlayerSettings.Android.targetSdkVersion = UnityEditor.AndroidSdkVersions.AndroidApiLevel34; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs.meta deleted file mode 100644 index d8c39f9aa..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/ApiLevelProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a7d5c04e38ca4b719ef73d8441d8a51c -timeCreated: 1721299438 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs deleted file mode 100644 index 14eb654ae..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs +++ /dev/null @@ -1,29 +0,0 @@ -#if UNITY_ANDROID -using System.IO; - -namespace Xsolla.DevTools -{ - public static class BaseProjectTemplateProcessor - { - public static void Process() - { - var sourceFilename = GetSourceFilename(); - if (sourceFilename == null) - return; - - var sourcePath = Path.Combine(Utils.GetWorkDir(), "Templates", sourceFilename); - var targetPath = Path.Combine(Utils.GetTargetDir(), "baseProjectTemplate.gradle"); - Utils.CopyFileIfNotExists(sourcePath, targetPath); - } - - private static string GetSourceFilename() - { -#if UNITY_2022_3_OR_NEWER - return null; -#else - return "baseProjectTemplate-2019.gradle"; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs.meta deleted file mode 100644 index 7600ba69d..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/BaseProjectTemplateProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 1a99e7577887415c8a2efba21375f28d -timeCreated: 1720022348 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs deleted file mode 100644 index 674e49578..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if UNITY_ANDROID -using System.IO; -using UnityEditor.Android; -using UnityEngine; - -namespace Xsolla.DevTools -{ - public static class GradlePathProcessor - { - public static void Process() - { - var gradleVersion = GetGradleVersion(); - var path = Application.dataPath.Replace("Assets", "gradle"); - path = Path.Combine(path, $"gradle-{gradleVersion}"); - AndroidExternalToolsSettings.gradlePath = path; - } - - private static string GetGradleVersion() - { -#if UNITY_6000_0_OR_NEWER - return "8.4"; -#else - return "7.2"; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs.meta deleted file mode 100644 index 8e0e0b864..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/GradlePathProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 002ba41d157d404ba1c6b51e21d91469 -timeCreated: 1720025067 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs deleted file mode 100644 index ba89b0e3d..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs +++ /dev/null @@ -1,35 +0,0 @@ -#if UNITY_ANDROID -using System.IO; - -namespace Xsolla.DevTools -{ - public static class GradleTemplateProcessor - { - public static void Process() - { - var sourceFilename = GetSourceFilename(); - if (sourceFilename == null) - return; - - var sourcePath = Path.Combine(Utils.GetWorkDir(), "Templates", sourceFilename); - var targetPath = Path.Combine(Utils.GetTargetDir(), "gradleTemplate.properties"); - Utils.CopyFileIfNotExists(sourcePath, targetPath); - } - - private static string GetSourceFilename() - { -#if UNITY_6000_0_OR_NEWER - return "gradleTemplate-6000.properties"; -#elif UNITY_2022_3_OR_NEWER - return "gradleTemplate-2022.properties"; -#elif UNITY_2021_3_OR_NEWER - return "gradleTemplate-2021.properties"; -#elif UNITY_2020_3_OR_NEWER - return "gradleTemplate-2020.properties"; -#else - return "gradleTemplate-2019.properties"; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs.meta deleted file mode 100644 index a222f2bc8..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/GradleTemplateProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 5972026d4a104e7bb91adedfe57a204d -timeCreated: 1720022802 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs deleted file mode 100644 index ff78e8217..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs +++ /dev/null @@ -1,35 +0,0 @@ -#if UNITY_ANDROID -using System.IO; - -namespace Xsolla.DevTools -{ - public static class LauncherTemplateProcessor - { - public static void Process() - { - var sourceFilename = GetLauncherSourceFileName(); - if (sourceFilename == null) - return; - - var sourcePath = Path.Combine(Utils.GetWorkDir(), "Templates", sourceFilename); - var targetPath = Path.Combine(Utils.GetTargetDir(), "launcherTemplate.gradle"); - Utils.CopyFileIfNotExists(sourcePath, targetPath); - } - - private static string GetLauncherSourceFileName() - { -#if UNITY_6000_0_OR_NEWER - return "launcherTemplate-6000.gradle"; -#elif UNITY_2022_3_OR_NEWER - return "launcherTemplate-2022.gradle"; -#elif UNITY_2021_3_OR_NEWER - return "launcherTemplate-2021.gradle"; -#elif UNITY_2020_3_OR_NEWER - return "launcherTemplate-2020.gradle"; -#else - return "launcherTemplate-2019.gradle"; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs.meta deleted file mode 100644 index 2503d8be0..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/LauncherTemplateProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b069102aa127492f8ff5e93ea65a14db -timeCreated: 1720023398 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs deleted file mode 100644 index da98983ed..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs +++ /dev/null @@ -1,35 +0,0 @@ -#if UNITY_ANDROID -using System.IO; - -namespace Xsolla.DevTools -{ - public static class MainTemplateProcessor - { - public static void Process() - { - var sourceFilename = GetSourceFilename(); - if (sourceFilename == null) - return; - - var sourcePath = Path.Combine(Utils.GetWorkDir(), "Templates", sourceFilename); - var targetPath = Path.Combine(Utils.GetTargetDir(), "mainTemplate.gradle"); - Utils.CopyFileIfNotExists(sourcePath, targetPath); - } - - private static string GetSourceFilename() - { -#if UNITY_6000_0_OR_NEWER - return "mainTemplate-6000.gradle"; -#elif UNITY_2022_3_OR_NEWER - return "mainTemplate-2022.gradle"; -#elif UNITY_2021_3_OR_NEWER - return "mainTemplate-2021.gradle"; -#elif UNITY_2020_3_OR_NEWER - return "mainTemplate-2020.gradle"; -#else - return "mainTemplate-2019.gradle"; -#endif - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs.meta deleted file mode 100644 index 9fcc602f5..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/MainTemplateProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: cffd75dbc241461fa3177034ae328811 -timeCreated: 1720022920 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs b/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs deleted file mode 100644 index a6fcd9923..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs +++ /dev/null @@ -1,101 +0,0 @@ -#if UNITY_ANDROID -using System; -using System.IO; -using System.Xml; - -namespace Xsolla.DevTools -{ - public static class ManifestProcessor - { - public static void Process() - { - var manifestPath = ProvideManifest(); - if (manifestPath != null) - PatchManifest(manifestPath); - } - - private static string ProvideManifest() - { - const string fileName = "AndroidManifest.xml"; - - var workDir = Utils.GetWorkDir(); - var sourceFilePath = Path.Combine(workDir, "Templates", fileName); - - var targetDir = Utils.GetTargetDir(); - var targetFilePath = Path.Combine(targetDir, fileName); - Utils.CopyFileIfNotExists(sourceFilePath, targetFilePath); - return targetFilePath; - } - - private static void PatchManifest(string filePath) - { - var xmlDoc = new XmlDocument(); - xmlDoc.Load(filePath); - - var root = xmlDoc.DocumentElement; - var applicationNode = root?.SelectSingleNode("application"); - if (applicationNode == null) - throw new Exception("Can't find 'application' node in AndroidManifest.xml"); - - var unityActivityNode = GetUnityActivityNode(applicationNode); - if (unityActivityNode == null) - throw new Exception("Can't find 'UnityPlayerActivity' node in AndroidManifest.xml"); - - var attribute = unityActivityNode.Attributes["android:exported"]; - if (attribute == null) - CreateXmlAttribute("android", "exported", "true", unityActivityNode); - - // var providerNode = applicationNode.SelectSingleNode("provider") as XmlElement; - // if (providerNode == null) - // providerNode = CreateXmlNode("provider", applicationNode, xmlDoc); - // - // if (providerNode?.Attributes == null) - // throw new Exception("Can't find 'provider' node in AndroidManifest.xml"); - // - // attribute = providerNode.Attributes["android:name"]; - // if (attribute == null) - // CreateXmlAttribute("android", "name", "androidx.startup.InitializationProvider", providerNode); - // - // attribute = providerNode.Attributes["android:authorities"]; - // if (attribute == null) - // CreateXmlAttribute("android", "authorities", "${applicationId}.androidx-startup", providerNode); - // - // attribute = providerNode.Attributes["tools:node"]; - // if (attribute == null) - // CreateXmlAttribute("tools", "node", "remove", providerNode); - - xmlDoc.Save(filePath); - } - - private static XmlElement CreateXmlNode(string name, XmlNode parent, XmlDocument xmlDoc) - { - var node = xmlDoc.CreateElement(name); - parent.AppendChild(node); - return node; - } - - private static XmlElement GetUnityActivityNode(XmlNode parent) - { - var children = parent.SelectNodes("activity"); - if (children == null) - throw new Exception("Can't find 'activity' nodes in AndroidManifest.xml"); - - var xmlNamespace = parent.OwnerDocument.DocumentElement.GetNamespaceOfPrefix("android"); - foreach (XmlElement child in children) - { - var attribute = child.GetAttributeNode("name", xmlNamespace); - if (attribute != null && attribute.Value == "com.unity3d.player.UnityPlayerActivity") - return child; - } - - return null; - } - - private static void CreateXmlAttribute(string prefix, string name, string value, XmlElement node) - { - var xmlNamespace = node.OwnerDocument.DocumentElement.GetNamespaceOfPrefix(prefix); - node.SetAttribute(name, xmlNamespace, value); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs.meta b/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs.meta deleted file mode 100644 index b9a2742a4..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/ManifestProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f4a652bc94f64ab29a8c02616959b7e1 -timeCreated: 1720023911 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates.meta b/Assets/DevTools/AndroidFilesProcessor/Templates.meta deleted file mode 100644 index e2234171a..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3dd80b171b96499283ed7d26b3a04e03 -timeCreated: 1692240378 \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml b/Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml deleted file mode 100644 index cb2c54a7f..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle deleted file mode 100644 index 6cce8e9e8..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle +++ /dev/null @@ -1,29 +0,0 @@ -allprojects { - buildscript { - repositories {**ARTIFACTORYREPOSITORY** - google() - mavenCentral() - } - - dependencies { - // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity - // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html - // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle - // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version - classpath 'com.android.tools.build:gradle:4.1.0' - **BUILD_SCRIPT_DEPS** - } - } - - repositories {**ARTIFACTORYREPOSITORY** - google() - mavenCentral() - flatDir { - dirs "${project(':unityLibrary').projectDir}/libs" - } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt b/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt deleted file mode 100644 index e05ca1e04..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt +++ /dev/null @@ -1,19 +0,0 @@ -android { - packagingOptions { - pickFirst 'META-INF/kotlinx-serialization-json.kotlin_module' - pickFirst 'META-INF/kotlinx_coroutines_core.version' - pickFirst 'META-INF/kotlinx-serialization-core.kotlin_module' - pickFirst 'META-INF/atomicfu.kotlin_module' - pickFirst 'META-INF/ktor-serialization-kotlinx.kotlin_module' - pickFirst 'META-INF/ktor-events.kotlin_module' - pickFirst 'META-INF/ktor-websocket-serialization.kotlin_module' - pickFirst 'META-INF/ktor-serialization.kotlin_module' - pickFirst 'META-INF/ktor-client-core.kotlin_module' - pickFirst 'META-INF/ktor-io.kotlin_module' - pickFirst 'META-INF/ktor-http.kotlin_module' - pickFirst 'META-INF/ktor-client-content-negotiation.kotlin_module' - pickFirst 'META-INF/ktor-serialization-kotlinx-json.kotlin_module' - pickFirst 'META-INF/ktor-websockets.kotlin_module' - pickFirst 'META-INF/ktor-utils.kotlin_module' - } -} diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt.meta deleted file mode 100644 index 2c8b720d0..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradle-patch.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d39f8bcf3b06f4446bdc307471da5a0d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties deleted file mode 100644 index bdea4ef08..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties +++ /dev/null @@ -1,7 +0,0 @@ -org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M -org.gradle.parallel=true -# Android Resolver Properties Start -android.useAndroidX=true -android.enableJetifier=true -# Android Resolver Properties End -**ADDITIONAL_PROPERTIES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties.meta deleted file mode 100644 index e7cd5c335..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2019.properties.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0988bf9e0f53941be924b7f40e1db0f1 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties deleted file mode 100644 index f519acb3e..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties +++ /dev/null @@ -1,9 +0,0 @@ -org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M -org.gradle.parallel=true -android.enableR8=**MINIFY_WITH_R_EIGHT** -unityStreamingAssets=.unity3d**STREAMING_ASSETS** -# Android Resolver Properties Start -android.useAndroidX=true -android.enableJetifier=true -# Android Resolver Properties End -**ADDITIONAL_PROPERTIES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties.meta deleted file mode 100644 index b7dfbd022..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2020.properties.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8cf0d4d758dff4abcbecd88bad664609 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties deleted file mode 100644 index abf3dec5a..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties +++ /dev/null @@ -1,9 +0,0 @@ -org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M -org.gradle.parallel=true -android.enableR8=**MINIFY_WITH_R_EIGHT** -unityStreamingAssets=**STREAMING_ASSETS** -# Android Resolver Properties Start -android.useAndroidX=true -android.enableJetifier=true -# Android Resolver Properties End -**ADDITIONAL_PROPERTIES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties.meta deleted file mode 100644 index f28bd7bd6..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 56907051394144d79a65c1d593a456ce -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties deleted file mode 100644 index 870468097..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties +++ /dev/null @@ -1,8 +0,0 @@ -org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M -org.gradle.parallel=true -unityStreamingAssets=**STREAMING_ASSETS** -# Android Resolver Properties Start -android.useAndroidX=true -android.enableJetifier=true -# Android Resolver Properties End -**ADDITIONAL_PROPERTIES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties.meta deleted file mode 100644 index a505a5225..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-6000.properties.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: aaa900cfa2bcc4a0ab79815e951bf045 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle deleted file mode 100644 index dad3edbb4..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle +++ /dev/null @@ -1,80 +0,0 @@ -apply plugin: 'com.android.application' - -dependencies { - implementation project(':unityLibrary') - } - -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - aaptOptions { - noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**] - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lintOptions { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - useProguard **PROGUARD_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - useProguard **PROGUARD_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING_OPTIONS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** -android { - packagingOptions { - pickFirst 'META-INF/kotlinx-serialization-json.kotlin_module' - pickFirst 'META-INF/kotlinx_coroutines_core.version' - pickFirst 'META-INF/kotlinx-serialization-core.kotlin_module' - pickFirst 'META-INF/atomicfu.kotlin_module' - pickFirst 'META-INF/ktor-serialization-kotlinx.kotlin_module' - pickFirst 'META-INF/ktor-events.kotlin_module' - pickFirst 'META-INF/ktor-websocket-serialization.kotlin_module' - pickFirst 'META-INF/ktor-serialization.kotlin_module' - pickFirst 'META-INF/ktor-client-core.kotlin_module' - pickFirst 'META-INF/ktor-io.kotlin_module' - pickFirst 'META-INF/ktor-http.kotlin_module' - pickFirst 'META-INF/ktor-client-content-negotiation.kotlin_module' - pickFirst 'META-INF/ktor-serialization-kotlinx-json.kotlin_module' - pickFirst 'META-INF/ktor-websockets.kotlin_module' - pickFirst 'META-INF/ktor-utils.kotlin_module' - } -} diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle.meta deleted file mode 100644 index 90599711a..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2019.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 173cd4d9dd2cd4e798b32a00827f3a43 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle deleted file mode 100644 index d31b59e03..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle +++ /dev/null @@ -1,59 +0,0 @@ -apply plugin: 'com.android.application' - -dependencies { - implementation project(':unityLibrary') - } - -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - aaptOptions { - noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lintOptions { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle.meta deleted file mode 100644 index 38189d61b..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2020.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: db8b9338565704d02a7961625b8bef46 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle deleted file mode 100644 index 543d075d6..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle +++ /dev/null @@ -1,59 +0,0 @@ -apply plugin: 'com.android.application' - -dependencies { - implementation project(':unityLibrary') - } - -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - aaptOptions { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lintOptions { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle.meta deleted file mode 100644 index 4a60094ea..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2021.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6a17e081ee969443181c0d604f231635 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle deleted file mode 100644 index 5054a3471..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle +++ /dev/null @@ -1,61 +0,0 @@ -apply plugin: 'com.android.application' - -dependencies { - implementation project(':unityLibrary') - } - -android { - ndkPath "**NDKPATH**" - - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - aaptOptions { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lintOptions { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle.meta deleted file mode 100644 index 03ad174fc..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-2022.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9f7d572b8dfc446a3b3ddc139f86540d -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle deleted file mode 100644 index bbba98e59..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle +++ /dev/null @@ -1,71 +0,0 @@ -apply plugin: 'com.android.application' -apply from: 'setupSymbols.gradle' -apply from: '../shared/keepUnitySymbols.gradle' - -dependencies { - implementation project(':unityLibrary') - } - -android { - namespace "**NAMESPACE**" - ndkPath "**NDKPATH**" - ndkVersion "**NDKVERSION**" - - compileSdk **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - defaultConfig { - minSdk **MINSDK** - targetSdk **TARGETSDK** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - debugSymbolLevel **DEBUGSYMBOLLEVEL** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - androidResources { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lint { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING****PLAY_ASSET_PACKS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - texture { - enableSplit = true - } - } - - **GOOGLE_PLAY_DEPENDENCIES** -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle.meta deleted file mode 100644 index ef6b30773..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/launcherTemplate-6000.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f69fdd09c3f594fa2876d6b51385603f -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle deleted file mode 100644 index b089c9b77..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle +++ /dev/null @@ -1,89 +0,0 @@ -// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN - -// Android Resolver Repos Start -([rootProject] + (rootProject.subprojects as List)).each { project -> - project.repositories { - def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") - maven { - url "https://maven.google.com" - } - maven { - url "https://repo1.maven.org/maven2/" // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:12 - } - mavenLocal() - mavenCentral() - } -} -// Android Resolver Repos End -apply plugin: 'com.android.library' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'com.xsolla.android:login:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 - implementation 'com.xsolla.android:login-facebook:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 - implementation 'com.xsolla.android:login-google:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 - implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 - implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 - implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 - implementation 'io.ktor:ktor-client-content-negotiation-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:38 - implementation 'io.ktor:ktor-client-core-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:39 - implementation 'io.ktor:ktor-client-okhttp-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:40 - implementation 'io.ktor:ktor-events-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:41 - implementation 'io.ktor:ktor-http-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:42 - implementation 'io.ktor:ktor-io-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:43 - implementation 'io.ktor:ktor-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:44 - implementation 'io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:46 - implementation 'io.ktor:ktor-serialization-kotlinx-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:45 - implementation 'io.ktor:ktor-utils-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:47 - implementation 'io.ktor:ktor-websocket-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:48 - implementation 'io.ktor:ktor-websockets-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:49 - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:33 - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:34 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:35 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:36 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packagingOptions { - exclude ('/lib/arm64-v8a/*' + '*') - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lintOptions { - abortOnError false - } - - aaptOptions { - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING_OPTIONS** -}**REPOSITORIES****SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle.meta deleted file mode 100644 index fb7918718..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2019.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fd68ff050e54b4ba38f4281502a410db -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle deleted file mode 100644 index bf191cbf2..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle +++ /dev/null @@ -1,91 +0,0 @@ -// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN - -// Android Resolver Repos Start -([rootProject] + (rootProject.subprojects as List)).each { project -> - project.repositories { - def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") - maven { - url "https://maven.google.com" - } - maven { - url "https://repo1.maven.org/maven2/" // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:12 - } - mavenLocal() - mavenCentral() - } -} -// Android Resolver Repos End -apply plugin: 'com.android.library' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'com.xsolla.android:login:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 - implementation 'com.xsolla.android:login-facebook:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 - implementation 'com.xsolla.android:login-google:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 - implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 - implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 - implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 - implementation 'io.ktor:ktor-client-content-negotiation-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:38 - implementation 'io.ktor:ktor-client-core-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:39 - implementation 'io.ktor:ktor-client-okhttp-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:40 - implementation 'io.ktor:ktor-events-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:41 - implementation 'io.ktor:ktor-http-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:42 - implementation 'io.ktor:ktor-io-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:43 - implementation 'io.ktor:ktor-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:44 - implementation 'io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:46 - implementation 'io.ktor:ktor-serialization-kotlinx-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:45 - implementation 'io.ktor:ktor-utils-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:47 - implementation 'io.ktor:ktor-websocket-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:48 - implementation 'io.ktor:ktor-websockets-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:49 - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:33 - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:34 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:35 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:36 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packagingOptions { - exclude ('/lib/arm64-v8a/*' + '*') - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lintOptions { - abortOnError false - } - - aaptOptions { - noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING_OPTIONS** -}**REPOSITORIES** -**IL_CPP_BUILD_SETUP** -**SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle.meta deleted file mode 100644 index 27206565f..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2020.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 610336ede65e0438ebc798b80006c514 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle.meta deleted file mode 100644 index ca291253d..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 52fee00a8916f4e74b59aed26d373473 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle deleted file mode 100644 index 88a14c5a7..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle +++ /dev/null @@ -1,76 +0,0 @@ -apply plugin: 'com.android.library' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'com.xsolla.android:login:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 - implementation 'com.xsolla.android:login-facebook:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 - implementation 'com.xsolla.android:login-google:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 - implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 - implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 - implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 - implementation 'io.ktor:ktor-client-content-negotiation-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:38 - implementation 'io.ktor:ktor-client-core-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:39 - implementation 'io.ktor:ktor-client-okhttp-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:40 - implementation 'io.ktor:ktor-events-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:41 - implementation 'io.ktor:ktor-http-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:42 - implementation 'io.ktor:ktor-io-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:43 - implementation 'io.ktor:ktor-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:44 - implementation 'io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:46 - implementation 'io.ktor:ktor-serialization-kotlinx-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:45 - implementation 'io.ktor:ktor-utils-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:47 - implementation 'io.ktor:ktor-websocket-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:48 - implementation 'io.ktor:ktor-websockets-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:49 - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:33 - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:34 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:35 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:36 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packagingOptions { - exclude ('/lib/arm64-v8a/*' + '*') - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - ndkPath "**NDKPATH**" - - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lintOptions { - abortOnError false - } - - aaptOptions { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING_OPTIONS** -} -**IL_CPP_BUILD_SETUP** -**SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle.meta deleted file mode 100644 index 62db668c3..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2022.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1c4b949c318be45309e959669bb84209 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle deleted file mode 100644 index e2c77cbda..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle +++ /dev/null @@ -1,81 +0,0 @@ -apply plugin: 'com.android.library' -apply from: '../shared/keepUnitySymbols.gradle' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'com.xsolla.android:login:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 - implementation 'com.xsolla.android:login-facebook:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 - implementation 'com.xsolla.android:login-google:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 - implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 - implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 - implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 - implementation 'io.ktor:ktor-client-content-negotiation-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:38 - implementation 'io.ktor:ktor-client-core-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:39 - implementation 'io.ktor:ktor-client-okhttp-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:40 - implementation 'io.ktor:ktor-events-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:41 - implementation 'io.ktor:ktor-http-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:42 - implementation 'io.ktor:ktor-io-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:43 - implementation 'io.ktor:ktor-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:44 - implementation 'io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:46 - implementation 'io.ktor:ktor-serialization-kotlinx-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:45 - implementation 'io.ktor:ktor-utils-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:47 - implementation 'io.ktor:ktor-websocket-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:48 - implementation 'io.ktor:ktor-websockets-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:49 - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:33 - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:34 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:35 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:36 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packaging { - exclude ('/lib/arm64-v8a/*' + '*') - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - namespace "com.unity3d.player" - ndkPath "**NDKPATH**" - ndkVersion "**NDKVERSION**" - - compileSdk **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - defaultConfig { - minSdk **MINSDK** - targetSdk **TARGETSDK** - ndk { - abiFilters **ABIFILTERS** - debugSymbolLevel **DEBUGSYMBOLLEVEL** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** -**DEFAULT_CONFIG_SETUP** - } - - lint { - abortOnError false - } - - androidResources { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING** -} -**IL_CPP_BUILD_SETUP** -**SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle.meta b/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle.meta deleted file mode 100644 index 9383fdedc..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-6000.gradle.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 5cc0a347e367942acb700cb944f1def7 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/DevTools/AndroidFilesProcessor/Utils.cs b/Assets/DevTools/AndroidFilesProcessor/Utils.cs deleted file mode 100644 index 176dead8d..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Utils.cs +++ /dev/null @@ -1,54 +0,0 @@ -#if UNITY_ANDROID -using System.IO; -using UnityEditor; -using UnityEngine; - -namespace Xsolla.DevTools -{ - public static class Utils - { - public static void ClearTargetDir() - { - var targetDir = GetTargetDir(); - if (Directory.Exists(targetDir)) - Directory.Delete(targetDir, true); - } - - public static string GetWorkDir() - { - var guids = AssetDatabase.FindAssets($"t:Script {nameof(Utils)}"); - if (guids.Length == 0) - throw new FileNotFoundException($"Can't find {nameof(Utils)} script"); - - var path = AssetDatabase.GUIDToAssetPath(guids[0]); - path = path.Replace("Assets", Application.dataPath); - path = Path.GetDirectoryName(path); - - if (path == null) - throw new DirectoryNotFoundException("Can't find directory with android file templates"); - - return path; - } - - public static string GetTargetDir() - { - return Path.Combine(Application.dataPath, "Plugins", "Android"); - } - - public static void CopyFileIfNotExists(string sourcePath, string targetPath) - { - if (!File.Exists(sourcePath)) - throw new FileNotFoundException($"File not found: {sourcePath}"); - - if (File.Exists(targetPath)) - return; - - var targetDir = Path.GetDirectoryName(targetPath); - if (targetDir != null && !Directory.Exists(targetDir)) - Directory.CreateDirectory(targetDir); - - File.Copy(sourcePath, targetPath); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/Utils.cs.meta b/Assets/DevTools/AndroidFilesProcessor/Utils.cs.meta deleted file mode 100644 index 0d2a96d60..000000000 --- a/Assets/DevTools/AndroidFilesProcessor/Utils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: df3b0b7671814771801d27ba7f63c7c6 -timeCreated: 1720022277 \ No newline at end of file diff --git a/Assets/DevTools/PackagesManager.cs b/Assets/DevTools/PackagesManager.cs deleted file mode 100644 index 300463e43..000000000 --- a/Assets/DevTools/PackagesManager.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; -using Xsolla.Core; - -namespace Xsolla.DevTools -{ - public static class PackagesManager - { - [MenuItem("Dev Tools/Export SDK package", false, 100)] - public static void ExportSdk() - { - var assetGuids = GetGuids("Assets/Xsolla"); - var packagePath = BuildPackagePath("xsolla-commerce-sdk"); - - var parameters = new object[] { - assetGuids, - packagePath - }; - - ExportPackage(parameters); - } - - [MenuItem("Dev Tools/Export DEMO package", false, 110)] - public static void ExportDemo() - { - ResetSdkSettings(); - - var sdkAssetGuids = GetGuids("Assets/Xsolla"); - var demoAssetGuids = GetGuids("Assets/Xsolla.Demo"); - var resourcesAssetGuids = GetGuids("Assets/Resources"); - - var assetGuids = sdkAssetGuids - .Concat(demoAssetGuids) - .Concat(resourcesAssetGuids) - .Distinct() - .ToArray(); - - var packagePath = BuildPackagePath("xsolla-commerce-demo"); - - var parameters = new object[] { - assetGuids, - packagePath - }; - - ExportPackage(parameters); - } - - [MenuItem("Dev Tools/Reset SDK Settings", false, 120)] - public static void ResetSdkSettings() - { - XsollaSettings.StoreProjectId = Constants.DEFAULT_PROJECT_ID; - XsollaSettings.LoginId = Constants.DEFAULT_LOGIN_ID; - XsollaSettings.OAuthClientId = Constants.DEFAULT_OAUTH_CLIENT_ID; - XsollaSettings.CallbackUrl = string.Empty; - XsollaSettingsEditor.SaveSettingsAsset(); - } - - private static string BuildPackagePath(string packageName) - { - var projectPath = Application.dataPath.Replace("Assets", string.Empty); - return Path.Combine(projectPath, $"{packageName}_v{PlayerSettings.bundleVersion}.unitypackage"); - } - - private static void ExportPackage(object[] parameters) - { - var methods = new List { - "UnityEditor.PackageUtility.ExportPackageAndPackageManagerManifest" - }; - - TryStaticInvoke(methods, parameters); - } - - #region from the unity asset store tools package - - private static string[] GetGuids(string rootPath) - { - var rootGuid = AssetDatabase.AssetPathToGUID(rootPath); - var guids = CollectAllChildren(rootGuid, Array.Empty()); - return BuildExportPackageAssetListGuids(guids, true); - } - - private static string[] BuildExportPackageAssetListGuids(string[] guids, bool dependencies) - { - var methodInfo = GetMethodInfo(new List { - "UnityEditor.PackageUtility.BuildExportPackageItemsList", - "UnityEditor.AssetServer.BuildExportPackageAssetListAssetsItems" - }, new[] { - typeof(string[]), - typeof(bool) - }); - - var parameters = new object[] { - guids, - dependencies - }; - - var objArray = (object[]) methodInfo.Invoke(null, parameters); - var strArray = new string[objArray.Length]; - - var field = methodInfo.ReturnType.GetElementType()?.GetField("guid"); - if (field == null) - throw new Exception(); - - for (var index = 0; index < objArray.Length; ++index) - { - var str = (string) field.GetValue(objArray[index]); - strArray[index] = str; - } - - return strArray; - } - - private static string[] CollectAllChildren(string guid, IEnumerable collection) - { - return (string[]) TryStaticInvoke(new List { - "UnityEditor.AssetDatabase.CollectAllChildren", - "UnityEditor.AssetServer.CollectAllChildren" - }, - new object[] { - guid, - collection - } - ); - } - - private static object TryStaticInvoke(List methods, object[] parameters) - { - return GetMethodInfo(methods).Invoke(null, parameters); - } - - private static MethodInfo GetMethodInfo(List methods, Type[] parametersType = null) - { - var methodInfo = (MethodInfo) null; - foreach (var method in methods) - { - var chArray = new[] { - '.' - }; - var strArray = method.Split(chArray); - var assembly = Assembly.Load(strArray[0]); - var name1 = $"{strArray[0]}.{strArray[1]}"; - var name2 = strArray[2]; - var type = assembly.GetType(name1); - if (type != null) - methodInfo = parametersType != null ? type.GetMethod(name2, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, parametersType, null) : type.GetMethod(name2, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - if (methodInfo != null) - break; - } - - return methodInfo != null ? methodInfo : throw new MissingMethodException(methods[0]); - } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/DevTools/PackagesManager.cs.meta b/Assets/DevTools/PackagesManager.cs.meta deleted file mode 100644 index 215e33be6..000000000 --- a/Assets/DevTools/PackagesManager.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 5c8560b2e27744308979e7a833b9a744 -timeCreated: 1630664284 \ No newline at end of file diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml new file mode 100644 index 000000000..98049aac7 --- /dev/null +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml.meta b/Assets/Plugins/Android/AndroidManifest.xml.meta similarity index 75% rename from Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml.meta rename to Assets/Plugins/Android/AndroidManifest.xml.meta index dd0d1f7c9..941891b07 100644 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/AndroidManifest.xml.meta +++ b/Assets/Plugins/Android/AndroidManifest.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a51341c91ab2a4e1480d59223a7786c5 +guid: 029d589b1f00f4653b715c41a9a12912 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties b/Assets/Plugins/Android/gradleTemplate.properties similarity index 100% rename from Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2022.properties rename to Assets/Plugins/Android/gradleTemplate.properties diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties.meta b/Assets/Plugins/Android/gradleTemplate.properties.meta similarity index 74% rename from Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties.meta rename to Assets/Plugins/Android/gradleTemplate.properties.meta index 9bc08922a..e608c8543 100644 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/gradleTemplate-2021.properties.meta +++ b/Assets/Plugins/Android/gradleTemplate.properties.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 60c3693f692ae4aedad71780aaa24d95 +guid: ff7136b12123744b9a6f0caa663a98e3 DefaultImporter: externalObjects: {} userData: diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle b/Assets/Plugins/Android/mainTemplate.gradle similarity index 55% rename from Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle rename to Assets/Plugins/Android/mainTemplate.gradle index 0e7f465bf..778621b0e 100644 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/mainTemplate-2021.gradle +++ b/Assets/Plugins/Android/mainTemplate.gradle @@ -25,22 +25,6 @@ dependencies { implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 - implementation 'io.ktor:ktor-client-content-negotiation-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:38 - implementation 'io.ktor:ktor-client-core-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:39 - implementation 'io.ktor:ktor-client-okhttp-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:40 - implementation 'io.ktor:ktor-events-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:41 - implementation 'io.ktor:ktor-http-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:42 - implementation 'io.ktor:ktor-io-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:43 - implementation 'io.ktor:ktor-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:44 - implementation 'io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:46 - implementation 'io.ktor:ktor-serialization-kotlinx-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:45 - implementation 'io.ktor:ktor-utils-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:47 - implementation 'io.ktor:ktor-websocket-serialization-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:48 - implementation 'io.ktor:ktor-websockets-jvm:2.1.0' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:49 - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:33 - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:34 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:35 - implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:36 // Android Resolver Dependencies End **DEPS**} @@ -56,12 +40,14 @@ android { } // Android Resolver Exclusions End android { + namespace "com.unity3d.player" + ndkPath "**NDKPATH**" compileSdkVersion **APIVERSION** buildToolsVersion '**BUILDTOOLS**' compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { @@ -83,7 +69,7 @@ android { noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" }**PACKAGING_OPTIONS** -}**REPOSITORIES** +} **IL_CPP_BUILD_SETUP** **SOURCE_BUILD_SETUP** **EXTERNAL_SOURCES** diff --git a/Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle.meta b/Assets/Plugins/Android/mainTemplate.gradle.meta similarity index 74% rename from Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle.meta rename to Assets/Plugins/Android/mainTemplate.gradle.meta index 708303b9b..ee4c71348 100644 --- a/Assets/DevTools/AndroidFilesProcessor/Templates/baseProjectTemplate-2019.gradle.meta +++ b/Assets/Plugins/Android/mainTemplate.gradle.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c527550fe986d4cb7b82e0272ed508a5 +guid: c4bcf789501924eee8ee972439d4b81f DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Xsolla/Core/Editor/XsollaDependencies.xml b/Assets/Xsolla/Core/Editor/XsollaDependencies.xml index 7c20f085e..e097aa9f9 100644 --- a/Assets/Xsolla/Core/Editor/XsollaDependencies.xml +++ b/Assets/Xsolla/Core/Editor/XsollaDependencies.xml @@ -29,23 +29,5 @@ - - - - - - - - - - - - - - - - - - diff --git a/ProjectSettings/AndroidResolverDependencies.xml b/ProjectSettings/AndroidResolverDependencies.xml index 41de6b871..fb3179e46 100644 --- a/ProjectSettings/AndroidResolverDependencies.xml +++ b/ProjectSettings/AndroidResolverDependencies.xml @@ -1,31 +1,15 @@ - com.xsolla.android:login:6.0.8 - com.xsolla.android:login-facebook:6.0.8 - com.xsolla.android:login-google:6.0.8 - com.xsolla.android:login-qq:6.0.8 - com.xsolla.android:login-wechat:6.0.8 + com.xsolla.android:login:6.0.11 + com.xsolla.android:login-facebook:6.0.11 + com.xsolla.android:login-google:6.0.11 + com.xsolla.android:login-qq:6.0.11 + com.xsolla.android:login-wechat:6.0.11 com.xsolla.android:payments:1.4.2 - io.ktor:ktor-client-content-negotiation-jvm:2.1.0 - io.ktor:ktor-client-core-jvm:2.1.0 - io.ktor:ktor-client-okhttp-jvm:2.1.0 - io.ktor:ktor-events-jvm:2.1.0 - io.ktor:ktor-http-jvm:2.1.0 - io.ktor:ktor-io-jvm:2.1.0 - io.ktor:ktor-serialization-jvm:2.1.0 - io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0 - io.ktor:ktor-serialization-kotlinx-jvm:2.1.0 - io.ktor:ktor-utils-jvm:2.1.0 - io.ktor:ktor-websocket-serialization-jvm:2.1.0 - io.ktor:ktor-websockets-jvm:2.1.0 - org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 - org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 - org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.3.3 - org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3 - + diff --git a/ProjectSettings/GvhProjectSettings.xml b/ProjectSettings/GvhProjectSettings.xml index 3a1730acc..c20156eff 100644 --- a/ProjectSettings/GvhProjectSettings.xml +++ b/ProjectSettings/GvhProjectSettings.xml @@ -9,8 +9,8 @@ - - + + diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2eb4294d9..28a00eca6 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -168,7 +168,7 @@ PlayerSettings: overrideDefaultApplicationIdentifier: 1 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 24 - AndroidTargetSdkVersion: 33 + AndroidTargetSdkVersion: 34 AndroidPreferredInstallLocation: 1 aotOptions: stripEngineCode: 1 @@ -243,9 +243,9 @@ PlayerSettings: clonedFromGUID: 5f34be1353de5cf4398729fda238591b templatePackageId: com.unity.template.2d@1.0.2 templateDefaultScene: Assets/Scenes/SampleScene.unity - useCustomMainManifest: 0 + useCustomMainManifest: 1 useCustomLauncherManifest: 0 - useCustomMainGradleTemplate: 0 + useCustomMainGradleTemplate: 1 useCustomLauncherGradleManifest: 0 useCustomBaseGradleTemplate: 0 useCustomGradlePropertiesTemplate: 0 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset index fa0b14657..a88bee0f1 100644 --- a/ProjectSettings/UnityConnectSettings.asset +++ b/ProjectSettings/UnityConnectSettings.asset @@ -9,6 +9,7 @@ UnityConnectSettings: m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com m_TestInitMode: 0 CrashReportingSettings: m_EventUrl: https://perf-events.cloud.unity3d.com @@ -22,6 +23,7 @@ UnityConnectSettings: m_Enabled: 0 m_TestMode: 0 m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 UnityAdsSettings: m_Enabled: 0 m_InitializeOnStartup: 1 From 9fcf86315415dce1f73f5b8ee590112238c9862e Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Wed, 4 Dec 2024 18:10:51 +0800 Subject: [PATCH 15/21] SDK-4095 Move android auth callback to main thread --- Assets/Xsolla/Core/Android/AndroidAuthCallback.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/Xsolla/Core/Android/AndroidAuthCallback.cs b/Assets/Xsolla/Core/Android/AndroidAuthCallback.cs index c66be6104..486fbee47 100644 --- a/Assets/Xsolla/Core/Android/AndroidAuthCallback.cs +++ b/Assets/Xsolla/Core/Android/AndroidAuthCallback.cs @@ -19,30 +19,34 @@ public AndroidAuthCallback(AndroidHelper androidHelper, Action onSuccess, Action OnCancel = onCancel; } + // called from proxy activities - SocialAuthProxyActivity and XsollaWidgetAuthProxyActivity public void onSuccess() { try { var accessToken = AndroidHelper.Xlogin.CallStatic("getToken"); var refreshToken = AndroidHelper.Xlogin.CallStatic("getRefreshToken"); - XsollaToken.Create(accessToken, refreshToken); - OnSuccess?.Invoke(); + AndroidHelper.MainThreadExecutor.Enqueue(() => { + XsollaToken.Create(accessToken, refreshToken); + OnSuccess?.Invoke(); + }); } catch (Exception e) { - OnError?.Invoke(new Error(errorMessage: e.Message)); + AndroidHelper.MainThreadExecutor.Enqueue(() => OnError?.Invoke(new Error(errorMessage: e.Message))); } } + // called from proxy activities - SocialAuthProxyActivity and XsollaWidgetAuthProxyActivity public void onError(AndroidJavaObject _, string errorMessage) { if (!string.IsNullOrEmpty(errorMessage) && errorMessage == "CANCELLED") { - OnCancel?.Invoke(); + AndroidHelper.MainThreadExecutor.Enqueue(() => OnCancel?.Invoke()); } else { - OnError?.Invoke(new Error(errorMessage: errorMessage)); + AndroidHelper.MainThreadExecutor.Enqueue(() => OnError?.Invoke(new Error(errorMessage: errorMessage))); } } } From ec474ab38036551a52a99b947fdc659c4e94f6c1 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Thu, 5 Dec 2024 15:48:45 +0800 Subject: [PATCH 16/21] SDK-4039 Make proxy activities transparent --- Assets/Xsolla/Core/Editor/AndroidManifestPreprocess.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Xsolla/Core/Editor/AndroidManifestPreprocess.cs b/Assets/Xsolla/Core/Editor/AndroidManifestPreprocess.cs index d11ff5989..adcb258e7 100644 --- a/Assets/Xsolla/Core/Editor/AndroidManifestPreprocess.cs +++ b/Assets/Xsolla/Core/Editor/AndroidManifestPreprocess.cs @@ -56,6 +56,7 @@ private static void SetupProxyActivity(string activityName) var activityNode = new ActivityNode(fullActivityName); activityNode.AddAttribute(AndroidManifestConstants.ExportedAttribute, "true"); activityNode.AddAttribute(AndroidManifestConstants.ConfigChanges, "orientation|screenSize|keyboardHidden"); + activityNode.AddAttribute("android:theme", "@android:style/Theme.Translucent.NoTitleBar"); var manifest = LoadManifestWrapper(); @@ -101,7 +102,7 @@ private static string GetTemplateFilePath() path = Path.GetDirectoryName(path); if (path == null) throw new DirectoryNotFoundException("Can't find directory with android file templates"); - + var fileName = "AndroidManifest.xml"; #if UNITY_6000 fileName = "AndroidManifest_6000.xml"; From a0a473add1c1f5f81934ef8a5ea81ea6ce5fe031 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Thu, 12 Dec 2024 17:11:35 +0800 Subject: [PATCH 17/21] Update android dependencies --- Assets/Plugins/Android/mainTemplate.gradle | 12 +-- .../Xsolla/Core/Editor/XsollaDependencies.xml | 12 +-- .../AndroidResolverDependencies.xml | 12 +-- ProjectSettings/ProjectSettings.asset | 99 ++++++++++++++++++- 4 files changed, 116 insertions(+), 19 deletions(-) diff --git a/Assets/Plugins/Android/mainTemplate.gradle b/Assets/Plugins/Android/mainTemplate.gradle index 778621b0e..8d85ab094 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle +++ b/Assets/Plugins/Android/mainTemplate.gradle @@ -19,12 +19,12 @@ apply plugin: 'com.android.library' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) // Android Resolver Dependencies Start - implementation 'com.xsolla.android:login:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 - implementation 'com.xsolla.android:login-facebook:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 - implementation 'com.xsolla.android:login-google:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 - implementation 'com.xsolla.android:login-qq:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 - implementation 'com.xsolla.android:login-wechat:6.0.11' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 - implementation 'com.xsolla.android:payments:1.4.2' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 + implementation 'com.xsolla.android:login:6.0.14' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:27 + implementation 'com.xsolla.android:login-facebook:6.0.14' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:28 + implementation 'com.xsolla.android:login-google:6.0.14' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:29 + implementation 'com.xsolla.android:login-qq:6.0.14' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:31 + implementation 'com.xsolla.android:login-wechat:6.0.14' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:30 + implementation 'com.xsolla.android:payments:1.4.4' // Assets/Xsolla/Core/Editor/XsollaDependencies.xml:26 // Android Resolver Dependencies End **DEPS**} diff --git a/Assets/Xsolla/Core/Editor/XsollaDependencies.xml b/Assets/Xsolla/Core/Editor/XsollaDependencies.xml index e097aa9f9..ec3cb3b49 100644 --- a/Assets/Xsolla/Core/Editor/XsollaDependencies.xml +++ b/Assets/Xsolla/Core/Editor/XsollaDependencies.xml @@ -23,11 +23,11 @@ Additional repositories can be added using the "repositories" element. --> - - - - - - + + + + + + diff --git a/ProjectSettings/AndroidResolverDependencies.xml b/ProjectSettings/AndroidResolverDependencies.xml index fb3179e46..3545eaf7a 100644 --- a/ProjectSettings/AndroidResolverDependencies.xml +++ b/ProjectSettings/AndroidResolverDependencies.xml @@ -1,11 +1,11 @@ - com.xsolla.android:login:6.0.11 - com.xsolla.android:login-facebook:6.0.11 - com.xsolla.android:login-google:6.0.11 - com.xsolla.android:login-qq:6.0.11 - com.xsolla.android:login-wechat:6.0.11 - com.xsolla.android:payments:1.4.2 + com.xsolla.android:login:6.0.14 + com.xsolla.android:login-facebook:6.0.14 + com.xsolla.android:login-google:6.0.14 + com.xsolla.android:login-qq:6.0.14 + com.xsolla.android:login-wechat:6.0.14 + com.xsolla.android:payments:1.4.4 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 28a00eca6..2e46df757 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -137,7 +137,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 2.5.0 + bundleVersion: 2.5.1 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 @@ -368,6 +368,103 @@ PlayerSettings: m_Height: 36 m_Kind: 1 m_SubKind: + - m_BuildTarget: iPhone + m_Icons: + - m_Textures: [] + m_Width: 180 + m_Height: 180 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 167 + m_Height: 167 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 152 + m_Height: 152 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 76 + m_Height: 76 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 87 + m_Height: 87 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 60 + m_Height: 60 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 20 + m_Height: 20 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 1024 + m_Height: 1024 + m_Kind: 4 + m_SubKind: App Store m_BuildTargetBatching: [] m_BuildTargetShaderSettings: [] m_BuildTargetGraphicsJobs: From 99351184b958744121d38650825ffb31fa11faee Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Thu, 12 Dec 2024 17:33:53 +0800 Subject: [PATCH 18/21] Update version and changelogs --- Assets/Xsolla/CHANGELOG.md | 30 +++++++++++++++++++++++- Assets/Xsolla/Core/Internal/Constants.cs | 2 +- CHANGELOG.md | 28 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/Assets/Xsolla/CHANGELOG.md b/Assets/Xsolla/CHANGELOG.md index 334942114..90f84cc86 100644 --- a/Assets/Xsolla/CHANGELOG.md +++ b/Assets/Xsolla/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.5.1] - 2024-12-12 +### Changed +- Minimum supported Unity version updated to 2021.3.45f1. +- Removed the `limit` and `offset` parameters from the following SDK methods: + - `XsollaCatalog.GetItems` + - `XsollaCatalog.GetGroupItems` + - `XsollaCatalog.GetItemGroups` + - `XsollaCatalog.GetVirtualCurrencyList` + - `XsollaCatalog.GetVirtualCurrencyPackagesList` + - `XsollaCatalog.GetBundles` + - `XsollaCatalog.GetCatalog` +- Android Proxy Activities used for authentication is transparent now. + +### Added +- New methods for XsollaCatalog: + - `XsollaCatalog.GetPaginatedItems` + - `XsollaCatalog.GetPaginatedGroupItems`[CHANGELOG.md](../../CHANGELOG.md) + - `XsollaCatalog.GetPaginatedVirtualCurrencyList` + - `XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList` + - `XsollaCatalog.GetPaginatedBundles` +- New method for XsollaUserAccount: + - `XsollaUserAccount.UnlinkSocialProvider` + +### Fixed +- Potential `meta-data` attribute merge conflict in `AndroidManifest.xml`. +- An issue where changes to Xsolla SDK settings were not properly saved to the asset. +- An issue where the callback was not invoked after authentication with the Xsolla Login Widget. + ## [2.5.0] - 2024-10-17 ### Added - OAuth2.0 support for the Xsolla Login Widget with token refresh functionality @@ -22,7 +50,7 @@ ## [2.4.1] - 2024-07-19 ### Added - Unity 6 support - +[CHANGELOG.md](CHANGELOG.md) ### Changed - Third-party dependency manager updated to latest version - `PurchaseParams` structure: diff --git a/Assets/Xsolla/Core/Internal/Constants.cs b/Assets/Xsolla/Core/Internal/Constants.cs index 95c0c8aaa..32a2afa3b 100644 --- a/Assets/Xsolla/Core/Internal/Constants.cs +++ b/Assets/Xsolla/Core/Internal/Constants.cs @@ -2,7 +2,7 @@ namespace Xsolla.Core { public static class Constants { - public const string SDK_VERSION = "2.5.0"; + public const string SDK_VERSION = "2.5.1"; public const string DEFAULT_PROJECT_ID = "77640"; public const string DEFAULT_LOGIN_ID = "026201e3-7e40-11ea-a85b-42010aa80004"; diff --git a/CHANGELOG.md b/CHANGELOG.md index 334942114..06a30ba7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.5.1] - 2024-12-12 +### Changed +- Minimum supported Unity version updated to 2021.3.45f1. +- Removed the `limit` and `offset` parameters from the following SDK methods: + - `XsollaCatalog.GetItems` + - `XsollaCatalog.GetGroupItems` + - `XsollaCatalog.GetItemGroups` + - `XsollaCatalog.GetVirtualCurrencyList` + - `XsollaCatalog.GetVirtualCurrencyPackagesList` + - `XsollaCatalog.GetBundles` + - `XsollaCatalog.GetCatalog` +- Android Proxy Activities used for authentication is transparent now. + +### Added +- New methods for XsollaCatalog: + - `XsollaCatalog.GetPaginatedItems` + - `XsollaCatalog.GetPaginatedGroupItems`[CHANGELOG.md](../../CHANGELOG.md) + - `XsollaCatalog.GetPaginatedVirtualCurrencyList` + - `XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList` + - `XsollaCatalog.GetPaginatedBundles` +- New method for XsollaUserAccount: + - `XsollaUserAccount.UnlinkSocialProvider` + +### Fixed +- Potential `meta-data` attribute merge conflict in `AndroidManifest.xml`. +- An issue where changes to Xsolla SDK settings were not properly saved to the asset. +- An issue where the callback was not invoked after authentication with the Xsolla Login Widget. + ## [2.5.0] - 2024-10-17 ### Added - OAuth2.0 support for the Xsolla Login Widget with token refresh functionality From 2476c5ca465523c581e3e87be3123366d76b9a80 Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Thu, 12 Dec 2024 17:38:52 +0800 Subject: [PATCH 19/21] Hide facebook native auth settings --- Assets/Resources/XsollaSettings.asset | 2 -- .../Editor/XsollaSettingsEditor.Android.cs | 26 +++++++++---------- Assets/Xsolla/Core/Settings/XsollaSettings.cs | 19 ++++++++------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Assets/Resources/XsollaSettings.asset b/Assets/Resources/XsollaSettings.asset index f85a6f8e6..0061f8c49 100644 --- a/Assets/Resources/XsollaSettings.asset +++ b/Assets/Resources/XsollaSettings.asset @@ -64,8 +64,6 @@ MonoBehaviour: iosPayStationUISettings: isFoldout: 0 paystationThemeId: 63295aab2e47fab76f7708e3 - facebookAppId: - facebookClientToken: googleServerId: wechatAppId: qqAppId: diff --git a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Android.cs b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Android.cs index f0f8b8ab1..cc0f55de8 100644 --- a/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Android.cs +++ b/Assets/Xsolla/Core/Settings/Editor/XsollaSettingsEditor.Android.cs @@ -28,19 +28,19 @@ private bool AndroidSettings() var changed = false; - var facebookAppId = EditorGUILayout.TextField(new GUIContent(FACEBOOK_APP_ID_LABEL, FACEBOOK_APP_ID_TOOLTIP), XsollaSettings.FacebookAppId); - if (facebookAppId != XsollaSettings.FacebookAppId) - { - XsollaSettings.FacebookAppId = facebookAppId; - changed = true; - } - - var facebookClientToken = EditorGUILayout.TextField(new GUIContent(FACEBOOK_CLIENT_TOKEN_LABEL, FACEBOOK_CLIENT_TOKEN_TOOLTIP), XsollaSettings.FacebookClientToken); - if (facebookClientToken != XsollaSettings.FacebookClientToken) - { - XsollaSettings.FacebookClientToken = facebookClientToken; - changed = true; - } + // var facebookAppId = EditorGUILayout.TextField(new GUIContent(FACEBOOK_APP_ID_LABEL, FACEBOOK_APP_ID_TOOLTIP), XsollaSettings.FacebookAppId); + // if (facebookAppId != XsollaSettings.FacebookAppId) + // { + // XsollaSettings.FacebookAppId = facebookAppId; + // changed = true; + // } + // + // var facebookClientToken = EditorGUILayout.TextField(new GUIContent(FACEBOOK_CLIENT_TOKEN_LABEL, FACEBOOK_CLIENT_TOKEN_TOOLTIP), XsollaSettings.FacebookClientToken); + // if (facebookClientToken != XsollaSettings.FacebookClientToken) + // { + // XsollaSettings.FacebookClientToken = facebookClientToken; + // changed = true; + // } var googleServerId = EditorGUILayout.TextField(new GUIContent(GOOGLE_SERVER_ID_LABEL, GOOGLE_SERVER_ID_TOOLTIP), XsollaSettings.GoogleServerId); if (googleServerId != XsollaSettings.GoogleServerId) diff --git a/Assets/Xsolla/Core/Settings/XsollaSettings.cs b/Assets/Xsolla/Core/Settings/XsollaSettings.cs index a5464dcbe..e1d27f88e 100644 --- a/Assets/Xsolla/Core/Settings/XsollaSettings.cs +++ b/Assets/Xsolla/Core/Settings/XsollaSettings.cs @@ -25,8 +25,8 @@ public class XsollaSettings : ScriptableObject [SerializeField] private PayStationUISettings androidPayStationUISettings = new PayStationUISettings(); [SerializeField] private PayStationUISettings iosPayStationUISettings = new PayStationUISettings(); - [SerializeField] private string facebookAppId; - [SerializeField] private string facebookClientToken; + // [SerializeField] private string facebookAppId; + // [SerializeField] private string facebookClientToken; [SerializeField] private string googleServerId; [SerializeField] private string wechatAppId; [SerializeField] private string qqAppId; @@ -137,14 +137,17 @@ public static PayStationUISettings IosPayStationUISettings public static string FacebookAppId { - get => Instance.facebookAppId; - set => Instance.facebookAppId = value; + get => string.Empty; + + // get => Instance.facebookAppId; + // set => Instance.facebookAppId = value; } public static string FacebookClientToken { - get => Instance.facebookClientToken; - set => Instance.facebookClientToken = value; + get => string.Empty; + // get => Instance.facebookClientToken; + // set => Instance.facebookClientToken = value; } public static string GoogleServerId @@ -185,7 +188,7 @@ public static XsollaSettings Instance throw new Exception("`XsollaSettings` asset not found. Please create it."); if (instances.Length > 1) - throw new Exception("Multiple `XsollaSettings` assets found. Please keep only one asset."); + throw new Exception("Multiple `XsollaSettings` assets found. Please keep only one asset."); _instance = instances[0]; } @@ -194,4 +197,4 @@ public static XsollaSettings Instance } } } -} +} \ No newline at end of file From d6d8fb521cb4d6582ebe3b3f1546dcdb17169ead Mon Sep 17 00:00:00 2001 From: Mariia Date: Fri, 13 Dec 2024 11:56:16 +0500 Subject: [PATCH 20/21] Proofread --- Assets/Xsolla/CHANGELOG.md | 36 ++++++++-------- Assets/Xsolla/Catalog/XsollaCatalog.cs | 42 +++++++++---------- Assets/Xsolla/Core/Entities/PurchaseParams.cs | 3 +- .../Xsolla/UserAccount/XsollaUserAccount.cs | 3 +- 4 files changed, 41 insertions(+), 43 deletions(-) diff --git a/Assets/Xsolla/CHANGELOG.md b/Assets/Xsolla/CHANGELOG.md index 90f84cc86..fc409b699 100644 --- a/Assets/Xsolla/CHANGELOG.md +++ b/Assets/Xsolla/CHANGELOG.md @@ -2,31 +2,31 @@ ## [2.5.1] - 2024-12-12 ### Changed -- Minimum supported Unity version updated to 2021.3.45f1. +- Minimum supported Unity version updated to 2021.3.45f1 - Removed the `limit` and `offset` parameters from the following SDK methods: - - `XsollaCatalog.GetItems` - - `XsollaCatalog.GetGroupItems` + - `XsollaCatalog.GetItems` + - `XsollaCatalog.GetGroupItems` - `XsollaCatalog.GetItemGroups` - `XsollaCatalog.GetVirtualCurrencyList` - `XsollaCatalog.GetVirtualCurrencyPackagesList` - `XsollaCatalog.GetBundles` - `XsollaCatalog.GetCatalog` -- Android Proxy Activities used for authentication is transparent now. +- Android Proxy Activities used for authentication is transparent now ### Added -- New methods for XsollaCatalog: +- New methods for `XsollaCatalog` class: - `XsollaCatalog.GetPaginatedItems` - - `XsollaCatalog.GetPaginatedGroupItems`[CHANGELOG.md](../../CHANGELOG.md) + - `XsollaCatalog.GetPaginatedGroupItems` - `XsollaCatalog.GetPaginatedVirtualCurrencyList` - `XsollaCatalog.GetPaginatedVirtualCurrencyPackagesList` - `XsollaCatalog.GetPaginatedBundles` -- New method for XsollaUserAccount: +- New method for `XsollaUserAccount` class: - `XsollaUserAccount.UnlinkSocialProvider` ### Fixed -- Potential `meta-data` attribute merge conflict in `AndroidManifest.xml`. -- An issue where changes to Xsolla SDK settings were not properly saved to the asset. -- An issue where the callback was not invoked after authentication with the Xsolla Login Widget. +- Potential `meta-data` attribute merge conflict in `AndroidManifest.xml` +- Issue with saving changes of Xsolla SDK settings in the asset +- Issue with invoking callback after authentication with Xsolla login widget ## [2.5.0] - 2024-10-17 ### Added @@ -50,7 +50,7 @@ ## [2.4.1] - 2024-07-19 ### Added - Unity 6 support -[CHANGELOG.md](CHANGELOG.md) + ### Changed - Third-party dependency manager updated to latest version - `PurchaseParams` structure: @@ -85,7 +85,7 @@ ## [2.3.0] - 2024-02-01 ### Changed -- `AuthWithXsollaWidget` SDK method. Added the ‘locale’ parameter +- `AuthWithXsollaWidget` SDK method. Added the `locale` parameter ## [2.2.0] - 2023-11-29 ### Added @@ -241,13 +241,13 @@ ### Changed - Updated wrapper methods for IGS&BB API calls - Updated wrapper methods for Login API calls -- Separated 'Xsolla' and 'Xsolla.Demo' -- Separated 'Login' into several modules -- Separated 'Inventory' and 'Store' into several modules +- Separated `Xsolla` and `Xsolla.Demo` +- Separated `Login` into several modules +- Separated `Inventory` and `Store` into several modules - Updated Android libraries - Reworked SDK settings - Made naming of several SDK methods more consistent -- Demo: Moved user attributes to the 'User Account' page ('Character' page removed) +- Demo: Moved user attributes to the `User Account` page (`Character` page removed) ### Removed - Demo: Battle pass prototype - Demo: Email confirmation window if confirmation disabled in project settings @@ -266,7 +266,7 @@ - Improved calculation of in-app browser size for VR projects - Other fixes and improvements ### Changed -- Updated 'ItemPurchase' method (added 'quantity' parameter) +- Updated `ItemPurchase` method (added `quantity` parameter) - Updated packages and dependencies - Improved social networks authentication for iOS builds @@ -312,7 +312,7 @@ - OAuth2.0 state parameter for more API methods - Pay Station UI settings for different build targets - Additional Pay Station UI color themes -- 'Create payment token' method +- `Create payment token` method - Xsolla assembly definitions ### Fixed - In-game browser scroll diff --git a/Assets/Xsolla/Catalog/XsollaCatalog.cs b/Assets/Xsolla/Catalog/XsollaCatalog.cs index f8ed01e95..d3616c488 100644 --- a/Assets/Xsolla/Catalog/XsollaCatalog.cs +++ b/Assets/Xsolla/Catalog/XsollaCatalog.cs @@ -8,10 +8,10 @@ public static class XsollaCatalog { private static string BaseUrl => $"https://store.xsolla.com/api/v2/project/{XsollaSettings.StoreProjectId}"; - /// //TEXTREVIEW - /// Returns a list of virtual items + /// + /// Returns a full list of virtual items. /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual items were successfully received. @@ -59,10 +59,10 @@ void handleResponse(StoreItems response) } } - /// //TEXTREVIEW + /// /// Returns a list of virtual items according to pagination settings. /// The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual items were successfully received. @@ -114,9 +114,9 @@ public static void GetCatalogSimplified(Action onSuccess, Actio ErrorGroup.ItemsListErrors); } - /// //TEXTREVIEW + /// /// Returns a list of items for the specified group. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Group external ID. @@ -166,9 +166,9 @@ void handleResponse(StoreItems response) } } - /// //TEXTREVIEW + /// /// Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Group external ID. @@ -205,7 +205,7 @@ public static void GetPaginatedGroupItems(string groupExternalId, ActionCalled after virtual item groups were successfully received. /// Called after the request resulted with an error. /// Defines localization of the item text fields.[Two-letter lowercase language code](https://developers.xsolla.com/doc/pay-station/features/localization/). Leave empty to use the default value. - /// Promo code. Unique case-sensitive code. Contains letters and numbers // TEXTREVIEW + /// Promo code. Unique case-sensitive code. Contains letters and numbers. public static void GetItemGroups(Action onSuccess, Action onError, string locale = null, string promoCode = null) { var url = new UrlBuilder($"{BaseUrl}/items/groups") @@ -221,7 +221,7 @@ public static void GetItemGroups(Action onSuccess, Action onError } /// - /// Returns a list of virtual currencies. //TEXTREVIEW + /// Returns a full list of virtual currencies. The list includes currencies for which display in the store is enabled in settings. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currencies were successfully received. @@ -270,7 +270,7 @@ void handleResponse(VirtualCurrencyItems response) } /// - /// Returns a list of virtual currencies according to pagination settings. //TEXTREVIEW + /// Returns a list of virtual currencies according to pagination settings. The list includes currencies for which display in the store is enabled in settings. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currencies were successfully received. @@ -299,9 +299,9 @@ public static void GetPaginatedVirtualCurrencyList(Action } /// - /// Returns a list of virtual currency packages. //TEXTREVIEW + /// Returns a list of full virtual currency packages. /// The list includes packages for which display in the store is enabled in the settings. - /// If used after user authentication, the method returns packages that match the personalization rules for the current user. + /// If called after user authentication, the method returns packages that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currency packages were successfully received. @@ -350,9 +350,9 @@ void handleResponse(VirtualCurrencyPackages response) } /// - /// Returns a list of virtual currency packages according to pagination settings. //TEXTREVIEW + /// Returns a list of virtual currency packages according to pagination settings. /// The list includes packages for which display in the store is enabled in the settings. - /// If used after user authentication, the method returns packages that match the personalization rules for the current user. + /// If called after user authentication, the method returns packages that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/). /// Called after virtual currency packages were successfully received. @@ -382,9 +382,9 @@ public static void GetPaginatedVirtualCurrencyPackagesList(Action - /// Returns a list of bundles. //TEXTREVIEW + /// Returns a full list of bundles. /// The list includes bundles for which display in the store is enabled in the settings. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/#unreal_engine_sdk_how_to_bundles). /// Called after bundles are successfully received. @@ -433,9 +433,9 @@ void handleResponse(BundleItems response) } /// - /// Returns a list of bundles according to pagination settings. //TEXTREVIEW + /// Returns a list of bundles according to pagination settings. /// The list includes bundles for which display in the store is enabled in the settings. - /// If used after user authentication, the method returns items that match the personalization rules for the current user. + /// If called after user authentication, the method returns items that match the personalization rules for the current user. /// /// [More about the use cases](https://developers.xsolla.com/sdk/unity/catalog/catalog-display/#unreal_engine_sdk_how_to_bundles). /// Called after bundles are successfully received. @@ -761,4 +761,4 @@ public static void GetCatalog(Action onSuccess, Action onErro ErrorGroup.ItemsListErrors); } } -} \ No newline at end of file +} diff --git a/Assets/Xsolla/Core/Entities/PurchaseParams.cs b/Assets/Xsolla/Core/Entities/PurchaseParams.cs index e6199e9cb..4d2f35bfb 100644 --- a/Assets/Xsolla/Core/Entities/PurchaseParams.cs +++ b/Assets/Xsolla/Core/Entities/PurchaseParams.cs @@ -55,10 +55,9 @@ public class PurchaseParams /// public bool? google_pay_quick_payment_button; - ///TEXTREVIEW /// /// Disables the `sdk` parameter in the `Payment` token. `false` by default. /// public bool disable_sdk_parameter; } -} \ No newline at end of file +} diff --git a/Assets/Xsolla/UserAccount/XsollaUserAccount.cs b/Assets/Xsolla/UserAccount/XsollaUserAccount.cs index b9420de25..86f7012f6 100644 --- a/Assets/Xsolla/UserAccount/XsollaUserAccount.cs +++ b/Assets/Xsolla/UserAccount/XsollaUserAccount.cs @@ -686,9 +686,8 @@ public static void LinkSocialProvider(SocialProvider providerName, Action TokenAutoRefresher.Check(error, onError, () => LinkSocialProvider(providerName, onSuccess, onError, redirectUri))); } - //TEXTREVIEW /// - /// Unlinks social network that can be used for authentication to the current account. + /// Unlinks social network that can be used for authentication from the current user account. /// /// Name of a social network. Provider must be connected to Login in Publisher Account.
/// Can be `amazon`, `apple`, `baidu`, `battlenet`, `discord`, `facebook`, `github`, `google`, `instagram`, `kakao`, `linkedin`, `mailru`, `microsoft`, `msn`, `naver`, `ok`, `paradox`, `paypal`, `psn`, `qq`, `reddit`, `steam`, `twitch`, `twitter`, `vimeo`, `vk`, `wechat`, `weibo`, `yahoo`, `yandex`, `youtube`, `xbox`, `playstation`. From 6eecdd4a9c801faf57cc373b259572eaa94dc9ad Mon Sep 17 00:00:00 2001 From: Denis Rakhimov Date: Fri, 13 Dec 2024 18:22:56 +0800 Subject: [PATCH 21/21] Return PackagesManager to DevTools --- Assets/DevTools/PackagesManager.cs | 161 ++++++++++++++++++++++++ Assets/DevTools/PackagesManager.cs.meta | 3 + 2 files changed, 164 insertions(+) create mode 100644 Assets/DevTools/PackagesManager.cs create mode 100644 Assets/DevTools/PackagesManager.cs.meta diff --git a/Assets/DevTools/PackagesManager.cs b/Assets/DevTools/PackagesManager.cs new file mode 100644 index 000000000..2f7363271 --- /dev/null +++ b/Assets/DevTools/PackagesManager.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using Xsolla.Core; + +namespace Xsolla.DevTools +{ + public static class PackagesManager + { + [MenuItem("Dev Tools/Export SDK package", false, 100)] + public static void ExportSdk() + { + var assetGuids = GetGuids("Assets/Xsolla"); + var packagePath = BuildPackagePath("xsolla-commerce-sdk"); + + var parameters = new object[] { + assetGuids, + packagePath + }; + + ExportPackage(parameters); + } + + [MenuItem("Dev Tools/Export DEMO package", false, 110)] + public static void ExportDemo() + { + ResetSdkSettings(); + + var sdkAssetGuids = GetGuids("Assets/Xsolla"); + var demoAssetGuids = GetGuids("Assets/Xsolla.Demo"); + var resourcesAssetGuids = GetGuids("Assets/Resources"); + + var assetGuids = sdkAssetGuids + .Concat(demoAssetGuids) + .Concat(resourcesAssetGuids) + .Distinct() + .ToArray(); + + var packagePath = BuildPackagePath("xsolla-commerce-demo"); + + var parameters = new object[] { + assetGuids, + packagePath + }; + + ExportPackage(parameters); + } + + [MenuItem("Dev Tools/Reset SDK Settings", false, 120)] + public static void ResetSdkSettings() + { + XsollaSettings.StoreProjectId = Constants.DEFAULT_PROJECT_ID; + XsollaSettings.LoginId = Constants.DEFAULT_LOGIN_ID; + XsollaSettings.OAuthClientId = Constants.DEFAULT_OAUTH_CLIENT_ID; + XsollaSettings.CallbackUrl = string.Empty; + XsollaSettingsEditor.SaveSettingsAsset(); + } + + private static string BuildPackagePath(string packageName) + { + var projectPath = Application.dataPath.Replace("Assets", string.Empty); + return Path.Combine(projectPath, $"{packageName}_v{PlayerSettings.bundleVersion}.unitypackage"); + } + + private static void ExportPackage(object[] parameters) + { + var methods = new List { + "UnityEditor.PackageUtility.ExportPackageAndPackageManagerManifest" + }; + + TryStaticInvoke(methods, parameters); + } + + #region from the unity asset store tools package + + private static string[] GetGuids(string rootPath) + { + var rootGuid = AssetDatabase.AssetPathToGUID(rootPath); + var guids = CollectAllChildren(rootGuid, Array.Empty()); + return BuildExportPackageAssetListGuids(guids, true); + } + + private static string[] BuildExportPackageAssetListGuids(string[] guids, bool dependencies) + { + var methodInfo = GetMethodInfo(new List { + "UnityEditor.PackageUtility.BuildExportPackageItemsList", + "UnityEditor.AssetServer.BuildExportPackageAssetListAssetsItems" + }, new[] { + typeof(string[]), + typeof(bool) + }); + + var parameters = new object[] { + guids, + dependencies + }; + + var objArray = (object[]) methodInfo.Invoke(null, parameters); + var strArray = new string[objArray.Length]; + + var field = methodInfo.ReturnType.GetElementType()?.GetField("guid"); + if (field == null) + throw new Exception(); + + for (var index = 0; index < objArray.Length; ++index) + { + var str = (string) field.GetValue(objArray[index]); + strArray[index] = str; + } + + return strArray; + } + + private static string[] CollectAllChildren(string guid, IEnumerable collection) + { + return (string[]) TryStaticInvoke(new List { + "UnityEditor.AssetDatabase.CollectAllChildren", + "UnityEditor.AssetServer.CollectAllChildren" + }, + new object[] { + guid, + collection + } + ); + } + + private static object TryStaticInvoke(List methods, object[] parameters) + { + return GetMethodInfo(methods).Invoke(null, parameters); + } + + private static MethodInfo GetMethodInfo(List methods, Type[] parametersType = null) + { + var methodInfo = (MethodInfo) null; + foreach (var method in methods) + { + var chArray = new[] { + '.' + }; + var strArray = method.Split(chArray); + var assembly = Assembly.Load(strArray[0]); + var name1 = $"{strArray[0]}.{strArray[1]}"; + var name2 = strArray[2]; + var type = assembly.GetType(name1); + if (type != null) + methodInfo = parametersType != null ? type.GetMethod(name2, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, parametersType, null) : type.GetMethod(name2, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + if (methodInfo != null) + break; + } + + return methodInfo != null ? methodInfo : throw new MissingMethodException(methods[0]); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/DevTools/PackagesManager.cs.meta b/Assets/DevTools/PackagesManager.cs.meta new file mode 100644 index 000000000..8a6799aef --- /dev/null +++ b/Assets/DevTools/PackagesManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6a9cbd2f9fe64343b01a5e7be9b23f75 +timeCreated: 1734085258 \ No newline at end of file