Example #1
0
        public MovementBlock(UpdateBlock update)
        {
            Update       = update;
            UpdateFlags  = (UpdateFlags)update.ReadUShort();
            ObjectTypeId = update.ObjectType;

            this.Parse();
        }
Example #2
0
		public MovementBlock(UpdateBlock update)
		{
			Update = update;
			UpdateFlags = (UpdateFlags)update.ReadUShort();
			ObjectTypeId = update.ObjectType;

			this.Parse();
		}
Example #3
0
        /// <summary>
        /// Returns a string representation of the given field in the given block
        /// </summary>
        public static string Render(ExtendedUpdateFieldId fieldId, UpdateBlock block)
        {
            var renderer = FieldRenderUtil.GetRenderer(fieldId.ObjectType);

            uint fieldNum = (uint)fieldId.RawId;
            var field = renderer.Fields.Get(fieldNum);
            if (field != null)
            {
                string strVal;
                field.Renderer(field, block.Values, out strVal);
                return strVal;
            }

            return block.Values.GetUInt32(fieldNum).ToString();
        }
Example #4
0
        /// <summary>
        /// Returns a string representation of the given field in the given block
        /// </summary>
        public static string Render(ExtendedUpdateFieldId fieldId, UpdateBlock block)
        {
            var renderer = FieldRenderUtil.GetRenderer(fieldId.ObjectType);

            uint fieldNum = (uint)fieldId.RawId;
            var  field    = renderer.Fields.Get(fieldNum);

            if (field != null)
            {
                string strVal;
                field.Renderer(field, block.Values, out strVal);
                return(strVal);
            }

            return(block.Values.GetUInt32(fieldNum).ToString());
        }
Example #5
0
        public ParsedUpdatePacket(DateTime timeStamp, byte[] bytes, bool singleBlock)
        {
            TimeStamp = timeStamp;
            Bytes = bytes;
            SingleBlock = singleBlock;

            if (SingleBlock)
            {
                m_blocks = new UpdateBlock[1];
            }
            else
            {
                var count = Bytes.GetUInt32(0);
                m_blocks = new UpdateBlock[count];
                index = 4;
            }

            for (int i = 0; i < m_blocks.Length; i++)
            {
                m_blocks[i] = new UpdateBlock(this, i);
            }
        }
Example #6
0
        public ParsedUpdatePacket(DateTime timeStamp, byte[] bytes, bool singleBlock)
        {
            TimeStamp   = timeStamp;
            Bytes       = bytes;
            SingleBlock = singleBlock;


            if (SingleBlock)
            {
                m_blocks = new UpdateBlock[1];
            }
            else
            {
                var count = Bytes.GetUInt32(0);
                m_blocks = new UpdateBlock[count];
                index    = 4;
            }

            for (int i = 0; i < m_blocks.Length; i++)
            {
                m_blocks[i] = new UpdateBlock(this, i);
            }
        }