Skip to content

Commit

Permalink
Send locked status in minimal response (#354)
Browse files Browse the repository at this point in the history
Before this patch, you could play a locked level by clicking on it from
the level browse list before it loads the full information.
  • Loading branch information
jvyden authored Jan 27, 2024
2 parents a44bf98 + a90bf1a commit 7f49c6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Refresh.GameServer/Types/Levels/GameMinimalLevelResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public class GameMinimalLevelResponse : IDataConvertableFrom<GameMinimalLevelRes

[XmlElement("playerCount")] public int PlayerCount { get; set; }


[XmlElement("initiallyLocked")] public bool IsLocked { get; set; }
[XmlElement("isSubLevel")] public bool IsSubLevel { get; set; }
[XmlElement("shareable")] public int IsCopyable { get; set; }

private GameMinimalLevelResponse() {}

public static GameMinimalLevelResponse? FromOldWithExtraData(GameLevelResponse? old, MatchService matchService, GameDatabaseContext database, IDataStore dataStore, TokenGame game)
Expand Down Expand Up @@ -94,6 +97,9 @@ private GameMinimalLevelResponse() {}
YourStarRating = level.YourStarRating,
YourRating = level.YourRating,
AverageStarRating = level.AverageStarRating,
IsLocked = level.IsLocked,
IsSubLevel = level.IsSubLevel,
IsCopyable = level.IsCopyable,
};
}

Expand Down

0 comments on commit 7f49c6e

Please sign in to comment.