feat: Add game activity status (Experimental)
All checks were successful
Queue Release Build / prepare (push) Successful in 23s
Deploy Web Apps / deploy (push) Successful in 5m54s
Queue Release Build / build-windows (push) Successful in 16m19s
Queue Release Build / build-linux (push) Successful in 30m13s
Queue Release Build / finalize (push) Successful in 47s

This commit is contained in:
2026-04-27 05:46:33 +02:00
parent 3858beb28e
commit 53389ed3ad
50 changed files with 2007 additions and 104 deletions

View File

@@ -8,7 +8,11 @@ import {
of,
throwError
} from 'rxjs';
import { catchError, map, scan } from 'rxjs/operators';
import {
catchError,
map,
scan
} from 'rxjs/operators';
import {
ChannelPermissionOverride,
type Channel,
@@ -32,6 +36,19 @@ import type {
} from '../../domain/models/server-directory.model';
import type { RoomSignalSourceInput } from '../../domain/logic/room-signal-source.logic';
interface ServerLookupError {
status?: number;
error?: {
errorCode?: unknown;
};
}
function isServerNotFoundError(error: unknown): boolean {
const lookupError = error as ServerLookupError;
return lookupError?.status === 404 && lookupError.error?.errorCode === 'SERVER_NOT_FOUND';
}
@Injectable({ providedIn: 'root' })
export class ServerDirectoryApiService {
private readonly http = inject(HttpClient);
@@ -90,6 +107,10 @@ export class ServerDirectoryApiService {
return this.http.get<ServerInfo>(`${this.getApiBaseUrl(selector)}/servers/${serverId}`).pipe(
map((server) => this.normalizeServerInfo(server, this.resolveEndpoint(selector))),
catchError((error) => {
if (isServerNotFoundError(error)) {
return of(null);
}
console.error('Failed to get server:', error);
return of(null);
})