Skip to content

Commit e6fefe8

Browse files
committed
Change DispAchievementType lock to IsDispAchievementTypeSet param
1 parent b11f242 commit e6fefe8

4 files changed

Lines changed: 14 additions & 15 deletions

File tree

TaikoLocalServer/Controllers/Game/BaidController.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public async Task<IActionResult> GetBaid([FromBody] BAIDRequest request)
2626

2727
response = Mappers.BaidResponseMapper.Map3906WithPostProcess(commonResponse);
2828
response.PlayerType = 0;
29-
response.IsDispAchievementTypeSet = true;
3029

3130
return Ok(response);
3231
}
@@ -55,7 +54,6 @@ public async Task<IActionResult> GetBaid3209([FromBody] Models.v3209.BAIDRequest
5554

5655
response = Mappers.BaidResponseMapper.Map3209WithPostProcess(commonResponse);
5756
response.PlayerType = 0;
58-
response.IsDispAchievementTypeSet = true;
5957

6058
return Ok(response);
6159
}

TaikoLocalServer/Handlers/BaidQuery.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ public async Task<CommonBaidResponse> Handle(BaidQuery request, CancellationToke
3333

3434
var songBestData = context.SongBestData.Where(datum => datum.Baid == baid).ToList();
3535
var achievementDisplayDifficulty = userData.AchievementDisplayDifficulty;
36-
// Please Do not rewrite Difficulty.None, it will lock your Difficulty Panel level in one play
37-
// if (achievementDisplayDifficulty == Difficulty.None)
38-
// {
39-
// achievementDisplayDifficulty = songBestData
40-
// .Where(datum => datum.BestCrown >= CrownType.Clear)
41-
// .Select(datum => datum.Difficulty)
42-
// .DefaultIfEmpty(Difficulty.Easy)
43-
// .Max();
44-
// }
36+
var isDispAchievementTypeSet = true;
37+
if (achievementDisplayDifficulty == Difficulty.None)
38+
{
39+
isDispAchievementTypeSet = false;
40+
achievementDisplayDifficulty = songBestData
41+
.Where(datum => datum.BestCrown >= CrownType.Clear)
42+
.Select(datum => datum.Difficulty)
43+
.DefaultIfEmpty(Difficulty.Easy)
44+
.Max();
45+
}
4546
// For each crown type, calculate how many songs have that crown type
4647
var crownCountData = songBestData
4748
.Where(datum => !timeLimitSongsList.Contains(datum.SongId) && (datum.Difficulty == achievementDisplayDifficulty || (achievementDisplayDifficulty == Difficulty.UraOni && datum.Difficulty == Difficulty.Oni)))
@@ -124,8 +125,9 @@ public async Task<CommonBaidResponse> Handle(BaidQuery request, CancellationToke
124125
CostumeData = costumeData,
125126
CostumeFlagArrays = costumeFlagArrays,
126127
DisplayDan = userData.DisplayDan,
127-
DisplaySouUchi = userData.DisplaySouUchi,
128+
IsDispSouuchiOn = userData.DisplaySouUchi,
128129
DispAchievementType = (uint)achievementDisplayDifficulty,
130+
IsDispAchievementTypeSet = isDispAchievementTypeSet,
129131
GenericInfoFlg = genericInfoFlgArray,
130132
GotDanFlg = gotDanFlagArray,
131133
GotDanMax = maxDan,

TaikoLocalServer/Mappers/BaidResponseMapper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static BAIDResponse Map3906WithPostProcess(CommonBaidResponse commonBaidR
2323
response.CostumeFlg3 = commonBaidResponse.CostumeFlagArrays[2];
2424
response.CostumeFlg4 = commonBaidResponse.CostumeFlagArrays[3];
2525
response.CostumeFlg5 = commonBaidResponse.CostumeFlagArrays[4];
26-
response.IsDispSouuchiOn = commonBaidResponse.DisplaySouUchi;
2726
return response;
2827
}
2928

@@ -45,7 +44,6 @@ public static Models.v3209.BAIDResponse Map3209WithPostProcess(CommonBaidRespons
4544
response.CostumeFlg3 = commonBaidResponse.CostumeFlagArrays[2];
4645
response.CostumeFlg4 = commonBaidResponse.CostumeFlagArrays[3];
4746
response.CostumeFlg5 = commonBaidResponse.CostumeFlagArrays[4];
48-
response.IsDispSouuchiOn = commonBaidResponse.DisplaySouUchi;
4947
return response;
5048
}
5149
}

TaikoLocalServer/Models/Application/CommonBaidResponse.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CommonBaidResponse
1818

1919
public string LastPlayDatetime { get; set; } = DateTime.Now.ToString(Constants.DateTimeFormat);
2020
public bool DisplayDan { get; set; }
21-
public bool DisplaySouUchi { get; set; }
21+
public bool IsDispSouuchiOn { get; set; }
2222
public uint GotDanMax { get; set; }
2323
public byte[] GotDanFlg { get; set; } = Array.Empty<byte>();
2424
public byte[] GotGaidenFlg { get; set; } = Array.Empty<byte>();
@@ -28,6 +28,7 @@ public class CommonBaidResponse
2828
public uint[] AryScoreRankCounts { get; set; } = Array.Empty<uint>();
2929
public bool IsDispAchievementOn { get; set; }
3030
public uint DispAchievementType { get; set; }
31+
public bool IsDispAchievementTypeSet { get; set; }
3132
public uint LastPlayMode { get; set; }
3233
public uint AiRank { get; set; }
3334
public uint AiTotalWin { get; set; }

0 commit comments

Comments
 (0)