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


C# Item.GetPacketFlags方法代码示例

本文整理汇总了C#中Item.GetPacketFlags方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetPacketFlags方法的具体用法?C# Item.GetPacketFlags怎么用?C# Item.GetPacketFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item.GetPacketFlags方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;

                this.m_Stream.Write((uint)serial);
				this.m_Stream.Write((short)(itemID & TileData.MaxItemValue));

                if (amount != 0)
                    this.m_Stream.Write((short)amount);

                x &= 0x7FFF;

                if (direction != 0)
                    x |= 0x8000;

                this.m_Stream.Write((short)x);

                y &= 0x3FFF;

                if (hue != 0)
                    y |= 0x8000;

                if (flags != 0)
                    y |= 0x4000;

                this.m_Stream.Write((short)y);

                if (direction != 0)
                    this.m_Stream.Write((byte)direction);

                this.m_Stream.Write((sbyte)loc.Z);

                if (hue != 0)
                    this.m_Stream.Write((ushort)hue);

                if (flags != 0)
                    this.m_Stream.Write((byte)flags);
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:59,代码来源:Blocker.cs

示例2: 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;
            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 );
            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.m_Z );

            if ( hue != 0 )
                m_Stream.Write( (ushort) hue );

            if ( flags != 0 )
                m_Stream.Write( (byte) flags );
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:71,代码来源:Packets.cs

示例3: 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() );
        }
开发者ID:Leorgrium,项目名称:runuo,代码行数:52,代码来源:Packets.cs

示例4: WorldItemHS

        public WorldItemHS(Item item, PacketWriter stream)
            : base(0xF3, 26, stream)
        {
            stream.Write((short)0x1);

            int itemID = item.ItemID;

            if (item is BaseMulti)
                m_Stream.Write((byte)0x02);
            else if (item is IDamageable)
                m_Stream.Write((byte)0x03);
            else
                m_Stream.Write((byte)0x00);

            if (item is BaseMulti)
            {
                stream.Write((int)item.Serial);
                itemID &= 0x3FFF;
                stream.Write((ushort)itemID);
                stream.Write((byte)0);
            }
            else
            {
                stream.Write((int)item.Serial);
                itemID &= 0xFFFF;
                stream.Write((ushort)itemID);
                stream.Write((byte)0);
            }

            int amount = item.Amount;
            stream.Write((short)amount);
            stream.Write((short)amount);

            Point3D loc = item.Location;
            int x = loc.m_X & 0x7FFF;
            int y = loc.m_Y & 0x3FFF;
            stream.Write((short)x);
            stream.Write((short)y);
            stream.Write((sbyte)loc.m_Z);

            stream.Write((byte)item.Light);
            stream.Write((short)item.Hue);
            stream.Write((byte)item.GetPacketFlags());

            stream.Write((short)0x00); // ??
        }
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:46,代码来源:Packets.cs

示例5: WorldItemHS

        public WorldItemHS(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
        }
开发者ID:zerodowned,项目名称:justuo-with-ec-support,代码行数:29,代码来源:Packets.cs

示例6: WorldItemHS

		public WorldItemHS( Item item, int itemID ) : base( 0xF3, 26 )
		{
			m_Stream.Write( (short) 0x1 );

			if ( item is BaseMulti )
			{
				m_Stream.Write( (byte) 0x02 );

				m_Stream.Write( (int) item.Serial );

				itemID &= 0x3FFF;

				m_Stream.Write( (ushort) itemID );

				m_Stream.Write( (byte) 0 );
			}
			else
			{
				m_Stream.Write( (byte) 0x00 );

				m_Stream.Write( (int) item.Serial );

				itemID &= 0xFFFF;

				m_Stream.Write( (ushort) 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.HSHue > -1 ? item.HSHue : item.Hue ) );
			m_Stream.Write( (byte) item.GetPacketFlags() );

			m_Stream.Write( (short) 0x00 ); // ??

			/*
			0x01 is sent when an item is draw by other ways:

			- the item is dropped by player
			- the item is moved by player
			- the item is updated (open door, change item amount, change use remains etc )
			*/
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:54,代码来源:Packets.cs


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