raidboss: add support for timeline blocks #853
Draft
+185
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add new
blockbeginandblockendkeywords for the timeline file.These implement basic "block" support by allowing a timeline to identify
collections of entries that belong together.
To start a block, the timeline should use
blockbegin "name"where"name" is a unique block name. This also creates an implicit label for
the start of the block.
To end a block the
blockendkeyword on its own line should be used.To avoid complexity with making the actual timeline logic handle blocks,
implement support via a clever hack in the timeline parser to offset all
entries.
Keep track of the current block, and the largest time offset found so
far. When a
blockbeginkeyword is found, use the largest known offsetto generate a new "offset". To ensure a decent gap, add 500 seconds to
that time then round up to the next multiple of 1000.
For all entries until the next
blockend, add this offset to theirencoded time. This essentially automatically offsets blocks in the
timeline instead of requiring manual offset configuration. Entries
outside of blocks do not get modified.
For jumps by label, add "block scoping" where a label is prefixed by the
blockname separated by a ':'. Currently no timelines actually use ':' in
their label name so this should be safe.
A jump with a ':' in its name will always jump to the block label
without implicit handling. Labels without ':' will get implicit handling
in the following priority, with the first existing option being chosen
This means that timeline files can re-use labels across blocks, and that
blocks get implicit labels that do not override explicit ones.
This solution is very much a hack, but it avoids a massive refactor that
would be required for explicit block handling within many parts of the
codebase.
Signed-off-by: Jacob Keller jacob.keller@gmail.com