File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 4
4
using SDRSharp . Common ;
5
5
using SDRSharp . Radio ;
6
6
using System ;
7
+ using System . Linq ;
7
8
using System . Reflection ;
8
9
using System . Threading . Tasks ;
9
10
using System . Windows . Forms ;
@@ -44,10 +45,24 @@ public void Initialize(ISharpControl control)
44
45
_control = control ;
45
46
if ( Utils . GetBooleanSetting ( "EnableRPC" , true ) )
46
47
{
47
- client = new DiscordRpcClient ( Utils . GetStringSetting ( "ClientID" ) , pipe : discordPipe )
48
+ if ( Utils . GetStringSetting ( "ClientID" ) . All ( char . IsWhiteSpace ) )
48
49
{
49
- Logger = new ConsoleLogger ( logLevel , true )
50
- } ;
50
+ Utils . SaveSetting ( "ClientID" , "765213507321856078" ) ;
51
+ }
52
+
53
+ try
54
+ {
55
+ client = new DiscordRpcClient ( Utils . GetStringSetting ( "ClientID" ) , pipe : discordPipe )
56
+ {
57
+ Logger = new ConsoleLogger ( logLevel , true )
58
+ } ;
59
+ }
60
+ catch ( Exception ex )
61
+ {
62
+ _controlPanel . ChangeStatus = $ "RPC Error: { ex . Message } ";
63
+ LogWriter . WriteToFile ( "Error in DiscordRpcClient\n " + ex . ToString ( ) ) ;
64
+ return ;
65
+ }
51
66
52
67
client . RegisterUriScheme ( ) ;
53
68
client . OnRpcMessage += Client_OnRpcMessage ;
Original file line number Diff line number Diff line change 32
32
// You can specify all the values or you can default the Build and Revision Numbers
33
33
// by using the '*' as shown below:
34
34
// [assembly: AssemblyVersion("1.0.*")]
35
- [ assembly: AssemblyVersion ( "1.2.0.0 " ) ]
36
- [ assembly: AssemblyFileVersion ( "1.2.0.0 " ) ]
35
+ [ assembly: AssemblyVersion ( "1.2.0.2 " ) ]
36
+ [ assembly: AssemblyFileVersion ( "1.2.0.2 " ) ]
You can’t perform that action at this time.
0 commit comments