diff --git a/OpenRA.Mods.Common/DiscordService.cs b/OpenRA.Mods.Common/DiscordService.cs index 8b54b8f203..e5756f047e 100644 --- a/OpenRA.Mods.Common/DiscordService.cs +++ b/OpenRA.Mods.Common/DiscordService.cs @@ -169,6 +169,22 @@ namespace OpenRA.Mods.Common currentState = state; } + void UpdateParty(int players, int slots) + { + if (client.CurrentPresence.Party != null) + { + client.UpdatePartySize(players, slots); + return; + } + + client.UpdateParty(new Party + { + ID = Secrets.CreateFriendlySecret(new Random()), + Size = players, + Max = slots + }); + } + public void Dispose() { if (client != null) @@ -186,7 +202,7 @@ namespace OpenRA.Mods.Common public static void UpdatePlayers(int players, int slots) { - Service?.client.UpdatePartySize(players, slots); + Service?.UpdateParty(players, slots); } public static void UpdateDetails(string details) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index a6a362f030..203b27ca15 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -784,6 +784,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { if (!skirmishMode) DiscordService.UpdatePlayers(numberOfPlayers, slots); + DiscordService.UpdateDetails(mapTitle); } }