using System.Collections; using System.Collections.Generic; using Thousandto.Code.Logic.Network; using UnityEngine; /// /// 消息拓展类 /// public class MsgExtend { static MsgExtend _sharedInstance = null; public static MsgExtend Instance { get { return SharedInstance; } } public static MsgExtend SharedInstance { get { if (_sharedInstance == null) { _sharedInstance = new MsgExtend(); } return _sharedInstance; } } //lua消息ID表 public HashSet ResLuaMsgIDMap = new HashSet(); public HashSet ResLuaExtendMsgIDMap = new HashSet(); private HashSet ResCSMsgIDMap = new HashSet(); private bool isInitMsg = false; //这个消息是否走lua端 public bool IsGoLuaMsg(uint msgId) { if (!isInitMsg) { isInitMsg = true; } return !ResCSMsgIDMap.Contains(msgId) && (ResLuaMsgIDMap.Contains(msgId) || msgId >= 500000); } //这个消息是否是lua扩展消息,lua和C#同时处理 public bool IsGoLuaExtendMsg(uint msgId) { return ResLuaExtendMsgIDMap.Contains(msgId); } }