-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pretty straight-forward. Includes a category that only shows adventures levels as a side-bonus. This also checks against the `GameAsset` type to see if the RootLevel is the expected type, returning an error if so. This only happens if the `GameAsset` is available; the only case where this would happen would be when re-uploading an adventure/level from the dry archive.
- Loading branch information
Showing
16 changed files
with
118 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ public enum RefreshContext | |
PasswordReset, | ||
LevelListOverride, | ||
CoolLevels, | ||
Publishing, | ||
} |
24 changes: 24 additions & 0 deletions
24
Refresh.GameServer/Types/Levels/Categories/AdventureCategory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Bunkum.Core; | ||
using Refresh.GameServer.Database; | ||
using Refresh.GameServer.Endpoints.Game.Levels.FilterSettings; | ||
using Refresh.GameServer.Types.Data; | ||
using Refresh.GameServer.Types.UserData; | ||
|
||
namespace Refresh.GameServer.Types.Levels.Categories; | ||
|
||
public class AdventureCategory : LevelCategory | ||
{ | ||
public AdventureCategory() : base("adventure", Array.Empty<string>(), false) | ||
{ | ||
this.Name = "Adventures"; | ||
this.Description = "Storylines and other big projects by the community."; | ||
this.FontAwesomeIcon = "book-bookmark"; | ||
this.IconHash = "g820625"; | ||
} | ||
|
||
public override DatabaseList<GameLevel>? Fetch(RequestContext context, int skip, int count, DataContext dataContext, | ||
LevelFilterSettings levelFilterSettings, GameUser? _) | ||
{ | ||
return dataContext.Database.GetAdventureLevels(count, skip, dataContext.User, levelFilterSettings); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.