This commit is contained in:
2025-08-22 20:19:15 -04:00
parent f19552929e
commit 391bf3d1f8
58 changed files with 535 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
import { RoomInstance } from "../instances/base.ts";
import { Instance } from "../instances/Instance.ts";
import KV from "../persistence/kv.ts";
import { PlatformMask, ProfileRole } from "../platforms/types.ts";
import { type ServerBase } from "../server.ts";
@@ -6,7 +6,10 @@ import { type SignalRSocketHandler } from "../socket/signalr/socket.ts";
import { ProfileAvatarManager } from "./content/Avatar.ts";
import ProfileContentManager from "./content/base.ts";
import { ProfileMatchmakingManager } from "./content/Matchmaking.ts";
import { ProfileMessageManager } from "./content/Messages.ts";
import { ProfileReputationManager } from "./content/Reputation.ts";
import { ProfileSettingsManager } from "./content/Settings.ts";
import { ProfileSubscriptionsManager } from "./content/Subscriptions.ts";
import ProfileManagerBase from "./manager.ts";
import { recNetAccountSchema, SelfAccount, type RecNetAccount } from "./types/profile.ts";
@@ -16,7 +19,7 @@ class Profile {
#kv: KV;
#socket: SignalRSocketHandler | null = null;
#instance: RoomInstance | null = null;
#instance: Instance | null = null;
#server: ServerBase;
#selfAcc: SelfAccount;
@@ -26,6 +29,9 @@ class Profile {
Settings: ProfileSettingsManager;
Avatar: ProfileAvatarManager;
Matchmaking: ProfileMatchmakingManager;
Reputation: ProfileReputationManager;
Subscriptions: ProfileSubscriptionsManager;
Messages: ProfileMessageManager;
constructor(acc: SelfAccount, kv: KV, server: ServerBase) {
this.#id = acc.accountId;
@@ -36,6 +42,9 @@ class Profile {
this.Settings = new ProfileSettingsManager(this, this.#kv);
this.Avatar = new ProfileAvatarManager(this, this.#kv);
this.Matchmaking = new ProfileMatchmakingManager(this, this.#kv);
this.Reputation = new ProfileReputationManager(this, this.#kv);
this.Subscriptions = new ProfileSubscriptionsManager(this, this.#kv);
this.Messages = new ProfileMessageManager(this, this.#kv);
}
async #saveSelfAcc() {
@@ -121,7 +130,7 @@ class Profile {
getInstance() {
return this.#instance;
}
setInstance(inst: RoomInstance) {
setInstance(inst: Instance) {
this.#instance = inst;
}