Struct FLaunchableScript
Struct FLaunchableScript
- Defined in File LaunchableScript.h
struct FLaunchableScriptSource: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h
Dependencies: FLaunchableScriptRunnable
A struct to hold the configuration of a launchable script.
Public Functions
| Symbol | Details |
|---|---|
FLaunchableScript | Construct a launchable script with no arguments or URL. |
~FLaunchableScript | — |
FLaunchableScript | Construct a launchable script with a file URL. |
FLaunchableScript | Construct a launchable script with a file URL and arguments. |
AppendArgs | Append additional arguments to the script. |
LaunchScript | Launch the script in a background thread. |
KillScript | Kill 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.
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | AdditionalArgs | FString & | 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
| Symbol | Details |
|---|---|
ScriptID | Unique identifier for this script instance. |
ScriptInstanceName | Display name for this script instance. |
ScriptURL | A path to the script to be launched. |
Args | The arguments to be passed to the script. |
bIsMirroring | Whether the background mirroring worker is active. |
Runnable | The runnable task that executes the script. |
Thread | The thread that runs the script. |
ScriptID
FGuid ScriptIDUnique identifier for this script instance.
ScriptInstanceName
FString ScriptInstanceNameDisplay name for this script instance.
ScriptURL
FString ScriptURLA path to the script to be launched.
Args
FString ArgsThe arguments to be passed to the script.
bIsMirroring
bool bIsMirroringWhether the background mirroring worker is active.
Runnable
FLaunchableScriptRunnable *Runnable = nullptrThe runnable task that executes the script.
Thread
FRunnableThread *Thread = nullptrThe thread that runs the script.
Public Static Functions
| Symbol | Details |
|---|---|
KillScriptByIDOrName | Static method to kill a script by its ID or name (for console commands). |
KillAllScripts | Static method to kill all running scripts (for console commands). |
ListActiveScripts | Static 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.
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | IDOrName | const 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
| Symbol | Details |
|---|---|
ActiveScripts | Static registry of active scripts for console command access. |
ActiveScripts
static TMap<FGuid, FLaunchableScript *> ActiveScriptsStatic registry of active scripts for console command access.