public static void PluginShutdown <T>(IPluginStateValue <T> plugin) where T : IPlugin { if (plugin.Startup) { int pluginStatusResponse = 0; try { pluginStatusResponse = plugin.Plugin.Shutdown(); if (pluginStatusResponse == 0) { Console.WriteLine("[{0}] successfully shutdown.", plugin.Plugin.Info.Name); } else { Console.WriteLine("[{0}] failed to shutdown properly with status {1}.", plugin.Plugin.Info.Name, pluginStatusResponse); } } catch (Exception ex) { HandleException(ex); } plugin.Startup = false; } }
public static void PluginStartup <T>(IPluginStateValue <T> plugin) where T : IPlugin { if (!plugin.Startup) { int pluginStatusResponse = 0; try { pluginStatusResponse = plugin.Plugin.Startup(hostDelegates); if (pluginStatusResponse == 0) { Console.WriteLine("[{0}] successfully started.", plugin.Plugin.Info.Name); } else { Console.WriteLine("[{0}] failed to startup properly with status {1}.", plugin.Plugin.Info.Name, pluginStatusResponse); } } catch (Exception ex) { HandleException(ex); } plugin.Startup = true; } }
public static void PluginReceiveData <T>(IPluginStateValue <T> plugin, object gameMemory) where T : IPluginUI { // If the UI plugin isn't started, start it now. if (!plugin.Startup) { PluginStartup(plugin); } if (gameMemory != null) { int uiPluginReceiveDataStatus = 0; try { uiPluginReceiveDataStatus = plugin.Plugin.ReceiveData(gameMemory); } catch (Exception ex) { HandleException(ex); } } }