Beispiel #1
0
        private void CommentProvider_OnDisconnected(object sender, DisconnectEvtArgs e)
        {
            _mw.AppendLogln("INFO", "弹幕服务器断开");

            //如果不是用户触发的,则尝试重连。
            if (!IsRunning)
            {
                return;
            }
            _mw.AppendLogln("INFO", "尝试重新连接弹幕服务器");
            _commentProvider.Connect();
        }
Beispiel #2
0
        private void CommentProvider_OnDisconnected(object sender, DisconnectEvtArgs e)
        {
            InfoLogger.SendInfo(Roomid, "INFO", "弹幕服务器断开");

            //如果不是用户触发的,则尝试重连。
            if (!force_stoping)
            {
                return;
            }
            InfoLogger.SendInfo(Roomid, "INFO", "尝试重新连接弹幕服务器");
            commentProvider.Connect();
        }
Beispiel #3
0
 private CommentProvider ReceiveComment()
 {
     try
     {
         _commentProvider = new CommentProvider(_roomid, _mw);
         _commentProvider.OnDisconnected      += CommentProvider_OnDisconnected;
         _commentProvider.OnReceivedRoomCount += CommentProvider_OnReceivedRoomCount;
         _commentProvider.OnReceivedComment   += CommentProvider_OnReceivedComment;
         _commentProvider.Connect();
         return(_commentProvider);
     }catch (Exception e)
     {
         _mw.AppendLogln("ERROR", "弹幕服务器出错:" + e.Message);
         return(null);
     }
 }
Beispiel #4
0
 private CommentProvider ReceiveComment()
 {
     try
     {
         var _commentProvider = new CommentProvider(realRoomid);
         _commentProvider.OnDisconnected      += CommentProvider_OnDisconnected;
         _commentProvider.OnReceivedRoomCount += CommentProvider_OnReceivedRoomCount;
         _commentProvider.OnReceivedComment   += CommentProvider_OnReceivedComment;
         _commentProvider.Connect();
         return(_commentProvider);
     }
     catch (Exception e)
     {
         InfoLogger.SendInfo(Roomid, "ERROR", "弹幕服务器出错:" + e.Message);
         return(null);
     }
 }