void Share_Onclik() { if (MessageMgr.GetInstance()._NowCount <= 0) { if (Core.SM.CurScenesName == SceneName.GAME_BATTLE) { //ycg SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(20081), BanBattleManager.Instance.go_uiPanel); } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(20081)); } return; } string mContent = ""; if (minput != null) { mContent = "#$&" + _videoid + "{{@}}" + mTitle.text + "#$&" + minput.value; MessageMgr.GetInstance().SendWorldChat2(mContent); minput.value = ""; } Destroy(gameObject); }
/// <summary> /// 根据标题查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Query_Click(object sender, EventArgs e) { this.AllMessage.Visible = true; string msgName = this.txtMessageTitle.Value.Trim(); if (msgName == "") { this.hint.InnerHtml = "请输入标题"; this.AllMessage.Visible = false; this.showPager.Visible = true; } else { MessageMgr mgr = new MessageMgr(); List <Message> message = mgr.LookSingleMessage(msgName); if (message != null) { this.MsgRepeater.DataSource = message; this.MsgRepeater.DataBind(); this.showPager.Visible = false; this.hint.InnerHtml = ""; } else { this.hint.InnerHtml = "标题输入错误或者不存在"; this.AllMessage.Visible = false; this.showPager.Visible = true; } } }
void Back_OnClick() { MessageMgr.GetInstance().DeleteChatCell(); DBUIController.mDBUIInstance.ShowFor2D_UI(); DBUIController.mDBUIInstance.RefreshUserInfo(); Destroy(gameObject); }
public void OnShow() { CheckSocketConnect(); mUITable2.Reposition(); SetFreeNum(MessageMgr.GetInstance()._NowCount); MessageMgr.GetInstance().ShowChatList(); }
private void Update() { if (msgQueue.Count != 0) { MessageMgr.SendMessageToUIForm(EnumUIFormType.MainUIForm, Define.ON_ADD_DEBUG_DATA, msgQueue.Dequeue()); } }
//回车键触发这个函数 public void ToSendText(string text) { text.Trim(); if (this.toggle.isOn) { if (text.Length > 0) { var strs = text.Split(' '); if (strs.Length != 2 || int.Parse(strs[1]) == null) { //层层封装后,服务器和客户端之间发送消息,就可以这样简单 MessageMgr.Q_SendText(text); //MessageMgr.SendObject(MessageData.Init(new MessageData(), text, UserName)); } else { MessageMgr.SendMessage(SocketNetWork.udpClientSocket, text, SocketNetWork.udpServerEnd); //MessageMgr.SendObject(MessageData.Init(new MessageData(), Convert.ToInt32(strs[0]), Convert.ToInt32(strs[1]), UserName)); } } } else { //MessageMgr.SendMessage(SocketNetWork.udpClientSocket, text, SocketNetWork.udpServerEnd); MessageMgr.SendObject(SocketNetWork.tcpServerSocket, MessageData.Init(text, MessageType.Merge, UserName)); } }
void Send_OnClick() { if (m_nleftCnt <= 0) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(20093)); return; } string mContent = ""; if (mInput != null) { mContent = mInput.value; if (mInput.value.Contains("#$&") || mInput.value.Contains("{{@}}")) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(75003)); return; } if (GetTextLength() > 50) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(25132)); return; } MessageMgr.GetInstance().SendWorldChat(mContent); mInput.value = ""; } }
//发送图片时调用 void ToSendFile(PointerEventData data) { var path = OpenProject(); print("获取路径为" + path); if (string.IsNullOrEmpty(path)) { return; } FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read); var index = fs.Name.LastIndexOf('\\'); var str = new string(fs.Name.ToCharArray(), index + 1, fs.Name.Length - index - 1); print("文件名" + str); BinaryReader strread = new BinaryReader(fs); byte[] byt = new byte[fs.Length]; Debug.Log("本次发送数据长度:" + byt.Length); strread.Read(byt, 0, byt.Length - 1); //MessageMgr.SendMessage(SocketNetWork.socket, byt); MessageMgr.SendObject(MessageData.Init(new MessageData(), str, UserName, byt)); strread.Close(); }
void Start() { m_Content.SafeText(""); m_StrLength = (float)m_Content.width; m_Url = MessageMgr.GetInstance().Upgrape; SetContentDetail(Core.Data.stringManager.getString(25171)); }
private void OnClickButton() { UserModel.SelectionIndex = index; MessageMgr.SendMessage(Define.GLOBAL_MESSAGE_TYPE, Define.ON_SELECTION_MSG, debugData.ID); UIManager.Instance.OpenUIForms(EnumUIFormType.SelectMsgUIForm); MessageMgr.SendMessageToUIForm(EnumUIFormType.SelectMsgUIForm, "Info", debugData.Condition + "\n" + debugData.StackTrace); }
private void OnDestroy() { MessageMgr.RemoveMsgListener(m_CurrentClassName + "Msg", OnCurrentUIFormMsgEvent); MessageMgr.RemoveMsgListener(UIDefine.GLOBAL_UI_FORM_MSG_EVENT, OnGlobalUIFormMsgEvent); OnRelease(); }
public static MessageMgr GetInstance() { if (mMessageMgr == null) { mMessageMgr = new MessageMgr(); } return(mMessageMgr); }
public static MessageMgr GetIns() { if (null == instance) { instance = new MessageMgr(); } return(instance); }
void OnDestroy() { mInput = null; mUITable2 = null; mFreeNum = null; MessageMgr.GetInstance().Clear(); _instance = null; }
void OnEndTalk(PointerEventData f) { AudioClip ap; int length; MicrophoneMgr.EndRecording(out length, out ap); MessageMgr.SendObject(MessageData.Init(new MessageData(), WavUtility.FromAudioClip(ap), this.UserName)); }
private void Awake() { string[] tempStringArr = GetType().ToString().Split('.'); m_CurrentClassName = tempStringArr[tempStringArr.Length - 1]; OnAwake(); MessageMgr.AddMsgListener(m_CurrentClassName + "Msg", OnCurrentUIFormMsgEvent); MessageMgr.AddMsgListener(UIDefine.GLOBAL_UI_FORM_MSG_EVENT, OnGlobalUIFormMsgEvent); }
private void Awake() { text_Content = UnityHelper.FindTheChildNode(gameObject, "Msg").GetComponent <Text>(); image_Log = UnityHelper.FindTheChildNode(gameObject, "Log").GetComponent <Image>(); image_Warning = UnityHelper.FindTheChildNode(gameObject, "Warning").GetComponent <Image>(); image_Error = UnityHelper.FindTheChildNode(gameObject, "Error").GetComponent <Image>(); RigisterAllButtonObjectEvent(OnClickButton); MessageMgr.AddMsgListener("LatestMsgUIFormMsg", OnMessagesEvent); }
private void Awake() { mLoopListView = UnityHelper.FindTheChildNode(gameObject, "Viewport").GetComponent <LoopListView2>(); mLoopListView.InitListView(0, OnGetItemByIndex); scrollbar = UnityHelper.FindTheChildNode(gameObject, "Scrollbar").GetComponent <Scrollbar>(); MessageMgr.AddMsgListener("AllMsgUIFormMsg", OnUIFormMessagesEvent); MessageMgr.AddMsgListener(Define.GLOBAL_MESSAGE_TYPE, OnGlobalMessagesEvent); }
private void Awake() { scrollRect = UnityHelper.FindTheChildNode(gameObject, "ScrollRect").GetComponent <ScrollRect>(); scrollRect.enabled = false; text_Msg = UnityHelper.FindTheChildNode(gameObject, "Msg").GetComponent <Text>(); inputField = UnityHelper.FindTheChildNode(gameObject, "InputField").GetComponent <InputField>(); RigisterAllButtonObjectEvent(OnClickButton); MessageMgr.AddMsgListener("SelectMsgUIFormMsg", OnMessagesEvent); inputField.onValueChanged.AddListener(Change); inputField.onEndEdit.AddListener(End); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int msgID = int.Parse(Request.QueryString["msgID"]); MessageMgr msg = new MessageMgr(); Message allMsg = msg.ShowSingleMessage(msgID); this.title.InnerText = allMsg.msgTitle; this.contents.InnerHtml = allMsg.msgContents; msg.UpdateMessageTotal(msgID); } }
// Start is called before the first frame update void Start() { if (disposable == null) { disposable = new Disposable(); MessageMgr.GetIns().RegisterMessage <string>("UIMessage", Execute, disposable); } string uimessageBarMenu = "mrtp://UIMessage/BarMenuSetting/实景直播=mrtp://UIMessage/LocalSearch/spaceName=测试空间&tag=风景&keyWord=测试|虚拟直播=mrtp://UIMessage/LocalSearch/spaceName=测试空间&tag=风景&keyWord=测试"; string uimessageUIAdjust = "mrtp://UIMessage/UIAdjustSetting/视频浏览=off&home=on&播放列表=off"; MessageMgr.GetIns().Dispatch("UIMessage", uimessageBarMenu); MessageMgr.GetIns().Dispatch("UIMessage", uimessageUIAdjust); }
public static int DeleteMessage(int msgID) { MessageMgr sm = new MessageMgr(); if (sm.DeleteAnnunciate(msgID)) { return(1); } else { return(0); } }
private void Awake() { m_Name = transform.Find("Name").GetComponent <Text>(); m_CombatEffectiveness = transform.Find("CombatEffectiveness").GetComponent <Text>(); m_Gold = transform.Find("Gold").GetComponent <Text>(); m_Name.text = "角色姓名:" + UserDatas.Name; UpdatCombatEffectiveness(); UpdateGold(); //注册事件>>>>>>>>>>>>>>>>>>>>>>>>>>>>> MessageMgr.AddMsgListener("TestMessageCenter", OnTestMessageCenterEvent); }
public void LoadAssetBundle() { MessageMgr.addMessagePaser <Login_c2s>(1); MessageMgr.addMessagePaser <Login_s2c>(2); MessageMgr.AddMessageListener(2, (m) => { var msg = (Login_s2c)m; Debug.Log("log ret:" + msg.retCode); }); StartCoroutine(LoadTest()); }
static void Main(string[] args) { var demo = new MessageMgr(); var demo2 = new Message2Mgr(); var demo3 = new MultiMessageMgr(); var demo4 = new MultiMessageMgrWithDepictUsingLayMode(); demo.Run(); demo2.Run(); demo3.Run(); demo4.Run(); System.Console.Read(); }
private void UpdataDebugCount() { DebugCountInfo debugCount = new DebugCountInfo(); debugCount.Count = dicCurrentData.Count; debugCount.LogCount = logCount; debugCount.WarningCount = warningCount; debugCount.ErrorCount = errorCount; string msg = JsonUtility.ToJson(debugCount); MessageMgr.SendMessageToUIForm(EnumUIFormType.MainUIForm, Define.ON_UPDATE_DEBUG_COUNT, msg); MessageMgr.SendMessageToUIForm(EnumUIFormType.AllMsgUIForm, Define.ON_UPDATE_DEBUG_COUNT, msg); }
/// /// 当用户注销的时候,这个必须被调用, 而且这个方法必须在跳场景之后 /// public void OnUnregister() { /// ********* 注销的设定 ******** mUnregister = true; /// /// 清理所有的底层信息, /// Core.TimerEng.deleteAllTask(); AsyncTask.RemoveAllDelayedWork(); /// /// 网络地址必须连接到UserCenter /// HttpClient.RevertToUserCenter(); /// /// 所有的数据必须全部同步 /// Core.Data.rechargeDataMgr.Unregister(); Core.Data.Unregister(); Core.Data.itemManager.ClearBagData(); Core.Data.guideManger.Clear(); Core.Data.sourceManager.Clear(); FinalTrialMgr trialMgr = FinalTrialMgr.GetInstance(); if (trialMgr != null) { trialMgr.Unregister(); } HttpRequestFactory._sessionId = "empty"; Core.Data.battleTeamMgr.Unregister(); #if UNITY_EDITOR UniqueGUID.getInstance().Unregister(); #endif /// /// 清除邮件 /// if (MailReveicer.Instance != null) { MailReveicer.Instance.DeleteMailReveicer(); } if (MessageMgr.GetInstance() != null) { MessageMgr.GetInstance().UnRegister(); } System.GC.Collect(); }
void GetResponseErrorCode(HttpTask _task) { if (_task != null) { if (_task.response != null) { if (_task.response.errorCode == 2109) { MessageMgr.GetInstance().Upgrape = _task.response.msg.url; AsyncTask.QueueOnMainThread(() => { UIVersinUpgrade.OpenUI(); }); } } } }
//分页显示 private void LoadPage() { //rows是Message的列表 MessageMgr msg = new MessageMgr(); Pager <Message> allMsg = msg.ShowPagerMessageList(this.pager.CurrentPageIndex - 1, this.pager.PageSize); this.MsgRepeater.DataSource = allMsg.rows; this.MsgRepeater.DataBind(); this.pager.RecordCount = allMsg.total; if (allMsg == null) { string warn = "暂时没有通告"; this.msgWarn.InnerHtml = warn; } }
private void AddLatestMsg(string key, string Content, LogType type) { int tempIndex = GetIndexByKey(key); if (tempIndex == -1) { return; } LatestMsgInfo latestMsgInfo = new LatestMsgInfo(); latestMsgInfo.Index = tempIndex; latestMsgInfo.Type = type; latestMsgInfo.Content = Content; UIManager.Instance.OpenUIForms(EnumUIFormType.LatestMsgUIForm); MessageMgr.SendMessageToUIForm(EnumUIFormType.LatestMsgUIForm, "LatestMsgInfo", JsonUtility.ToJson(latestMsgInfo)); }