public async Task <ChunithmClientLibrary.PlayerRecord.IPlayerRecordContainer> UpdatePlayerRecordAsync() { await LoadGlobalMusicDataTable(); DebugLogger.WriteLine("HighScoreRecord更新の開始"); ChunithmClientLibrary.PlayerRecord.IPlayerRecordContainer record = new ChunithmClientLibrary.PlayerRecord.PlayerRecordContainer(); var difficulties = new[] { Difficulty.Basic, Difficulty.Advanced, Difficulty.Expert, Difficulty.Master, }; foreach (var difficulty in difficulties) { DebugLogger.WriteLine($"{difficulty} の取得"); var musicGenre = chunithmNetConnector.GetMusicGenreAsync(Utility.GENRE_ALL_CODE, difficulty); await musicGenre; if (!musicGenre.Result.Success) { throw new Exception($"{difficulty}の取得に失敗しました"); } var highScoreRecordTable = new HighScoreRecordTable(); highScoreRecordTable.Add(musicGenre.Result.MusicGenre); record.SetTable(highScoreRecordTable, difficulty); } return(record); }
private async void 楽曲更新ToolStripMenuItem_Click(object sender, EventArgs e) { var maxLevel = 14; var loadNum = maxLevel + 1; Console.WriteLine($"楽曲の取得中... (1/{loadNum})"); var musicGenre = chunithmNetBackgroundConnector.GetMusicGenreAsync(Utility.GENRE_ALL_CODE, Difficulty.Master); await musicGenre; if (!musicGenre.Result.Success) { Console.WriteLine("!! Failed !!"); Console.WriteLine("Error Code : " + musicGenre.Result.ErrorCode); Console.WriteLine(musicGenre.Result.ErrorMessage); return; } var musicGenreDocument = musicGenre.Result.DocumentText; var musicLevelDocuments = new List <string>(); for (var i = 1; i <= maxLevel; i++) { Console.WriteLine($"楽曲の取得中... ({i + 1}/{loadNum})"); var musicLevel = chunithmNetBackgroundConnector.GetMusicLevelAsync(i); await musicLevel; if (!musicLevel.Result.Success) { Console.WriteLine("!! Failed !!"); Console.WriteLine("Error Code : " + musicLevel.Result.ErrorCode); Console.WriteLine(musicLevel.Result.ErrorMessage); return; } musicLevelDocuments.Add(musicLevel.Result.DocumentText); } Console.WriteLine("Success"); Console.WriteLine("楽曲テーブルを生成します..."); var musicDataTable = new MusicDataTable(); var musicGenreParser = new MusicGenreParser(); var musicLevelParser = new MusicLevelParser(); musicDataTable.Add(musicGenreParser.Parse(musicGenreDocument)); foreach (var musicLevel in musicLevelDocuments) { musicDataTable.Add(musicLevelParser.Parse(musicLevel)); } var tableUpdate = dataManagerConnector.UpdateTableAsync(musicDataTable.MusicDatas); await tableUpdate; Console.WriteLine("Success"); }
private async void musicGenreGetAllMASTERToolStripMenuItem_Click(object sender, EventArgs e) { await chunithmNetConnector.GetMusicGenreAsync(Utility.GENRE_ALL_CODE, Difficulty.Master); }