1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 05:02:56 +08:00

Merge pull request #17572 from peppy/fix-multi-sounds-explosion

Fix multiplayer sounds playing too much after gameplay
This commit is contained in:
Dean Herbert 2022-03-31 16:52:24 +09:00 committed by GitHub
commit 140eaa6039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,21 +37,21 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
base.UserJoined(user); base.UserJoined(user);
userJoinedSample?.Play(); Scheduler.AddOnce(() => userJoinedSample?.Play());
} }
protected override void UserLeft(MultiplayerRoomUser user) protected override void UserLeft(MultiplayerRoomUser user)
{ {
base.UserLeft(user); base.UserLeft(user);
userLeftSample?.Play(); Scheduler.AddOnce(() => userLeftSample?.Play());
} }
protected override void UserKicked(MultiplayerRoomUser user) protected override void UserKicked(MultiplayerRoomUser user)
{ {
base.UserKicked(user); base.UserKicked(user);
userKickedSample?.Play(); Scheduler.AddOnce(() => userKickedSample?.Play());
} }
private void hostChanged(ValueChangedEvent<APIUser> value) private void hostChanged(ValueChangedEvent<APIUser> value)
@ -59,7 +59,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
// only play sound when the host changes from an already-existing host. // only play sound when the host changes from an already-existing host.
if (value.OldValue == null) return; if (value.OldValue == null) return;
hostChangedSample?.Play(); Scheduler.AddOnce(() => hostChangedSample?.Play());
} }
} }
} }