@@ -20,9 +20,8 @@ public class MainPlugin : ISharpPlugin
2020 bool RPCalreadyLoaded = false ;
2121 private ISharpControl _control ;
2222 bool playedBefore = false ;
23- private IConfigurationPanelProvider configurationPanelProvider ;
2423 private SDRSharp . FrontEnds . SpyServer . ControllerPanel controllerPanel ;
25- public TopWindowMessages windowMessages ;
24+ private TopWindowMessages windowMessages ;
2625 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Style" , "IDE0044:Add readonly modifier" , Justification = "<Pending>" ) ]
2726 private RichPresence presence = new RichPresence ( )
2827 {
@@ -37,7 +36,7 @@ public class MainPlugin : ISharpPlugin
3736 }
3837 } ;
3938 private static DiscordRpcClient client ;
40- private static bool isRunning = true ;
39+ private bool isRunning = true ;
4140 public string DisplayName
4241 {
4342 get { return _displayName ; }
@@ -52,6 +51,8 @@ public UserControl Gui
5251 }
5352 public void Initialize ( ISharpControl control )
5453 {
54+ IConfigurationPanelProvider configurationPanelProvider ;
55+
5556 if ( Utils . GetBooleanSetting ( "ShowWelcomePage" , true ) )
5657 {
5758 new WelcomeForm ( ) . ShowDialog ( ) ;
@@ -63,7 +64,9 @@ public void Initialize(ISharpControl control)
6364 try
6465 {
6566 if ( Utils . GetBooleanSetting ( "EnableRPCInvite" , false ) )
67+ {
6668 _control . RegisterFrontControl ( windowMessages , PluginPosition . Top ) ;
69+ }
6770 }
6871 catch ( Exception ex )
6972 {
@@ -139,7 +142,10 @@ public void Initialize(ISharpControl control)
139142 _ = MainLoop ( ) ;
140143 }
141144 else
145+ {
142146 _controlPanel . ChangeStatus = "RPC is disabled" ;
147+ }
148+
143149 LogWriter . WriteToFile ( "EOM Initialize" ) ;
144150 }
145151 private void Client_OnPresenceUpdate ( object sender , PresenceMessage args )
@@ -214,7 +220,7 @@ async Task MainLoop()
214220 {
215221 try
216222 {
217- await Task . Delay ( 2000 ) ;
223+ await Task . Delay ( 2000 ) . ConfigureAwait ( false ) ;
218224 isRunning = true ;
219225 LogWriter . WriteToFile ( $ "MainLoop called { isRunning } { client . IsInitialized } ") ;
220226 while ( client != null && isRunning )
0 commit comments