1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 22:20:48 +08:00

Merge pull request #32495 from bdach/some-more-activities

Adjust user activity updates
This commit is contained in:
Dan Balasescu
2025-03-24 12:53:12 +09:00
committed by GitHub
Unverified
4 changed files with 55 additions and 2 deletions
@@ -44,6 +44,8 @@ namespace osu.Game.Online
(typeof(UserActivity.EditingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.ModdingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.TestingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.InDailyChallengeLobby), typeof(UserActivity)),
(typeof(UserActivity.PlayingDailyChallenge), typeof(UserActivity)),
};
}
}
@@ -39,6 +39,7 @@ using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Play;
using osu.Game.Users;
using osuTK;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
@@ -107,6 +108,8 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
public override bool? ApplyModTrackAdjustments => true;
protected override UserActivity InitialActivity => new UserActivity.InDailyChallengeLobby();
public DailyChallenge(Room room)
{
this.room = room;
@@ -526,7 +529,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
private void startPlay()
{
sampleStart?.Play();
this.Push(new PlayerLoader(() => new PlaylistsPlayer(room, playlistItem)
this.Push(new PlayerLoader(() => new DailyChallengePlayer(room, playlistItem)
{
Exited = () => Scheduler.AddOnce(() => leaderboard.RefetchScores())
}));
@@ -0,0 +1,20 @@
// 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 osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Play;
using osu.Game.Users;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{
public partial class DailyChallengePlayer : PlaylistsPlayer
{
protected override UserActivity InitialActivity => new UserActivity.PlayingDailyChallenge(Beatmap.Value.BeatmapInfo, Ruleset.Value);
public DailyChallengePlayer(Room room, PlaylistItem playlistItem, PlayerConfiguration? configuration = null)
: base(room, playlistItem, configuration)
{
}
}
}
+29 -1
View File
@@ -34,6 +34,8 @@ namespace osu.Game.Users
[Union(41, typeof(EditingBeatmap))]
[Union(42, typeof(ModdingBeatmap))]
[Union(43, typeof(TestingBeatmap))]
[Union(51, typeof(InDailyChallengeLobby))]
[Union(52, typeof(PlayingDailyChallenge))]
public abstract class UserActivity
{
public abstract string GetStatus(bool hideIdentifiableInformation = false);
@@ -58,6 +60,7 @@ namespace osu.Game.Users
[Union(23, typeof(InMultiplayerGame))]
[Union(24, typeof(SpectatingMultiplayerGame))]
[Union(31, typeof(InPlaylistGame))]
[Union(52, typeof(PlayingDailyChallenge))]
public abstract class InGame : UserActivity
{
[Key(0)]
@@ -244,7 +247,7 @@ namespace osu.Game.Users
[SerializationConstructor]
public SpectatingMultiplayerGame() { }
public override string GetStatus(bool hideIdentifiableInformation = false) => $"Watching others {base.GetStatus(hideIdentifiableInformation).ToLowerInvariant()}";
public override string GetStatus(bool hideIdentifiableInformation = false) => @"Spectating a multiplayer game";
}
[MessagePackObject]
@@ -277,5 +280,30 @@ namespace osu.Game.Users
? null
: RoomName;
}
[MessagePackObject]
public class InDailyChallengeLobby : UserActivity
{
[SerializationConstructor]
public InDailyChallengeLobby() { }
public override string GetStatus(bool hideIdentifiableInformation = false) => @"In daily challenge lobby";
}
[MessagePackObject]
public class PlayingDailyChallenge : InGame
{
public PlayingDailyChallenge(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
: base(beatmapInfo, ruleset)
{
}
[SerializationConstructor]
public PlayingDailyChallenge()
{
}
public override string GetStatus(bool hideIdentifiableInformation = false) => @$"{RulesetPlayingVerb} in daily challenge";
}
}
}