mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 16:42:55 +08:00
Merge pull request #17725 from peppy/multiplayer-hotifx
Avoid multiplayer crashes when events arrive in unexpected order
This commit is contained in:
commit
62f5409191
@ -493,11 +493,13 @@ namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
if (Room == null)
|
||||
var user = Room?.Users.SingleOrDefault(u => u.UserID == userId);
|
||||
|
||||
// TODO: user should NEVER be null here, see https://github.com/ppy/osu/issues/17713.
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
Room.Users.Single(u => u.UserID == userId).State = state;
|
||||
|
||||
user.State = state;
|
||||
updateUserPlayingState(userId, state);
|
||||
|
||||
RoomUpdated?.Invoke();
|
||||
@ -510,10 +512,13 @@ namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
if (Room == null)
|
||||
var user = Room?.Users.SingleOrDefault(u => u.UserID == userId);
|
||||
|
||||
// TODO: user should NEVER be null here, see https://github.com/ppy/osu/issues/17713.
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
Room.Users.Single(u => u.UserID == userId).MatchState = state;
|
||||
user.MatchState = state;
|
||||
RoomUpdated?.Invoke();
|
||||
}, false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user