private void CommentProvider_OnDisconnected(object sender, DisconnectEvtArgs e) { _mw.AppendLogln("INFO", "弹幕服务器断开"); //如果不是用户触发的,则尝试重连。 if (!IsRunning) { return; } _mw.AppendLogln("INFO", "尝试重新连接弹幕服务器"); _commentProvider.Connect(); }
private void CommentProvider_OnDisconnected(object sender, DisconnectEvtArgs e) { InfoLogger.SendInfo(Roomid, "INFO", "弹幕服务器断开"); //如果不是用户触发的,则尝试重连。 if (!force_stoping) { return; } InfoLogger.SendInfo(Roomid, "INFO", "尝试重新连接弹幕服务器"); commentProvider.Connect(); }
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); } }
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); } }