mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Import beatmaps into the database via IPC
This commit is contained in:
committed by
Dean Herbert
parent
3a163de0f7
commit
45c0bc5428
@ -21,6 +21,7 @@ using osu.Framework.Input;
|
||||
using osu.Game.Input;
|
||||
using OpenTK.Input;
|
||||
using System.IO;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -68,8 +69,21 @@ namespace osu.Game
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
BeatmapIPC.MessageReceived += (message) => Console.WriteLine($@"Got beatmap: {message.Path}");
|
||||
|
||||
BeatmapIPC.MessageReceived += message =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var reader = ArchiveReader.GetReader(Host.Storage, message.Path);
|
||||
Beatmaps.AddBeatmap(reader);
|
||||
// TODO: Switch to beatmap list and select the new song
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// TODO: Show the user some info?
|
||||
Console.WriteLine($@"Failed to import beatmap: {ex}");
|
||||
}
|
||||
};
|
||||
|
||||
base.Load(game);
|
||||
|
||||
//attach our bindables to the audio subsystem.
|
||||
|
Reference in New Issue
Block a user