mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 21:32:57 +08:00
Merge pull request #3810 from peppy/fix-chat-crash
Fix hard crash due to out-of-order chat sequencing
This commit is contained in:
commit
2bc3c4cc8b
@ -97,9 +97,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public virtual void SetUp()
|
public virtual void SetUp()
|
||||||
|
{
|
||||||
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
manager?.Delete(manager.GetAllUsableBeatmapSets());
|
manager?.Delete(manager.GetAllUsableBeatmapSets());
|
||||||
Child = songSelect = new TestSongSelect();
|
Child = songSelect = new TestSongSelect();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -48,10 +48,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Channel.NewMessagesArrived += newMessagesArrived;
|
|
||||||
Channel.MessageRemoved += messageRemoved;
|
|
||||||
Channel.PendingMessageResolved += pendingMessageResolved;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -59,6 +55,11 @@ namespace osu.Game.Overlays.Chat
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
newMessagesArrived(Channel.Messages);
|
newMessagesArrived(Channel.Messages);
|
||||||
|
|
||||||
|
Channel.NewMessagesArrived += newMessagesArrived;
|
||||||
|
Channel.MessageRemoved += messageRemoved;
|
||||||
|
Channel.PendingMessageResolved += pendingMessageResolved;
|
||||||
|
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +79,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
|
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
|
||||||
|
|
||||||
if (!IsLoaded) return;
|
|
||||||
|
|
||||||
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage))
|
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage))
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2018.1120.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2018.1203.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user