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; }
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; }
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()); }
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(); }
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); } } }
/// <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); }
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); } } }
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(); }
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()); }