Skip to content

Struct FLaunchableScript

Struct FLaunchableScript

  • Defined in File LaunchableScript.h
struct FLaunchableScript

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Dependencies: FLaunchableScriptRunnable

A struct to hold the configuration of a launchable script.


Public Functions

SymbolDetails
FLaunchableScriptConstruct a launchable script with no arguments or URL.
~FLaunchableScript
FLaunchableScriptConstruct a launchable script with a file URL.
FLaunchableScriptConstruct a launchable script with a file URL and arguments.
AppendArgsAppend additional arguments to the script.
LaunchScriptLaunch the script in a background thread.
KillScriptKill the currently running script process.

FLaunchableScript

FLaunchableScript()

Construct a launchable script with no arguments or URL.

Will fail to launch unless ScriptURL is set

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp


~FLaunchableScript

~FLaunchableScript()

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

FLaunchableScript

FLaunchableScript(FString ScriptURL)

Construct a launchable script with a file URL.

Parameters

ScriptURL – [in] The URL of the script to launch

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

FLaunchableScript

FLaunchableScript(FString ScriptURL, FString Args)

Construct a launchable script with a file URL and arguments.

Parameters

  • ScriptURL – [in] The URL of the script to launch

  • Args – [in] The arguments to pass to the script

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

AppendArgs

void AppendArgs(FString &AdditionalArgs)

Append additional arguments to the script.

Parameters

AdditionalArgs – [in] The arguments to append to the script.

#DirectionNameTypeDescription
1AdditionalArgsFString &The arguments to append to the script.

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

LaunchScript

void LaunchScript()

Launch the script in a background thread.

Creates a new thread and process to execute the script asynchronously. The script’s stdout and stderr are automatically logged.

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

KillScript

bool KillScript()

Kill the currently running script process.

Terminates the script process if it is currently running and cleans up resources.

Returns:

True if the process was successfully terminated or wasn’t running, false on error.

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp


Public Members

SymbolDetails
ScriptIDUnique identifier for this script instance.
ScriptInstanceNameDisplay name for this script instance.
ScriptURLA path to the script to be launched.
ArgsThe arguments to be passed to the script.
bIsMirroringWhether the background mirroring worker is active.
RunnableThe runnable task that executes the script.
ThreadThe thread that runs the script.

ScriptID

FGuid ScriptID

Unique identifier for this script instance.


ScriptInstanceName

FString ScriptInstanceName

Display name for this script instance.


ScriptURL

FString ScriptURL

A path to the script to be launched.


Args

FString Args

The arguments to be passed to the script.


bIsMirroring

bool bIsMirroring

Whether the background mirroring worker is active.


Runnable

FLaunchableScriptRunnable *Runnable = nullptr

The runnable task that executes the script.


Thread

FRunnableThread *Thread = nullptr

The thread that runs the script.


Public Static Functions

SymbolDetails
KillScriptByIDOrNameStatic method to kill a script by its ID or name (for console commands).
KillAllScriptsStatic method to kill all running scripts (for console commands).
ListActiveScriptsStatic method to list all running scripts (for console commands).

KillScriptByIDOrName

static bool KillScriptByIDOrName(const FString &IDOrName)

Static method to kill a script by its ID or name (for console commands).

Parameters

IDOrName – [in] The ID (GUID string) or name of the script instance to kill.

Returns:

True if the script was found and killed, false otherwise.

#DirectionNameTypeDescription
1IDOrNameconst FString &The ID (GUID string) or name of the script instance to kill.

Attributes: static

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

KillAllScripts

static void KillAllScripts()

Static method to kill all running scripts (for console commands).

Attributes: static

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

ListActiveScripts

static void ListActiveScripts()

Static method to list all running scripts (for console commands).

Attributes: static

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

Public Static Attributes

SymbolDetails
ActiveScriptsStatic registry of active scripts for console command access.

ActiveScripts

static TMap<FGuid, FLaunchableScript *> ActiveScripts

Static registry of active scripts for console command access.