mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Merge branch 'master' into update-inspectcode-version
This commit is contained in:
23
osu.Game/Online/API/APIPlaylistBeatmap.cs
Normal file
23
osu.Game/Online/API/APIPlaylistBeatmap.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// 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.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
{
|
||||
public class APIPlaylistBeatmap : APIBeatmap
|
||||
{
|
||||
[JsonProperty("checksum")]
|
||||
public string Checksum { get; set; }
|
||||
|
||||
public override BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
||||
{
|
||||
var b = base.ToBeatmap(rulesets);
|
||||
b.MD5Hash = Checksum;
|
||||
return b;
|
||||
}
|
||||
}
|
||||
}
|
34
osu.Game/Online/API/Requests/CreateChannelRequest.cs
Normal file
34
osu.Game/Online/API/Requests/CreateChannelRequest.cs
Normal file
@ -0,0 +1,34 @@
|
||||
// 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.
|
||||
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class CreateChannelRequest : APIRequest<APIChatChannel>
|
||||
{
|
||||
private readonly Channel channel;
|
||||
|
||||
public CreateChannelRequest(Channel channel)
|
||||
{
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
{
|
||||
var req = base.CreateWebRequest();
|
||||
req.Method = HttpMethod.Post;
|
||||
|
||||
req.AddParameter("type", $"{ChannelType.PM}");
|
||||
req.AddParameter("target_id", $"{channel.Users.First().Id}");
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
protected override string Target => @"chat/channels";
|
||||
}
|
||||
}
|
@ -64,7 +64,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"max_combo")]
|
||||
private int? maxCombo { get; set; }
|
||||
|
||||
public BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
||||
public virtual BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
||||
{
|
||||
var set = BeatmapSet?.ToBeatmapSet(rulesets);
|
||||
|
||||
|
18
osu.Game/Online/API/Requests/Responses/APIChatChannel.cs
Normal file
18
osu.Game/Online/API/Requests/Responses/APIChatChannel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// 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.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Online.Chat;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIChatChannel
|
||||
{
|
||||
[JsonProperty(@"channel_id")]
|
||||
public int? ChannelID { get; set; }
|
||||
|
||||
[JsonProperty(@"recent_messages")]
|
||||
public List<Message> RecentMessages { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user