本文整理汇总了C#中Server.Item.GetPacketFlags方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetPacketFlags方法的具体用法?C# Item.GetPacketFlags怎么用?C# Item.GetPacketFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Item
的用法示例。
在下文中一共展示了Item.GetPacketFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GMItemPacket
public GMItemPacket( Item item ) : base( 0x1A )
{
this.EnsureCapacity( 20 );
// 14 base length
// +2 - Amount
// +2 - Hue
// +1 - Flags
uint serial = (uint)item.Serial.Value;
int itemID = 0x1183;
int amount = item.Amount;
Point3D loc = item.Location;
int x = loc.X;
int y = loc.Y;
int hue = item.Hue;
int flags = item.GetPacketFlags();
int direction = (int)item.Direction;
if ( amount != 0 )
serial |= 0x80000000;
else
serial &= 0x7FFFFFFF;
m_Stream.Write( (uint) serial );
m_Stream.Write( (short) (itemID & 0x7FFF) );
if ( amount != 0 )
m_Stream.Write( (short) amount );
x &= 0x7FFF;
if ( direction != 0 )
x |= 0x8000;
m_Stream.Write( (short) x );
y &= 0x3FFF;
if ( hue != 0 )
y |= 0x8000;
if ( flags != 0 )
y |= 0x4000;
m_Stream.Write( (short) y );
if ( direction != 0 )
m_Stream.Write( (byte) direction );
m_Stream.Write( (sbyte) loc.Z );
if ( hue != 0 )
m_Stream.Write( (ushort) hue );
if ( flags != 0 )
m_Stream.Write( (byte) flags );
}
示例2: OldEtherealResidueWorldItem
public OldEtherealResidueWorldItem( Item item ) : base( 0x1A )
{
this.EnsureCapacity( 20 );
uint serial = (uint)item.Serial.Value;
int itemID = 0x0F8F & 0x3FFF; //grave dust
int amount = item.Amount;
Point3D loc = item.Location;
int x = loc.X;
int y = loc.Y;
int hue = item.Hue == 0 ? 1151 : item.Hue; //pretty close in hue
int flags = item.GetPacketFlags();
int direction = (int)item.Direction;
if ( amount != 0 )
serial |= 0x80000000;
else
serial &= 0x7FFFFFFF;
m_Stream.Write( (uint) serial );
if ( item is BaseMulti )
m_Stream.Write( (short) (itemID | 0x4000) );
else
m_Stream.Write( (short) itemID );
if ( amount != 0 )
m_Stream.Write( (short) amount );
x &= 0x7FFF;
if ( direction != 0 )
x |= 0x8000;
m_Stream.Write( (short) x );
y &= 0x3FFF;
if ( hue != 0 )
y |= 0x8000;
if ( flags != 0 )
y |= 0x4000;
m_Stream.Write( (short) y );
if ( direction != 0 )
m_Stream.Write( (byte) direction );
m_Stream.Write( (sbyte) loc.Z );
if ( hue != 0 )
m_Stream.Write( (ushort) hue );
if ( flags != 0 )
m_Stream.Write( (byte) flags );
}
示例3: WorldItem
public WorldItem( Item item )
: base(0x1A)
{
this.EnsureCapacity( 20 );
// 14 base length
// +2 - Amount
// +2 - Hue
// +1 - Flags
uint serial = (uint)item.Serial.Value;
int itemID = item.ItemID & 0x3FFF;
int amount = item.Amount;
Point3D loc = item.Location;
int x = loc.m_X;
int y = loc.m_Y;
int hue = item.Hue;
int flags = item.GetPacketFlags();
int direction = (int)item.Direction;
if ( amount != 0 )
{
serial |= 0x80000000;
}
else
{
serial &= 0x7FFFFFFF;
}
m_Stream.Write( (uint) serial );
if ( item is BaseMulti )
m_Stream.Write( (short) (itemID | 0x4000) );
else
m_Stream.Write( (short) itemID );
if ( amount != 0 )
{
m_Stream.Write( (short) amount );
}
x &= 0x7FFF;
if ( direction != 0 )
{
x |= 0x8000;
}
m_Stream.Write( (short) x );
y &= 0x3FFF;
if ( hue != 0 )
{
y |= 0x8000;
}
if ( flags != 0 )
{
y |= 0x4000;
}
m_Stream.Write( (short) y );
if ( direction != 0 )
m_Stream.Write( (byte) direction );
m_Stream.Write( (sbyte) loc.m_Z );
if ( hue != 0 )
m_Stream.Write( (ushort) hue );
if ( flags != 0 )
m_Stream.Write( (byte) flags );
}
示例4: WorldItemSA
public WorldItemSA( Item item )
: base(0xF3, 24)
{
m_Stream.Write( (short) 0x1 );
int itemID = item.ItemID;
if ( item is BaseMulti ) {
m_Stream.Write( (byte) 0x02 );
m_Stream.Write( (int) item.Serial );
itemID &= 0x3FFF;
m_Stream.Write( (short) itemID );
m_Stream.Write( (byte) 0 );
/*} else if ( ) {
m_Stream.Write( (byte) 0x01 );
m_Stream.Write( (int) item.Serial );
m_Stream.Write( (short) itemID );
m_Stream.Write( (byte) item.Direction );*/
} else {
m_Stream.Write( (byte) 0x00 );
m_Stream.Write( (int) item.Serial );
itemID &= 0x7FFF;
m_Stream.Write( (short) itemID );
m_Stream.Write( (byte) 0 );
}
int amount = item.Amount;
m_Stream.Write( (short) amount );
m_Stream.Write( (short) amount );
Point3D loc = item.Location;
int x = loc.m_X & 0x7FFF;
int y = loc.m_Y & 0x3FFF;
m_Stream.Write( (short) x );
m_Stream.Write( (short) y );
m_Stream.Write( (sbyte) loc.m_Z );
m_Stream.Write( (byte) item.Light );
m_Stream.Write( (short) item.Hue );
m_Stream.Write( (byte) item.GetPacketFlags() );
}
示例5: WorldItem
public WorldItem( Item item )
: base(0xF3, 26)
{
int itemId = item.ItemID;
m_Stream.Write( (short) 1 );
m_Stream.Write( (byte) item.GraphicData );
m_Stream.Write( (uint) item.Serial.Value );
m_Stream.Write( (short) itemId );
m_Stream.Write( (byte) item.Direction );
m_Stream.Write( (short) item.Amount );
m_Stream.Write( (short) item.Amount );
Point3D loc = item.Location;
m_Stream.Write( (short) loc.X );
m_Stream.Write( (short) loc.Y );
m_Stream.Write( (sbyte) loc.Z );
m_Stream.Write( (byte) item.Light );
m_Stream.Write( (ushort) item.Hue );
m_Stream.Write( (byte) item.GetPacketFlags() );
m_Stream.Write( (short) 0x0 ); // 0 for new item, 1 for update
}