From fff113ccf4477d97eda9808cbe1086511bd8760d Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Thu, 12 Oct 2023 19:39:42 +0800 Subject: [PATCH] fix bugs --- .../Web3AuthSDK/Samples/Web3AuthSample.cs | 4 +- .../Web3AuthSDK/Samples/Web3AuthSample.unity | 6 +- .../Plugins/Web3AuthSDK/Types/MfaSetting.cs | 8 +-- .../Web3AuthSDK/Types/MfaSetting.cs.meta | 11 ++++ .../Plugins/Web3AuthSDK/Types/MfaSettings.cs | 8 +-- .../Web3AuthSDK/Types/MfaSettings.cs.meta | 11 ++++ .../Web3AuthSDK/Types/Web3AuthOptions.cs | 1 + .../Web3AuthSDK/Types/WhiteLabelData.cs | 3 +- Assets/Plugins/Web3AuthSDK/Web3Auth.cs | 64 +++++++++++-------- Packages/manifest.json | 10 +-- Packages/packages-lock.json | 10 +-- ProjectSettings/ProjectSettings.asset | 19 ++++-- ProjectSettings/ProjectVersion.txt | 4 +- 13 files changed, 98 insertions(+), 61 deletions(-) create mode 100644 Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs.meta create mode 100644 Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs.meta diff --git a/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.cs b/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.cs index 0d3a2d5..00539df 100644 --- a/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.cs +++ b/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.cs @@ -72,10 +72,10 @@ void Start() {"CUSTOM_VERIFIER", loginConfigItem} } */ - clientId = "BG4pe3aBso5SjVbpotFQGnXVHgxhgOxnqnNBKyjfEJ3izFvIVWUaMIzoCrAfYag8O6t6a6AOvdLcS4JR2sQMjR4", + clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", buildEnv = BuildEnv.PRODUCTION, redirectUrl = new Uri("torusapp://com.torus.Web3AuthUnity/auth"), - network = Web3Auth.Network.SAPPHIRE_DEVNET + network = Web3Auth.Network.SAPPHIRE_MAINNET }); web3Auth.onLogin += onLogin; web3Auth.onLogout += onLogout; diff --git a/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.unity b/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.unity index fd56440..f68e520 100644 --- a/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.unity +++ b/Assets/Plugins/Web3AuthSDK/Samples/Web3AuthSample.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481676, a: 1} + m_IndirectSpecularColor: {r: 0.4439372, g: 0.49315345, b: 0.5721989, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -896,9 +896,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3eab2a0bf902d6e4b9c2e968ad89f528, type: 3} m_Name: m_EditorClassIdentifier: - clientId: BG4pe3aBso5SjVbpotFQGnXVHgxhgOxnqnNBKyjfEJ3izFvIVWUaMIzoCrAfYag8O6t6a6AOvdLcS4JR2sQMjR4 + clientId: BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ redirectUri: torusapp://com.torus.Web3AuthUnity/auth - network: 1 + network: 5 --- !u!1 &529774071 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs b/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs index 0f1add4..f004a28 100644 --- a/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs +++ b/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; - +#nullable enable public class MfaSetting { public bool enable { get; set; } @@ -9,8 +9,8 @@ public class MfaSetting // Constructor public MfaSetting(bool enable, int? priority, bool? mandatory) { - enable = enable; - priority = priority; - mandatory = mandatory; + this.enable = enable; + this.priority = priority; + this.mandatory = mandatory; } } \ No newline at end of file diff --git a/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs.meta b/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs.meta new file mode 100644 index 0000000..b7bedfc --- /dev/null +++ b/Assets/Plugins/Web3AuthSDK/Types/MfaSetting.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c18c9f2d6c614e168f82ef75dc0ed8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs b/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs index 19e42df..7c6145d 100644 --- a/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs +++ b/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs @@ -36,9 +36,9 @@ public MfaSettings( MfaSetting socialBackupFactor = null, MfaSetting passwordFactor = null) { - deviceShareFactor = deviceShareFactor; - backUpShareFactor = backUpShareFactor; - socialBackupFactor = socialBackupFactor; - passwordFactor = passwordFactor; + this.deviceShareFactor = deviceShareFactor; + this.backUpShareFactor = backUpShareFactor; + this.socialBackupFactor = socialBackupFactor; + this.passwordFactor = passwordFactor; } } \ No newline at end of file diff --git a/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs.meta b/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs.meta new file mode 100644 index 0000000..a65d588 --- /dev/null +++ b/Assets/Plugins/Web3AuthSDK/Types/MfaSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84c44fcb449df4b2db451e85439e068d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs b/Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs index 1cd6be6..2ed4dfc 100644 --- a/Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs +++ b/Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +#nullable enable public class Web3AuthOptions { public string clientId { get; set; } diff --git a/Assets/Plugins/Web3AuthSDK/Types/WhiteLabelData.cs b/Assets/Plugins/Web3AuthSDK/Types/WhiteLabelData.cs index c9cf47f..8d11ef1 100644 --- a/Assets/Plugins/Web3AuthSDK/Types/WhiteLabelData.cs +++ b/Assets/Plugins/Web3AuthSDK/Types/WhiteLabelData.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; -using Newtonsoft.Json; - +#nullable enable public class WhiteLabelData { public string? appName { get; set; } public string? logoLight { get; set; } diff --git a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs index dba4939..a948a4b 100644 --- a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs +++ b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs @@ -23,7 +23,7 @@ public enum ChainNamespace EIP155, SOLANA } - public enum BuildEnv + public enum BuildEnv { PRODUCTION, STAGING, TESTING } @@ -246,7 +246,7 @@ private async void request(string path, LoginParams loginParams = null, Dictiona this.initParams["redirectUrl"] = Utils.GetCurrentURL(); #endif - loginParams.redirectUrl = new Uri(StartLocalWebserver()); + loginParams.redirectUrl = loginParams.redirectUrl ?? new Uri(this.initParams["redirectUrl"].ToString()); Dictionary paramMap = new Dictionary(); paramMap["options"] = this.initParams; paramMap["params"] = loginParams == null ? (object)new Dictionary() : (object)loginParams; @@ -258,30 +258,33 @@ private async void request(string path, LoginParams loginParams = null, Dictiona (paramMap["params"] as Dictionary)[item.Key] = item.Value; } - string loginId = await createSession(JsonConvert.SerializeObject(paramMap, Newtonsoft.Json.Formatting.None, + string loginId = await createSession(JsonConvert.SerializeObject(paramMap, Formatting.None, new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore - }), 600); + { + NullValueHandling = NullValueHandling.Ignore + }), 600); - if(!string.IsNullOrEmpty(loginId)) { + if (!string.IsNullOrEmpty(loginId)) + { var loginIdObject = new Dictionary { { "loginId", loginId } }; - string hash = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(loginIdObject, Newtonsoft.Json.Formatting.None, - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore - }))); - - UriBuilder uriBuilder = new UriBuilder(this.web3AuthOptions.sdkUrl); - uriBuilder.Path = path; - uriBuilder.Fragment = "b64Params=" + hash; - - Utils.LaunchUrl(uriBuilder.ToString(), this.initParams["redirectUrl"].ToString(), gameObject.name); - } else { - throw new Exception("Some went wrong. Please try again later."); + string hash = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(loginIdObject, Formatting.None, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore + }))); + + UriBuilder uriBuilder = new UriBuilder(this.web3AuthOptions.sdkUrl); + uriBuilder.Path = path; + uriBuilder.Fragment = "b64Params=" + hash; + + Utils.LaunchUrl(uriBuilder.ToString(), this.initParams["redirectUrl"].ToString(), gameObject.name); + } + else + { + throw new Exception("Some went wrong. Please try again later."); } } @@ -353,10 +356,13 @@ public void logout(Uri redirectUrl = null, string appState = null) private void authorizeSession(string newSessionId) { string sessionId = ""; - if(string.IsNullOrEmpty(newSessionId)) { - sessionId = KeyStoreManagerUtils.getPreferencesData(KeyStoreManagerUtils.SESSION_ID); - } else { - sessionId = newSessionId; + if (string.IsNullOrEmpty(newSessionId)) + { + sessionId = KeyStoreManagerUtils.getPreferencesData(KeyStoreManagerUtils.SESSION_ID); + } + else + { + sessionId = newSessionId; } if (!string.IsNullOrEmpty(sessionId)) @@ -386,7 +392,8 @@ private void authorizeSession(string newSessionId) throw new UnKnownException(this.web3AuthResponse.error ?? "Something went wrong"); } - if (!string.IsNullOrEmpty(this.web3AuthResponse.sessionId)) { + if (!string.IsNullOrEmpty(this.web3AuthResponse.sessionId)) + { KeyStoreManagerUtils.savePreferenceData(KeyStoreManagerUtils.SESSION_ID, this.web3AuthResponse.sessionId); } @@ -469,7 +476,8 @@ private void sessionTimeOutAPI() } } - private async Task createSession(string data, long sessionTime) { + private async Task createSession(string data, long sessionTime) + { TaskCompletionSource createSessionResponse = new TaskCompletionSource(); var newSessionKey = KeyStoreManagerUtils.generateRandomSessionKey(); var ephemKey = KeyStoreManagerUtils.getPubKey(newSessionKey); @@ -514,7 +522,9 @@ private async Task createSession(string data, long sessionTime) { createSessionResponse.SetException(new Exception("Something went wrong. Please try again later.")); Debug.LogError(ex.Message); } - } else { + } + else + { createSessionResponse.SetException(new Exception("Something went wrong. Please try again later.")); } } diff --git a/Packages/manifest.json b/Packages/manifest.json index 6c47117..64c7fbc 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,14 +1,14 @@ { "dependencies": { - "com.unity.ai.navigation": "1.1.4", - "com.unity.collab-proxy": "2.0.5", - "com.unity.ide.rider": "3.0.24", - "com.unity.ide.visualstudio": "2.0.18", + "com.unity.ai.navigation": "1.1.5", + "com.unity.collab-proxy": "2.1.0", + "com.unity.ide.rider": "3.0.25", + "com.unity.ide.visualstudio": "2.0.21", "com.unity.ide.vscode": "1.2.5", "com.unity.nuget.newtonsoft-json": "3.2.1", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.7.4", + "com.unity.timeline": "1.7.5", "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 8702dd3..f66e117 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,7 +1,7 @@ { "dependencies": { "com.unity.ai.navigation": { - "version": "1.1.4", + "version": "1.1.5", "depth": 0, "source": "registry", "dependencies": { @@ -10,7 +10,7 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "2.0.5", + "version": "2.1.0", "depth": 0, "source": "registry", "dependencies": {}, @@ -24,7 +24,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.24", + "version": "3.0.25", "depth": 0, "source": "registry", "dependencies": { @@ -33,7 +33,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.18", + "version": "2.0.21", "depth": 0, "source": "registry", "dependencies": { @@ -76,7 +76,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.7.4", + "version": "1.7.5", "depth": 0, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index f48f981..f9f5566 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -86,6 +86,7 @@ PlayerSettings: hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 + dedicatedServerOptimizations: 0 bakeCollisionMeshes: 0 forceSingleInstance: 0 useFlipModelSwapchain: 1 @@ -125,6 +126,7 @@ PlayerSettings: switchNVNMaxPublicTextureIDCount: 0 switchNVNMaxPublicSamplerIDCount: 0 switchNVNGraphicsFirmwareMemory: 32 + switchMaxWorkerMultiple: 8 stadiaPresentMode: 0 stadiaTargetFramerate: 0 vulkanNumSwapchainBuffers: 3 @@ -145,6 +147,7 @@ PlayerSettings: isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 useHDRDisplay: 0 hdrBitDepth: 0 m_ColorGamuts: 00000000 @@ -160,6 +163,7 @@ PlayerSettings: buildNumber: Bratwurst: 0 Standalone: 0 + VisionOS: 0 iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 1 @@ -184,8 +188,8 @@ PlayerSettings: tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 tvOSTargetOSVersionString: 12.0 - bratwurstSdkVersion: 0 - bratwurstTargetOSVersionString: 16.4 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -234,11 +238,11 @@ PlayerSettings: appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: - bratwurstManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 - bratwurstManualSigningProvisioningProfileType: 0 - appleEnableAutomaticSigning: 0 + VisionOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 1 iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 @@ -515,6 +519,7 @@ PlayerSettings: switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 switchUseGOLDLinker: 0 switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 @@ -645,7 +650,6 @@ PlayerSettings: switchSocketBufferEfficiency: 4 switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 switchUseNewStyleFilepaths: 1 switchUseLegacyFmodPriorities: 0 switchUseMicroSleepForYield: 1 @@ -756,7 +760,8 @@ PlayerSettings: webGLMemoryGeometricGrowthCap: 96 webGLPowerPreference: 2 scriptingDefineSymbols: {} - additionalCompilerArguments: {} + additionalCompilerArguments: + iPhone: [] platformArchitecture: {} scriptingBackend: Android: 1 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index e7e2f19..37f39b7 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.3.4f1 -m_EditorVersionWithRevision: 2022.3.4f1 (35713cd46cd7) +m_EditorVersion: 2022.3.11f1 +m_EditorVersionWithRevision: 2022.3.11f1 (d00248457e15)