| back 
 
SimHub PluginsSimHub is a.Net frameworkWPF
	 C# application with XAML user interface.Many plugins (.dll files) extract telemetry properties from games,
 while other plugins enabled in
  do things with those properties. SimHub bundles many plugins, but more are available from others.
 
 
 After
 Init()initialization, each plugin appears to run in its own thread.A hang in one plugin minimally impacts function in others. 
On launch,
 plugin method
 public void DataUpdate(PluginManager pluginManager, ref GameData data)should run in well under 1/60 second,
updating any properties available to others
 and preparing the plugin method for its next invocation.
 SimHub appears robust against relaunching a still-busy plugin's
 DataUpdate()thread.60Hz launch rate preempts plugins needing to implement dynamic
 invoking methodsand simplifies synchronization.
 
 
 
static
Class methods and data that are available without a class instance are
static.A
 static classcannot be instantiantiated (i.e., nonew).They are important e.g. for communication among threads.
Delegates can pass methods as arguments to other methods,
AKA callback functions.
Event handlers are nothing more than methods invoked through delegatesthat are either static or instance methods with matching return type,
 but I have yet to recognize a delegate instance method... making statics crucial.
 Unlike C++ function pointers, C# delegates encapsulate method and object instance.
 Sadly, delegates are often coded in lambda expressions,
 which syntax are IMO impossible to read.  Also IMO, many absurdly complex C# examples
 can be blamed on programmers' being confounded by syntax,
 resulting in more-or-less blind copy/pasting code from other working fragments.
 SimHub C# Custom Expressions
SimHub property values can also be set using C#, which by default are hidden in the UI.SimHub support for these C# expressions preceded NCalc, JavaScript, plugin SDK, etc
 and is kept for backward compatibility.
 SimHub stores them in
 PluginsData/*/DataCorePlugin/CustomExpressionsThose to be used in all games are stored in
 PluginsData/Common/DataCorePlugin/CustomExpressionsAs of 7.04.8b4, these are evaluated when games are loaded,
 before other plugins are loaded.
 SimHub C# Custom Expressions special trick for a static:
 
init(value);    
return KKDash;
    
}  
static int KKDash = 0;
class KKDAsh{}
static void init(global::SimHub.Plugins.PluginManager pluginManager){
    
        pluginManager.AddAction("KartKraft_Dash_toggle", typeof(KKDAsh), (a, b) =>
        {
            KKDash = (KKDash + 1) % 3;
        });
Question:  are Custom Expressions evaluated
 at 60Hz or (more likely) only when referenced?
 
 Properties set or referenced only in a plugin's
 Init{}section impose minimal overhead. |