|
|
@@ -145,6 +145,34 @@ namespace GamecraftRPC |
|
|
|
|
|
|
|
}) |
|
|
|
.Build(); |
|
|
|
|
|
|
|
CommandBuilder.Builder() |
|
|
|
.Name("DiscordVoice") |
|
|
|
.Description("Connect to Discord Voice Lobby") |
|
|
|
.Action(() => |
|
|
|
{ |
|
|
|
if (DiscordRPC != null) |
|
|
|
{ |
|
|
|
GamecraftModdingAPI.Utility.Logging.CommandLogError("Discord GameSDK is unavailable. Please make sure Discord is open when launching Gamecraft."); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (PresenceUtility.Lobby.HasValue) |
|
|
|
{ |
|
|
|
//LobbyManager lm = DiscordRPC.GetLobbyManager(); |
|
|
|
if (PresenceUtility.IsVoiceConnected) |
|
|
|
{ |
|
|
|
lm.DisconnectLobby(PresenceUtility.Lobby.Value.Id, (result) => { GamecraftModdingAPI.Utility.Logging.CommandLog($"Disconnected voice (Result: {result})"); }); |
|
|
|
PresenceUtility.IsVoiceConnected = false; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
lm.ConnectVoice(PresenceUtility.Lobby.Value.Id, (result) => { GamecraftModdingAPI.Utility.Logging.CommandLog($"Connected voice (Result: {result})"); }); |
|
|
|
PresenceUtility.IsVoiceConnected = true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.Build(); |
|
|
|
#if !RELEASE |
|
|
|
bool alreadyWarned = false; |
|
|
|
Client.EnterMenu += (_, args) => |
|
|
|