Skip to content

Commit

Permalink
Change maximum room number to closest powers of two
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Mar 11, 2024
1 parent 226df71 commit 169e2e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions osu.Desktop/DiscordRichPresence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ private void updateStatus()
Privacy = string.IsNullOrEmpty(room.Settings.Password) ? Party.PrivacySetting.Public : Party.PrivacySetting.Private,
ID = room.RoomID.ToString(),
// technically lobbies can have infinite users, but Discord needs this to be set to something.
// 1024 just happens to look nice.
// https://discord.com/channels/188630481301012481/188630652340404224/1212967974793642034
Max = 1024,
// to make party display sensible, assign a powers of two above participants count (8 at minimum).
Max = (int)Math.Max(8, Math.Pow(2, Math.Ceiling(Math.Log2(room.Users.Count)))),
Size = room.Users.Count,
};

Expand Down

0 comments on commit 169e2e1

Please sign in to comment.