private void FPS_Conn(Type publishType, int code, IEventArgs args, object[] param) { if (args is ConnArg) { ConnArg c = (ConnArg)args; connected = c.conn; } if (args is FpsArg) { FpsArg c = (FpsArg)args; fps = c.fps; } }
private void ListenMessage(Type publishType, int code, IEventArgs args, object[] param) { if (args is ConnArg) { ConnArg ar = (ConnArg)args; if (ar.conn) { err_text = string.Format("<color=#BC00FFFF>【{0}】 Connect Sever Sucess</color>", DateTime.Now.ToString("HH:mm:ss")); } else { if (string.IsNullOrEmpty(ar.err)) { err_text = string.Format("<color=#BC00FFFF>【{0}】 Try Connect Sever {1}</color>", DateTime.Now.ToString("HH:mm:ss"), ar.count); } else { err_text = string.Format("<color=#BC00FFFF>【{0}】 {1}</color>", DateTime.Now.ToString("HH:mm:ss"), ar.err); } } } if (param == null || param.Length == 0) { return; } if (param[0] is SeverFormBroadCast) { SeverFormBroadCast br = param[0] as SeverFormBroadCast; text = string.Format("【{1}】 Sever : <color=#BC00FFFF>{0}</color>", br.message, DateTime.Now.ToString("HH:mm:ss")); } if (param[0] is PanBroadCast) { PanBroadCast br = param[0] as PanBroadCast; text = string.Format("【{4}】 {0} 绘制 [{1},{2}] <color=#{3}>■Color {3}</color> 半径{5}", br.name, br.colomn.posX, br.colomn.posY, br.colomn.color, DateTime.Now.ToString("HH:mm:ss"), br.size); } if (param[0] is loginBroadCast) { loginBroadCast br = param[0] as loginBroadCast; text = string.Format("【{1}】 {0} 上线了", br.name, DateTime.Now.ToString("HH:mm:ss")); } if (param[0] is LoginResponse) { LoginResponse br = param[0] as LoginResponse; err_text = string.Format("<color=#BC00FFFF>【{0}】 登录 {1}</color>", DateTime.Now.ToString("HH:mm:ss"), br.err); } if (param[0] is RegisterResponse) { RegisterResponse br = param[0] as RegisterResponse; err_text = string.Format("<color=#BC00FFFF>【{0}】 注册 {1}</color>", DateTime.Now.ToString("HH:mm:ss"), br.err); } if (param[0] is PanResponse) { danmu = string.Format("<color=#D9934F66>【{0}】图片请求中</color>", DateTime.Now.ToString("HH:mm:ss")); } if (param[0] is ChatBroadCast) { ChatBroadCast br = param[0] as ChatBroadCast; danmu = string.Format("【{2}】{0}: {1}", br.name, br.message, DateTime.Now.ToString("HH:mm:ss")); } }