2019-01-24 08:43:03 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-12-22 03:50:37 +00:00
|
|
|
|
|
|
|
using System.Net.Http;
|
|
|
|
using osu.Framework.IO.Network;
|
2020-07-22 09:29:50 +00:00
|
|
|
using osu.Game.Online.API;
|
2018-12-22 03:50:37 +00:00
|
|
|
|
2020-07-22 09:29:50 +00:00
|
|
|
namespace osu.Game.Online.Multiplayer
|
2018-12-22 03:50:37 +00:00
|
|
|
{
|
|
|
|
public class JoinRoomRequest : APIRequest
|
|
|
|
{
|
|
|
|
private readonly Room room;
|
|
|
|
|
2020-07-14 04:07:17 +00:00
|
|
|
public JoinRoomRequest(Room room)
|
2018-12-22 03:50:37 +00:00
|
|
|
{
|
|
|
|
this.room = room;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override WebRequest CreateWebRequest()
|
|
|
|
{
|
|
|
|
var req = base.CreateWebRequest();
|
|
|
|
req.Method = HttpMethod.Put;
|
|
|
|
return req;
|
|
|
|
}
|
|
|
|
|
2020-07-14 04:07:17 +00:00
|
|
|
protected override string Target => $"rooms/{room.RoomID.Value}/users/{User.Id}";
|
2018-12-22 03:50:37 +00:00
|
|
|
}
|
|
|
|
}
|