public MovementBlock(UpdateBlock update) { Update = update; UpdateFlags = (UpdateFlags)update.ReadUShort(); ObjectTypeId = update.ObjectType; this.Parse(); }
/// <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(); }
/// <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()); }
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); } }