schola.core.unreal_connections.UnrealConnection
Class Definition
class schola.core.unreal_connections.UnrealConnection(url, port)Bases: object
Abstract Base Class for a gRPC based connection to Unreal Engine.
Parameters
url
Type: str
The url to connect to.
port
Type: int
The port on that URL to connect to.
Attributes
url
Type: str
The URL to connect to.
port
Type: int
The port on the URL to connect to.
channel
Type: grpc.Channel
The channel connecting to Unreal Engine on the chosen address.
Properties
address
Type: str (property)
Returns the address of the connection.
Returns: The address of the connection
Return type: str
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, port)Parameters:
- url (
str) - port (
int)
close
close()Close the Unreal Connection. Method must be safe to call multiple times.
Return type: None
connect_stubs
connect_stubs(*stubs)Connects the gRPC stubs to the Unreal Engine channel.
Parameters:
- *stubs (
List["grpc.Stub"]) – The gRPC stubs to connect to the Unreal Engine channel
Return type: List[grpc.Stub]
get_open_port
get_open_port(url)Get an open port on the given URL.
Parameters:
- url (
str) – The URL to get an open port on
Returns:
socket.socket– A socket object bound to the open portint– The open port
Return type: Tuple[socket, int]
start
start()Open the Connection to Unreal Engine.
Return type: None