Beispiel #1
0
 public void SendMsgToMap(string szMsg, ChatTone pChat = ChatTone.TOP_LEFT)
 {
     foreach (var pUser in Players.Values)
     {
         pUser.Send(szMsg, pChat);
     }
 }
Beispiel #2
0
 public static void SendMessageToAll(string message, ChatTone tone)
 {
     foreach (var plr in Players.Values)
     {
         plr.SendMessage(message, tone);
     }
 }
Beispiel #3
0
 public void SendMessageToMap(string szMsg, ChatTone chatTone)
 {
     foreach (var plr in Players.Values)
     {
         plr.Send(szMsg, chatTone);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Packet Type: 1004. This packet is sent to the client to display an in-game message from the server or from
 /// another player. It can also be used to direct the client during login to the world or to the character
 /// creation screen. Generic messages can be found in the class below this one (ServerMessages class).
 /// </summary>
 /// <param name="message">The message text being sent in the packet to the player.</param>
 /// <param name="tone">The tone of the message (where it is displayed in the client).</param>
 /// <param name="color">The hue of the message (default is white).</param>
 public MsgTalk(string message, ChatTone tone, Color color)
     : base(0)
 {
     Hue       = color;
     Tone      = tone;
     Style     = ChatStyle.NORMAL;
     Recipient = ALLUSERS;
     Sender    = SYSTEM;
     Suffix    = "";
     Message   = message;
 }
Beispiel #5
0
        public void Send(string szMsg, bool bSelf, ChatTone pTone = ChatTone.TOP_LEFT)
        {
            var pMsg = new MsgTalk(szMsg, pTone);

            if (bSelf)
            {
                m_pOwner.Send(pMsg);
            }
            foreach (var pRole in m_pPlayers.Values.Cast <Character>())
            {
                pRole.Send(pMsg);
            }
        }
Beispiel #6
0
        public string Message;      // The text for the message, what is sent in the message.
        // Notes about the packet: The message id can be the client id, or the current hour * 100 + the current
        // minute ((now.Hour * 100) + now.Minute). The suffix can be the date an offline message was sent on.

        /// <summary>
        /// Packet Type: 1004. This packet is sent to the client to display an in-game message from the server or from
        /// another player. It can also be used to direct the client during login to the world or to the character
        /// creation screen. Generic messages can be found in the class below this one (ServerMessages class).
        /// </summary>
        /// <param name="receivedPacket">The received packet from the server's packet handler.</param>
        public MsgTalk(byte[] receivedPacket)
            : base(receivedPacket)
        {
            // Read in normal data values:
            Hue           = Color.FromArgb(ReadInt(4));
            Tone          = (ChatTone)ReadUShort(8);
            Style         = (ChatStyle)ReadUShort(10);
            Identity      = ReadUInt(12);
            RecipientMesh = ReadUInt(16);
            SenderMesh    = ReadUInt(20);

            // Read in strings:
            Sender    = ReadString(ReadByte(25), 26);
            Recipient = ReadString(ReadByte(26 + Sender.Length), 27 + Sender.Length);
            Suffix    = ReadString(ReadByte(27 + Sender.Length + Recipient.Length), 28 + Sender.Length + Recipient.Length);
            Message   = ReadString(ReadByte(28 + Sender.Length + Recipient.Length + Suffix.Length), 29 + Sender.Length + Recipient.Length + Suffix.Length);
        }
 /// <summary>
 /// This method will send a text message to the user interface. It can only be sent after a successful login.
 /// </summary>
 /// <param name="text">The text message that will be sent to the user.</param>
 /// <param name="tone">Where the message will be located.</param>
 public void SendMessage(string text, ChatTone tone = ChatTone.TOP_LEFT)
 {
     Send(new MsgTalk(text, tone));
 }