7b1ff38df7
Implement line-buffered reader
...
Add a line-buffered reader decorator operating on StreamReader
instances. The decorator has two main operations - PeekLine(), which
allows to see the next line in the stream without consuming it,
ReadLine(), which consumes and returns the next line in the stream, and
ReadToEnd() which reads all the remaining text in the stream (including
the unconsumed peeked line). Peeking line-per-line uses an internal
queue of lines that have been read ahead from the underlying stream.
The addition of the line-buffered reader is a workaround solution to
a problem with decoding. At current selecting a decoder works by
irreversibly reading the first line from the stream and looking for
a magic string that indicates the type of decoder to use.
It might however be possible for a file to be valid in format, just
missing a header. In such a case a lack of a line-buffered reader makes
it impossible to reparse the content of that first line. Introducing it
will however allow to peek the first line for magic first.
- If magic is found in the first line, GetDecoder() will peek it and
use it to return the correct Decoder instance. Note that in the case
of JsonBeatmapDecoder the magic is the opening JSON object brace,
and therefore must not be consumed.
- If magic is not found, the fallback decoder will be able to consume
it using ReadLine() in Decode().
This commit additionally contains basic unit tests for the reader.
Suggested-by: Aergwyn <aergwyn@t-online.de >
2019-09-15 01:26:15 +02:00
f925e781a9
Refactor HitWindows for legibility
2019-09-06 15:24:14 +09:00
94b5caf740
Fix build issues
2019-08-23 15:18:56 +03:00
15a592e25e
Just assert doesn't throw and don't catch at LegacyDecoder
2019-08-07 19:25:40 +09:00
497d2cb677
shorten tests and rename
2019-08-06 12:35:18 +09:00
2c32d886d7
Add better asserts
2019-08-06 10:39:54 +09:00
b8c38d4dfd
remove unnecessary assert
2019-08-06 10:36:26 +09:00
a5c17ae26d
Don't use GetDecoder
2019-08-06 10:14:36 +09:00
cd6fe91882
Log error for invalid events
2019-08-06 10:05:21 +09:00
f2b940f930
Add tests
2019-08-01 17:31:37 +09:00
60ea3d4e1a
Fix skinning support for combobreak
2019-06-30 21:58:30 +09:00
9e1cb90dd8
Remove existing argument for ItemAdded event
...
For all usages, it looks like this was unnecessary.
2019-06-26 11:40:41 +09:00
12aa264657
Consolidate tests and check for file reference counts
2019-06-10 18:35:23 +09:00
28b2a516e3
Ensure exception is only thrown once on rollback
2019-06-10 18:13:33 +09:00
dcdb806120
Catch newly thrown exception in test
2019-06-10 17:26:56 +09:00
5b75060b94
Add test for rollback logic correctly dereferencing files
2019-06-10 16:45:45 +09:00
f090e292c9
Move ArchiveModelManager import process to async flow
2019-06-10 13:42:22 +09:00
58efa7a177
Merge pull request #4729 from peppy/fix-control-point-ordering
...
Fix control points with same timestamp potentially being parsed incorrectly
2019-05-21 15:33:27 +09:00
7e38aabe75
Remove equivalence check from controlpoint parsing
2019-05-21 14:27:41 +09:00
e3ae858c87
Adjust testcase to avoid potential rounding issues
2019-05-21 14:01:41 +09:00
f1c9073338
Fix commented line check not working with whitespace
2019-05-14 16:16:55 +09:00
19bc6b72cc
More tests to showcase failures
2019-05-14 10:13:42 +09:00
7aa10956b5
Add unit test
2019-05-14 09:46:42 +09:00
d7c09e7dbd
Merge remote-tracking branch 'origin/master' into fix-new-inspections
...
# Conflicts:
# osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
# osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs
# osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
# osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
# osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
# osu.Game.Tests/Visual/SongSelect/TestCaseBeatmapScoresContainer.cs
# osu.Game/Graphics/OsuFont.cs
# osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs
# osu.Game/Overlays/Profile/Header/BadgeContainer.cs
# osu.Game/Overlays/Profile/ProfileHeader.cs
# osu.Game/Screens/Select/PlaySongSelect.cs
# osu.Game/Skinning/LegacySkinDecoder.cs
2019-05-07 13:20:17 +09:00
0222424aef
Make mods IReadOnlyList<Mod> gamewide
...
Prevents potential multiple evaluations of enumerable.
2019-04-10 17:20:36 +09:00
c584967eb1
Remove mods from workingbeatmap
2019-04-09 12:59:32 +09:00
c39c37a18d
Apply more missed cases
2019-04-01 12:44:46 +09:00
4c77899738
Add storyboard ordering test
2019-03-26 16:37:52 +09:00
461a0a5038
Merge branch 'master' into remove-unnecessary-code
2019-03-20 10:22:24 +09:00
0241148385
Add extensive tests
2019-03-13 11:30:38 +09:00
00191ca940
Actually set the beatmap difficulty
2019-03-12 15:24:35 +09:00
059397ac50
Remove unnecessary early return for maching beatmap IDs
2019-03-12 14:40:13 +09:00
d0ae75af6e
Add tests and fix scenario where all matching are contained by duplicate candidate
2019-03-11 18:13:33 +09:00
cfac47413c
Disable failing tests temporarily
2019-03-08 10:42:25 +09:00
a08086cc8a
Fix volume not being considered for file samples
2019-03-05 18:21:29 +09:00
80737b9ef8
Remove "silent" parameter; consolidate import logic
2019-02-25 18:24:06 +09:00
628b3e1119
Move osu-resources to nuget
2019-01-28 18:33:39 +09:00
8617aaa2a7
Update licence header (and remove year)
2019-01-24 17:43:03 +09:00
6eff79913b
remove blank lines
2019-01-11 10:34:56 +01:00
c45c34d400
Make beatmap importing possible elsewhere in tests
2018-12-25 19:17:21 +09:00
eb88768bd0
Fix incorrect controlpoint being applied to samples
2018-12-03 17:21:27 +09:00
a8ad7d4670
Add silent import parameter
2018-11-30 18:27:13 +09:00
10095d09c3
Fix test namespace
2018-11-30 17:02:01 +09:00
3727955911
Refactors/renames
2018-11-30 16:35:45 +09:00
831cd3ed59
ScoreInfo scoreInfo -> ScoreInfo score
2018-11-30 15:18:52 +09:00
2bedffc00f
Add tests
2018-11-30 14:27:34 +09:00
a88b69ec43
Notify of existing imports
2018-11-28 20:19:35 +09:00
f27bd3ef3e
OpenTK -> osuTK
2018-11-20 17:14:59 +09:00
ace1dce281
Merge remote-tracking branch 'origin/master' into fix-slider-samples
...
# Conflicts:
# osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
2018-11-05 18:10:22 +09:00
92d570342c
Fix sample additions not falling back to non-addition bank
2018-11-05 17:35:24 +09:00