mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add error message when creation fails
This commit is contained in:
@ -42,13 +42,19 @@ namespace osu.Game.Screens.Multi
|
||||
TimeBetweenPolls = 5000;
|
||||
}
|
||||
|
||||
public void CreateRoom(Room room)
|
||||
public void CreateRoom(Room room, Action<string> onError = null)
|
||||
{
|
||||
room.Host.Value = api.LocalUser;
|
||||
|
||||
var req = new CreateRoomRequest(room);
|
||||
req.Success += result => addRoom(room, result);
|
||||
req.Failure += exception => Logger.Log($"Failed to create room: {exception}");
|
||||
req.Failure += exception =>
|
||||
{
|
||||
if (req.Result != null)
|
||||
onError?.Invoke(req.Result.Error);
|
||||
else
|
||||
Logger.Log($"Failed to create the room: {exception}", level: LogLevel.Important);
|
||||
};
|
||||
|
||||
api.Queue(req);
|
||||
}
|
||||
|
Reference in New Issue
Block a user