public bool AddParseMsgCb(Type type, ParseMessageCallback parsMsgCb) { try { if (m_msgFactory == null) { return(false); } CMsgID msgID = m_msgFactory.CreateMsgIDByType(type); if (msgID == null) { return(false); } if (m_hashtable.ContainsKey(msgID.MsgID)) { return(false); } m_msgFactory.AddMsgType(type); m_hashtable.Add(msgID.MsgID, parsMsgCb); } catch (System.Exception) { return(false); } return(true); }
public void DelMsgType(Type type) { CMsgID msg = CreateMsgIDByType(type); if (msg == null) { return; } m_hashtable.Remove(msg.MsgID); }
public void AddMsgType(Type type) { CMsgID msg = CreateMsgIDByType(type); if (msg == null) { return; } m_hashtable.Add(msg.MsgID, type.FullName); }
public void DelParseMsgCb(CMsgID msgID) { try { if (!m_hashtable.ContainsKey(msgID.MsgID)) { return; } m_hashtable.Remove(msgID.MsgID); } catch (System.Exception) { ; } }
public CMsg CreateMessageByMsgID(CMsgID msgID) { try { if (!m_hashtable.ContainsKey(msgID.MsgID)) { return(null); } string typeName = (string)m_hashtable[msgID.MsgID]; return(CreateMessageByTypeName(typeName)); } catch (System.Exception) { return(null); } }
public bool AddParseMsgCb(CMsgID msgID, ParseMessageCallback parsMsgCb) { try { if (m_hashtable.ContainsKey(msgID.MsgID)) { return(false); } m_hashtable.Add(msgID.MsgID, parsMsgCb); } catch (System.Exception) { return(false); } return(true); }
public bool DelParseMsgCb(Type type) { try { CMsgID msgID = m_msgFactory.CreateMsgIDByType(type); if (msgID == null) { return(false); } if (m_hashtable.ContainsKey(msgID.MsgID)) { m_hashtable.Remove(msgID.MsgID); } m_msgFactory.DelMsgType(type); return(true); } catch (System.Exception) { return(false); } }
public CMsg(uint msgID) { m_msgID = CMsgID.CreateMsgID(msgID); }
public CMsg(uint serverType, uint funcType, uint msgNumber) { m_msgID = CMsgID.CreateMsgID(serverType, funcType, msgNumber); }
public void AddMsgType(CMsgID msgID, Type type) { m_hashtable.Add(msgID.MsgID, type.FullName); }
public void DelMsgType(CMsgID msgID) { m_hashtable.Remove(msgID.MsgID); }