Exemplo n.º 1
0
        public void Send(byte nFlag, IHotfixMessage rMessage)
        {
            NetworkOpcodeTypes rOpcodeTypes = this.mSession.Parent.OpcodeTypes;
            ushort             nOpcode      = rOpcodeTypes.GetOpcode(rMessage.GetType());

            byte[] rBytes = this.mMessagePacker.SerializeToByteArray(rMessage);

            Send(nFlag, nOpcode, rBytes);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 发送网络消息
        /// </summary>
        public void SendMsg(IHotfixMessage msg)
        {
            ushort msgID = _msgTypes.GetKeyByValue(msg.GetType());

            NetManager.Instance.SendMsg(msgID, msg);
        }