1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Remove auto sort of shop folder

This commit is contained in:
S-Sebb?? 2023-09-24 03:24:41 +08:00
parent e8924d762b
commit 4b299b5259
5 changed files with 19 additions and 12 deletions

View File

@ -46,7 +46,6 @@ public class GetDanOdaiController : BaseController<GetDanOdaiController>
Logger.LogWarning("Requested dan id {Id} does not exist!", danId); Logger.LogWarning("Requested dan id {Id} does not exist!", danId);
continue; continue;
} }
Logger.LogInformation(odaiData.Stringify());
response.AryOdaiDatas.Add(odaiData); response.AryOdaiDatas.Add(odaiData);
} }

View File

@ -19,7 +19,7 @@ public class GetShopFolderController : BaseController<GetShopFolderController>
gameDataService.GetTokenDataDictionary().TryGetValue("shopTokenId", out var shopTokenId); gameDataService.GetTokenDataDictionary().TryGetValue("shopTokenId", out var shopTokenId);
var shopFolderDictionary = gameDataService.GetShopFolderDictionary(); var shopFolderList = gameDataService.GetShopFolderList();
var response = new GetShopFolderResponse var response = new GetShopFolderResponse
{ {
@ -28,7 +28,7 @@ public class GetShopFolderController : BaseController<GetShopFolderController>
VerupNo = 2 VerupNo = 2
}; };
foreach (var shopFolder in shopFolderDictionary) response.AryShopFolderDatas.Add(shopFolder.Value); response.AryShopFolderDatas.AddRange(shopFolderList);
return Ok(response); return Ok(response);
} }

View File

@ -22,14 +22,18 @@ public class PlayResultController : BaseController<PlayResultController>
private readonly IAiDatumService aiDatumService; private readonly IAiDatumService aiDatumService;
private readonly IGameDataService gameDataService;
public PlayResultController(IUserDatumService userDatumService, ISongPlayDatumService songPlayDatumService, public PlayResultController(IUserDatumService userDatumService, ISongPlayDatumService songPlayDatumService,
ISongBestDatumService songBestDatumService, IDanScoreDatumService danScoreDatumService, IAiDatumService aiDatumService) ISongBestDatumService songBestDatumService, IDanScoreDatumService danScoreDatumService, IAiDatumService aiDatumService,
IGameDataService gameDataService)
{ {
this.userDatumService = userDatumService; this.userDatumService = userDatumService;
this.songPlayDatumService = songPlayDatumService; this.songPlayDatumService = songPlayDatumService;
this.songBestDatumService = songBestDatumService; this.songBestDatumService = songBestDatumService;
this.danScoreDatumService = danScoreDatumService; this.danScoreDatumService = danScoreDatumService;
this.aiDatumService = aiDatumService; this.aiDatumService = aiDatumService;
this.gameDataService = gameDataService;
} }
[HttpPost] [HttpPost]
@ -74,6 +78,7 @@ public class PlayResultController : BaseController<PlayResultController>
} }
var bestData = await songBestDatumService.GetAllSongBestData(request.BaidConf); var bestData = await songBestDatumService.GetAllSongBestData(request.BaidConf);
for (var songNumber = 0; songNumber < playResultData.AryStageInfoes.Count; songNumber++) for (var songNumber = 0; songNumber < playResultData.AryStageInfoes.Count; songNumber++)
{ {
var stageData = playResultData.AryStageInfoes[songNumber]; var stageData = playResultData.AryStageInfoes[songNumber];

View File

@ -33,11 +33,10 @@ public class GameDataService : IGameDataService
private ImmutableDictionary<uint, GetfolderResponse.EventfolderData> folderDictionary = private ImmutableDictionary<uint, GetfolderResponse.EventfolderData> folderDictionary =
ImmutableDictionary<uint, GetfolderResponse.EventfolderData>.Empty; ImmutableDictionary<uint, GetfolderResponse.EventfolderData>.Empty;
private ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> shopFolderDictionary =
ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData>.Empty;
private ImmutableDictionary<string, uint> qrCodeDataDictionary = ImmutableDictionary<string, uint>.Empty; private ImmutableDictionary<string, uint> qrCodeDataDictionary = ImmutableDictionary<string, uint>.Empty;
private List<GetShopFolderResponse.ShopFolderData> shopFolderList = new();
private List<uint> musics = new(); private List<uint> musics = new();
private List<uint> musicsWithUra = new(); private List<uint> musicsWithUra = new();
@ -98,9 +97,9 @@ public class GameDataService : IGameDataService
return folderDictionary; return folderDictionary;
} }
public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary() public List<GetShopFolderResponse.ShopFolderData> GetShopFolderList()
{ {
return shopFolderDictionary; return shopFolderList;
} }
public Dictionary<string, int> GetTokenDataDictionary() public Dictionary<string, int> GetTokenDataDictionary()
@ -270,7 +269,10 @@ public class GameDataService : IGameDataService
private void InitializeShopFolderData(List<ShopFolderData>? shopFolderData) private void InitializeShopFolderData(List<ShopFolderData>? shopFolderData)
{ {
shopFolderData.ThrowIfNull("Shouldn't happen!"); shopFolderData.ThrowIfNull("Shouldn't happen!");
shopFolderDictionary = shopFolderData.ToImmutableDictionary(data => data.SongNo, ToResponseShopFolderData); foreach (var folderData in shopFolderData)
{
shopFolderList.Add(ToResponseShopFolderData(folderData));
}
} }
private void InitializeTokenData(Dictionary<string, int>? tokenData) private void InitializeTokenData(Dictionary<string, int>? tokenData)

View File

@ -1,4 +1,5 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using SharedProject.Models;
namespace TaikoLocalServer.Services.Interfaces; namespace TaikoLocalServer.Services.Interfaces;
@ -24,7 +25,7 @@ public interface IGameDataService
public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary(); public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary();
public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary(); public List<GetShopFolderResponse.ShopFolderData> GetShopFolderList();
public Dictionary<string, int> GetTokenDataDictionary(); public Dictionary<string, int> GetTokenDataDictionary();