Add ary_movie_info handle
This commit is contained in:
parent
b880ac9663
commit
aa6499866f
12
SharedProject/Models/MovieData.cs
Normal file
12
SharedProject/Models/MovieData.cs
Normal 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; }
|
||||
}
|
@ -33,12 +33,14 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
|
||||
FlagCalculator.GetBitArrayFromIds(enabledMusicList, songIdMax, Logger);
|
||||
var uraReleaseBit = FlagCalculator.GetBitArrayFromIds(enabledUraMusicList, songIdMax, Logger);
|
||||
|
||||
var movieDataDictionary = gameDataService.GetMovieDataDictionary();
|
||||
|
||||
var verupNo1 = new uint[] { 104 };
|
||||
var aryVerUp = verupNo1.Select(i => new InitialdatacheckResponse.VerupNoData1
|
||||
{
|
||||
MasterType = i,
|
||||
VerupNo = 1
|
||||
})
|
||||
{
|
||||
MasterType = i,
|
||||
VerupNo = 1
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var response = new InitialdatacheckResponse
|
||||
@ -49,6 +51,9 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
|
||||
UraReleaseBit = uraReleaseBit,
|
||||
SongIntroductionEndDatetime = DateTime.Now.AddYears(10).ToString(Constants.DATE_TIME_FORMAT),
|
||||
};
|
||||
|
||||
foreach (var movieData in movieDataDictionary) response.AryMovieInfoes.Add(movieData.Value);
|
||||
|
||||
response.AryVerupNoData1s.AddRange(aryVerUp);
|
||||
|
||||
var danData = new List<InitialdatacheckResponse.VerupNoData2.InformationData>();
|
||||
@ -60,6 +65,7 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
|
||||
VerupNo = 1
|
||||
});
|
||||
}
|
||||
|
||||
var verupNo2 = new uint[] { 101 };
|
||||
foreach (var i in verupNo2)
|
||||
{
|
||||
@ -70,8 +76,8 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
|
||||
verUp2.AryInformationDatas.AddRange(danData);
|
||||
response.AryVerupNoData2s.Add(verUp2);
|
||||
}
|
||||
response.AryChassisFunctionIds = new uint[] {1,2,3};
|
||||
|
||||
response.AryChassisFunctionIds = new uint[] { 1, 2, 3 };
|
||||
|
||||
return Ok(response);
|
||||
}
|
||||
|
@ -21,6 +21,9 @@ public class GameDataService : IGameDataService
|
||||
private ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> introDataDictionary =
|
||||
ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData>.Empty;
|
||||
|
||||
private ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> movieDataDictionary =
|
||||
ImmutableDictionary<uint, InitialdatacheckResponse.MovieData>.Empty;
|
||||
|
||||
private ImmutableDictionary<uint, MusicAttributeEntry> musicAttributes =
|
||||
ImmutableDictionary<uint, MusicAttributeEntry>.Empty;
|
||||
|
||||
@ -75,6 +78,11 @@ public class GameDataService : IGameDataService
|
||||
return introDataDictionary;
|
||||
}
|
||||
|
||||
public ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> GetMovieDataDictionary()
|
||||
{
|
||||
return movieDataDictionary;
|
||||
}
|
||||
|
||||
public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary()
|
||||
{
|
||||
return folderDictionary;
|
||||
@ -104,6 +112,7 @@ public class GameDataService : IGameDataService
|
||||
var compressedMusicAttributePath = Path.Combine(dataPath, Constants.MUSIC_ATTRIBUTE_COMPRESSED_FILE_NAME);
|
||||
var danDataPath = Path.Combine(dataPath, settings.DanDataFileName);
|
||||
var songIntroDataPath = Path.Combine(dataPath, settings.IntroDataFileName);
|
||||
var movieDataPath = Path.Combine(dataPath, settings.MovieDataFileName);
|
||||
var eventFolderDataPath = Path.Combine(dataPath, settings.EventFolderDataFileName);
|
||||
var shopFolderDataPath = Path.Combine(dataPath, settings.ShopFolderDataFileName);
|
||||
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 danDataFile = File.OpenRead(danDataPath);
|
||||
await using var songIntroDataFile = File.OpenRead(songIntroDataPath);
|
||||
await using var movieDataFile = File.OpenRead(movieDataPath);
|
||||
await using var eventFolderDataFile = File.OpenRead(eventFolderDataPath);
|
||||
await using var shopFolderDataFile = File.OpenRead(shopFolderDataPath);
|
||||
await using var tokenDataFile = File.OpenRead(tokenDataPath);
|
||||
@ -130,6 +140,7 @@ public class GameDataService : IGameDataService
|
||||
var attributesData = await JsonSerializer.DeserializeAsync<MusicAttributes>(musicAttributeFile);
|
||||
var danData = await JsonSerializer.DeserializeAsync<List<DanData>>(danDataFile);
|
||||
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 shopFolderData = await JsonSerializer.DeserializeAsync<List<ShopFolderData>>(shopFolderDataFile);
|
||||
var tokenData = await JsonSerializer.DeserializeAsync<Dictionary<string, uint>>(tokenDataFile);
|
||||
@ -143,6 +154,8 @@ public class GameDataService : IGameDataService
|
||||
|
||||
InitializeIntroData(introData);
|
||||
|
||||
InitializeMovieData(movieData);
|
||||
|
||||
InitializeEventFolderData(eventFolderData);
|
||||
|
||||
InitializeShopFolderData(shopFolderData);
|
||||
@ -182,6 +195,12 @@ public class GameDataService : IGameDataService
|
||||
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)
|
||||
{
|
||||
danData.ThrowIfNull("Shouldn't happen!");
|
||||
@ -255,7 +274,7 @@ public class GameDataService : IGameDataService
|
||||
|
||||
private static GetSongIntroductionResponse.SongIntroductionData ToResponseIntroData(SongIntroductionData data)
|
||||
{
|
||||
var responseOdaiData = new GetSongIntroductionResponse.SongIntroductionData
|
||||
var responseIntroData = new GetSongIntroductionResponse.SongIntroductionData
|
||||
{
|
||||
SetId = data.SetId,
|
||||
VerupNo = data.VerupNo,
|
||||
@ -263,7 +282,18 @@ public class GameDataService : IGameDataService
|
||||
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)
|
||||
|
@ -18,6 +18,8 @@ public interface IGameDataService
|
||||
|
||||
public ImmutableDictionary<uint, GetSongIntroductionResponse.SongIntroductionData> GetSongIntroDictionary();
|
||||
|
||||
public ImmutableDictionary<uint, InitialdatacheckResponse.MovieData> GetMovieDataDictionary();
|
||||
|
||||
public ImmutableDictionary<uint, GetfolderResponse.EventfolderData> GetFolderDictionary();
|
||||
|
||||
public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary();
|
||||
|
@ -2,15 +2,17 @@
|
||||
|
||||
public class DataSettings
|
||||
{
|
||||
public string DanDataFileName { get; set; } = "dan_data.json";
|
||||
public string DanDataFileName { get; set; } = "dan_data.json";
|
||||
|
||||
public string EventFolderDataFileName { get; set; } = "event_folder_data.json";
|
||||
public string EventFolderDataFileName { get; set; } = "event_folder_data.json";
|
||||
|
||||
public string IntroDataFileName { get; set; } = "intro_data.json";
|
||||
public string IntroDataFileName { get; set; } = "intro_data.json";
|
||||
|
||||
public string ShopFolderDataFileName { get; set; } = "shop_folder_data.json";
|
||||
public string MovieDataFileName { get; set; } = "movie_data.json";
|
||||
|
||||
public string TokenDataFileName { get; set; } = "token_data.json";
|
||||
public string ShopFolderDataFileName { get; set; } = "shop_folder_data.json";
|
||||
|
||||
public string LockedSongsDataFileName { get; set; } = "locked_songs_data.json";
|
||||
public string TokenDataFileName { get; set; } = "token_data.json";
|
||||
|
||||
public string LockedSongsDataFileName { get; set; } = "locked_songs_data.json";
|
||||
}
|
@ -58,12 +58,24 @@
|
||||
<None Include="Configurations\Logging.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\musicinfo.bin">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
6
TaikoLocalServer/wwwroot/data/movie_data.json
Normal file
6
TaikoLocalServer/wwwroot/data/movie_data.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"movie_id": 0,
|
||||
"enable_days": 0
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user