Skip to content

Commit

Permalink
Fix: loading of osu!.db after newest osu! update
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrekol committed Nov 7, 2019
1 parent 9bdba2e commit defed95
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CollectionManagerDll/Modules/FileIO/OsuDb/OsuDatabaseReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ private void ReadMapMetaData(Beatmap beatmap)
beatmap.DisableSkin = _binaryReader.ReadBoolean();
beatmap.DisableSb = _binaryReader.ReadBoolean();
_binaryReader.ReadBoolean();
beatmap.BgDim = _binaryReader.ReadInt16();
_binaryReader.ReadBoolean();
if(FileDate < 20140609)
beatmap.BgDim = (short)_binaryReader.ReadInt16();
//bytes not analysed.
if (FileDate <= 20160403)
_binaryReader.BaseStream.Seek(4, SeekOrigin.Current);
else
_binaryReader.BaseStream.Seek(8, SeekOrigin.Current);
_binaryReader.ReadInt32();
_binaryReader.ReadByte();
}

private class TimingPoint
Expand Down Expand Up @@ -373,8 +373,7 @@ private bool DatabaseContainsData()
_binaryReader.BaseStream.Seek(1, SeekOrigin.Current);
Username = _binaryReader.ReadString();
ExpectedNumOfBeatmaps = _binaryReader.ReadInt32();
if (FileDate > 20160403)
_binaryReader.BaseStream.Seek(4, SeekOrigin.Current);

_logger?.Log(string.Format("Expected number of beatmaps: {0}", ExpectedNumOfBeatmaps));

if (ExpectedNumOfBeatmaps < 0)
Expand Down

0 comments on commit defed95

Please sign in to comment.