Skip to content

Commit bc53c76

Browse files
authored
Merge pull request #218 from immutable/fix/game-bridget-status-response
[DX-2959] fix: throw an error if provider is not set
2 parents 1be2758 + 1e48c71 commit bc53c76

File tree

12 files changed

+286
-188
lines changed

12 files changed

+286
-188
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/**/*.meta
8989
src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle/**/*.meta
9090

9191
*.idea
92+
93+
# Code coverage
94+
sample/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json

sample/Assets/Scripts/AuthenticatedScript.cs

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public async void Connect()
101101
// Use existing credentials to connect to Passport
102102
ShowOutput("Connecting into Passport using saved credentials...");
103103
ConnectButton.gameObject.SetActive(false);
104-
bool connected = await passport.ConnectImx();
104+
bool connected = await passport.ConnectImx(useCachedSession: true);
105105
if (connected)
106106
{
107107
IsRegisteredOffchainButton.gameObject.SetActive(true);
@@ -186,39 +186,74 @@ public async void GetAddress()
186186

187187
public async void Logout()
188188
{
189-
ShowOutput("Logging out...");
189+
try
190+
{
191+
ShowOutput("Logging out...");
190192
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
191-
await passport.LogoutPKCE();
193+
await passport.LogoutPKCE();
192194
#else
193-
await passport.Logout();
195+
await passport.Logout();
194196
#endif
195-
SampleAppManager.IsConnected = false;
196-
passport.OnAuthEvent -= OnPassportAuthEvent;
197-
SceneManager.LoadScene(sceneName: "UnauthenticatedScene");
197+
SampleAppManager.IsConnected = false;
198+
passport.OnAuthEvent -= OnPassportAuthEvent;
199+
SceneManager.LoadScene(sceneName: "UnauthenticatedScene");
200+
}
201+
catch (Exception ex)
202+
{
203+
ShowOutput($"Failed to log out: {ex.Message}");
204+
}
198205
}
199206

200207
public async void GetAccessToken()
201208
{
202-
string accessToken = await passport.GetAccessToken();
203-
ShowOutput(accessToken ?? "No access token");
209+
try
210+
{
211+
string accessToken = await passport.GetAccessToken();
212+
ShowOutput(accessToken);
213+
}
214+
catch (Exception ex)
215+
{
216+
ShowOutput($"Failed to get ID token: {ex.Message}");
217+
}
204218
}
205219

206220
public async void GetIdToken()
207221
{
208-
string idToken = await passport.GetIdToken();
209-
ShowOutput(idToken ?? "No ID token");
222+
try
223+
{
224+
string idToken = await passport.GetIdToken();
225+
ShowOutput(idToken);
226+
}
227+
catch (Exception ex)
228+
{
229+
ShowOutput($"Failed to get ID token: {ex.Message}");
230+
}
210231
}
211232

212233
public async void GetEmail()
213234
{
214-
string email = await passport.GetEmail();
215-
ShowOutput(email ?? "No email");
235+
try
236+
{
237+
string email = await passport.GetEmail();
238+
ShowOutput(email);
239+
}
240+
catch (Exception ex)
241+
{
242+
ShowOutput($"Failed to get email: {ex.Message}");
243+
}
216244
}
217245

218246
public async void GetPassportId()
219247
{
220-
string passportId = await passport.GetPassportId();
221-
ShowOutput(passportId ?? "No Passport ID");
248+
try
249+
{
250+
string passportId = await passport.GetPassportId();
251+
ShowOutput(passportId);
252+
}
253+
catch (Exception ex)
254+
{
255+
ShowOutput($"Failed to get Passport ID: {ex.Message}");
256+
}
222257
}
223258

224259
public void ShowTransfer()

sample/Assets/Scripts/UnauthenticatedScript.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,14 @@ public async void Relogin()
130130
}
131131
else
132132
{
133-
ShowOutput($"Could not login using saved credentials");
134133
ClearStorageAndCache();
135-
134+
ShowOutput($"Could not login using saved credentials");
136135
}
137136
}
138137
catch (Exception ex)
139138
{
140-
ShowOutput($"Relogin() error: {ex.Message}");
141139
ClearStorageAndCache();
140+
ShowOutput($"Relogin() error: {ex.Message}");
142141
}
143142
}
144143

