1
0
mirror of synced 2024-11-27 16:10:53 +01:00

Add ary_movie_info handle

This commit is contained in:
esuo1198 2023-09-13 12:24:48 +09:00
parent b880ac9663
commit aa6499866f
7 changed files with 98 additions and 28 deletions

View File

@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace SharedProject.Models;
public class MovieData
{
[JsonPropertyName("movie_id")]
public uint MovieId { get; set; }
[JsonPropertyName("enable_days")]
public uint EnableDays { get; set; }
}

View File

@ -33,6 +33,8 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
FlagCalculator.GetBitArrayFromIds(enabledMusicList, songIdMax, Logger); FlagCalculator.GetBitArrayFromIds(enabledMusicList, songIdMax, Logger);
var uraReleaseBit = FlagCalculator.GetBitArrayFromIds(enabledUraMusicList, songIdMax, Logger); var uraReleaseBit = FlagCalculator.GetBitArrayFromIds(enabledUraMusicList, songIdMax, Logger);
var movieDataDictionary = gameDataService.GetMovieDataDictionary();
var verupNo1 = new uint[] { 104 }; var verupNo1 = new uint[] { 104 };
var aryVerUp = verupNo1.Select(i => new InitialdatacheckResponse.VerupNoData1 var aryVerUp = verupNo1.Select(i => new InitialdatacheckResponse.VerupNoData1
{ {
@ -49,6 +51,9 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
UraReleaseBit = uraReleaseBit, UraReleaseBit = uraReleaseBit,
SongIntroductionEndDatetime = DateTime.Now.AddYears(10).ToString(Constants.DATE_TIME_FORMAT), SongIntroductionEndDatetime = DateTime.Now.AddYears(10).ToString(Constants.DATE_TIME_FORMAT),
}; };
foreach (var movieData in movieDataDictionary) response.AryMovieInfoes.Add(movieData.Value);
response.AryVerupNoData1s.AddRange(aryVerUp); response.AryVerupNoData1s.AddRange(aryVerUp);
var danData = new List<InitialdatacheckResponse.VerupNoData2.InformationData>(); var danData = new List<InitialdatacheckResponse.VerupNoData2.InformationData>();
@ -60,6 +65,7 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
VerupNo = 1 VerupNo = 1
}); });
} }
var verupNo2 = new uint[] { 101 }; var verupNo2 = new uint[] { 101 };
foreach (var i in verupNo2) foreach (var i in verupNo2)
{ {
@ -70,8 +76,8 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
verUp2.AryInformationDatas.AddRange(danData); verUp2.AryInformationDatas.AddRange(danData);
response.AryVerupNoData2s.Add(verUp2); response.AryVerupNoData2s.Add(verUp2);
} }
response.AryChassisFunctionIds = new uint[] {1,2,3};
response.AryChassisFunctionIds = new uint[] { 1, 2, 3 };
return Ok(response); return Ok(response);
} }

View File

