当前位置: 首页>>代码示例>>C#>>正文


C# PacketReader.ReadSByte方法代码示例

本文整理汇总了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;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:33,代码来源:StaffItems.cs

示例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();
        }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:24,代码来源:CarContact.cs

示例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;
         }
     }
 }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:21,代码来源:ContainerClosingFix.cs

示例4: Read

 public override void Read(PacketReader reader)
 {
     EntityId = reader.ReadInt();
     HeadYaw = reader.ReadSByte();
 }
开发者ID:TheaP,项目名称:c-raft,代码行数:5,代码来源:Packet.cs

示例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." );
				}
			}
		}
开发者ID:herculesjr,项目名称:razor,代码行数:22,代码来源:Stuff.cs


注:本文中的PacketReader.ReadSByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。