Skip to content

Commit

Permalink
Fix dive in by level
Browse files Browse the repository at this point in the history
Before the logic was
- if not a level search OR
- or the room wasnt a user level
- or the room contained the level ID

Now the logic is
- if not a level search OR
- (level type is user AND the room is playing a level being searched for)
  • Loading branch information
Beyley committed Aug 1, 2024
1 parent b792484 commit f506671
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public Response Execute(DataContext dataContext, SerializedRoomData body, GameSe

IEnumerable<GameRoom> rooms = allRooms.Where(r =>
// If the level id isn't specified, or is 0, then we don't want to try to match against level IDs, else only match the user to people who are playing that level
(userLevelIds.Count == 0 || r.LevelType != RoomSlotType.Online || userLevelIds.Contains(r.LevelId)) &&
(developerLevelIds.Count == 0 || r.LevelType != RoomSlotType.Story || developerLevelIds.Contains(r.LevelId)) &&
(userLevelIds.Count == 0 || (r.LevelType == RoomSlotType.Online && userLevelIds.Contains(r.LevelId))) &&
(developerLevelIds.Count == 0 || (r.LevelType == RoomSlotType.Story && developerLevelIds.Contains(r.LevelId))) &&
// Make sure that we don't try to match the player into a full room, or a room which won't fit the user's current room
usersRoom.PlayerIds.Count + r.PlayerIds.Count <= 4)
// Shuffle the rooms around before sorting, this is because the selection is based on a weighted average towards the top of the range,
Expand Down

0 comments on commit f506671

Please sign in to comment.