Skip to content

Commit

Permalink
Fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
EnderIce2 committed Feb 2, 2024
1 parent 17a6a05 commit 3173c29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 18 additions & 3 deletions MainPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using SDRSharp.Common;
using SDRSharp.Radio;
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand Down Expand Up @@ -44,10 +45,24 @@ public void Initialize(ISharpControl control)
_control = control;
if (Utils.GetBooleanSetting("EnableRPC", true))
{
client = new DiscordRpcClient(Utils.GetStringSetting("ClientID"), pipe: discordPipe)
if (Utils.GetStringSetting("ClientID").All(char.IsWhiteSpace))
{
Logger = new ConsoleLogger(logLevel, true)
};
Utils.SaveSetting("ClientID", "765213507321856078");
}

try
{
client = new DiscordRpcClient(Utils.GetStringSetting("ClientID"), pipe: discordPipe)
{
Logger = new ConsoleLogger(logLevel, true)
};
}
catch (Exception ex)
{
_controlPanel.ChangeStatus = $"RPC Error: {ex.Message}";
LogWriter.WriteToFile("Error in DiscordRpcClient\n" + ex.ToString());
return;
}

client.RegisterUriScheme();
client.OnRpcMessage += Client_OnRpcMessage;
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.0.2")]
[assembly: AssemblyFileVersion("1.2.0.2")]

0 comments on commit 3173c29

Please sign in to comment.