Skip to content

Commit

Permalink
filter locked levels from lucky dip
Browse files Browse the repository at this point in the history
  • Loading branch information
Metraberryy committed Aug 27, 2024
1 parent a0157c9 commit 807d5d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ void ParseLbp3Query(string key, Action allMust, Action noneCan, Action dontCare)

if (!queryBuilder.GetFilters(typeof(CrossControlFilter)).Any())
queryBuilder.AddFilter(new ExcludeCrossControlFilter());

if (controller.Request.Path.Value.EndsWith("lbp2luckydip"))

Check warning on line 179 in ProjectLighthouse.Servers.GameServer/Extensions/ControllerExtensions.cs

View workflow job for this annotation

GitHub Actions / Build & Test (Linux, ubuntu-latest, true, true)

Dereference of a possibly null reference.

Check warning on line 179 in ProjectLighthouse.Servers.GameServer/Extensions/ControllerExtensions.cs

View workflow job for this annotation

GitHub Actions / Build & Test (Linux, ubuntu-latest, true, true)

Dereference of a possibly null reference.
queryBuilder.AddFilter(new LockedSlotFilter());

queryBuilder.AddFilter(new SubLevelFilter(token.UserId));
queryBuilder.AddFilter(new HiddenSlotFilter());
Expand Down
11 changes: 11 additions & 0 deletions ProjectLighthouse/Filter/Filters/LockedSlotFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Linq.Expressions;
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
using LBPUnion.ProjectLighthouse.Types.Filter;

namespace LBPUnion.ProjectLighthouse.Filter.Filters;

public class LockedSlotFilter : ISlotFilter
{
public Expression<Func<SlotEntity, bool>> GetPredicate() => s => !s.InitiallyLocked;
}

0 comments on commit 807d5d2

Please sign in to comment.