示例#1
0
		/// <summary>
		/// JikkyoIdから放送に接続する
		/// </summary>
		/// <param name="liveId"></param>
		/// <returns></returns>
		private bool connectJikkyoID(string jikkyoId)
		{
			if (_accountInfomation == null) {
				_mainview.ShowFatalMessage("ログインが完了していません");
				return false;
			}

			NicoApiSharp.Streaming.Jikkyo.GetFlv flvInfo = NicoApiSharp.Streaming.Jikkyo.GetFlv.GetInstance(jikkyoId);

			if (flvInfo != null) {
				if (!flvInfo.HasError) {
					_basicStatus = flvInfo;
					_watcherStatus = null;
					_messageServerStatus = flvInfo;
					_description = NicoApiSharp.Streaming.Jikkyo.JikkyoDescription.GetInstance(jikkyoId);
					_seetType = SeetType.Jikkyo;

					return ConnectServer(_accountInfomation, _description, _messageServerStatus);
				} else {
					_mainview.ShowFatalMessage(flvInfo.ErrorMessage);
				}
			}

			return false;
		}
示例#2
0
		/// <summary>
		/// チケット情報を元にメッセージサーバーへの接続を試みる
		/// </summary>
		/// <param name="ticket"></param>
		/// <returns></returns>
		public bool ConnectByLiveTicket(LiveTicket ticket)
		{
			if (ticket != null) {
				_basicStatus = ticket;
				_messageServerStatus = ticket;
				_description = ticket;
				_seetType = ticket.RoomLabel != "立ち見席" ? SeetType.Arena : SeetType.Standing;

				return ConnectServer(_accountInfomation, ticket, ticket);
			}

			return false;
		}
示例#3
0
		/// <summary>
		/// LiveIdから放送に接続する
		/// </summary>
		/// <param name="liveId"></param>
		/// <returns></returns>
		private bool connectLiveID(string liveId)
		{
			if (_accountInfomation == null) {
				_mainview.ShowFatalMessage("ログインが完了していません");
				return false;
			}

			NicoApiSharp.Streaming.Live.PlayerStatus playerStatus = NicoApiSharp.Streaming.Live.PlayerStatus.GetInstance(liveId);

			if (playerStatus != null) {
				if (!playerStatus.HasError) {
					_basicStatus = playerStatus;
					_watcherStatus = playerStatus;
					_messageServerStatus = playerStatus;
					_description = NicoApiSharp.Streaming.Live.LiveDescription.GetInstance(liveId);
					_seetType = _basicStatus.RoomLabel != "立ち見席" ? SeetType.Arena : SeetType.Standing;

					return ConnectServer(_accountInfomation, _description, _messageServerStatus);
				} else {
					_mainview.ShowFatalMessage(playerStatus.ErrorMessage);
				}
			}

			return false;
		}
示例#4
-2
		public bool StartMockLive(string liveId, string liveName, DateTime liveStart) {
			LiveTicket lt = new LiveTicket();
			lt.Id = liveId;
			lt.Title = liveName;
			lt.StartTime = liveStart;
			lt.LocalStartTime = liveStart;
			_basicStatus = lt;
			_messageServerStatus = lt;
			_description = lt;
			_seetType = SeetType.Arena;

			_chatReceiver.Disconnect();

			_chats.Clear();
			_ngChecker.Initialize(this);

			// プラグインに通知
			foreach (Hal.NCSPlugin.IPlugin plugin in _plugins) {
				plugin.OnLiveStart(this.Id, this.ServerStartTime, _chats.Count);
			}

			return true;

		}