/// <summary> /// 当接收到新数据 /// </summary> /// <param name="channel">协议ID</param> /// <param name="type">数据类型</param> /// <param name="buff">数据内容</param> void OnReceiveBuff(int channel, int type, byte[] buff) { ReciveMsgVO msgVo = new ReciveMsgVO(); msgVo.channel = channel; msgVo.type = type; msgVo.bytes = buff; GameMgr.Instance.ReciveMsgPool.Enqueue(msgVo); }
/// <summary> /// 当接收到新数据 /// </summary> /// <param name="channel">协议ID</param> /// <param name="type">数据类型</param> /// <param name="buff">数据内容</param> /// <param name="clientIndex">客户端序号</param> void OnReceiveBuff(int channel, int type, byte[] buff, int clientIndex) { ReciveMsgVO msgVo = new ReciveMsgVO(); msgVo.channel = channel; msgVo.type = type; msgVo.bytes = buff; msgVo.clientIndex = clientIndex; GameMgr.Instance.ReciveMsgPool.Enqueue(msgVo); waitMsgList.Remove(channel); if (waitMsgList.Count == 0) { Timer.Instance.AddTimer(0, 1, 0, () => { UIManager.Instance.SetWaitIconActive(waitMsgList.Count > 0); }); } }