mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +09:00
Add score processed callback to spectator client
This commit is contained in:
parent
d81a724dd7
commit
b03291330f
@ -32,5 +32,12 @@ namespace osu.Game.Online.Spectator
|
|||||||
/// <param name="userId">The user.</param>
|
/// <param name="userId">The user.</param>
|
||||||
/// <param name="data">The frame data.</param>
|
/// <param name="data">The frame data.</param>
|
||||||
Task UserSentFrames(int userId, FrameDataBundle data);
|
Task UserSentFrames(int userId, FrameDataBundle data);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Signals that a user's submitted score was fully processed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">The ID of the user who achieved the score.</param>
|
||||||
|
/// <param name="scoreId">The ID of the score.</param>
|
||||||
|
Task UserScoreProcessed(int userId, long scoreId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
connection.On<int, SpectatorState>(nameof(ISpectatorClient.UserBeganPlaying), ((ISpectatorClient)this).UserBeganPlaying);
|
connection.On<int, SpectatorState>(nameof(ISpectatorClient.UserBeganPlaying), ((ISpectatorClient)this).UserBeganPlaying);
|
||||||
connection.On<int, FrameDataBundle>(nameof(ISpectatorClient.UserSentFrames), ((ISpectatorClient)this).UserSentFrames);
|
connection.On<int, FrameDataBundle>(nameof(ISpectatorClient.UserSentFrames), ((ISpectatorClient)this).UserSentFrames);
|
||||||
connection.On<int, SpectatorState>(nameof(ISpectatorClient.UserFinishedPlaying), ((ISpectatorClient)this).UserFinishedPlaying);
|
connection.On<int, SpectatorState>(nameof(ISpectatorClient.UserFinishedPlaying), ((ISpectatorClient)this).UserFinishedPlaying);
|
||||||
|
connection.On<int, long>(nameof(ISpectatorClient.UserScoreProcessed), ((ISpectatorClient)this).UserScoreProcessed);
|
||||||
};
|
};
|
||||||
|
|
||||||
IsConnected.BindTo(connector.IsConnected);
|
IsConnected.BindTo(connector.IsConnected);
|
||||||
|
@ -64,6 +64,11 @@ namespace osu.Game.Online.Spectator
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual event Action<int, SpectatorState>? OnUserFinishedPlaying;
|
public virtual event Action<int, SpectatorState>? OnUserFinishedPlaying;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called whenever a user-submitted score has been fully processed.
|
||||||
|
/// </summary>
|
||||||
|
public virtual event Action<int, long>? OnUserScoreProcessed;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A dictionary containing all users currently being watched, with the number of watching components for each user.
|
/// A dictionary containing all users currently being watched, with the number of watching components for each user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -160,6 +165,13 @@ namespace osu.Game.Online.Spectator
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task ISpectatorClient.UserScoreProcessed(int userId, long scoreId)
|
||||||
|
{
|
||||||
|
Schedule(() => OnUserScoreProcessed?.Invoke(userId, scoreId));
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public void BeginPlaying(long? scoreToken, GameplayState state, Score score)
|
public void BeginPlaying(long? scoreToken, GameplayState state, Score score)
|
||||||
{
|
{
|
||||||
// This schedule is only here to match the one below in `EndPlaying`.
|
// This schedule is only here to match the one below in `EndPlaying`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user