I added this class:
Code:
public sealed class LinkedBookHeader : Packet
{
public LinkedBookHeader(Mobile from, BaseBook book)
: base(0xD4)
{
string title = book.Title == null ? "" : book.Title;
string author = book.Author == null ? "" : book.Author;
byte[] titleBuffer = Utility.UTF8.GetBytes(title);
byte[] authorBuffer = Utility.UTF8.GetBytes(author);
EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
m_Stream.Write((int)book.Serial);
m_Stream.Write((bool)true);
m_Stream.Write((bool)book.Writable);
m_Stream.Write((ushort)book.PagesCount);
m_Stream.Write((ushort)(titleBuffer.Length + 1));
m_Stream.Write(titleBuffer, 0, titleBuffer.Length);
m_Stream.Write((byte)0); // terminate
m_Stream.Write((ushort)(authorBuffer.Length + 1));
m_Stream.Write(authorBuffer, 0, authorBuffer.Length);
m_Stream.Write((byte)0); // terminate
}
}
And changed this part of the OnDoubleClick method:
Code:
from.Send(new LinkedBookHeader(from, book)); //changed this line
from.Send(new BookPageDetails(book));
Toggle = !Toggle;
}