コード例 #1
0
        static void Main(string[] args)
        {
            connector = new ChunithmMusicDatabaseHttpClientConnector(url);

            ITableGetResponse tableGet = null;

            tableGet = TableGet();

            if (TABLE_UPDATE)
            {
                if (tableGet != null)
                {
                    TableUpdate(new List <IMusicDataTableUnit>(tableGet.MusicDataTable.GetTableUnits()));
                }
            }

            if (MUSIC_DATA_UPDATE)
            {
                if (tableGet != null)
                {
                    var music = tableGet.MusicDataTable.GetTableUnits().FirstOrDefault();
                    if (music != null)
                    {
                        MusicDataUpdate(new List <IMusicDataTableUnit>()
                        {
                            music
                        });
                    }
                }
            }

            Console.ReadLine();
        }
コード例 #2
0
        public void Call(string[] args)
        {
            var arg = new Argument(args);

            var musicDataTable = new MusicDataTable();

            using (var connector = new ChunithmNetHttpClientConnector())
                using (var databaseConnector = new ChunithmMusicDatabaseHttpClientConnector(arg.DataBaseUrl))
                {
                    var currentTable = databaseConnector.GetTableAsync().GetMusicDatabaseApiResult("get current table... ");

                    connector.LoginAsync(arg.SegaId, arg.Password).GetNetApiResult("login... ");
                    connector.SelectAimeAsync(arg.AimeIndex).GetNetApiResult("selecting aime... ");

                    var musicGenre = connector.GetMusicGenreAsync(GENRE_CODE_ALL, Difficulty.Master).GetNetApiResult("downloading music list... ");
                    musicDataTable.Add(musicGenre.MusicGenre);

                    if (currentTable.MusicDataTable.GetTableUnits().Count() == musicDataTable.GetTableUnits().Count())
                    {
                        Console.WriteLine("skip update.");
                        return;
                    }

                    for (var i = 0; i < arg.MaxLevelValue; i++)
                    {
                        var musicLevel = connector.GetMusicLevelAsync(i).GetNetApiResult($"downloading level info ({i + 1}/{arg.MaxLevelValue})", false);
                        musicDataTable.Add(musicLevel.MusicLevel);
                    }

                    databaseConnector.UpdateTableAsync(musicDataTable.MusicDatas).GetMusicDatabaseApiResult("sending table... ");

                    Console.WriteLine("completed.");
                }
        }
コード例 #3
0
        public MainForm()
        {
            WebBrowserSettings.Initialize();
            InitializeComponent();

            if (useChromeWebBrowser)
            {
                chunithmNetChromeWebBrowser = new ChromiumWebBrowser(ChunithmNetUrl.Top);
                chunithmNetTab.Controls.Add(chunithmNetChromeWebBrowser);
                var connector = new ChunithmNetChromiumWebBrowserConnector(chunithmNetChromeWebBrowser);
                chunithmNetConnector = connector;
                resources.Add(connector);
                resources.Add(chunithmNetChromeWebBrowser);

                chunithmNetBackgroundChromeWebBrowser = new ChromiumWebBrowser(ChunithmNetUrl.Top);
                chunithmNetBackgroundChromeWebBrowser.CreateControl();
                var backgroundConnector = new ChunithmNetChromiumWebBrowserConnector(chunithmNetBackgroundChromeWebBrowser);
                chunithmNetBackgroundConnector = backgroundConnector;
                resources.Add(backgroundConnector);
                resources.Add(chunithmNetBackgroundChromeWebBrowser);
            }
            else
            {
                chunithmNetWebBrowser = new WebBrowser();
                chunithmNetWebBrowser.Navigate(ChunithmNetUrl.Top);
                chunithmNetTab.Controls.Add(chunithmNetWebBrowser);
                chunithmNetWebBrowser.Dock = DockStyle.Fill;
                var connector = new ChunithmNetWebBrowserConnector(chunithmNetWebBrowser);
                chunithmNetConnector = connector;
                resources.Add(connector);
                resources.Add(chunithmNetWebBrowser);

                chunithmNetBackgroundWebBrowser = new WebBrowser();
                this.Controls.Add(chunithmNetBackgroundWebBrowser);
                chunithmNetBackgroundWebBrowser.Visible = false;
                var backgroundConnector = new ChunithmNetWebBrowserConnector(chunithmNetBackgroundWebBrowser);
                chunithmNetBackgroundConnector = backgroundConnector;
                resources.Add(backgroundConnector);
                resources.Add(chunithmNetBackgroundWebBrowser);
            }

            dataManagerChromeWebBrowser = new ChromiumWebBrowser(urlDataManager);
            dataManagerTab.Controls.Add(dataManagerChromeWebBrowser);
            dataManagerConnector = new ChunithmMusicDatabaseHttpClientConnector("");
        }
コード例 #4
0
        private static IMusicDataTable <IMusicDataTableUnit> GetTable(Argument arg)
        {
            using (var connector = new ChunithmMusicDatabaseHttpClientConnector(arg.Host))
            {
                Console.WriteLine("get table...");
                var tableGet = connector.GetTableAsync().Result;
                if (tableGet.Success)
                {
                    Console.WriteLine("success.");
                }
                else
                {
                    Console.WriteLine("failure.");
                }

                return(tableGet.MusicDataTable);
            }
        }
コード例 #5
0
        public void Call(string[] args)
        {
            var arg = new Argument(args);

            IMusicDataTable <IMusicDataTableUnit> table = null;

            using (var connector = new ChunithmMusicDatabaseHttpClientConnector(arg.DataBaseUrl))
            {
                var tableGet = connector.GetTableAsync().Result;
                table = tableGet.MusicDataTable;
            }

            using (var writer = new StreamWriter(arg.DestinationPath))
            {
                var source = GenerateSource(table, arg.VersionName, arg.TemplateHtmlPath);
                writer.Write(source);
            }
        }
コード例 #6
0
        // 楽曲テーブルの取得
        private static void GetMusicDataTable()
        {
            if (!UPDATE_HISTORY)
            {
                musicDataTable = new MusicDataTable();
                return;
            }

            using (var databaseConnector = new ChunithmMusicDatabaseHttpClientConnector(""))
            {
                var getTableResult = databaseConnector.GetTableAsync().Result;
                if (!getTableResult.Success)
                {
                    throw new Exception("楽曲テーブルの取得に失敗");
                }
                if (getTableResult.MusicDataTable == null)
                {
                    throw new Exception("楽曲テーブルがnull");
                }
                musicDataTable = new MusicDataTable();
                musicDataTable.Add(getTableResult.MusicDataTable);
                Console.WriteLine("楽曲テーブル取得");
            }
        }
コード例 #7
0
        private static IMusicDataTable <IMusicDataTableUnit> GetMusicDataTable(string url)
        {
            var connector = new ChunithmMusicDatabaseHttpClientConnector(url);

            return(connector.GetTableAsync().Result.MusicDataTable);
        }
コード例 #8
0
 public PlayerDataTable(IChunithmNetConnector chunithmNetConnector, ChunithmMusicDatabaseHttpClientConnector dataManagerConnector)
 {
     this.chunithmNetConnector = chunithmNetConnector ?? throw new ArgumentNullException(nameof(chunithmNetConnector));
     this.dataManagerConnector = dataManagerConnector ?? throw new ArgumentNullException(nameof(dataManagerConnector));
 }