Skip to content

Commit

Permalink
Fix level hash play command
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed May 7, 2024
1 parent 90420e6 commit a255525
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static GameLevelResponse FromHash(string hash)
{
return new GameLevelResponse
{
LevelId = 5000,
LevelId = int.MaxValue,
Title = $"Hashed Level - {hash}",
IconHash = "0",
GameVersion = 0,
Expand Down Expand Up @@ -118,7 +118,7 @@ public static GameLevelResponse FromHash(string hash)
UpdateDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
EnforceMinMaxPlayers = false,
SameScreenGame = false,
SkillRewards = null,
SkillRewards = [],
LevelType = "",
};
}
Expand Down
2 changes: 1 addition & 1 deletion Refresh.GameServer/Endpoints/Game/Levels/LevelEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class LevelEndpoints : EndpointGroup
public GameLevelResponse? LevelById(RequestContext context, GameDatabaseContext database, MatchService matchService,
GameUser user, string slotType, int id, IDataStore dataStore, Token token, LevelListOverrideService overrideService)
{
if (id == 5000 && overrideService.GetLastHashOverrideForUser(token, out string hash))
if (id == int.MaxValue && overrideService.GetLastHashOverrideForUser(token, out string hash))
{
return GameLevelResponse.FromHash(hash);
}
Expand Down
36 changes: 1 addition & 35 deletions Refresh.GameServer/Types/Levels/GameMinimalLevelResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,7 @@ private GameMinimalLevelResponse() {}
/// <returns></returns>
public static GameMinimalLevelResponse FromHash(string hash)
{
return new GameMinimalLevelResponse
{
LevelId = 5000,
Title = $"Hashed Level - {hash}",
IconHash = "0",
GameVersion = 0,
RootResource = hash,
Description = "This is a hashed level. We don't know anything about it.",
Location = new GameLocation(),
Handle = new SerializedUserHandle
{
Username = $"!Hashed",
IconHash = "0",
},
Type = "user",
TeamPicked = false,
MinPlayers = 1,
MaxPlayers = 4,
HeartCount = 0,
TotalPlayCount = 0,
UniquePlayCount = 0,
YayCount = 0,
BooCount = 0,
AverageStarRating = 0,
YourStarRating = 0,
YourRating = 0,
PlayerCount = 0,
ReviewsEnabled = false,
ReviewCount = 0,
CommentsEnabled = false,
CommentCount = 0,
IsLocked = false,
IsSubLevel = false,
IsCopyable = 0,
};
return FromOld(GameLevelResponse.FromHash(hash))!;
}

public static GameMinimalLevelResponse? FromOldWithExtraData(GameLevelResponse? old, MatchService matchService, GameDatabaseContext database, IDataStore dataStore, TokenGame game)
Expand Down

0 comments on commit a255525

Please sign in to comment.