mirror of
https://github.com/EnderIce2/SDR-RPC.git
synced 2025-05-26 03:14:26 +00:00
Fix #13
This commit is contained in:
parent
17a6a05739
commit
3173c291f5
@ -4,6 +4,7 @@ using DiscordRPC.Message;
|
|||||||
using SDRSharp.Common;
|
using SDRSharp.Common;
|
||||||
using SDRSharp.Radio;
|
using SDRSharp.Radio;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -44,10 +45,24 @@ namespace EnderIce2.SDRSharpPlugin
|
|||||||
_control = control;
|
_control = control;
|
||||||
if (Utils.GetBooleanSetting("EnableRPC", true))
|
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.RegisterUriScheme();
|
||||||
client.OnRpcMessage += Client_OnRpcMessage;
|
client.OnRpcMessage += Client_OnRpcMessage;
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0.0")]
|
[assembly: AssemblyVersion("1.2.0.2")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0.0")]
|
[assembly: AssemblyFileVersion("1.2.0.2")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user