Basic live service:
- Matchmaking
- Instance
- Presence (albeit empty atm)
Authentication fixes; differentiate between user and profile
Default auth timeout is now 3 hours
Add "operators" database key ("all users with operator permissions", or "developer" role set in token), add check in `Profile`
Fix default profile image filename reference when not set
account/me
Log hile reporting, do stuff with the report later ("Server" user for commands, operators can check reports)
Refresh login done by client automatically when token expires, requires extra work
This commit is contained in:
89
src/data/live/instances.ts
Normal file
89
src/data/live/instances.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import Profile from "../profiles.ts";
|
||||
|
||||
enum IntegratedRoomScene {
|
||||
Calibration = "f5fbd9c9-e853-4036-9d48-5f68e861af04",
|
||||
DormRoom = "76d98498-60a1-430c-ab76-b54a29b7a163",
|
||||
RecCenter = "cbad71af-0831-44d8-b8ef-69edafa841f6",
|
||||
ThreeDCharades = "4078dfed-24bb-4db7-863f-578ba48d726b",
|
||||
DiscGolfLake = "f6f7256c-e438-4299-b99e-d20bef8cf7e0",
|
||||
DiscGolfPropulsion = "d9378c9f-80bc-46fb-ad1e-1bed8a674f55",
|
||||
Dodgeball = "3d474b26-26f7-45e9-9a36-9b02847d5e6f",
|
||||
Paddleball = "d89f74fa-d51e-477a-a425-025a891dd499",
|
||||
Paintball_River = "e122fe98-e7db-49e8-a1b1-105424b6e1f0",
|
||||
Paintball_Homestead = "a785267d-c579-42ea-be43-fec1992d1ca7",
|
||||
Paintball_Quarry = "ff4c6427-7079-4f59-b22a-69b089420827",
|
||||
Paintball_Clearcut = "380d18b5-de9c-49f3-80f7-f4a95c1de161",
|
||||
Paintball_Spillway = "58763055-2dfb-4814-80b8-16fac5c85709",
|
||||
PaintballVR_River = "e122fe98-e7db-49e8-a1b1-105424b6e1f0",
|
||||
PaintballVR_Homestead = "a785267d-c579-42ea-be43-fec1992d1ca7",
|
||||
PaintballVR_Quarry = "ff4c6427-7079-4f59-b22a-69b089420827",
|
||||
PaintballVR_Clearcut = "380d18b5-de9c-49f3-80f7-f4a95c1de161",
|
||||
PaintballVR_Spillway = "58763055-2dfb-4814-80b8-16fac5c85709",
|
||||
GoldenTrophy = "91e16e35-f48f-4700-ab8a-a1b79e50e51b",
|
||||
TheRiseofJumbotron = "acc06e66-c2d0-4361-b0cd-46246a4c455c",
|
||||
CrimsonCauldron = "949fa41f-4347-45c0-b7ac-489129174045",
|
||||
IsleOfLostSkulls = "7e01cfe0-820a-406f-b1b3-0a5bf575235c",
|
||||
Soccer = "6d5eea4b-f069-4ed0-9916-0e2f07df0d03",
|
||||
LaserTagHangar = "239e676c-f12f-489f-bf3a-d4c383d692c3",
|
||||
LaserTagCyberJunk = "9d6456ce-6264-48b4-808d-2d96b3d91038",
|
||||
RecRoyaleSquads = "253fa009-6e65-4c90-91a1-7137a56a267f",
|
||||
RecRoyaleVR = "253fa009-6e65-4c90-91a1-7137a56a267f",
|
||||
RecRoyaleSolos = "b010171f-4875-4e89-baba-61e878cd41e1",
|
||||
Lounge = "a067557f-ca32-43e6-b6e5-daaec60b4f5a",
|
||||
PerformanceHall = "9932f88f-3929-43a0-a012-a40b5128e346",
|
||||
MakerRoom = "a75f7547-79eb-47c6-8986-6767abcb4f92",
|
||||
Park = "0a864c86-5a71-4e18-8041-8124e4dc9d98",
|
||||
ArtTesting = "42699ed2-0c1b-4f3d-93a2-ce01dfce7a79",
|
||||
River = "e122fe98-e7db-49e8-a1b1-105424b6e1f0",
|
||||
Homestead = "a785267d-c579-42ea-be43-fec1992d1ca7",
|
||||
Quarry = "ff4c6427-7079-4f59-b22a-69b089420827",
|
||||
Clearcut = "380d18b5-de9c-49f3-80f7-f4a95c1de161",
|
||||
Spillway = "58763055-2dfb-4814-80b8-16fac5c85709",
|
||||
Lake = "f6f7256c-e438-4299-b99e-d20bef8cf7e0",
|
||||
PropulsionTestRange = "d9378c9f-80bc-46fb-ad1e-1bed8a674f55",
|
||||
Gym = "3d474b26-26f7-45e9-9a36-9b02847d5e6f",
|
||||
Stadium = "6d5eea4b-f069-4ed0-9916-0e2f07df0d03",
|
||||
Hangar = "239e676c-f12f-489f-bf3a-d4c383d692c3",
|
||||
CyberJunkCity = "9d6456ce-6264-48b4-808d-2d96b3d91038",
|
||||
DodgeballVR = "3d474b26-26f7-45e9-9a36-9b02847d5e6f",
|
||||
}
|
||||
|
||||
interface RoomInstance {
|
||||
|
||||
roomInstanceId: number,
|
||||
roomId: number,
|
||||
subRoomId: number,
|
||||
location: IntegratedRoomScene,
|
||||
dataBlob?: string,
|
||||
eventId?: number,
|
||||
photonRegionId: "us",
|
||||
photonRoomId: string,
|
||||
name?: string,
|
||||
maxCapacity: number,
|
||||
isFull: boolean,
|
||||
isPrivate: boolean,
|
||||
isInProgress: boolean
|
||||
|
||||
}
|
||||
|
||||
const instancePlayers: Map<RoomInstance, Set<Profile>> = new Map();
|
||||
const instanceMap: Map<number, Set<RoomInstance>> = new Map();
|
||||
|
||||
class InstancesBase {
|
||||
|
||||
async #ensureSubSet(roomId: number) {
|
||||
const subMap = instanceMap.get(roomId);
|
||||
if (!subMap) instanceMap.set(roomId, new Set());
|
||||
}
|
||||
|
||||
// get all instances
|
||||
// get all instances for a room
|
||||
// do not put instance categorization here (instance searching, or "matchmaking"); put that in MatchmakingBase
|
||||
|
||||
// add, remove, check for, get profile(s) in instances
|
||||
// synchronize profile.#instance with the profile's current instance (profile.setInstance(RoomInstance)?)
|
||||
|
||||
}
|
||||
|
||||
const Instances = new InstancesBase();
|
||||
export default Instances;
|
||||
Reference in New Issue
Block a user