give myself something to do tomorrow
Matchmaking base
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
import Profile from "../profiles.ts";
|
||||
import { IntegratedRoomScene } from "../content/roomtypes.ts";
|
||||
import { IntegratedRoomScene, RoomDetails } from "../content/roomtypes.ts";
|
||||
|
||||
const log = new Logging("Instances");
|
||||
|
||||
@@ -22,6 +22,16 @@ export interface RoomInstance {
|
||||
|
||||
}
|
||||
|
||||
interface InstanceOptions {
|
||||
|
||||
Room: RoomDetails,
|
||||
SceneIndex?: number,
|
||||
EventId?: number,
|
||||
Name?: string,
|
||||
Private?: boolean
|
||||
|
||||
}
|
||||
|
||||
const instancePlayers: Map<RoomInstance, Set<Profile>> = new Map();
|
||||
/**
|
||||
* `Map<roomId (number), RoomInstance>`
|
||||
@@ -91,8 +101,10 @@ class InstancesBase {
|
||||
return this.getInstancePlayers(instance).size < instance.maxCapacity;
|
||||
}
|
||||
|
||||
// add, remove, check for, get profile(s) in instances
|
||||
// synchronize profile.#instance with the profile's current instance (profile.setInstance(RoomInstance)?)
|
||||
createInstance(options: InstanceOptions) {
|
||||
// todo: use room data to create room instance
|
||||
}
|
||||
|
||||
setPlayerInstance(player: Profile, instance: RoomInstance) {
|
||||
const currentInstance = player.getInstance();
|
||||
if (currentInstance === instance) return;
|
||||
|
||||
@@ -59,11 +59,7 @@ route.router.get("/bulk",
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
rs.json(
|
||||
[await Profile.getExportAccount(id)].filter((val) =>
|
||||
val !== null
|
||||
),
|
||||
);
|
||||
rs.json([await Profile.getExportAccount(id)].filter((val) => val !== null));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ route.router.post('/login',
|
||||
(_rq, rs) => {
|
||||
// temporary
|
||||
rs.sendStatus(200);
|
||||
// check for existing login
|
||||
// set login lock
|
||||
// init presence
|
||||
// use device_class from token request
|
||||
},
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user