本文整理汇总了C#中PacketReader.ReadSByte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadSByte方法的具体用法?C# PacketReader.ReadSByte怎么用?C# PacketReader.ReadSByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadSByte方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnFilter
public override void OnFilter( PacketReader p, PacketHandlerEventArgs args )
{
uint serial = p.ReadUInt32();
ushort itemID = p.ReadUInt16();
if ( (serial & 0x80000000) != 0 )
p.ReadUInt16(); // amount
if ( (itemID & 0x8000) != 0 )
itemID = (ushort)((itemID&0x7FFF) + p.ReadSByte()); // itemID offset
ushort x = p.ReadUInt16();
ushort y = p.ReadUInt16();
if ( (x & 0x8000) != 0 )
p.ReadByte(); // direction
short z = p.ReadSByte();
if ( ( y & 0x8000 ) != 0 )
p.ReadUInt16(); // hue
bool visable = true;
if ( ( y & 0x4000 ) != 0 )
{
int flags = p.ReadByte();
visable = ( (flags&0x80) == 0 );
}
if ( IsStaffItem( itemID ) || !visable )
args.Block = true;
}
示例2: CarContact
/// <summary>
/// Creates a new instance of the <see cref="CarContact"/> class.
/// </summary>
/// <param name="reader">A <see cref="PacketReader"/> containing the packet data.</param>
public CarContact(PacketReader reader) {
if (reader == null) {
throw new ArgumentNullException("reader");
}
PLID = reader.ReadByte();
Info = (ContactFlags)reader.ReadByte();
reader.Skip(1);
Steer = reader.ReadSByte();
ThrBrk = reader.ReadByte();
CluHan = reader.ReadByte();
GearSp = reader.ReadByte();
Speed = reader.ReadByte();
Direction = reader.ReadByte();
Heading = reader.ReadByte();
AccelF = reader.ReadSByte();
AccelR = reader.ReadSByte();
X = reader.ReadInt16();
Y = reader.ReadInt16();
}
示例3: ContainerContentUpdate1
private static void ContainerContentUpdate1(PacketReader p, PacketHandlerEventArgs args)
{
Serial serial = p.ReadUInt32();
if (containers.ContainsKey(serial))
{
Item item = World.FindItem(serial);
if (item == null || item.Deleted || item != containers[serial])
args.Block = true;
else
{
ushort itemID = (ushort)(p.ReadUInt16() + p.ReadSByte());
ushort amount = p.ReadUInt16();
if (amount == 0)
amount = 1;
Point3D position = new Point3D(p.ReadUInt16(), p.ReadUInt16(), 0);
p.ReadUInt32();
ushort hue = p.ReadUInt16();
args.Block = item.ItemID == itemID && item.Amount == amount && item.Position == position && item.Hue == hue;
}
}
}
示例4: Read
public override void Read(PacketReader reader)
{
EntityId = reader.ReadInt();
HeadYaw = reader.ReadSByte();
}
示例5: MobileMoving
private static void MobileMoving( PacketReader p, PacketHandlerEventArgs args )
{
Mobile m = World.FindMobile( p.ReadUInt32() );
if ( m != null && m.Notoriety == (byte)m_Type && m_Type != AutoTargType.none )
{
Point3D oldPos = m.Position;
Point3D newPos = new Point3D( p.ReadUInt16(), p.ReadUInt16(), p.ReadSByte() );
int dist = Utility.Distance( World.Player.Position, newPos );
int oldDist = Utility.Distance( World.Player.Position, oldPos );
int range = 15;
if ( Config.GetBool( "RangeCheckLT" ) )
range = Config.GetInt( "LTRange" );
if ( oldDist > dist && oldDist > range && dist <= range )
{
Targeting.SetLastTargetTo( m );
World.Player.SendMessage( MsgLevel.Force, "New target acquired." );
}
}
}