Esempio n. 1
0
        public void SendNoticeMessage(string strMsg)
        {
            //发送消息
            NPacket packet = NPacketPool.GetEnablePacket();

            packet.CreateHead(MainCommand.MDM_GR_SYSTEM, SubCommand.SUB_GR_MESSAGE);
            packet.AddUShort((ushort)0);
            packet.AddUShort((ushort)strMsg.Length);
            packet.AddString(strMsg, StringHelper.GetStringLength(strMsg));
            Send(packet);
        }
Esempio n. 2
0
        public void SendChatMessage(uint dwTargetID, string strMsg, uint emotion)
        {
            //发送消息
            NPacket packet = NPacketPool.GetEnablePacket();

            packet.CreateHead(MainCommand.MDM_GF_FRAME, SubCommand.SUB_GF_USER_CHAT);
            packet.AddUShort((ushort)StringHelper.GetStringLength(strMsg));
            packet.AddUInt(emotion);
            packet.AddUInt(MySelf.ID);
            packet.AddUInt(dwTargetID);
            packet.AddString(strMsg, StringHelper.GetStringLength(strMsg));
            Send(packet);
        }