ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.09k stars 2.23k forks source link

The game crashes when I'm playing, spectating or joining a room (not always) #14302

Closed weajus closed 3 years ago

weajus commented 3 years ago

Describe the bug: The game crashes when I'm playing, spectating or joining a room with "osu.Game.Screens.OnlinePlay.Multiplayer.Participants.TeamDisplay.load()"

Screenshots or videos showing encountered issue: not needed(?)

osu!lazer version: 2021.815.0 Logs: runtime.log

bdach commented 3 years ago

The only thing that I can plausibly see being null is user here:

https://github.com/ppy/osu/blob/f49c9673ccf415b46d8e14f46fb2c35ab2f86e02/osu.Game/Screens/OnlinePlay/Multiplayer/Participants/TeamDisplay.cs#L64

It seems that MultiplayerRoomUser.User is fundamentally unsafe to access as it can be potentially populated at any later point (via MultiplayerClient.PopulateUser()). The fix for this particular thing would be probably to pass MultiplayerRoomUser.UserID down to the display rather than the full user, as it only accesses the ID - however there may be more places to revisit, such as this recently-added assertion in kick logic:

https://github.com/ppy/osu/blob/f49c9673ccf415b46d8e14f46fb2c35ab2f86e02/osu.Game/Screens/OnlinePlay/Multiplayer/Participants/ParticipantPanel.cs#L173-L175

weajus commented 3 years ago

I found something in network.log before it crashes, idk if it's something really helpful

2021-08-15 17:57:22 [verbose]: Performing request osu.Game.Online.API.Requests.GetUpdatesRequest 2021-08-15 17:57:24 [verbose]: Request to https://osu.ppy.sh/api/v2/users/?ids[]=7392246 failed with System.Net.WebException: Request to https://osu.ppy.sh/api/v2/users/?ids[]=7392246 timed out after 10 seconds idle (read 0 bytes, retried 0 times).. 2021-08-15 17:57:24 [verbose]: Failing request osu.Game.Online.API.Requests.GetUsersRequest (System.Net.WebException: Request to https://osu.ppy.sh/api/v2/users/?ids[]=7392246 timed out after 10 seconds idle (read 0 bytes, retried 0 times).) 2021-08-15 17:57:40 [verbose]: Request to https://osu.ppy.sh/api/v2/chat/updates failed with System.Net.WebException: Request to https://osu.ppy.sh/api/v2/chat/updates?since=2838721900 timed out after 17 seconds idle (read 0 bytes, retried 0 times).. 2021-08-15 17:57:40 [verbose]: Failing request osu.Game.Online.API.Requests.GetUpdatesRequest (System.Net.WebException: Request to https://osu.ppy.sh/api/v2/chat/updates?since=2838721900 timed out after 17 seconds idle (read 0 bytes, retried 0 times).) 2021-08-15 17:57:40 [verbose]: WebException while performing request osu.Game.Online.API.Requests.GetUpdatesRequest: Request to https://osu.ppy.sh/api/v2/chat/updates?since=2838721900 timed out after 17 seconds idle (read 0 bytes, retried 0 times). 2021-08-15 17:57:40 [verbose]: API failure count is now 2 2021-08-15 17:57:40 [verbose]: Performing request osu.Game.Online.Rooms.PartRoomRequest