Ejemplo n.º 1
0
        /// <summary>
        /// 初始化COre
        /// </summary>
        public static void Core_Init(SatrtType satrtType = SatrtType.DDTV_Core)
        {
            Console.WriteLine($"========================\nDDTV_Core启动,当前版本:{Ver}\n========================");
            Log.LogInit(LogClass.LogType.Debug);
            //TestVetInfo();
            ServicePointManager.SecurityProtocol       = SecurityProtocolType.Tls12;
            ServicePointManager.DefaultConnectionLimit = 1024 * 1024 * 1024;
            ServicePointManager.Expect100Continue      = false;
            CoreConfig.ConfigInit(satrtType);
            Tool.DDTV_Update.CheckTheUpdateProgramForUpdates();

            //switch (satrtType)
            //{
            //    case SatrtType.DDTV_Core:
            //        Tool.DDTV_Update.ComparisonVersion("Core", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            //        break;
            //    case SatrtType.DDTV_GUI:
            //        Tool.DDTV_Update.ComparisonVersion("GUI", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            //        break;
            //    case SatrtType.DDTV_WEB:
            //        Tool.DDTV_Update.ComparisonVersion("WEB", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            //        break;
            //}


            #region 测试代码


            //SystemAssembly.ConfigModule.RoomConfig.AddRoom(473244363,"");

            //while (true)
            //{
            //    if (Console.ReadKey().Key.Equals(ConsoleKey.I))
            //    {
            //        Console.WriteLine($"请输入UID");
            //        long uid = long.Parse(Console.ReadLine());
            //        SystemAssembly.DownloadModule.Download.CancelDownload(uid);
            //    }
            //}
            //SystemAssembly.DownloadModule.Download.AddDownloadTaskd(408490081);
            //List<long> vs = new List<long>()
            //{
            //    17661166,
            //    1081765694,
            //    269415357,
            //    36576761,
            //    2096422,
            //    8041302
            //};
            //Task.Run((Action)(() =>
            //{
            //    foreach (var item in vs)
            //    {
            //        BilibiliModule.API.WebSocket.WebSocket.ConnectRoomAsync(item.Value.uid);
            //var roomInfo = SystemAssembly.BilibiliModule.API.WebSocket.WebSocket.ConnectRoomAsync(122459);
            //roomInfo.roomWebSocket.LiveChatListener.MessageReceived += LiveChatListener_MessageReceived;
            //        Thread.Sleep(1000);
            //    }
            //}));
            //while (true)
            //{
            //    int i = 1;
            //    foreach (var item in BilibiliModule.Rooms.Rooms.RoomInfo)
            //    {
            //        if (item.Value.roomWebSocket.IsConnect)
            //        {
            //            long Time = TimeModule.Time.Operate.GetRunMilliseconds()-item.Value.roomWebSocket.dokiTime;
            //            Console.WriteLine(Time>35000 ? "no■"+Time : "ko□"+Time+$" {i} {item.Value.room_id} {item.Value.roomWebSocket.LiveChatListener.host.host_list[0].host}");
            //            i++;
            //        }

            //    }
            //    Thread.Sleep(10000);
            //}

            //BilibiliModule.API.DanMu.getDanmuInfo(411812743);
            //var ttt = BilibiliModule.Rooms.Rooms.GetValue(125555553, DataCacheModule.DataCacheClass.CacheType.is_sp);
            //Console.WriteLine(BilibiliModule.Rooms.Rooms.AddRoom(494850406, "test"));
            //BilibiliModule.API.RoomInfo.room_init(2299184);
            //string url = BilibiliModule.API.RoomInfo.playUrl(2299184, BilibiliModule.Rooms.RoomInfoClass.PlayQuality.OriginalPainting);
            //DownloadModule.Download.DownFLV_WebClient(url);
            //BilibiliModule.API.DanMu.send(BilibiliModule.Rooms.Rooms.GetValue(408490081, DataCacheModule.DataCacheClass.CacheType.room_id), "DDTV3.0弹幕发送测试");
            #endregion
        }