mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Import beatmaps into the database via IPC
This commit is contained in:
committed by
Dean Herbert
parent
3a163de0f7
commit
45c0bc5428
@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps.IO
|
||||
foreach (var reader in readers)
|
||||
{
|
||||
if (reader.Test(storage, path))
|
||||
return (ArchiveReader)Activator.CreateInstance(reader.Type);
|
||||
return (ArchiveReader)Activator.CreateInstance(reader.Type, storage.GetStream(path));
|
||||
}
|
||||
throw new IOException("Unknown file format");
|
||||
}
|
||||
|
@ -13,12 +13,7 @@ namespace osu.Game.Beatmaps.IO
|
||||
AddReader<OszArchiveReader>((storage, path) =>
|
||||
{
|
||||
using (var stream = storage.GetStream(path))
|
||||
{
|
||||
if (!ZipFile.IsZipFile(stream, false))
|
||||
return false;
|
||||
using (ZipFile zip = ZipFile.Read(stream))
|
||||
return zip.Entries.Any(e => e.FileName.EndsWith(".osu"));
|
||||
}
|
||||
return ZipFile.IsZipFile(stream, false);
|
||||
});
|
||||
OsuLegacyDecoder.Register();
|
||||
}
|
||||
|
@ -18,7 +18,12 @@ namespace osu.Game.Beatmaps.Objects.Osu
|
||||
Circle = 1,
|
||||
Slider = 2,
|
||||
NewCombo = 4,
|
||||
CircleNewCombo = 5,
|
||||
SliderNewCombo = 6,
|
||||
Spinner = 8,
|
||||
ColourHax = 122,
|
||||
Hold = 128,
|
||||
ManiaLong = 128,
|
||||
}
|
||||
|
||||
public static OsuBaseHit Parse(string val)
|
||||
@ -26,6 +31,7 @@ namespace osu.Game.Beatmaps.Objects.Osu
|
||||
string[] split = val.Split(',');
|
||||
var type = (HitObjectType)int.Parse(split[3]);
|
||||
bool combo = type.HasFlag(HitObjectType.NewCombo);
|
||||
type &= (HitObjectType)0xF;
|
||||
type &= ~HitObjectType.NewCombo;
|
||||
OsuBaseHit result;
|
||||
switch (type)
|
||||
|
Reference in New Issue
Block a user