@ -21,6 +21,9 @@ public class GameDataService : IGameDataService
private ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> introDataDictionary = private ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> introDataDictionary =
ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData>.Empty; ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData>.Empty;
private ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> movieDataDictionary =
ImmutableDictionary<uint, InitialdatacheckResponse.MovieData>.Empty;
private ImmutableDictionary<uint, MusicAttributeEntry> musicAttributes = private ImmutableDictionary<uint, MusicAttributeEntry> musicAttributes =
ImmutableDictionary<uint, MusicAttributeEntry>.Empty; ImmutableDictionary<uint, MusicAttributeEntry>.Empty;
@ -75,6 +78,11 @@ public class GameDataService : IGameDataService
return introDataDictionary; return introDataDictionary;
} }
public ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> GetMovieDataDictionary()
{
return movieDataDictionary;
}
public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary() public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary()
{ {
return folderDictionary; return folderDictionary;
@ -104,6 +112,7 @@ public class GameDataService : IGameDataService
var compressedMusicAttributePath = Path.Combine(dataPath, Constants.MUSIC_ATTRIBUTE_COMPRESSED_FILE_NAME); var compressedMusicAttributePath = Path.Combine(dataPath, Constants.MUSIC_ATTRIBUTE_COMPRESSED_FILE_NAME);
var danDataPath = Path.Combine(dataPath, settings.DanDataFileName); var danDataPath = Path.Combine(dataPath, settings.DanDataFileName);
var songIntroDataPath = Path.Combine(dataPath, settings.IntroDataFileName); var songIntroDataPath = Path.Combine(dataPath, settings.IntroDataFileName);
var movieDataPath = Path.Combine(dataPath, settings.MovieDataFileName);
var eventFolderDataPath = Path.Combine(dataPath, settings.EventFolderDataFileName); var eventFolderDataPath = Path.Combine(dataPath, settings.EventFolderDataFileName);
var shopFolderDataPath = Path.Combine(dataPath, settings.ShopFolderDataFileName); var shopFolderDataPath = Path.Combine(dataPath, settings.ShopFolderDataFileName);
var tokenDataPath = Path.Combine(dataPath, settings.TokenDataFileName); var tokenDataPath = Path.Combine(dataPath, settings.TokenDataFileName);
@ -121,6 +130,7 @@ public class GameDataService : IGameDataService
await using var musicAttributeFile = File.OpenRead(musicAttributePath); await using var musicAttributeFile = File.OpenRead(musicAttributePath);
await using var danDataFile = File.OpenRead(danDataPath); await using var danDataFile = File.OpenRead(danDataPath);
await using var songIntroDataFile = File.OpenRead(songIntroDataPath); await using var songIntroDataFile = File.OpenRead(songIntroDataPath);
await using var movieDataFile = File.OpenRead(movieDataPath);
await using var eventFolderDataFile = File.OpenRead(eventFolderDataPath); await using var eventFolderDataFile = File.OpenRead(eventFolderDataPath);
await using var shopFolderDataFile = File.OpenRead(shopFolderDataPath); await using var shopFolderDataFile = File.OpenRead(shopFolderDataPath);
await using var tokenDataFile = File.OpenRead(tokenDataPath); await using var tokenDataFile = File.OpenRead(tokenDataPath);
@ -130,6 +140,7 @@ public class GameDataService : IGameDataService
var attributesData = await JsonSerializer.DeserializeAsync<MusicAttributes>(musicAttributeFile); var attributesData = await JsonSerializer.DeserializeAsync<MusicAttributes>(musicAttributeFile);
var danData = await JsonSerializer.DeserializeAsync<List<DanData>>(danDataFile); var danData = await JsonSerializer.DeserializeAsync<List<DanData>>(danDataFile);
var introData = await JsonSerializer.DeserializeAsync<List<SongIntroductionData>>(songIntroDataFile); var introData = await JsonSerializer.DeserializeAsync<List<SongIntroductionData>>(songIntroDataFile);
var movieData = await JsonSerializer.DeserializeAsync<List<MovieData>>(movieDataFile);
var eventFolderData = await JsonSerializer.DeserializeAsync<List<EventFolderData>>(eventFolderDataFile); var eventFolderData = await JsonSerializer.DeserializeAsync<List<EventFolderData>>(eventFolderDataFile);
var shopFolderData = await JsonSerializer.DeserializeAsync<List<ShopFolderData>>(shopFolderDataFile); var shopFolderData = await JsonSerializer.DeserializeAsync<List<ShopFolderData>>(shopFolderDataFile);
var tokenData = await JsonSerializer.DeserializeAsync<Dictionary<string, uint>>(tokenDataFile); var tokenData = await JsonSerializer.DeserializeAsync<Dictionary<string, uint>>(tokenDataFile);
@ -143,6 +154,8 @@ public class GameDataService : IGameDataService
InitializeIntroData(introData); InitializeIntroData(introData);
InitializeMovieData(movieData);
InitializeEventFolderData(eventFolderData); InitializeEventFolderData(eventFolderData);
InitializeShopFolderData(shopFolderData); InitializeShopFolderData(shopFolderData);
@ -182,6 +195,12 @@ public class GameDataService : IGameDataService
introDataDictionary = introData.ToImmutableDictionary(data => data.SetId, ToResponseIntroData); introDataDictionary = introData.ToImmutableDictionary(data => data.SetId, ToResponseIntroData);
} }
private void InitializeMovieData(List<MovieData>? movieData)
{
movieData.ThrowIfNull("Shouldn't happen!");
movieDataDictionary = movieData.ToImmutableDictionary(data => data.MovieId, ToResponseMovieData);
}
private void InitializeDanData(List<DanData>? danData) private void InitializeDanData(List<DanData>? danData)
{ {
danData.ThrowIfNull("Shouldn't happen!"); danData.ThrowIfNull("Shouldn't happen!");
@ -255,7 +274,7 @@ public class GameDataService : IGameDataService
private static GetSongIntroductionResponse.SongIntroductionData ToResponseIntroData(SongIntroductionData data) private static GetSongIntroductionResponse.SongIntroductionData ToResponseIntroData(SongIntroductionData data)
{ {
var responseOdaiData = new GetSongIntroductionResponse.SongIntroductionData var responseIntroData = new GetSongIntroductionResponse.SongIntroductionData
{ {
SetId = data.SetId, SetId = data.SetId,
VerupNo = data.VerupNo, VerupNo = data.VerupNo,
@ -263,7 +282,18 @@ public class GameDataService : IGameDataService
SubSongNoes = data.SubSongNo SubSongNoes = data.SubSongNo
}; };
return responseOdaiData; return responseIntroData;
}
private static InitialdatacheckResponse.MovieData ToResponseMovieData(MovieData data)
{
var responseMovieData = new InitialdatacheckResponse.MovieData
{
MovieId = data.MovieId,
EnableDays = data.EnableDays
};
return responseMovieData;
} }
private static GetfolderResponse.EventfolderData ToResponseEventFolderData(EventFolderData data) private static GetfolderResponse.EventfolderData ToResponseEventFolderData(EventFolderData data)

View File

@ -18,6 +18,8 @@ public interface IGameDataService
public ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> GetSongIntroDictionary(); public ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> GetSongIntroDictionary();
public ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> GetMovieDataDictionary();
public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary(); public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary();
public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary(); public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary();

View File

@ -8,6 +8,8 @@ public class DataSettings
public string IntroDataFileName { get; set; } = "intro_data.json"; public string IntroDataFileName { get; set; } = "intro_data.json";
public string MovieDataFileName { get; set; } = "movie_data.json";
public string ShopFolderDataFileName { get; set; } = "shop_folder_data.json"; public string ShopFolderDataFileName { get; set; } = "shop_folder_data.json";
public string TokenDataFileName { get; set; } = "token_data.json"; public string TokenDataFileName { get; set; } = "token_data.json";

View File

@ -58,12 +58,24 @@
<None Include="Configurations\Logging.json"> <None Include="Configurations\Logging.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<Content Update="wwwroot\data\locked_songs_data.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\movie_data.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\music_order.bin"> <Content Update="wwwroot\data\music_order.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Update="wwwroot\data\musicinfo.bin"> <Content Update="wwwroot\data\musicinfo.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Update="wwwroot\data\shop_folder_data.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\token_data.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\wordlist.bin"> <Content Update="wwwroot\data\wordlist.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

View File

@ -0,0 +1,6 @@
[
{
"movie_id": 0,
"enable_days": 0
}
]