本文整理汇总了C#中Server.Items.BaseBook.GetWorldLocation方法的典型用法代码示例。如果您正苦于以下问题:C# BaseBook.GetWorldLocation方法的具体用法?C# BaseBook.GetWorldLocation怎么用?C# BaseBook.GetWorldLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.BaseBook
的用法示例。
在下文中一共展示了BaseBook.GetWorldLocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseContentChange
public static void BaseContentChange( BaseBook book, NetState state, PacketReader pvSrc )
{
Mobile from = state.Mobile;
if ( book == null || !book.Writable || !from.InRange( book.GetWorldLocation(), 1 ) )
return;
int pageCount = pvSrc.ReadUInt16();
if ( pageCount > book.PagesCount )
return;
for ( int i = 0; i < pageCount; ++i )
{
int index = pvSrc.ReadUInt16();
if ( index >= 1 && index <= book.PagesCount )
{
--index;
int lineCount = pvSrc.ReadUInt16();
if ( lineCount <= 8 )
{
string[] lines = new string[lineCount];
for ( int j = 0; j < lineCount; ++j )
if ( (lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80 )
return;
book.Pages[index].Lines = lines;
}
else
{
return;
}
}
else
{
return;
}
}
}
示例2: BookHeader
public BookHeader(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);
this.EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
this.m_Stream.Write((int)book.Serial);
this.m_Stream.Write((bool)true);
this.m_Stream.Write((bool)book.Writable && from.InRange(book.GetWorldLocation(), 1));
this.m_Stream.Write((ushort)book.PagesCount);
this.m_Stream.Write((ushort)(titleBuffer.Length + 1));
this.m_Stream.Write(titleBuffer, 0, titleBuffer.Length);
this.m_Stream.Write((byte)0); // terminate
this.m_Stream.Write((ushort)(authorBuffer.Length + 1));
this.m_Stream.Write(authorBuffer, 0, authorBuffer.Length);
this.m_Stream.Write((byte)0); // terminate
}
示例3: ContentChange
public static void ContentChange( NetState state, PacketReader pvSrc, BaseBook book )
{
Mobile from = state.Mobile;
// MOD BEGIN
if ( book is HTMLBook && book.RootParent != from )
return;
// MOD END
if ( book == null || !book.Writable || !from.InRange( book.GetWorldLocation(), 1 ) )
return;
int pageCount = pvSrc.ReadUInt16();
if ( pageCount > book.PagesCount )
return;
for ( int i = 0; i < pageCount; ++i )
{
int index = pvSrc.ReadUInt16();
if ( index >= 1 && index <= book.PagesCount )
{
--index;
int lineCount = pvSrc.ReadUInt16();
if ( lineCount <= 8 )
{
string[] lines = new string[lineCount];
for ( int j = 0; j < lineCount; ++j )
if ( (lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80 )
return;
book.Pages[index].Lines = lines;
}
else
{
return;
}
}
else
{
return;
}
}
// MOD BEGIN
if ( book is HTMLBook )
((HTMLBook)book).RequiresFormatting = true;
// MOD END
}