@@ -37,11 +37,11 @@ CesiumIonSession::CesiumIonSession(
37
37
, _loadTokensQueued(false )
38
38
, _authorizeUrl()
39
39
, _ionServerUrl(std::move(ionServerUrl))
40
- /* , _ionApiUrl(std::move(ionApiUrl)) */
41
- , _ionApplicationId(ionApplicationId) {}
40
+ , _ionApiUrl(std::move(ionApiUrl))
41
+ , _ionApplicationId(ionApplicationId) {
42
+ }
42
43
43
44
void CesiumIonSession::connect () {
44
-
45
45
if (this ->isConnecting () || this ->isConnected () || this ->isResuming ()) {
46
46
return ;
47
47
}
@@ -86,7 +86,7 @@ void CesiumIonSession::connect() {
86
86
this ->_authorizeUrl = url;
87
87
},
88
88
this ->_appData .value (),
89
- _ionServerUrl ,
89
+ _ionApiUrl ,
90
90
CesiumUtility::Uri::resolve (_ionServerUrl, " oauth" ));
91
91
}
92
92
@@ -97,9 +97,6 @@ void CesiumIonSession::connect() {
97
97
this ->_isConnecting = false ;
98
98
this ->_connection = std::move (connection);
99
99
100
- // TODO: how to update filed in OmniIonServer?
101
- // CesiumForUnity::CesiumIonServer server = session.server();
102
-
103
100
Settings::AccessToken token;
104
101
token.ionApiUrl = _ionApiUrl;
105
102
token.accessToken = this ->_connection .value ().getAccessToken ();
@@ -142,8 +139,6 @@ void CesiumIonSession::resume() {
142
139
143
140
this ->_isResuming = true ;
144
141
145
- this ->_connection .reset (); // DEBUG
146
-
147
142
// Verify that the connection actually works.
148
143
this ->ensureAppDataLoaded ()
149
144
.thenInMainThread ([this , accessToken](bool loadedAppData) {
@@ -346,26 +341,20 @@ CesiumAsync::Future<bool> CesiumIonSession::ensureAppDataLoaded() {
346
341
return CesiumIonClient::Connection::appData (
347
342
this ->_asyncSystem ,
348
343
this ->_pAssetAccessor ,
349
- this ->_ionApiUrl ) // .ToStlString()?
344
+ this ->_ionApiUrl )
350
345
.thenInMainThread ([this ](CesiumIonClient::Response<CesiumIonClient::ApplicationData>&& applicationData) {
351
346
CesiumAsync::Promise<bool > promise = this ->_asyncSystem .createPromise <bool >();
352
347
353
348
this ->_appData = applicationData.value ;
354
349
if (!applicationData.value .has_value ()) {
355
- // UnityEngine::Debug::LogError(System::String(fmt::format(
356
- // "Failed to obtain ion server application data: {}",
357
- // applicationData.errorMessage)));
358
350
promise.resolve (false );
359
351
} else {
360
352
promise.resolve (true );
361
353
}
362
354
363
355
return promise.getFuture ();
364
356
})
365
- .catchInMainThread ([this ](std::exception && e) {
366
- // logResponseErrors(e);
367
- (void )e; // get around unused formal parameter error
368
-
357
+ .catchInMainThread ([this ]([[maybe_unused]]std::exception && e) {
369
358
return this ->_asyncSystem .createResolvedFuture (false );
370
359
});
371
360
}
0 commit comments