コード例 #1
0
 /// <summary>
 /// Handles private messages by the character.
 /// </summary>
 /// <param name="character">The character to handle packet for.</param>
 /// <param name="packet">The packet containing handle data.</param>
 public void Handle(Character character, Packet packet)
 {
     if (!character.Muted)
     {
         long   name    = packet.ReadLong();
         int    length  = packet.ReadByte() & 0xFF;
         string message = ChatUtilities.DecryptChat(packet, length);
         character.Contacts.SendMessage(name, message);
     }
 }
コード例 #2
0
        /// <summary>
        /// Handles the chat information sent from the client.
        /// </summary>
        /// <param name="character">The character to handle packet for.</param>
        /// <param name="packet">The packet containing handle data.</param>
        public void Handle(Character character, Packet packet)
        {
            if (!character.Muted)
            {
                int    effects = packet.ReadShort() & 0xFFFF;
                int    length  = packet.ReadByte();
                string text    = ChatUtilities.DecryptChat(packet, length);

                if (character.ClanRoom != null && text.StartsWith("/"))
                {
                    GameEngine.Content.ClanChat.Message(character, text.Substring(1));
                }
                else
                {
                    character.Speak(ChatMessage.Create(effects, length, text));
                    ChatUtilities.LogChat(character.Name, ChatType.Normal, null, text);
                }
            }
        }