This commit is contained in:
2025-09-21 17:47:28 -04:00
parent e759f90a3f
commit 138243a06d
6 changed files with 81 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ export class ServerMatchmakingBase extends ServerContentBase {
if (options.roomName === 'DormRoom')
return `@${options.profile.getUsername()}'s Dorm`;
else {
if (options.subRoomName || options.subRoomName !== "Home") return `^${options.roomName}.${options.subRoomName}`;
if (typeof options.subRoomName !== 'undefined' && options.subRoomName !== "Home") return `^${options.roomName}.${options.subRoomName}`;
else return `^${options.roomName}`;
}
}
@@ -73,7 +73,10 @@ export class ServerMatchmakingBase extends ServerContentBase {
let allInstances = this.server.Instances.getAllInstances();
const subroom = (await targetRoom.getAllSubrooms()).values().find(factory => factory.Name == options.subRoomName);
// if a subroom was specified, filter instances that
// filter by instances with the same room ID
allInstances = new Set(allInstances.values().filter(inst => inst.roomId == targetRoom.getRoomId()));
// if a subroom was specified, filter by instances with the same scene ID
if (subroom) allInstances = new Set(allInstances.values().filter(inst => inst.subRoomId == subroom.RoomSceneId));
// filter out instances that are in progress and do not support joininprogress
@@ -86,6 +89,7 @@ export class ServerMatchmakingBase extends ServerContentBase {
if (!foundInstance) {
const matchmakeableSubrooms = (await targetRoom.getAllSubrooms()).values().filter(scene => scene.CanMatchmakeInto).toArray();
if (matchmakeableSubrooms.length === 0) return { errorCode: MatchmakingErrorCode.RoomIsNotActive };
const index = Math.floor(Math.random() * matchmakeableSubrooms.length);
log.d(`Scene ${matchmakeableSubrooms[index].RoomSceneId} was chosen for matchmaking into new instance of room ${targetRoom.getRoomId()}`);

View File

@@ -0,0 +1,41 @@
export enum StorefrontTypes {
None,
LaserTag,
RecCenter,
Watch,
Quest_LostSkulls = 100,
Quest_Dracula,
Quest_GoldenTrophy,
Quest_CrimsonCauldron,
RecRoyale = 200,
Cafe = 300,
Paintball = 400,
Paintball_River,
Paintball_Homestead,
Paintball_Quarry,
Paintball_ClearCut,
Paintball_Spillway,
Paintball_SunsetDriveIn,
Bowling = 500,
StuntRunner = 600,
DormMirror = 700
}
export enum CurrencyType {
Invalid,
LaserTagTickets,
RecCenterTokens,
LostSkullsGold = 100,
DraculaSilver,
RecRoyale_Season1 = 200
}
export enum StorefrontBalanceType {
NonPurchasedNonP2P = -2,
NonPurchasedP2P,
SteamPurchased,
OculusPurchased,
PlayStationPurchased,
MicrosoftPurchased,
IOSPurchased = 5
}