Rooms and matchmaking debugging

* Dorm is not properly cloned (fix this)
* Basic matchmaking implementation
* Goto route
* Goto DormRoom
This commit is contained in:
2025-04-02 14:10:01 -04:00
parent 27b3754330
commit bcee414004
6 changed files with 237 additions and 86 deletions

View File

@@ -33,14 +33,30 @@ route.router.post('/room/:roomName',
APIUtils.Authentication,
APIUtils.AuthenticationType(AuthType.Game),
(rq: express.Request<MatchmakingParams>, rs: express.Response) => {
async (rq: express.Request<MatchmakingParams>, rs: express.Response) => {
if (!rq.params.roomName) {
rs.json({
errorCode: MatchmakingErrorCode.NoSuchRoom
});
return;
}
rs.json(Matchmaking.matchmake({ profile: rs.locals.profile, roomName: rq.params.roomName }));
rs.json(await Matchmaking.matchmake({ profile: rs.locals.profile, roomName: rq.params.roomName }));
},
);
);
route.router.post('/room/:roomName/:subRoomName',
APIUtils.Authentication,
APIUtils.AuthenticationType(AuthType.Game),
async (rq: express.Request<MatchmakingParams>, rs: express.Response) => {
if (!rq.params.roomName) {
rs.json({
errorCode: MatchmakingErrorCode.NoSuchRoom
});
return;
}
rs.json(await Matchmaking.matchmake({ profile: rs.locals.profile, roomName: rq.params.roomName, subRoomName: rq.params.subRoomName }));
},
)