Esempio n. 1
0
        public static void Handle(Player account, byte[] buffer)
        {
            MsgRemoteText packet = buffer;

            foreach (var mapObject in GameWorld.Maps.Values.SelectMany(value => value.Entities.Values).OfType <Player>())
            {
                //mapObject.Send(MsgText.CreateFor(packet.Header, Constants.ALLUSERS, packet.Message, MsgTextType.Service));
            }
        }
Esempio n. 2
0
        public static byte[] Create(string header, string message)
        {
            var packet = new MsgRemoteText
            {
                Size = 532,
                Id   = 2
            };

            for (var i = 0; i < header.Length; i++)
            {
                packet.Header[i] = (byte)header[i];
            }

            for (var i = 0; i < message.Length; i++)
            {
                packet.Message[i] = (byte)message[i];
            }
            return(packet);
        }
Esempio n. 3
0
        internal static byte[] Create(ConsoleColor colorCode, string message)
        {
            var header = "Info";

            switch (colorCode)
            {
            case ConsoleColor.White:
            case ConsoleColor.Cyan:
            case ConsoleColor.Blue:
                break;

            case ConsoleColor.Green:
                header = "Win";
                break;

            case ConsoleColor.Red:
                header = "ERROR";
                break;
            }
            var packet = new MsgRemoteText
            {
                Size = 532,
                Id   = 2
            };

            for (var i = 0; i < header.Length; i++)
            {
                packet.Header[i] = (byte)header[i];
            }

            for (var i = 0; i < message.Length; i++)
            {
                packet.Message[i] = (byte)message[i];
            }
            return(packet);
        }