Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.CsPackageManager Class Referencesealed
Inheritance diagram for Barotrauma.CsPackageManager:

Public Member Functions

bool LuaTryRegisterPackageTypes (string name, bool caseSensitive=false)
 Searches for all types in all loaded assemblies from content packages who's names contain the name string and registers them with the Lua Interpreter.
 
IEnumerable< ContentPackageGetCurrentPackagesByLoadOrder ()
 
bool TryGetPackageForPlugin< T > (out ContentPackage package)
 Tries to find the content package that a given plugin belongs to.
 
bool TryGetLoadedPluginsForPackage (ContentPackage package, out IEnumerable< IAssemblyPlugin > loadedPlugins)
 Tries to get the loaded plugins for a given package.
 
void Dispose ()
 
AssemblyLoadingSuccessState LoadAssemblyPackages ()
 Begins the loading process of scanning packages for scripts and binary assemblies, compiling and executing them.
 
void RunPluginsInit ()
 Executes instantiated plugins' Initialize() and OnLoadCompleted() methods.
 
void RunPluginsPreInit ()
 Executes instantiated plugins' PreInitPatching() method.
 
void InstantiatePlugins (bool force=false)
 Initializes plugin types that are registered.
 
void UnloadPlugins ()
 Unloads all plugins by calling Dispose() on them. Note: This does not remove their external references nor unregister their types.
 

Static Public Member Functions

static bool GetOrCreateRunConfig (ContentPackage package, out RunConfig config)
 Gets the RunConfig.xml for the given package located at [cp_root]/CSharp/RunConfig.xml. Generates a default config if one is not found.
 

Properties

bool AssembliesLoaded [get]
 Whether or not assemblies have been loaded.
 
bool PluginsPreInit [get]
 Whether or not loaded plugins had their preloader run.
 
bool PluginsInitialized [get]
 Whether or not plugins' types have been instantiated.
 
bool PluginsLoaded [get]
 Whether or not plugins are fully loaded.
 

Events

Action OnDispose
 Called when clean up is being performed. Use when relying on or making use of references from this manager.
 

Member Function Documentation

◆ Dispose()

void Barotrauma.CsPackageManager.Dispose ( )

◆ GetCurrentPackagesByLoadOrder()

IEnumerable< ContentPackage > Barotrauma.CsPackageManager.GetCurrentPackagesByLoadOrder ( )

◆ GetOrCreateRunConfig()

static bool Barotrauma.CsPackageManager.GetOrCreateRunConfig ( ContentPackage package,
out RunConfig config )
static

Gets the RunConfig.xml for the given package located at [cp_root]/CSharp/RunConfig.xml. Generates a default config if one is not found.

Parameters
packageThe package to search for.
configRunConfig data.
Returns
True if a config is loaded, false if one was created.

◆ InstantiatePlugins()

void Barotrauma.CsPackageManager.InstantiatePlugins ( bool force = false)

Initializes plugin types that are registered.

Parameters
force

◆ LoadAssemblyPackages()

AssemblyLoadingSuccessState Barotrauma.CsPackageManager.LoadAssemblyPackages ( )

Begins the loading process of scanning packages for scripts and binary assemblies, compiling and executing them.

Returns

◆ LuaTryRegisterPackageTypes()

bool Barotrauma.CsPackageManager.LuaTryRegisterPackageTypes ( string name,
bool caseSensitive = false )

Searches for all types in all loaded assemblies from content packages who's names contain the name string and registers them with the Lua Interpreter.

Parameters
name
caseSensitive
Returns

◆ RunPluginsInit()

void Barotrauma.CsPackageManager.RunPluginsInit ( )

Executes instantiated plugins' Initialize() and OnLoadCompleted() methods.

◆ RunPluginsPreInit()

void Barotrauma.CsPackageManager.RunPluginsPreInit ( )

Executes instantiated plugins' PreInitPatching() method.

◆ TryGetLoadedPluginsForPackage()

bool Barotrauma.CsPackageManager.TryGetLoadedPluginsForPackage ( ContentPackage package,
out IEnumerable< IAssemblyPlugin > loadedPlugins )

Tries to get the loaded plugins for a given package.

Parameters
packagePackage to find.
loadedPluginsThe collection of loaded plugins.
Returns

◆ TryGetPackageForPlugin< T >()

bool Barotrauma.CsPackageManager.TryGetPackageForPlugin< T > ( out ContentPackage package)

Tries to find the content package that a given plugin belongs to.

Parameters
packagePackage if found, null otherwise.
Template Parameters
TThe IAssemblyPlugin type to find.
Returns
Type Constraints
T :IAssemblyPlugin 

◆ UnloadPlugins()

void Barotrauma.CsPackageManager.UnloadPlugins ( )

Unloads all plugins by calling Dispose() on them. Note: This does not remove their external references nor unregister their types.

Property Documentation

◆ AssembliesLoaded

bool Barotrauma.CsPackageManager.AssembliesLoaded
get

Whether or not assemblies have been loaded.

◆ PluginsInitialized

bool Barotrauma.CsPackageManager.PluginsInitialized
get

Whether or not plugins' types have been instantiated.

◆ PluginsLoaded

bool Barotrauma.CsPackageManager.PluginsLoaded
get

Whether or not plugins are fully loaded.

◆ PluginsPreInit

bool Barotrauma.CsPackageManager.PluginsPreInit
get

Whether or not loaded plugins had their preloader run.

Event Documentation

◆ OnDispose

Action Barotrauma.CsPackageManager.OnDispose

Called when clean up is being performed. Use when relying on or making use of references from this manager.


The documentation for this class was generated from the following file: