add bgs and rooms stuff

This commit is contained in:
not-nullptr 2024-03-16 21:26:27 +00:00
parent 188e38c6ec
commit 7ad700c83d
11 changed files with 100 additions and 64 deletions

View file

@ -1,4 +1,5 @@
import type { IRoom, IRoomConfig, RoomPlayer } from "$types/rooms";
import { globalData, type SwitchGame } from "../other";
import type { SuyuUser } from "../schema";
import { v4 } from "uuid";
@ -52,6 +53,9 @@ export class Room {
netVersion: 1,
owner: this.host.username,
port: parseInt(parsed[1]),
game: globalData.games.find(
(g) => g.name.toUpperCase().trim() === config.gameName.toUpperCase().trim(),
),
};
}

View file

@ -1,14 +1,14 @@
interface SwitchGame {
export interface SwitchGame {
bannerUrl: string;
category: string[];
description: string;
developer: null;
frontBoxArt: null;
// developer: null;
// frontBoxArt: null;
iconUrl: string;
id: string;
intro: null | string;
isDemo: boolean;
key: null;
// key: null;
languages: string[];
name: string;
nsuId: number;
@ -16,12 +16,12 @@ interface SwitchGame {
publisher: string;
rating: number;
ratingContent: string[];
region: null;
// region: null;
releaseDate: number;
rightsId: string;
screenshots: string[];
size: number;
version: null;
// version: null;
}
export const globalData: {
games: SwitchGame[];