@3dsource/angular-unreal-module 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,7 @@ import { filter, withLatestFrom, distinctUntilChanged, first, catchError, map, t
|
|
|
4
4
|
import { createAction, props, createReducer, on, createFeature, Store, createSelector } from '@ngrx/store';
|
|
5
5
|
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
|
6
6
|
import { skip, share, merge, timer, of, Subject, combineLatest, switchMap, timeout, retryWhen, take, fromEvent, from, tap as tap$1, interval, startWith, combineLatestWith, takeUntil as takeUntil$1, auditTime, map as map$1, EMPTY, debounceTime as debounceTime$1, scan, Observable, BehaviorSubject, first as first$1, distinctUntilChanged as distinctUntilChanged$1, concat } from 'rxjs';
|
|
7
|
-
import { concatLatestFrom } from '@ngrx/operators';
|
|
7
|
+
import { concatLatestFrom, mapResponse } from '@ngrx/operators';
|
|
8
8
|
import { Falsy, Truthy, Logger, generateUuid, tapLog, COLOR_CODES, calculateMedian, clampf, Signal, where, KeyboardNumericCode, InvertedKeyMap, Semaphore, isEmpty, lerp, smoothTransition, getCanvasCached, getSnapshot, whereNot, HEXtoRGB, RGBtoHSV, inverseLerp, HSVtoRGB, RGBtoHEX, fpIsASameAsB, fitIntoRectangle } from '@3dsource/utils';
|
|
9
9
|
import { toSignal, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
10
10
|
import { HttpClient } from '@angular/common/http';
|
|
@@ -1953,7 +1953,7 @@ class AggregatorService extends SubService {
|
|
|
1953
1953
|
if (!deepEqual(json, previousJson)) {
|
|
1954
1954
|
if (json?.error) {
|
|
1955
1955
|
Logger.colored(...COLOR_CODES.FROM_UNREAL_ERROR, `${json.error}`, data);
|
|
1956
|
-
this.store.dispatch(showUnrealErrorMessage({ code: json.code }));
|
|
1956
|
+
this.store.dispatch(showUnrealErrorMessage({ code: json.code, error: json?.error }));
|
|
1957
1957
|
}
|
|
1958
1958
|
else {
|
|
1959
1959
|
this.showMessageFromUnreal(json);
|
|
@@ -3143,7 +3143,11 @@ class UnrealEffects {
|
|
|
3143
3143
|
});
|
|
3144
3144
|
this.sendLbmStat$ = this.store
|
|
3145
3145
|
.select(unrealFeature.selectViewportReady)
|
|
3146
|
-
.pipe(distinctUntilChanged(), filter(Truthy), exhaustMap(() => this.actions$.pipe(ofType(changeLowBandwidth), filter(({ lowBandwidth }) => lowBandwidth),
|
|
3146
|
+
.pipe(distinctUntilChanged(), filter(Truthy), exhaustMap(() => this.actions$.pipe(ofType(changeLowBandwidth), filter(({ lowBandwidth }) => lowBandwidth), concatLatestFrom(() => [
|
|
3147
|
+
this.store.select(unrealFeature.selectAwsInstance),
|
|
3148
|
+
this.store.select(unrealFeature.selectStreamClientCompanyId),
|
|
3149
|
+
this.store.select(unrealFeature.selectStreamViewId),
|
|
3150
|
+
]), first(), exhaustMap(([, instance, companyId, viewId]) => this.http
|
|
3147
3151
|
.post(this.unrealInitialConfig?.customErrorsEndpoint || '', {
|
|
3148
3152
|
message: {
|
|
3149
3153
|
type: 'front',
|
|
@@ -3211,6 +3215,44 @@ class UnrealEffects {
|
|
|
3211
3215
|
data: { content },
|
|
3212
3216
|
}).closed), map$1(() => showUnrealErrorMessage({ code: null })));
|
|
3213
3217
|
});
|
|
3218
|
+
this.sendStatisticsToUnreal$ = createEffect(() => {
|
|
3219
|
+
return this.actions$.pipe(ofType(showUnrealErrorMessage), filter(({ code }) => code === 404), concatLatestFrom(() => [
|
|
3220
|
+
this.store.select(unrealFeature.selectAwsInstance),
|
|
3221
|
+
this.store.select(unrealFeature.selectStreamClientCompanyId),
|
|
3222
|
+
this.store.select(unrealFeature.selectStreamViewId),
|
|
3223
|
+
]), switchMap(([action, instance, companyId, viewId]) => {
|
|
3224
|
+
console.log('this.unrealInitialConfig?.customErrorsEndpoint', this.unrealInitialConfig?.customErrorsEndpoint);
|
|
3225
|
+
console.log('data', {
|
|
3226
|
+
client: instance.pollingUrl,
|
|
3227
|
+
session_uuid: companyId,
|
|
3228
|
+
session_uuid2: viewId,
|
|
3229
|
+
message: {
|
|
3230
|
+
type: 'front',
|
|
3231
|
+
error: `pak_not_found::${action?.error ?? ''}`,
|
|
3232
|
+
signalling: instance.pollingUrl,
|
|
3233
|
+
},
|
|
3234
|
+
});
|
|
3235
|
+
return this.http
|
|
3236
|
+
.post(this.unrealInitialConfig?.customErrorsEndpoint || '', {
|
|
3237
|
+
client: instance.pollingUrl,
|
|
3238
|
+
session_uuid: companyId,
|
|
3239
|
+
session_uuid2: viewId,
|
|
3240
|
+
message: {
|
|
3241
|
+
type: 'front',
|
|
3242
|
+
error: `pak_not_found::${action?.error ?? ''}`,
|
|
3243
|
+
signalling: instance.pollingUrl,
|
|
3244
|
+
},
|
|
3245
|
+
})
|
|
3246
|
+
.pipe(mapResponse({
|
|
3247
|
+
next: () => {
|
|
3248
|
+
console.log('mapResponse next success');
|
|
3249
|
+
},
|
|
3250
|
+
error: () => {
|
|
3251
|
+
console.log('mapResponse next error');
|
|
3252
|
+
},
|
|
3253
|
+
}));
|
|
3254
|
+
}));
|
|
3255
|
+
}, { dispatch: false });
|
|
3214
3256
|
this.initAppBySetDataChannelConnected$ = createEffect(() => {
|
|
3215
3257
|
return this.actions$.pipe(ofType(setDataChannelConnected), tap(() => {
|
|
3216
3258
|
this.commandsSender.sendCommandToUnreal(getExecuteConsoleCommand({
|