/// <summary>
 /// 聊天
 /// </summary>
 public static void SendChat(eChatType type, long receiver, string content)
 {
     c2ss.ChatSend msg = PacketPools.Get(c2ss.msg.CHAT_SEND) as c2ss.ChatSend;
     msg.type         = type;
     msg.chat_content = content;
     if (type == eChatType.PRIVATE)
     {
         msg.receiver.SetIdx(receiver);
     }
     ClientNetManager.Instance.Send(msg);
 }
Example #2
0
        /// <summary>
        /// 发送聊天
        /// </summary>
        private void OnChatSend(PacketBase packet)
        {
            c2ss.ChatSend msg    = packet as c2ss.ChatSend;
            Player        player = UnitManager.Instance.GetPlayerByClientUID(msg.client_uid);

            if (player == null)
            {
                Log.Debug("OnChatSend 未找到unit:" + msg.client_uid.srv_uid + ", " + msg.client_uid.conn_idx);
                return;
            }

            ChatManager.Instance.HandleSendChat(player, msg.type, msg.receiver, msg.chat_content);
        }