@@ -201,15 +200,14 @@ public async void Reconnect()
201200
}
202201
else
203202
{
204-
ShowOutput($"Could not connect using saved credentials");
205203
ClearStorageAndCache();
206-
204+
ShowOutput($"Could not connect using saved credentials");
207205
}
208206
}
209207
catch (Exception ex)
210208
{
211-
ShowOutput($"Reconnect() error: {ex.Message}");
212209
ClearStorageAndCache();
210+
ShowOutput($"Reconnect() error: {ex.Message}");
213211
}
214212
}
215213

sample/Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
]
5050
}
5151
]
52-
}
52+
}

sample/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

sample/ProjectSettings/ProjectSettings.asset

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--- !u!129 &1
44
PlayerSettings:
55
m_ObjectHideFlags: 0
6-
serializedVersion: 26
6+
serializedVersion: 24
77
productGUID: 23782f6f9e1e0cd4fab77e7d94090ba2
88
AndroidProfiler: 0
99
AndroidFilterTouchesWhenObscured: 0
@@ -48,16 +48,14 @@ PlayerSettings:
4848
defaultScreenHeightWeb: 600
4949
m_StereoRenderingPath: 0
5050
m_ActiveColorSpace: 0
51-
unsupportedMSAAFallback: 0
52-
m_SpriteBatchVertexThreshold: 300
5351
m_MTRendering: 1
5452
mipStripping: 0
5553
numberOfMipsStripped: 0
56-
numberOfMipsStrippedPerMipmapLimitGroup: {}
5754
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
5855
iosShowActivityIndicatorOnLoading: -1
5956
androidShowActivityIndicatorOnLoading: -1
6057
iosUseCustomAppBackgroundBehavior: 0
58+
iosAllowHTTPDownload: 1
6159
allowedAutorotateToPortrait: 1
6260
allowedAutorotateToPortraitUpsideDown: 1
6361
allowedAutorotateToLandscapeRight: 1
@@ -76,7 +74,6 @@ PlayerSettings:
7674
androidMinimumWindowWidth: 400
7775
androidMinimumWindowHeight: 300
7876
androidFullscreenMode: 1
79-
androidAutoRotationBehavior: 1
8077
defaultIsNativeResolution: 1
8178
macRetinaSupport: 0
8279
runInBackground: 0
@@ -88,7 +85,6 @@ PlayerSettings:
8885
hideHomeButton: 0
8986
submitAnalytics: 1
9087
usePlayerLog: 1
91-
dedicatedServerOptimizations: 0
9288
bakeCollisionMeshes: 0
9389
forceSingleInstance: 0
9490
useFlipModelSwapchain: 1
@@ -123,20 +119,21 @@ PlayerSettings:
123119
switchNVNShaderPoolsGranularity: 33554432
124120
switchNVNDefaultPoolsGranularity: 16777216
125121
switchNVNOtherPoolsGranularity: 16777216
126-
switchGpuScratchPoolGranularity: 2097152
127-
switchAllowGpuScratchShrinking: 0
128122
switchNVNMaxPublicTextureIDCount: 0
129123
switchNVNMaxPublicSamplerIDCount: 0
130-
switchNVNGraphicsFirmwareMemory: 32
131-
switchMaxWorkerMultiple: 8
132124
stadiaPresentMode: 0
133125
stadiaTargetFramerate: 0
134126
vulkanNumSwapchainBuffers: 3
135127
vulkanEnableSetSRGBWrite: 0
136128
vulkanEnablePreTransform: 0
137129
vulkanEnableLateAcquireNextImage: 0
138130
vulkanEnableCommandBufferRecycling: 1
139-
loadStoreDebugModeEnabled: 0
131+
m_SupportedAspectRatios:
132+
4:3: 1
133+
5:4: 1
134+
16:10: 1
135+
16:9: 1
136+
Others: 1
140137
bundleVersion: 1.0
141138
preloadedAssets: []
142139
metroInputSource: 0
@@ -149,9 +146,8 @@ PlayerSettings:
149146
isWsaHolographicRemotingEnabled: 0
150147
enableFrameTimingStats: 0
151148
enableOpenGLProfilerGPURecorders: 1
152-
allowHDRDisplaySupport: 0
153149
useHDRDisplay: 0
154-
hdrBitDepth: 0
150+
D3DHDRBitDepth: 0
155151
m_ColorGamuts: 00000000
156152
targetPixelDensity: 30
157153
resolutionScalingMode: 0
@@ -180,15 +176,12 @@ PlayerSettings:
180176
APKExpansionFiles: 0
181177
keepLoadedShadersAlive: 0
182178
StripUnusedMeshComponents: 0
183-
strictShaderVariantMatching: 0
184179
VertexChannelCompressionMask: 4054
185180
iPhoneSdkVersion: 988
186181
iOSTargetOSVersionString: 13.0
187182
tvOSSdkVersion: 0
188183
tvOSRequireExtendedGameController: 0
189184
tvOSTargetOSVersionString: 12.0
190-
VisionOSSdkVersion: 0
191-
VisionOSTargetOSVersionString: 1.0
192185
uIPrerenderedIcon: 0
193186
uIRequiresPersistentWiFi: 0
194187
uIRequiresFullScreen: 1
@@ -237,10 +230,8 @@ PlayerSettings:
237230
appleDeveloperTeamID:
238231
iOSManualSigningProvisioningProfileID:
239232
tvOSManualSigningProvisioningProfileID:
240-
VisionOSManualSigningProvisioningProfileID:
241233
iOSManualSigningProvisioningProfileType: 0
242234
tvOSManualSigningProvisioningProfileType: 0
243-
VisionOSManualSigningProvisioningProfileType: 0
244235
appleEnableAutomaticSigning: 0
245236
iOSRequireARKit: 0
246237
iOSAutomaticallyDetectAndAddCapabilities: 1
@@ -255,15 +246,13 @@ PlayerSettings:
255246
useCustomLauncherGradleManifest: 0
256247
useCustomBaseGradleTemplate: 0
257248
useCustomGradlePropertiesTemplate: 0
258-
useCustomGradleSettingsTemplate: 0
259249
useCustomProguardFile: 1
260250
AndroidTargetArchitectures: 2
261251
AndroidTargetDevices: 0
262252
AndroidSplashScreenScale: 0
263253
androidSplashScreen: {fileID: 0}
264254
AndroidKeystoreName:
265255
AndroidKeyaliasName:
266-
AndroidEnableArmv9SecurityFeatures: 0
267256
AndroidBuildApkPerCpuArchitecture: 0
268257
AndroidTVCompatibility: 0
269258
AndroidIsGame: 1
@@ -277,6 +266,7 @@ PlayerSettings:
277266
banner: {fileID: 0}
278267
androidGamepadSupportLevel: 0
279268
chromeosInputEmulation: 1
269+
AndroidMinifyWithR8: 0
280270
AndroidMinifyRelease: 0
281271
AndroidMinifyDebug: 0
282272
AndroidValidateAppBundleSize: 1
@@ -521,9 +511,7 @@ PlayerSettings:
521511
iPhone: 1
522512
tvOS: 1
523513
m_BuildTargetGroupLightmapEncodingQuality: []
524-
m_BuildTargetGroupHDRCubemapEncodingQuality: []
525514
m_BuildTargetGroupLightmapSettings: []
526-
m_BuildTargetGroupLoadStoreDebugModeSettings: []
527515
m_BuildTargetNormalMapEncoding: []
528516
m_BuildTargetDefaultTextureCompressionFormat:
529517
- m_BuildTarget: Android
@@ -538,19 +526,17 @@ PlayerSettings:
538526
locationUsageDescription:
539527
microphoneUsageDescription:
540528
bluetoothUsageDescription:
541-
macOSTargetOSVersion: 10.13.0
542529
switchNMETAOverride:
543530
switchNetLibKey:
544531
switchSocketMemoryPoolSize: 6144
545532
switchSocketAllocatorPoolSize: 128
546533
switchSocketConcurrencyLimit: 14
547534
switchScreenResolutionBehavior: 2
548535
switchUseCPUProfiler: 0
549-
switchEnableFileSystemTrace: 0
536+
switchUseGOLDLinker: 0
550537
switchLTOSetting: 0
551538
switchApplicationID: 0x01004b9000490000
552539
switchNSODependencies:
553-
switchCompilerFlags:
554540
switchTitleNames_0:
555541
switchTitleNames_1:
556542
switchTitleNames_2:
@@ -676,6 +662,7 @@ PlayerSettings:
676662
switchSocketBufferEfficiency: 4
677663
switchSocketInitializeEnabled: 1
678664
switchNetworkInterfaceManagerInitializeEnabled: 1
665+
switchPlayerConnectionEnabled: 1
679666
switchUseNewStyleFilepaths: 0
680667
switchUseLegacyFmodPriorities: 1
681668
switchUseMicroSleepForYield: 1
@@ -765,7 +752,6 @@ PlayerSettings:
765752
webGLMemorySize: 32
766753
webGLExceptionSupport: 1
767754
webGLNameFilesAsHashes: 0
768-
webGLShowDiagnostics: 0
769755
webGLDataCaching: 1
770756
webGLDebugSymbols: 0
771757
webGLEmscriptenArgs:
@@ -778,12 +764,6 @@ PlayerSettings:
778764
webGLLinkerTarget: 1
779765
webGLThreadsSupport: 0
780766
webGLDecompressionFallback: 0
781-
webGLInitialMemorySize: 32
782-
webGLMaximumMemorySize: 2048
783-
webGLMemoryGrowthMode: 2
784-
webGLMemoryLinearGrowthStep: 16
785-
webGLMemoryGeometricGrowthStep: 0.2
786-
webGLMemoryGeometricGrowthCap: 96
787767
webGLPowerPreference: 2
788768
scriptingDefineSymbols: {}
789769
additionalCompilerArguments:
@@ -794,7 +774,6 @@ PlayerSettings:
794774
Android: 1
795775
Standalone: 0
796776
il2cppCompilerConfiguration: {}
797-
il2cppCodeGeneration: {}
798777
managedStrippingLevel:
799778
EmbeddedLinux: 1
800779
GameCoreScarlett: 1
@@ -813,9 +792,12 @@ PlayerSettings:
813792
suppressCommonWarnings: 1
814793
allowUnsafeCode: 0
815794
useDeterministicCompilation: 1
795+
enableRoslynAnalyzers: 1
796+
selectedPlatform: 0
816797
additionalIl2CppArgs:
817798
scriptingRuntimeVersion: 1
818799
gcIncremental: 1
800+
assemblyVersionValidation: 1
819801
gcWBarrierValidation: 0
820802
apiCompatibilityLevelPerPlatform: {}
821803
m_RenderingPath: 1
@@ -887,11 +869,6 @@ PlayerSettings:
887869
luminVersion:
888870
m_VersionCode: 1
889871
m_VersionName:
890-
hmiPlayerDataPath:
891-
hmiForceSRGBBlit: 1
892-
embeddedLinuxEnableGamepadInput: 1
893-
hmiLogStartupTiming: 0
894-
hmiCpuConfiguration:
895872
apiCompatibilityLevel: 6
896873
activeInputHandler: 0
897874
windowsGamepadBackendHint: 0
@@ -902,7 +879,6 @@ PlayerSettings:
902879
organizationId:
903880
cloudEnabled: 0
904881
legacyClampBlendShapeWeights: 0
905-
hmiLoadingImage: {fileID: 0}
906-
platformRequiresReadableAssets: 0
882+
playerDataPath:
883+
forceSRGBBlit: 1
907884
virtualTexturingSupportEnabled: 0
908-
insecureHttpOption: 0

0 commit comments

Comments
 (0)