mirror of
https://github.com/osukey/osukey.git
synced 2025-07-09 20:29:57 +09:00
Implement SoloPlayer's request construction
This commit is contained in:
@ -1,22 +1,34 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
|
using osu.Game.Online.Solo;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
public class SoloPlayer : SubmittingPlayer
|
public class SoloPlayer : SubmittingPlayer
|
||||||
{
|
{
|
||||||
public override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, int token)
|
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
Debug.Assert(Beatmap.Value.BeatmapInfo.OnlineBeatmapID != null);
|
||||||
|
|
||||||
|
int beatmapId = Beatmap.Value.BeatmapInfo.OnlineBeatmapID.Value;
|
||||||
|
|
||||||
|
return new SubmitSoloScoreRequest(beatmapId, token, score.ScoreInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override APIRequest<APIScoreToken> CreateTokenRequestRequest()
|
protected override APIRequest<APIScoreToken> CreateTokenRequestRequest()
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new CreateSoloScoreRequest(beatmapId, Game.VersionHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool HandleTokenRetrievalFailure(Exception exception) => false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user