mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:05:29 +08:00
Fix tests by requiring host
This commit is contained in:
parent
8be2defd09
commit
e9a19aacd7
@ -253,7 +253,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, API.LocalUser.Value);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
||||||
@ -283,7 +283,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, API.LocalUser.Value);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
||||||
@ -336,7 +336,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, API.LocalUser.Value);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
||||||
@ -597,7 +597,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, API.LocalUser.Value);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
AddStep("refresh rooms", () => this.ChildrenOfType<LoungeSubScreen>().Single().UpdateFilter());
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Screens.OnlinePlay.Components;
|
using osu.Game.Screens.OnlinePlay.Components;
|
||||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||||
@ -55,6 +56,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
/// Adds a room to a local "server-side" list that's returned when a <see cref="GetRoomsRequest"/> is fired.
|
/// Adds a room to a local "server-side" list that's returned when a <see cref="GetRoomsRequest"/> is fired.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="room">The room.</param>
|
/// <param name="room">The room.</param>
|
||||||
public void AddServerSideRoom(Room room) => requestsHandler.AddServerSideRoom(room);
|
/// <param name="host">The host.</param>
|
||||||
|
public void AddServerSideRoom(Room room, APIUser host) => requestsHandler.AddServerSideRoom(room, host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
apiRoom.HasPassword.Value = !string.IsNullOrEmpty(createRoomRequest.Room.Password.Value);
|
apiRoom.HasPassword.Value = !string.IsNullOrEmpty(createRoomRequest.Room.Password.Value);
|
||||||
apiRoom.Password.Value = createRoomRequest.Room.Password.Value;
|
apiRoom.Password.Value = createRoomRequest.Room.Password.Value;
|
||||||
|
|
||||||
AddServerSideRoom(apiRoom);
|
AddServerSideRoom(apiRoom, localUser);
|
||||||
|
|
||||||
var responseRoom = new APICreatedRoom();
|
var responseRoom = new APICreatedRoom();
|
||||||
responseRoom.CopyFrom(createResponseRoom(apiRoom, false));
|
responseRoom.CopyFrom(createResponseRoom(apiRoom, false));
|
||||||
@ -125,9 +125,11 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
/// Adds a room to a local "server-side" list that's returned when a <see cref="GetRoomsRequest"/> is fired.
|
/// Adds a room to a local "server-side" list that's returned when a <see cref="GetRoomsRequest"/> is fired.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="room">The room.</param>
|
/// <param name="room">The room.</param>
|
||||||
public void AddServerSideRoom(Room room)
|
/// <param name="host">The room host.</param>
|
||||||
|
public void AddServerSideRoom(Room room, APIUser host)
|
||||||
{
|
{
|
||||||
room.RoomID.Value ??= currentRoomId++;
|
room.RoomID.Value ??= currentRoomId++;
|
||||||
|
room.Host.Value = host;
|
||||||
|
|
||||||
for (int i = 0; i < room.Playlist.Count; i++)
|
for (int i = 0; i < room.Playlist.Count; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user