Exemplo n.º 1
0
        public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer)
        {
            GCChat msg = (GCChat)pPacket;

            //Talk.Instance.ReceiveTalk(msg);
            Interface.Talk.Instance.HandleRecvTalkPacket(msg);
            return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Exemplo n.º 2
0
    public void ReceiveTalk(GCChat msg)
    {
        ENUM_CHAT_TYPE chatType = (ENUM_CHAT_TYPE)msg.ChatType;
        string         name     = EncodeUtility.Instance.GetUnicodeString(msg.SourName) + ":";
        string         text     = Encoding.UTF8.GetString(msg.Contex);
        // 删除不必要的多余字符
        string showText = (name + text).Replace("\0", "");

        if (chatType == ENUM_CHAT_TYPE.CHAT_TYPE_NORMAL)
        {
            ShowChat(showText, chatType);
            CObject_Character talker = (CObject_Character)CObjectManager.Instance.FindServerObject((int)msg.SourObject);
            talker.ShowTalk(text);
        }
        else if (chatType == ENUM_CHAT_TYPE.CHAT_TYPE_TELL)//私聊
        {
            ShowChat(showText, chatType);
        }
    }