public Packet93_BookHeaderOld_1_26_0(uint BookSerial, BookWriteableFlag writable, ushort numPages, string title, string author) : base(0x93, 99) { int i = 1; i += WriteUInt(i, BookSerial); m_Data[i++] = (byte)writable; m_Data[i++] = 0x01; // unknown (this is the extra byte for 1.26.0 I think) i += WriteUShort(i, numPages); WriteAsciiNull(i, title.Length <= 60 ? title : title.Substring(0, 59)); i += 60; WriteAsciiNull(i, author.Length <= 30 ? author : author.Substring(0, 29)); i += 30; }
public override bool OnSending() { if (Socket.Version >= ClientVersion.v1_26_0) { int i = 1; uint serial = ReadUInt(i); i += 4; BookWriteableFlag writable = (BookWriteableFlag)ReadByte(i); i++; ushort numPages = ReadUShort(i); i += 2; string title = ReadAsciiStringFixed(i, 60); i += 60; string author = ReadAsciiStringFixed(i, 30); i += 30; ReplacePacket(new Packet93_BookHeaderOld_1_26_0(serial, writable, numPages, title, author)); } return(true); }