Пример #1
0
 public JournalEntry(DateTime time, uint serial, string name, string text, ushort color, SpeechType type, SpeechFont font, JournalEntrySource source)
 {
     TimeStamp = time;
     Serial = serial;
     Name = name;
     Text = text;
     Color = color;
     Type = type;
     Font = font;
     Source = source;
 }
Пример #2
0
 public JournalEntry(JournalEntry e, string text)
 {
     TimeStamp = e.TimeStamp;
     Serial = e.Serial;
     Name = e.Name;
     Text = text;
     Color = e.Color;
     Type = e.Type;
     Font = e.Font;
     Source = e.Source;
 }
Пример #3
0
 public JournalEntry(DateTime time, uint serial, string name, string text, ushort color, SpeechType type, SpeechFont font, JournalEntrySource source)
 {
     TimeStamp = time;
     Serial    = serial;
     Name      = name;
     Text      = text;
     Color     = color;
     Type      = type;
     Font      = font;
     Source    = source;
 }
Пример #4
0
        public static byte[] SpeechRequestAscii(SpeechType type, SpeechFont font, ushort color, string text)
        {
            // For security reasons
            if (text.Length > Core.MaxSpeechLenght)
            {
                text = text.Remove(Core.MaxSpeechLenght);
            }

            PacketWriter writer = new PacketWriter(0x03);

            writer.WriteBlockSize();
            writer.Write((byte)type);
            writer.Write(color);
            writer.Write((ushort)font);
            writer.WriteAsciiString(text);

            return(writer.GetBytes());
        }
Пример #5
0
        public static byte[] CharacterSpeechAscii(uint serial, ushort model, string name, SpeechType type, SpeechFont font, ushort color, string text)
        {
            // For security reasons
            if (text.Length > Core.MaxSpeechLenght)
                text = text.Remove(Core.MaxSpeechLenght);

            PacketWriter writer = new PacketWriter(0x1C);

            writer.WriteBlockSize();
            writer.Write(serial);
            writer.Write(model);
            writer.Write((byte)type);
            writer.Write(color);
            writer.Write((ushort)font);
            writer.WriteAsciiString(name, 30);
            writer.WriteAsciiString(text);

            return writer.GetBytes();
        }
Пример #6
0
        private static void PrintInternal(string speaker, string text, ushort color, SpeechFont font, SpeechType type)
        {
            if (text != null)
            {
                string[] lines = text.Split('\n');
                for (int i = 0; i < lines.Length; i++)
                {
                    byte[] data;

                    if (UseUnicodePrint)
                    {
                        data = PacketBuilder.CharacterSpeechUnicode(0xFFFFFFFF, 0xFFFF, speaker, type, font, color, lines[i]);
                    }
                    else
                    {
                        data = PacketBuilder.CharacterSpeechAscii(0xFFFFFFFF, 0xFFFF, speaker, type, font, color, lines[i]);
                    }

                    Core.SendToClient(data, true);
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Prints the specified font.
        /// </summary>
        /// <param name="font">The font.</param>
        /// <param name="color">The color.</param>
        /// <param name="format">The format.</param>
        /// <param name="args">The args.</param>
        public static void Print(SpeechFont font, ushort color, string format, params object[] args)
        {
            string text = String.Format(format, args);

            PrintInternal("Phoenix", text, color, font, SpeechType.Regular);
        }
Пример #8
0
 /// <summary>
 /// Prints the specified font.
 /// </summary>
 /// <param name="font">The font.</param>
 /// <param name="color">The color.</param>
 /// <param name="format">The format.</param>
 /// <param name="args">The args.</param>
 public static void Print(SpeechFont font, ushort color, string format, params object[] args)
 {
     string text = String.Format(format, args);
     PrintInternal("Phoenix", text, color, font, SpeechType.Regular);
 }
Пример #9
0
        private static void PrintInternal(string speaker, string text, ushort color, SpeechFont font, SpeechType type)
        {
            if (text != null) {
                string[] lines = text.Split('\n');
                for (int i = 0; i < lines.Length; i++) {
                    byte[] data;

                    if (UseUnicodePrint)
                        data = PacketBuilder.CharacterSpeechUnicode(0xFFFFFFFF, 0xFFFF, speaker, type, font, color, lines[i]);
                    else
                        data = PacketBuilder.CharacterSpeechAscii(0xFFFFFFFF, 0xFFFF, speaker, type, font, color, lines[i]);

                    Core.SendToClient(data, true);
                }
            }
        }
Пример #10
0
        public static byte[] SpeechRequestUnicode(SpeechType type, SpeechFont font, ushort color, string text)
        {
            // For security reasons
            if (text.Length > Core.MaxSpeechLenght)
                text = text.Remove(Core.MaxSpeechLenght);

            PacketWriter writer = new PacketWriter(0xAD);

            writer.WriteBlockSize();
            writer.Write((byte)type);
            writer.Write(color);
            writer.Write((ushort)font);
            writer.WriteAsciiString("CSY", 4);
            writer.WriteUnicodeString(text);

            return writer.GetBytes();
        }
Пример #11
0
        public static byte[] CharacterSpeechAscii(uint serial, ushort model, string name, SpeechType type, SpeechFont font, ushort color, string text)
        {
            // For security reasons
            if (text.Length > Core.MaxSpeechLenght)
            {
                text = text.Remove(Core.MaxSpeechLenght);
            }

            PacketWriter writer = new PacketWriter(0x1C);

            writer.WriteBlockSize();
            writer.Write(serial);
            writer.Write(model);
            writer.Write((byte)type);
            writer.Write(color);
            writer.Write((ushort)font);
            writer.WriteAsciiString(name, 30);
            writer.WriteAsciiString(text);

            return(writer.GetBytes());
        }