// Use this for initialization void Start() { m_Client = new Client(); m_Client.DataReceived += (sender, msg) => { m_QueueMsg.Enqueue(PtMessagePackage.Read(msg.Data)); }; }
public void TickDispatchMessages() { while (m_QueueMsg.Count > 0) { Message msg = null; if (m_QueueMsg.TryDequeue(out msg)) { PtMessagePackage package = PtMessagePackage.Read(msg.Data); notifier.Send((C2SMessageId)package.MessageId, package.Content, msg); //Notify.NotifyMgr.Instance.Send((C2SMessageId)package.MessageId,new Notify.Notification() { Params = new object[] { package.Content,msg} }); } } }