schola.core.unreal_connections.StandaloneUnrealConnection
Class Definition
class schola.core.unreal_connections.StandaloneUnrealConnection( url, executable_path, headless_mode, port=None, map=None, display_logs=True, set_fps=None, disable_script=False)Bases: UnrealConnection
A standalone connection that launches an Unreal Engine instance when started.
Parameters
url
Type: str
The URL to connect to.
executable_path
Type: str
The path to the Unreal Engine executable.
headless_mode
Type: bool
Whether to run in headless mode.
port
Type: int, optional
The port to connect to, if None, an open port will be found.
map
Type: str, optional
The map to load. Defaults to the default map in the Unreal Engine project.
display_logs
Type: bool
Default: True
Whether to display logs.
set_fps
Type: int, optional
Use a fixed fps while running, if None, no fixed timestep is used.
disable_script
Type: bool
Default: False
Whether to disable the autolaunch script setting in the Unreal Engine Schola Plugin.
Attributes
executable_path
Type: str
The path to the Unreal Engine executable.
headless_mode
Type: bool
Whether to run in headless mode.
display_logs
Type: bool
Whether to display logs.
set_fps
Type: int
Use a fixed fps while running, if None, no fixed timestep is used.
env_process
Type: subprocess.Popen, optional
The process running the Unreal Engine. None if the process is not running.
disable_script
Type: bool
Whether to disable the autolaunch script setting in the Unreal Engine Schola Plugin.
map
Type: str
The map to load. Defaults to the default map in the Unreal Engine project.
tcp_socket
Type: socket.socket, optional
A socket object bound to the open port. None if the port is supplied, and we don’t need to open a new port.
Properties
address
Returns the address of the connection.
is_active
Type: bool (property)
Returns whether the connection is active or not.
Returns: Whether the connection is active or not
Return type: bool
Methods
__init__
__init__( url, executable_path, headless_mode, port=None, map=None, display_logs=True, set_fps=None, disable_script=False)Parameters:
- url (
str) - executable_path (
str) - headless_mode (
bool) - port (
int | None) - map (
str | None) - display_logs (
bool) - set_fps (
int | None) - disable_script (
bool)
close
close()Close the connection to the Unreal Engine. Kills the Unreal Engine process if it is running.
Return type: None
connect_stubs
connect_stubs(*stubs)Connects the gRPC stubs to the Unreal Engine channel.
get_open_port
get_open_port(url)Get an open port on the given URL.
make_args
make_args()Make the arguments supplied to the Unreal Engine Executable.
Returns: The arguments to be supplied to the Unreal Engine Executable
Return type: List[str]
start
start()Start the Unreal Engine process.
Raises: Exception – If the subprocess is already running
Return type: None