mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add handling for GetRoomRequest()
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
@ -52,7 +53,23 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
||||
break;
|
||||
|
||||
case GetRoomsRequest getRoomsRequest:
|
||||
getRoomsRequest.TriggerSuccess(rooms);
|
||||
var roomsWithoutParticipants = new List<Room>();
|
||||
|
||||
foreach (var r in rooms)
|
||||
{
|
||||
var newRoom = new Room();
|
||||
|
||||
newRoom.CopyFrom(r);
|
||||
newRoom.RecentParticipants.Clear();
|
||||
|
||||
roomsWithoutParticipants.Add(newRoom);
|
||||
}
|
||||
|
||||
getRoomsRequest.TriggerSuccess(roomsWithoutParticipants);
|
||||
break;
|
||||
|
||||
case GetRoomRequest getRoomRequest:
|
||||
getRoomRequest.TriggerSuccess(rooms.Single(r => r.RoomID.Value == getRoomRequest.RoomId));
|
||||
break;
|
||||
|
||||
case GetBeatmapSetRequest getBeatmapSetRequest:
|
||||
|
Reference in New Issue
Block a user